Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] Objects colliding with mouse

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th May 2008 20:56 Edited at: 4th May 2008 21:00
This function will return the object colliding with the mouse as an integer. This function is great for selecting objects in your model maker, or selecting actually anything in 3 dimensions!

(Edit) Don`t copy the code from the code snippet! The TGC server somehow doubled the enters (as you can see) and it will take up 2 times the space. Download the zip file, the code "get_object_screen.dba.dba" is in it.




It`s pretty simple to use: All you have to be aware of, is to put a rotating collision box around that object. Thats all!

First include the file:

#include "get_object_screen.dba"

note that the file "get_object_screen.dba" has to be in the same directory as your program.

make object collision box (object),0-(sizex/2),0-(sizey/2),0-(sizez/2),sizex/2,sizey/2,sizez/2,1

Example:

if mouseclick()=1 then object_selected=get object screen()

File attached

TheComet

Oooooops!!! I accidentally formated drive c.

Attachments

Login to view attachments
Gunslinger
17
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 14th May 2008 21:46
Great, thank you!

Login to post a reply

Server time is: 2024-11-25 03:04:57
Your offset time is: 2024-11-25 03:04:57