I'm trying to use a Character Controller but the code doesn't seem to want to work at all.
#include "DarkGDK.h"
#include <globStruct.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
void CreateExtraCamera();
void RenderExtraCamera();
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbPhyStart();
int X = dbMakeVector3(1);
dbSetVector3(1,10,10,10);
dbLoadObject("Cube//Cube.x",1);
dbPhyMakeRigidBodyStaticMesh(1);
dbSetObjectDiffuse(1,dbRgb(25,0,0));
dbMakeLight(1);
dbSetPointLight(1,0,10,0);
dbColorLight(1,dbRgb(0,0,255));
dbMakeObjectBox(2,10,10,10);
dbPositionObject(2,10,10,10);
dbPhyMakeBoxCharacterController(2,dbObjectPositionX(2),dbObjectPositionY(2),dbObjectPositionZ(2),10,10,10,1.0,4.0,200.0);
dbMakeLight(2);
dbSetSpotLight(2,10,1000);
dbColorLight(2,dbRgb(255,0,0));
dbPositionLight(2,0,10,100);
//dbLockObjectOn(2);
CreateExtraCamera();
int MouseX = 0;
int MouseY = 0;
// our main loop
while ( LoopGDK ( ) )
{
MouseY += dbMouseMoveX()*0.6;
MouseX += dbMouseMoveY()*0.6;
if(MouseX > 90)
MouseX = 90;
if(MouseX < -90)
MouseX = -90;
dbPositionCamera(2,dbObjectPositionX(2),dbObjectPositionY(2),dbObjectPositionZ(2));
dbRotateCamera(MouseX,MouseY,0);
dbYRotateObject(2,MouseY);
//if(dbUpKey())
//{
dbPhyMoveCharacterController(2,600.0);
//}
RenderExtraCamera();
dbPhyUpdate();
// update the screen
dbSync ( );
}
// return back to windows
return;
}
NJow i don't know where it's the code or DP for GDK.
"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack