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.

Dark GDK / Object Collision

Author
Message
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 23rd May 2008 08:01
okay so i need to find out if an object is hitting nothing at all. Cycling through all existing objects and calculating collision would be too slow, and if(dbObjectCollision(object,0)==0) does not seem to work. so is there any way to do this?

Your signature has been erased by a mod - please reduce it to 600x120
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 23rd May 2008 08:30 Edited at: 23rd May 2008 08:31
Umm... Howz about
...

~~It's not who you are underneath, but what you do that defines you.~~
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 23rd May 2008 08:51
that returns if 2 given objects collide. what I need is it 1 object and ANY object collide. meaning if the object hits the terrain: it returns something other than 0, if it hits a table, it returns something other than 0.

Your signature has been erased by a mod - please reduce it to 600x120
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 23rd May 2008 09:13
make a loops that runs through all the objects and test for each of them separately.
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 23rd May 2008 09:28
is there no other way? wont that be........a fps killer?

Your signature has been erased by a mod - please reduce it to 600x120
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 23rd May 2008 12:27
Yes, there is:

Use dbObjectCollision(ObjA, 0). By setting the second parameter to zero, the command will return the object number that collided with ObjA. Simple, isn't it?
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 23rd May 2008 12:47
Simple yes, i tried that however and it refuses to return 0 when there is no collission. it basically says there is always a collission and refuses to allow me to move -.-

Your signature has been erased by a mod - please reduce it to 600x120
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd May 2008 17:39
Learn to set up and use groups in sparkys. Then you can check a WHOLE group is one fo - and not kill FPS

ITs better to check a couple grous: trees group, rocks group, terrain tiles group ... than iterating through each "thing" individually!

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 24th May 2008 16:25
I agree with Jason, use sparky's, and use the group thing in it, example-

dbMakeObjectSphere ( 1, 23.0f );
dbMakeObjectBox ( 2, 10.0f, 20.0f, 10.0f );
SC_SetupObject ( 1, 1, 1 );
SC_SetupObject ( 2, 1, 2 );
//Later in the code

if ( !SC_GroupCollision ( 3, 1 ){
}

That probably will work better, as Jason said. (This code is a little messy, mostly because it isn't a full code, but I think you get the point!)

~~Its not about what you know, its about how you figure it out.~~
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 24th May 2008 19:59
hmm i shall deff look into sparkys thank you

Your signature has been erased by a mod - please reduce it to 600x120

Login to post a reply

Server time is: 2024-11-20 11:42:59
Your offset time is: 2024-11-20 11:42:59