Common bugs
in
Havok, PhysX, Bullet, ODE, Ogre, Newton.. SOLVED!
Bug 1.) Few subSteps: "Moon gravity
effects"
bUg 2.) A lot of subSteps:
"Spiraling to death"
buG 3.) Interpolation VS. Temporal
Distribution
Common mistakes
related to fixedTimeStepping - UNCOVERED
a.) Design-Time Planning and Recognition of
Hardware Min. Sys. Requirements
b.) "Scaling the World" - Gravity, Mass, Size
and Hidden Effects of fixedStepping
c.) Jitter, Wobbles, Choppiness and Slowdowns: Unstable
Physics & Smooth Animation
Common pitfalls
for any kind of simulation, say - MOLECULAR DYNAMICS
-"Error and timing analysis
of multiple time-step integration methods for molecular
dynamics"
-"In
molecular dynamics simulations,
'Energy Drift' is the gradual change in the total energy
of a closed system"
-"Multiple
time-step integration
hampered by parametric resonance exhibits the instability
phenomenon"
Allegory Novella, Tech. Paper
& Chronicles of an Algorithm discovery: Three bugs with one stone.. allegory continues
***
Sep 2, 2008
>"i'm
just saying that undersampling does not quite work
"correctly" ..at first i thought that was in
agreement, but then it turned out to be a matter of
interpretation ...the rest was to define
"undersampling" in more practical terms,
something like this.."
"Half-solution
A"
//----------------------------------------------------------------------
accum= 0.0f;
STEP= 1.0f / 60;
fpsTensor= 30;
while( theBeatGoesOn )
{
nowTime=
getCurrentTime(RTN_SECONDS);
accum+= deltaTime= nowTime - lastTime;
anmDT= deltaTime - simDT;
if(cnt>0) simDT/= inRed*cnt;
lastTime= nowTime; cnt= 0;
while( accum >= STEP )
{
cnt++;
stepSimulation( STEP );
accum-= (simDT >= STEP)?
simDT+(STEP*anmDT*fpsTensor) : STEP;
}
simDT= getCurrentTime(RTN_SECONDS) - lastTime;
renderScene();
}
//----------------------------------------------------------------------
(R) All rights
reserved, dont you dare use this code unless you can
prove to me you're human being.
Use of this algorithm in commercial products without my
permission will be cheerfully taken to court.
--- Example Implementation, Bullet Physics Library ---
+++"Half-solution A"
//----------------------------------------------------------------------
//--------------------------
*** 1st algo - scaling the TIME "inside"
static btClock realTime;
double simDT, anmDT, STEP;
double secCnt, deltaTime = 0.0;
int cnt, FPS, SPS, fpsTensor= 60;
int btDiscreteDynamicsWorld::stepSimulation(btScalar
timeStep, int maxSubSteps, btScalar fixedTimeStep)
{
deltaTime=
double(realTime.getTimeMicroseconds())*0.000001f;
if(deltaTime > 0.75) deltaTime= 0; STEP=
fixedTimeStep;
m_localTime+= deltaTime; realTime.reset(); FPS++;
saveKinematicState(fixedTimeStep); applyGravity();
anmDT= deltaTime - simDT; if(cnt > 0) simDT/= cnt;
cnt= 0;
while( m_localTime >= fixedTimeStep )
{
cnt++; SPS++;
internalSingleStepSimulation(fixedTimeStep);
m_localTime-= (simDT >= STEP)?
simDT+(STEP*anmDT*fpsTensor) : STEP;
}
synchronizeMotionStates(); clearForces();
simDT= double(realTime.getTimeMicroseconds())*0.000001f;
return cnt;
}
+++"Full-solution
A" (simplistic accumulator)
//----------------------------------------------------------------------
//--------------------------
*** 2nd algo - capping the TIME "outside"
int btDiscreteDynamicsWorld::stepSimulation(
btScalar timeStep,int maxSubSteps, btScalar
fixedTimeStep)
{
m_localTime+= (timeStep <
fixedTimeStep*2)? timeStep : fixedTimeStep*2;
saveKinematicState(fixedTimeStep);
applyGravity(); maxSubSteps= 0;
while( m_localTime >= fixedTimeStep
)
{
internalSingleStepSimulation(fixedTimeStep);
m_localTime-=
fixedTimeStep; maxSubSteps++;
}
synchronizeMotionStates();
clearForces();
return maxSubSteps;
}
//--------------------------------------------------------------------------------
//================================================================================
content="Microsoft
FrontPage Express 2.0"
***
..and now, something completely different:
"The Hitchhiker's Guide to the
Earth"
Prixoni
& Mixoni
AROUND the WORLD in 80 YEARS..
Prixoni,
living at the thin line between life and death
has pressed this creature to adapt in the most
amazing way. With the help of magic rituals it is
able to transcend to lower levels of awareness
where it can sustain prolonged period of time
virtually dead. Ritual begins with meticulous
preparation where bodily fluids are exerted
through the front end of the creature's body that
resembles human head. Then, it assumes the
"death pose", and in this state all
vital functions cease. Scientists are completely
baffled as how it is possible for this creature
to revive.
Mixoni,
doesn't really exists, it is phantasmal
manifestation that accompanies Prixoni in its
thaumaturgical ventures as an odylic force to
another spheres of existence. It possesses great
power to ignore and awesome ability to
misunderstand.
|
OpenGL/OpenGL ES demos:
http://www.oocities.org/ze_aks/
http://www.oocities.org/ze_aks/myos.htm <-- best operating system
in the world

abaraba1@yahoo.com
|