Hi,
The comments below refer to the quoted code at the bottom...
I've been trying to get a basic Dark Physics experiment working, can you tell me why the particles are so small? How do I make them bigger so that the box gets more "full"?
I've tried setting the particle radius with: dbPhySetFluidParticleRadius(), but it fails to link with an unresolved symbol.
Any advice or examples of Dark Physics fluids in GDK (C++) would be much appreciated.
Regards, Dan...
#include "DarkGDK.h"
#include "DarkPhysics.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbRandomize ( dbTimer ( ) );
// Init physics
dbPhyStart();
dbPhySetAutoFixedTiming ( );
dbPhySetGravity ( 0, -9.8 * 3, 0 );
dbPhyMakeFluid(10);
dbPhySetFluidPosition(10, 0, 10, 0);
dbPhySetFluidRendererFluidColor(255, 0, 0, 0);
//dbPhySetFluidParticleRadius(10, 1);
// make a 3D open top box
// * Make base of box
dbMakeObjectBox(1, 16, 1, 16);
// * Make top side
dbMakeObjectBox(2, 16, 7, 1);
// * Make bottom side
dbMakeObjectBox(3, 16, 7, 1);
// * Make left side
dbMakeObjectBox(4, 1, 7, 14);
// * Make right side
dbMakeObjectBox(5, 1, 7, 14);
// * Position box sides
dbPositionObject(1, 0, 0.5, 0);
dbPositionObject(2, 0, 4.25, -7.5);
dbPositionObject(3, 0, 4.25, 7.5);
dbPositionObject(4, -7.5, 4.25, 0);
dbPositionObject(5, 7.5, 4.25, 0);
// * Make box sides rigid
dbPhyMakeRigidBodyStaticBox(1);
dbPhyMakeRigidBodyStaticBox(2);
dbPhyMakeRigidBodyStaticBox(3);
dbPhyMakeRigidBodyStaticBox(4);
dbPhyMakeRigidBodyStaticBox(5);
// build fluid
dbPhyBuildFluid(10);
// move our camera back so we can view the objects
// NB: Why do we have to do this last?
dbPositionCamera ( -10, 20, -20);
dbRotateCamera(45, 35, 0);
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
while ( LoopGDK ( ) )
{
// 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 );
// here we make a call to update the contents of the screen
dbPhyUpdate();
dbSync ( );
}
dbPhyEnd();
// before quitting delete our objects
for ( int i = 1; i < 6; i++ )
dbDeleteObject ( i );
// and now everything is ready to return back to Windows
return;
}