]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
add support for fixed joints (jointtype -1), debug only according to ODE docs
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Oct 2009 13:57:50 +0000 (13:57 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Oct 2009 13:57:50 +0000 (13:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9392 d7cf8633-e32d-0410-b094-e92efae38249

progs.h
world.c

diff --git a/progs.h b/progs.h
index 9cc5d371a2408a10b00d21ab7d1860afc58d9419..a528fa052704e5755d04dda55ca1bb63c506d702 100644 (file)
--- a/progs.h
+++ b/progs.h
@@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define JOINTTYPE_SLIDER 3
 #define JOINTTYPE_UNIVERSAL 4
 #define JOINTTYPE_HINGE2 5
+#define JOINTTYPE_FIXED -1
 
 typedef struct edict_engineprivate_s
 {
diff --git a/world.c b/world.c
index d825e07a271f5bcc21492ec8fb8d948df84d8d9b..73508152dba73a5297dfb11e0d41ac3aeef2afcf 100644 (file)
--- a/world.c
+++ b/world.c
@@ -691,7 +691,7 @@ dJointID        (ODE_API *dJointCreateUniversal)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreatePR)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreatePU)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreatePiston)(dWorldID, dJointGroupID);
-//dJointID        (ODE_API *dJointCreateFixed)(dWorldID, dJointGroupID);
+dJointID        (ODE_API *dJointCreateFixed)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreateNull)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreateAMotor)(dWorldID, dJointGroupID);
 //dJointID        (ODE_API *dJointCreateLMotor)(dWorldID, dJointGroupID);
@@ -1156,7 +1156,7 @@ static dllfunction_t odefuncs[] =
 //     {"dJointCreatePR",                                                              (void **) &dJointCreatePR},
 //     {"dJointCreatePU",                                                              (void **) &dJointCreatePU},
 //     {"dJointCreatePiston",                                                  (void **) &dJointCreatePiston},
-//     {"dJointCreateFixed",                                                   (void **) &dJointCreateFixed},
+       {"dJointCreateFixed",                                                   (void **) &dJointCreateFixed},
 //     {"dJointCreateNull",                                                    (void **) &dJointCreateNull},
 //     {"dJointCreateAMotor",                                                  (void **) &dJointCreateAMotor},
 //     {"dJointCreateLMotor",                                                  (void **) &dJointCreateLMotor},
@@ -1659,6 +1659,8 @@ static void World_Physics_Frame_BodyToEntity(world_t *world, prvm_edict_t *ed)
                                break;
                        case JOINTTYPE_HINGE2:
                                break;
+                       case JOINTTYPE_FIXED:
+                               break;
                }
                return;
        }
@@ -1785,6 +1787,9 @@ static void World_Physics_Frame_JointFromEntity(world_t *world, prvm_edict_t *ed
                case JOINTTYPE_HINGE2:
                        j = dJointCreateHinge2(world->physics.ode_world, 0);
                        break;
+               case JOINTTYPE_FIXED:
+                       j = dJointCreateFixed(world->physics.ode_world, 0);
+                       break;
                case 0:
                default:
                        // no joint
@@ -1857,6 +1862,8 @@ static void World_Physics_Frame_JointFromEntity(world_t *world, prvm_edict_t *ed
                                SETPARAMS(Hinge2,);
                                SETPARAMS(Hinge2,2);
                                break;
+                       case JOINTTYPE_FIXED:
+                               break;
                        case 0:
                        default:
                                Host_Error("what? but above the joint was valid...\n");