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 / checking for polygon collision using sparkys? Help!

Author
Message
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 11th Nov 2008 22:55
How do I just check for polygon collision?

I used
but this returns 1 all the time, Even if I'm miles away from object 2 (object 1 is a gun at the camera and object 2 is a level I made in 3ds max). Can someone please tell me how to make it return 1 if I'm hitting it and 0 if I'm not. Thanks
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 11th Nov 2008 23:27 Edited at: 11th Nov 2008 23:28
when you setup the object using

use 0 in type for polygon collision
and

use that to see your collision boxes make sure they are the right sizes

http://ninjagms.wetpaint.com/
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 12th Nov 2008 00:10
That did not work because you cant see the bounds for polygon objects. Here is the code, mabey you can work it out from this because I cant :

Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 12th Nov 2008 00:24 Edited at: 22nd Nov 2008 05:47
in your loop
call

use it on both of your objects
(the level and the gun)

http://ninjagms.wetpaint.com/
Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 13th Nov 2008 14:47
Ya, after you have moved/scaled/rotated your objects, you need to call SC_UpdateObject(objID) to update the collision data.
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 13th Nov 2008 14:48
Thanks guys
veltro
User Banned
Posted: 13th Nov 2008 15:54
here is the errror in your code


int collides=0;
if (SC_ObjectCollision (10,20)); <====== remove the ;
{
collides=1;
}

Login to post a reply

Server time is: 2024-11-25 07:28:10
Your offset time is: 2024-11-25 07:28:10