#include "DarkGDK.h"
#include "SC_Collision.h"
void collision(void);
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
SC_Start( );
dbLoadObject("Assault Trooper.x",1);
dbLoadImage("Image5.jpg",5);
SC_SetupObject(1,2,2);
dbPositionObject(1,-10,-10,-220);
dbRotateObject(1,90,180,180);
for( int i=10002; i <= 10040; i++ )
{
dbMakeObjectPlain( i,3,3 );
dbTextureObject (i,5);
dbSetObjectLight( i,0 );
dbHideObject( i );
}
dbSetObjectSpeed(1,10000);
dbPlayObject(1);
dbLoopObject(1);
while ( LoopGDK ( ) )
{
SC_DrawObjectBounds(1);
dbControlCameraUsingArrowKeys(0,2,2);
dbYRotateCamera( dbCameraAngleY() + ( dbMouseMoveX()/10.0f ) );
dbXRotateCamera( dbCameraAngleX() + ( dbMouseMoveY()/10.0f ) );
collision( );
// update the screen
SC_UpdateObject(1);
dbSync ( );
}
// return back to windows
return;
}
void collision(void)
{
int collide=0;
int counter = 10002;
if ( dbMouseClick() == 1 )
{
//get our collision vector
float oldx = dbCameraPositionX();
float oldy = dbCameraPositionY();
float oldz = dbCameraPositionZ();
dbMoveCamera( 200 );
float x = dbCameraPositionX();
float y = dbCameraPositionY();
float z = dbCameraPositionZ();
dbMoveCamera( -200 );
collide = SC_RayCast( 0, oldx,oldy,oldz, x,y,z, 0 );
if ( collide > 0 )
{
//get the collision point
float newx = SC_GetStaticCollisionX();
float newy = SC_GetStaticCollisionY();
float newz = SC_GetStaticCollisionZ();
//get collision normal
float normx = SC_GetCollisionNormalX();
float normy = SC_GetCollisionNormalY();
float normz = SC_GetCollisionNormalZ();
//position and point a marker in the right direction
dbPositionObject( counter, newx + normx/10.0f, newy + normy/10.0f, newz + normz/10.0f );
dbPointObject( counter, newx + normx, newy + normy, newz + normz );
dbShowObject( counter );
counter++;
if ( counter > 10040 ) counter = 10002;
}
}
}
In this code I get an error message that says
LINK : fatal error LNK1104: cannot open file 'SC_Collision.lib'
I extracted the SC collision to the dark GDK include file. Any reason why this isnt working? If you need more info let me know.
LOL