#include "DarkGDK.h"
#include "physics.h"
physics myPhysics;
void DarkGDK ( void )
{
myPhysics.start(true, 0.5, 0.5, 0.5);
myPhysics.setGravity(0, -15, 0);
dbSyncOn ( );
dbSyncRate ( 60 );
dbRandomize ( dbTimer ( ) );
// make some 3D objects
for ( int i = 1; i < 50; i++ )
{
// make a sphere
dbMakeObjectSphere ( i, 1 );
// position the object in a random location
dbPositionObject ( i, dbRnd ( 20 ), dbRnd ( 20 ), dbRnd ( 20 ) );
// adjust scaling
dbScaleObject ( i, 100 + dbRnd ( 400 ), 100 + dbRnd ( 400 ), 100 + dbRnd ( 400 ) );
// give the object a color
dbColorObject ( i, dbRgb ( dbRnd ( 255 ), dbRnd ( 255 ), dbRnd ( 255 ) ) );
// increase specular power
dbSetObjectSpecularPower ( i, 255 );
// turn off ambient lighting for this object
dbSetObjectAmbient ( i, 0 );
}
dbPositionCamera ( 10, 10, -20 );
myPhysics.simulate();
while ( LoopGDK ( ) )
{
myPhysics.update();
// display some text on screen
dbText ( 0, 0, "Use the up and down arrow keys to move the camera" );
// move the camera forwards
if ( dbUpKey ( ) )
dbMoveCamera ( 1 );
// move the camera backwards
if ( dbDownKey ( ) )
dbMoveCamera ( -1 );
// rotate all of our objects
for ( int i = 1; i < 50; i++ )
dbRotateObject ( i, dbObjectAngleX ( i ) + 0.1, dbObjectAngleY ( i ) + 0.2, dbObjectAngleZ ( i ) + 0.3 );
// here we make a call to update the contents of the screen
dbSync ( );
}
for ( int i = 1; i < 50; i++ )
dbDeleteObject ( i );
myPhysics.stop();
return;
}
Nothing that really does anything but initialize your physics