Ok, I wrote this simple program to see if I could even detect collision using sparky's collision. I need some help.
#include "DarkGDK.h"
#include "SC_Collision.h"
void DarkGDK ( void )
{
dbSetDisplayMode( 800,600,32 );
dbMakeObjectCylinder( 1,10 );
dbColorObject( 1,dbRGB(200,0,0) );
SC_Start( );
dbMakeObjectBox (2, 10, 10, 10);
dbPositionObject (2, 0, 0, 50);
SC_SetupObject (2, 0, 0);
//dbAutoCamOff( );
//dbPositionCamera( 0,0,-30 );
//setup the object for collision
SC_SetupObject( 1,0,0 );
int collide = 0;
while ( LoopGDK( ) )
{
if (dbUpKey() == 1)
{
dbPositionObject (1, dbObjectPositionX(1), dbObjectPositionY(1), dbObjectPositionZ(1) + 1);
}
collide = SC_ObjectCollision (1, 2);
if (collide > 0)
{
dbText ( dbScreenWidth()/2, dbScreenHeight()/2, "COLLISION!!!");
}
dbSync( );
}
}
Even though the two objects collide it doesn't say "collision!".
Any help is appreciated.