MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / processIslandsFast

Function processIslandsFast

3rd_party/Src/ode/ode/src/stepfast.cpp:852–885  ·  view source on GitHub ↗

Since the iterative algorithm doesn't care about islands of bodies, this is a faster algorithm that just sends it all the joints and bodies in one array. It's downfall is it's inability to handle disabled bodies as well as the old one.

Source from the content-addressed store, hash-verified

850// faster algorithm that just sends it all the joints and bodies in one array.
851// It's downfall is it's inability to handle disabled bodies as well as the old one.
852static void
853processIslandsFast (dxWorld * world, dReal stepsize, int maxiterations)
854{
855 // nothing to do if no bodies
856 if (world->nb <= 0)
857 return;
858
859# ifdef TIMING
860 dTimerStart ("creating joint and body arrays");
861# endif
862 dxBody **bodies, *body;
863 dxJoint **joints, *joint;
864 joints = (dxJoint **) ALLOCA (world->nj * sizeof (dxJoint *));
865 bodies = (dxBody **) ALLOCA (world->nb * sizeof (dxBody *));
866
867 int nj = 0;
868 for (joint = world->firstjoint; joint; joint = (dxJoint *) joint->next)
869 joints[nj++] = joint;
870
871 int nb = 0;
872 for (body = world->firstbody; body; body = (dxBody *) body->next)
873 {
874 body->flags &= ~dxBodyDisabled;
875 bodies[nb++] = body;
876
877 }
878
879 if (nj>3) dInternalStepIslandFast (world, bodies, nb, joints, nj, stepsize, maxiterations);
880 else dInternalStepIsland (world, bodies, nb, joints, nj, stepsize);
881# ifdef TIMING
882 dTimerEnd ();
883 dTimerReport (stdout, 1);
884# endif
885}
886
887#else
888

Callers 1

dWorldStepFast1Function · 0.85

Calls 8

dTimerStartFunction · 0.85
dInternalStepIslandFastFunction · 0.85
dInternalStepIslandFunction · 0.85
dTimerEndFunction · 0.85
dTimerReportFunction · 0.85
dTimerNowFunction · 0.85
dMessageFunction · 0.85
dDebugFunction · 0.85

Tested by

no test coverage detected