From: vortex Date: Sun, 31 Jul 2011 03:47:41 +0000 (+0000) Subject: Lightmaps merging debug print ("copying original lightmap") now uses dprint. ODE... X-Git-Tag: xonotic-v0.6.0~163^2~291 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4392c3a8e0dc8ad2b18e7c57545dda80d84738e0;p=xonotic%2Fdarkplaces.git Lightmaps merging debug print ("copying original lightmap") now uses dprint. ODE: Add SOLID_PHYSICS_TRIMESH to replace SOLID_BSP as it has some bad hacks applied (like unstuck code). Added cvar physics_ode_world_gravitymod. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11261 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/dpdefs/dpextensions.qc b/dpdefs/dpextensions.qc index 1aba127a..a0e5a36c 100644 --- a/dpdefs/dpextensions.qc +++ b/dpdefs/dpextensions.qc @@ -1606,6 +1606,7 @@ const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builti const float SOLID_PHYSICS_BOX = 32; const float SOLID_PHYSICS_SPHERE = 33; const float SOLID_PHYSICS_CAPSULE = 34; +const float SOLID_PHYSICS_TRIMESH = 35; //SOLID_BSP; //joint types: const float JOINTTYPE_POINT = 1; diff --git a/model_brush.c b/model_brush.c index 6a329ccd..50e961e3 100644 --- a/model_brush.c +++ b/model_brush.c @@ -4980,7 +4980,7 @@ static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump) mergebuf = (loadmodel->brushq3.deluxemapping && (i & 1)) ? mergeddeluxepixels : mergedpixels; mergebuf += 4 * (realindex & (mergedcolumns-1))*size + 4 * ((realindex >> powerx) & (mergedrows-1))*mergedwidth*size; if ((i & 1) == 0 || !loadmodel->brushq3.deluxemapping) - Con_Printf("copying original lightmap %i (%ix%i) to %i (at %i,%i)\n", i, size, size, lightmapindex, (realindex & (mergedcolumns-1))*size, ((realindex >> powerx) & (mergedrows-1))*size); + Con_DPrintf("copying original lightmap %i (%ix%i) to %i (at %i,%i)\n", i, size, size, lightmapindex, (realindex & (mergedcolumns-1))*size, ((realindex >> powerx) & (mergedrows-1))*size); // convert pixels from RGB or BGRA while copying them into the destination rectangle for (j = 0;j < size;j++) diff --git a/server.h b/server.h index cb32fe42..b8339b2e 100644 --- a/server.h +++ b/server.h @@ -330,6 +330,7 @@ typedef struct client_s #define SOLID_PHYSICS_BOX 32 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) #define SOLID_PHYSICS_SPHERE 33 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) #define SOLID_PHYSICS_CAPSULE 34 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) +#define SOLID_PHYSICS_TRIMESH 35 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity) // edict->deadflag values #define DEAD_NO 0 diff --git a/world.c b/world.c index 4830996c..3a6503d7 100644 --- a/world.c +++ b/world.c @@ -341,6 +341,7 @@ cvar_t physics_ode_world_damping_linear = {0, "physics_ode_world_damping_linear" cvar_t physics_ode_world_damping_linear_threshold = {0, "physics_ode_world_damping_linear_threshold", "0.01", "world linear damping threshold (see ODE User Guide); use defaults when set to -1"}; cvar_t physics_ode_world_damping_angular = {0, "physics_ode_world_damping_angular", "0.005", "world angular damping scale (see ODE User Guide); use defaults when set to -1"}; 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_autodisable = {0, "physics_ode_autodisable", "1", "automatic disabling of objects which dont move for long period of time, makes object stacking a lot faster"}; @@ -1495,6 +1496,7 @@ static void World_Physics_Init(void) Cvar_RegisterVariable(&physics_ode_world_damping_linear_threshold); Cvar_RegisterVariable(&physics_ode_world_damping_angular); Cvar_RegisterVariable(&physics_ode_world_damping_angular_threshold); + Cvar_RegisterVariable(&physics_ode_world_gravitymod); Cvar_RegisterVariable(&physics_ode_iterationsperframe); Cvar_RegisterVariable(&physics_ode_constantstep); Cvar_RegisterVariable(&physics_ode_movelimit); @@ -2084,6 +2086,7 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) switch(solid) { case SOLID_BSP: + case SOLID_PHYSICS_TRIMESH: modelindex = (int)PRVM_gameedictfloat(ed, modelindex); if (world == &sv.world) model = SV_GetModelByIndex(modelindex); @@ -2159,6 +2162,7 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) switch(solid) { case SOLID_BSP: + case SOLID_PHYSICS_TRIMESH: ed->priv.server->ode_offsetmatrix = identitymatrix; if (!model) { @@ -2636,7 +2640,7 @@ void World_Physics_Frame(world_t *world, double frametime, double gravity) for (i = 0;i < world->physics.ode_iterations;i++) { // set the gravity - dWorldSetGravity((dWorldID)world->physics.ode_world, 0, 0, -gravity); + dWorldSetGravity((dWorldID)world->physics.ode_world, 0, 0, -gravity * physics_ode_world_gravitymod.value); // set the tolerance for closeness of objects dWorldSetContactSurfaceLayer((dWorldID)world->physics.ode_world, max(0, physics_ode_contactsurfacelayer.value));