]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
remove physics_ode_worldstep cvar, it is now always dWorldQuickStep,
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Nov 2011 19:18:19 +0000 (19:18 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 8 Nov 2011 20:57:03 +0000 (21:57 +0100)
this should resolve problems with ode binaries from svn

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11538 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=9e7cf93753b0ee09dabf325a989f37f611fe7919

world.c
world.h

diff --git a/world.c b/world.c
index a7e8d4def873bb39a7093e98c9ff1b1c9583e4ce..c8e47ccdef0e5451e30d21a015b1c80de4b4f856 100644 (file)
--- a/world.c
+++ b/world.c
@@ -330,14 +330,10 @@ void World_LinkEdict(world_t *world, prvm_edict_t *ent, const vec3_t mins, const
 #define USEODE 1
 #endif
 
-// recent ODE trunk has dWorldStepFast1 removed
-//#define ODE_USE_STEPFAST
-
 #ifdef USEODE
 cvar_t physics_ode_quadtree_depth = {0, "physics_ode_quadtree_depth","5", "desired subdivision level of quadtree culling space"};
 cvar_t physics_ode_contactsurfacelayer = {0, "physics_ode_contactsurfacelayer","1", "allows objects to overlap this many units to reduce jitter"};
-cvar_t physics_ode_worldstep = {0, "physics_ode_worldstep","2", "step function to use, 0 - dWorldStep, 1 - dWorldStepFast1, 2 - dWorldQuickStep"};
-cvar_t physics_ode_worldstep_iterations = {0, "physics_ode_worldstep_iterations", "20", "parameter to dWorldQuickStep and dWorldStepFast1"};
+cvar_t physics_ode_worldstep_iterations = {0, "physics_ode_worldstep_iterations", "20", "parameter to dWorldQuickStep"};
 cvar_t physics_ode_contact_mu = {0, "physics_ode_contact_mu", "1", "contact solver mu parameter - friction pyramid approximation 1 (see ODE User Guide)"};
 cvar_t physics_ode_contact_erp = {0, "physics_ode_contact_erp", "0.96", "contact solver erp parameter - Error Restitution Percent (see ODE User Guide)"};
 cvar_t physics_ode_contact_cfm = {0, "physics_ode_contact_cfm", "0", "contact solver cfm parameter - Constraint Force Mixing (see ODE User Guide)"};
@@ -584,7 +580,7 @@ void            (ODE_API *dWorldSetERP)(dWorldID, dReal erp);
 //dReal           (ODE_API *dWorldGetERP)(dWorldID);
 void            (ODE_API *dWorldSetCFM)(dWorldID, dReal cfm);
 //dReal           (ODE_API *dWorldGetCFM)(dWorldID);
-void            (ODE_API *dWorldStep)(dWorldID, dReal stepsize);
+//void            (ODE_API *dWorldStep)(dWorldID, dReal stepsize);
 //void            (ODE_API *dWorldImpulseToForce)(dWorldID, dReal stepsize, dReal ix, dReal iy, dReal iz, dVector3 force);
 void            (ODE_API *dWorldQuickStep)(dWorldID w, dReal stepsize);
 void            (ODE_API *dWorldSetQuickStepNumIterations)(dWorldID, int num);
@@ -595,9 +591,7 @@ void            (ODE_API *dWorldSetQuickStepNumIterations)(dWorldID, int num);
 //dReal           (ODE_API *dWorldGetContactMaxCorrectingVel)(dWorldID);
 void            (ODE_API *dWorldSetContactSurfaceLayer)(dWorldID, dReal depth);
 //dReal           (ODE_API *dWorldGetContactSurfaceLayer)(dWorldID);
-#ifdef ODE_USE_STEPFAST
-void            (ODE_API *dWorldStepFast1)(dWorldID, dReal stepsize, int maxiterations);
-#endif
+//void            (ODE_API *dWorldStepFast1)(dWorldID, dReal stepsize, int maxiterations);
 //void            (ODE_API *dWorldSetAutoEnableDepthSF1)(dWorldID, int autoEnableDepth);
 //int             (ODE_API *dWorldGetAutoEnableDepthSF1)(dWorldID);
 //dReal           (ODE_API *dWorldGetAutoDisableLinearThreshold)(dWorldID);
@@ -1051,7 +1045,7 @@ static dllfunction_t odefuncs[] =
 //     {"dWorldGetERP",                                                                (void **) &dWorldGetERP},
        {"dWorldSetCFM",                                                                (void **) &dWorldSetCFM},
 //     {"dWorldGetCFM",                                                                (void **) &dWorldGetCFM},
-       {"dWorldStep",                                                                  (void **) &dWorldStep},
+//     {"dWorldStep",                                                                  (void **) &dWorldStep},
 //     {"dWorldImpulseToForce",                                                (void **) &dWorldImpulseToForce},
        {"dWorldQuickStep",                                                             (void **) &dWorldQuickStep},
        {"dWorldSetQuickStepNumIterations",                             (void **) &dWorldSetQuickStepNumIterations},
@@ -1062,9 +1056,7 @@ static dllfunction_t odefuncs[] =
 //     {"dWorldGetContactMaxCorrectingVel",                    (void **) &dWorldGetContactMaxCorrectingVel},
        {"dWorldSetContactSurfaceLayer",                                (void **) &dWorldSetContactSurfaceLayer},
 //     {"dWorldGetContactSurfaceLayer",                                (void **) &dWorldGetContactSurfaceLayer},
-#ifdef ODE_USE_STEPFAST
-       {"dWorldStepFast1",                                                             (void **) &dWorldStepFast1},
-#endif
+//     {"dWorldStepFast1",                                                             (void **) &dWorldStepFast1},
 //     {"dWorldSetAutoEnableDepthSF1",                                 (void **) &dWorldSetAutoEnableDepthSF1},
 //     {"dWorldGetAutoEnableDepthSF1",                                 (void **) &dWorldGetAutoEnableDepthSF1},
 //     {"dWorldGetAutoDisableLinearThreshold",                 (void **) &dWorldGetAutoDisableLinearThreshold},
@@ -1491,7 +1483,6 @@ static void World_Physics_Init(void)
 
        Cvar_RegisterVariable(&physics_ode_quadtree_depth);
        Cvar_RegisterVariable(&physics_ode_contactsurfacelayer);
-       Cvar_RegisterVariable(&physics_ode_worldstep);
        Cvar_RegisterVariable(&physics_ode_worldstep_iterations);
        Cvar_RegisterVariable(&physics_ode_contact_mu);
        Cvar_RegisterVariable(&physics_ode_contact_erp);
@@ -2674,17 +2665,8 @@ void World_Physics_Frame(world_t *world, double frametime, double gravity)
                        collisiontime += (Sys_DoubleTime() - tdelta3)*10000;
 
                        // run physics (move objects, calculate new velocities)
-                       if (physics_ode_worldstep.integer == 2)
-                       {
-                               dWorldSetQuickStepNumIterations((dWorldID)world->physics.ode_world, bound(1, physics_ode_worldstep_iterations.integer, 200));
-                               dWorldQuickStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
-                       }
-#ifdef ODE_USE_STEPFAST
-                       else if (physics_ode_worldstep.integer == 1)
-                               dWorldStepFast1((dWorldID)world->physics.ode_world, world->physics.ode_step, bound(1, physics_ode_worldstep_iterations.integer, 200));
-#endif
-                       else
-                               dWorldStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
+                       dWorldSetQuickStepNumIterations((dWorldID)world->physics.ode_world, bound(1, physics_ode_worldstep_iterations.integer, 200));
+                       dWorldQuickStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
 
                        // clear the JointGroup now that we're done with it
                        dJointGroupEmpty((dJointGroupID)world->physics.ode_contactgroup);
diff --git a/world.h b/world.h
index 334420fbff9599d29012044e417b139dadf4be51..008ba3f8e6786cfc1fe57791f017605774af7e5f 100644 (file)
--- a/world.h
+++ b/world.h
@@ -46,7 +46,7 @@ typedef struct world_physics_s
        void *ode_world;
        void *ode_space;
        void *ode_contactgroup;
-       // number of constraint solver iterations to use (for dWorldStepFast)
+       // number of constraint solver iterations to use (for dWorldQuickStep)
        int ode_iterations;
        // actual step (server frametime / ode_iterations)
        vec_t ode_step;