processed a lot of feedback: added 'realtime' simulation with fixed substeps (and clamping maximum number of substeps), this means that when stepSimulation is called with smaller timesteps then 'fixed substep' the motionstate is interpolated.

renamed m_ccdSweptSphereRadius,
enabled wireframe debugDrawObject (using debugDrawer)
This commit is contained in:
ejcoumans
2006-10-18 03:28:42 +00:00
parent 1fe414d98a
commit 3a6942fb91
32 changed files with 406 additions and 185 deletions

View File

@@ -38,7 +38,7 @@ int main(int argc,char** argv)
BasicDemo ccdDemo;
ccdDemo.initPhysics();
ccdDemo.setCameraDistance(50.f);
ccdDemo.setCameraDistance(10.f);
#ifdef CHECK_MEMORY_LEAKS
ccdDemo.exitPhysics();
@@ -60,8 +60,11 @@ void BasicDemo::clientMoveAndDisplay()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//simple dynamics world doesn't handle fixed-time-stepping
float ms = m_clock.getTimeMilliseconds();
m_clock.reset();
if (m_dynamicsWorld)
m_dynamicsWorld->stepSimulation(deltaTime);
m_dynamicsWorld->stepSimulation(ms / 1000.f);
renderme();
@@ -95,13 +98,6 @@ void BasicDemo::displayCallback(void) {
///make this positive to show stack falling from a distance
///this shows the penalty tresholds in action, springy/spungy look
void BasicDemo::clientResetScene()
{
}
void BasicDemo::initPhysics()
{
@@ -164,7 +160,7 @@ void BasicDemo::initPhysics()
btTransform trans;
trans.setIdentity();
//stack them
int colsize = 10;
int colsize = 2;
int row = (i*HALF_EXTENTS*2)/(colsize*2*HALF_EXTENTS);
int row2 = row;
int col = (i)%(colsize)-colsize/2;

View File

@@ -52,7 +52,6 @@ class BasicDemo : public DemoApplication
virtual void displayCallback();
virtual void clientResetScene();
};