X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=world.c;h=43fc01ed94b511761e301c7873a7b297f00bf04b;hp=44a906c40fc539d1cfb02e322e977797f70bdfd6;hb=776e54e8acfdf32471b292143d3be2a541e1867b;hpb=7938a89abdf37e9452182f64bc9aec0293f493a3 diff --git a/world.c b/world.c index 44a906c4..43fc01ed 100644 --- a/world.c +++ b/world.c @@ -351,7 +351,7 @@ cvar_t physics_ode_world_damping_angular = {0, "physics_ode_world_damping_angula cvar_t physics_ode_world_damping_angular_threshold = {0, "physics_ode_world_damping_angular_threshold", "0.01", "world angular damping threshold (see ODE User Guide); use defaults when set to -1"}; cvar_t physics_ode_world_gravitymod = {0, "physics_ode_world_gravitymod", "1", "multiplies gravity got from sv_gravity, this may be needed to tweak if strong damping is used"}; cvar_t physics_ode_iterationsperframe = {0, "physics_ode_iterationsperframe", "1", "divisor for time step, runs multiple physics steps per frame"}; -cvar_t physics_ode_constantstep = {0, "physics_ode_constantstep", "1", "use constant step (sys_ticrate value) instead of variable step which tends to increase stability"}; +cvar_t physics_ode_constantstep = {0, "physics_ode_constantstep", "1", "use constant step instead of variable step which tends to increase stability, if set to 1 uses sys_ticrate, instead uses it's own value"}; cvar_t physics_ode_autodisable = {0, "physics_ode_autodisable", "1", "automatic disabling of objects which dont move for long period of time, makes object stacking a lot faster"}; cvar_t physics_ode_autodisable_steps = {0, "physics_ode_autodisable_steps", "10", "how many steps object should be dormant to be autodisabled"}; cvar_t physics_ode_autodisable_time = {0, "physics_ode_autodisable_time", "0", "how many seconds object should be dormant to be autodisabled"}; @@ -2636,8 +2636,10 @@ void World_Physics_Frame(world_t *world, double frametime, double gravity) prvm_edict_t *ed; world->physics.ode_iterations = bound(1, physics_ode_iterationsperframe.integer, 1000); - if (physics_ode_constantstep.integer) - world->physics.ode_step = sys_ticrate.value / world->physics.ode_iterations; + if (physics_ode_constantstep.integer > 0 && physics_ode_constantstep.integer < 1) + world->physics.ode_step = physics_ode_constantstep.integer / world->physics.ode_iterations; + else if (physics_ode_constantstep.integer) + world->physics.ode_step = sys_ticrate.integer / world->physics.ode_iterations; else world->physics.ode_step = frametime / world->physics.ode_iterations; world->physics.ode_movelimit = physics_ode_movelimit.value / world->physics.ode_step;