]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Lightmaps merging debug print ("copying original lightmap") now uses dprint. ODE...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 Jul 2011 03:47:41 +0000 (03:47 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Sun, 31 Jul 2011 18:54:56 +0000 (20:54 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11261 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=4392c3a8e0dc8ad2b18e7c57545dda80d84738e0

dpdefs/dpextensions.qc
model_brush.c
server.h
world.c

index 1aba127a584f1b7a4c46b17dda93a060bdf48e31..a0e5a36cd5a480d85d30fba5d624a0f4114bf2b7 100644 (file)
@@ -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;
index 6a329ccd513c400f3c67bb0e1bd5b0f28cc1b6cc..50e961e3a0375c6a34084ca5ae8d8fbad273fb70 100644 (file)
@@ -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++)
index cb32fe422f2c21f93c7c17c6cccdc92c552e7b80..b8339b2eff4789e17cf29a1227c1061ec9722ce2 100644 (file)
--- 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 4830996ca77b50073ca69005e277fa51bee82b37..3a6503d702b0015110ab5877d42bdef1ba3b1cc9 100644 (file)
--- 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));