Hi,
Any idea why this wont work? It should say 1 when you walk into a box, however it always stays 0
#include "DarkGDK.h"
#include "SC_Collision.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
SC_Start();
dbMakeObjectSphere(1,0.1);
SC_SetupObject(1,0,0);
dbHideObject(1);
dbMakeObjectBox(2,1,1,1);
SC_SetupObject(2,0,0);
int ObjHit;
while ( LoopGDK ( ) )
{
dbPositionObject(1,dbCameraPositionX(),dbCameraPositionY(),dbCameraPositionZ());
dbYRotateCamera(dbWrapValue(dbCameraAngleY()+(dbMouseMoveX()*0.1)));
dbXRotateCamera(dbCameraAngleX()+(dbMouseMoveY()*0.1));
if (dbUpKey()==1) { dbMoveCamera(0.1); }
if (dbDownKey()==1) { dbMoveCamera(-0.1); }
ObjHit=SC_ObjectCollision(1,0);
dbText(100,0,dbStr(ObjHit));
dbSync ( );
}
return;
}
Thanks,
Alex
EDIT: Fixed I didnt know about SC_UpdateObject()