]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - world.c
add support for fixed joints (jointtype -1), debug only according to ODE docs
[xonotic/darkplaces.git] / world.c
diff --git a/world.c b/world.c
index 0df8faccc3f8a41f7503b0053f3f4ccd06d3bce9..73508152dba73a5297dfb11e0d41ac3aeef2afcf 100644 (file)
--- a/world.c
+++ b/world.c
@@ -371,6 +371,8 @@ struct dxJointNode;
 struct dxJointGroup;
 struct dxTriMeshData;
 
+#define dInfinity 3.402823466e+38f
+
 typedef struct dxWorld *dWorldID;
 typedef struct dxSpace *dSpaceID;
 typedef struct dxBody *dBodyID;
@@ -689,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);
@@ -1154,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},
@@ -1326,8 +1328,8 @@ static dllfunction_t odefuncs[] =
 //     {"dSpaceGetGeom",                                                               (void **) &dSpaceGetGeom},
 //     {"dSpaceGetClass",                                                              (void **) &dSpaceGetClass},
        {"dGeomDestroy",                                                                (void **) &dGeomDestroy},
-//     {"dGeomSetData",                                                                (void **) &dGeomSetData},
-//     {"dGeomGetData",                                                                (void **) &dGeomGetData},
+       {"dGeomSetData",                                                                (void **) &dGeomSetData},
+       {"dGeomGetData",                                                                (void **) &dGeomGetData},
        {"dGeomSetBody",                                                                (void **) &dGeomSetBody},
        {"dGeomGetBody",                                                                (void **) &dGeomGetBody},
        {"dGeomSetPosition",                                                    (void **) &dGeomSetPosition},
@@ -1657,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;
        }
@@ -1783,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
@@ -1855,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");