From 4faa30bc55ce8b30da01798c1d71019d5d74c8db Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 23 Oct 2009 13:57:50 +0000 Subject: [PATCH] add support for fixed joints (jointtype -1), debug only according to ODE docs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9392 d7cf8633-e32d-0410-b094-e92efae38249 --- progs.h | 1 + world.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/progs.h b/progs.h index 9cc5d371..a528fa05 100644 --- 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 d825e07a..73508152 100644 --- 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"); -- 2.39.2