[1812] | 1 | /*************************************************************************
|
---|
| 2 | * *
|
---|
| 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
|
---|
| 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org *
|
---|
| 5 | * *
|
---|
| 6 | * This library is free software; you can redistribute it and/or *
|
---|
| 7 | * modify it under the terms of EITHER: *
|
---|
| 8 | * (1) The GNU Lesser General Public License as published by the Free *
|
---|
| 9 | * Software Foundation; either version 2.1 of the License, or (at *
|
---|
| 10 | * your option) any later version. The text of the GNU Lesser *
|
---|
| 11 | * General Public License is included with this library in the *
|
---|
| 12 | * file LICENSE.TXT. *
|
---|
| 13 | * (2) The BSD-style license that is included with this library in *
|
---|
| 14 | * the file LICENSE-BSD.TXT. *
|
---|
| 15 | * *
|
---|
| 16 | * This library is distributed in the hope that it will be useful, *
|
---|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
|
---|
| 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
|
---|
| 20 | * *
|
---|
| 21 | *************************************************************************/
|
---|
| 22 |
|
---|
| 23 | #ifndef _ODE_OBJECTS_H_
|
---|
| 24 | #define _ODE_OBJECTS_H_
|
---|
| 25 |
|
---|
| 26 | #include <ode/common.h>
|
---|
| 27 | #include <ode/mass.h>
|
---|
| 28 | #include <ode/contact.h>
|
---|
| 29 |
|
---|
| 30 | #ifdef __cplusplus
|
---|
| 31 | extern "C" {
|
---|
| 32 | #endif
|
---|
| 33 |
|
---|
| 34 | /* world */
|
---|
| 35 |
|
---|
| 36 | dWorldID dWorldCreate();
|
---|
| 37 | void dWorldDestroy (dWorldID);
|
---|
| 38 |
|
---|
| 39 | void dWorldSetGravity (dWorldID, dReal x, dReal y, dReal z);
|
---|
| 40 | void dWorldGetGravity (dWorldID, dVector3 gravity);
|
---|
| 41 | void dWorldSetERP (dWorldID, dReal erp);
|
---|
| 42 | dReal dWorldGetERP (dWorldID);
|
---|
| 43 | void dWorldSetCFM (dWorldID, dReal cfm);
|
---|
| 44 | dReal dWorldGetCFM (dWorldID);
|
---|
| 45 | void dWorldStep (dWorldID, dReal stepsize);
|
---|
| 46 | void dWorldImpulseToForce (dWorldID, dReal stepsize,
|
---|
| 47 | dReal ix, dReal iy, dReal iz, dVector3 force);
|
---|
| 48 |
|
---|
| 49 | /* World QuickStep functions */
|
---|
| 50 |
|
---|
| 51 | void dWorldQuickStep (dWorldID w, dReal stepsize);
|
---|
| 52 | void dWorldSetQuickStepNumIterations (dWorldID, int num);
|
---|
| 53 | int dWorldGetQuickStepNumIterations (dWorldID);
|
---|
| 54 | void dWorldSetQuickStepW (dWorldID, dReal param);
|
---|
| 55 | dReal dWorldGetQuickStepW (dWorldID);
|
---|
| 56 |
|
---|
| 57 | /* World contact parameter functions */
|
---|
| 58 |
|
---|
| 59 | void dWorldSetContactMaxCorrectingVel (dWorldID, dReal vel);
|
---|
| 60 | dReal dWorldGetContactMaxCorrectingVel (dWorldID);
|
---|
| 61 | void dWorldSetContactSurfaceLayer (dWorldID, dReal depth);
|
---|
| 62 | dReal dWorldGetContactSurfaceLayer (dWorldID);
|
---|
| 63 |
|
---|
| 64 | /* StepFast1 functions */
|
---|
| 65 |
|
---|
| 66 | void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations);
|
---|
| 67 | void dWorldSetAutoEnableDepthSF1(dWorldID, int autoEnableDepth);
|
---|
| 68 | int dWorldGetAutoEnableDepthSF1(dWorldID);
|
---|
| 69 |
|
---|
| 70 | /* Auto-disable functions */
|
---|
| 71 |
|
---|
| 72 | dReal dWorldGetAutoDisableLinearThreshold (dWorldID);
|
---|
| 73 | void dWorldSetAutoDisableLinearThreshold (dWorldID, dReal linear_threshold);
|
---|
| 74 | dReal dWorldGetAutoDisableAngularThreshold (dWorldID);
|
---|
| 75 | void dWorldSetAutoDisableAngularThreshold (dWorldID, dReal angular_threshold);
|
---|
| 76 | int dWorldGetAutoDisableSteps (dWorldID);
|
---|
| 77 | void dWorldSetAutoDisableSteps (dWorldID, int steps);
|
---|
| 78 | dReal dWorldGetAutoDisableTime (dWorldID);
|
---|
| 79 | void dWorldSetAutoDisableTime (dWorldID, dReal time);
|
---|
| 80 | int dWorldGetAutoDisableFlag (dWorldID);
|
---|
| 81 | void dWorldSetAutoDisableFlag (dWorldID, int do_auto_disable);
|
---|
| 82 |
|
---|
| 83 | dReal dBodyGetAutoDisableLinearThreshold (dBodyID);
|
---|
| 84 | void dBodySetAutoDisableLinearThreshold (dBodyID, dReal linear_threshold);
|
---|
| 85 | dReal dBodyGetAutoDisableAngularThreshold (dBodyID);
|
---|
| 86 | void dBodySetAutoDisableAngularThreshold (dBodyID, dReal angular_threshold);
|
---|
| 87 | int dBodyGetAutoDisableSteps (dBodyID);
|
---|
| 88 | void dBodySetAutoDisableSteps (dBodyID, int steps);
|
---|
| 89 | dReal dBodyGetAutoDisableTime (dBodyID);
|
---|
| 90 | void dBodySetAutoDisableTime (dBodyID, dReal time);
|
---|
| 91 | int dBodyGetAutoDisableFlag (dBodyID);
|
---|
| 92 | void dBodySetAutoDisableFlag (dBodyID, int do_auto_disable);
|
---|
| 93 | void dBodySetAutoDisableDefaults (dBodyID);
|
---|
| 94 |
|
---|
| 95 | /* bodies */
|
---|
| 96 |
|
---|
| 97 | dBodyID dBodyCreate (dWorldID);
|
---|
| 98 | void dBodyDestroy (dBodyID);
|
---|
| 99 |
|
---|
| 100 | void dBodySetData (dBodyID, void *data);
|
---|
| 101 | void *dBodyGetData (dBodyID);
|
---|
| 102 |
|
---|
| 103 | void dBodySetPosition (dBodyID, dReal x, dReal y, dReal z);
|
---|
| 104 | void dBodySetRotation (dBodyID, const dMatrix3 R);
|
---|
| 105 | void dBodySetQuaternion (dBodyID, const dQuaternion q);
|
---|
| 106 | void dBodySetLinearVel (dBodyID, dReal x, dReal y, dReal z);
|
---|
| 107 | void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z);
|
---|
| 108 | const dReal * dBodyGetPosition (dBodyID);
|
---|
| 109 | const dReal * dBodyGetRotation (dBodyID); /* ptr to 4x3 rot matrix */
|
---|
| 110 | const dReal * dBodyGetQuaternion (dBodyID);
|
---|
| 111 | const dReal * dBodyGetLinearVel (dBodyID);
|
---|
| 112 | const dReal * dBodyGetAngularVel (dBodyID);
|
---|
| 113 |
|
---|
| 114 | void dBodySetMass (dBodyID, const dMass *mass);
|
---|
| 115 | void dBodyGetMass (dBodyID, dMass *mass);
|
---|
| 116 |
|
---|
| 117 | void dBodyAddForce (dBodyID, dReal fx, dReal fy, dReal fz);
|
---|
| 118 | void dBodyAddTorque (dBodyID, dReal fx, dReal fy, dReal fz);
|
---|
| 119 | void dBodyAddRelForce (dBodyID, dReal fx, dReal fy, dReal fz);
|
---|
| 120 | void dBodyAddRelTorque (dBodyID, dReal fx, dReal fy, dReal fz);
|
---|
| 121 | void dBodyAddForceAtPos (dBodyID, dReal fx, dReal fy, dReal fz,
|
---|
| 122 | dReal px, dReal py, dReal pz);
|
---|
| 123 | void dBodyAddForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
|
---|
| 124 | dReal px, dReal py, dReal pz);
|
---|
| 125 | void dBodyAddRelForceAtPos (dBodyID, dReal fx, dReal fy, dReal fz,
|
---|
| 126 | dReal px, dReal py, dReal pz);
|
---|
| 127 | void dBodyAddRelForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
|
---|
| 128 | dReal px, dReal py, dReal pz);
|
---|
| 129 |
|
---|
| 130 | const dReal * dBodyGetForce (dBodyID);
|
---|
| 131 | const dReal * dBodyGetTorque (dBodyID);
|
---|
| 132 | void dBodySetForce (dBodyID b, dReal x, dReal y, dReal z);
|
---|
| 133 | void dBodySetTorque (dBodyID b, dReal x, dReal y, dReal z);
|
---|
| 134 |
|
---|
| 135 | void dBodyGetRelPointPos (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 136 | dVector3 result);
|
---|
| 137 | void dBodyGetRelPointVel (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 138 | dVector3 result);
|
---|
| 139 | void dBodyGetPointVel (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 140 | dVector3 result);
|
---|
| 141 | void dBodyGetPosRelPoint (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 142 | dVector3 result);
|
---|
| 143 | void dBodyVectorToWorld (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 144 | dVector3 result);
|
---|
| 145 | void dBodyVectorFromWorld (dBodyID, dReal px, dReal py, dReal pz,
|
---|
| 146 | dVector3 result);
|
---|
| 147 |
|
---|
| 148 | void dBodySetFiniteRotationMode (dBodyID, int mode);
|
---|
| 149 | void dBodySetFiniteRotationAxis (dBodyID, dReal x, dReal y, dReal z);
|
---|
| 150 |
|
---|
| 151 | int dBodyGetFiniteRotationMode (dBodyID);
|
---|
| 152 | void dBodyGetFiniteRotationAxis (dBodyID, dVector3 result);
|
---|
| 153 |
|
---|
| 154 | int dBodyGetNumJoints (dBodyID b);
|
---|
| 155 | dJointID dBodyGetJoint (dBodyID, int index);
|
---|
| 156 |
|
---|
| 157 | void dBodyEnable (dBodyID);
|
---|
| 158 | void dBodyDisable (dBodyID);
|
---|
| 159 | int dBodyIsEnabled (dBodyID);
|
---|
| 160 |
|
---|
| 161 | void dBodySetGravityMode (dBodyID b, int mode);
|
---|
| 162 | int dBodyGetGravityMode (dBodyID b);
|
---|
| 163 |
|
---|
| 164 |
|
---|
| 165 | /* joints */
|
---|
| 166 |
|
---|
| 167 | dJointID dJointCreateBall (dWorldID, dJointGroupID);
|
---|
| 168 | dJointID dJointCreateHinge (dWorldID, dJointGroupID);
|
---|
| 169 | dJointID dJointCreateSlider (dWorldID, dJointGroupID);
|
---|
| 170 | dJointID dJointCreateContact (dWorldID, dJointGroupID, const dContact *);
|
---|
| 171 | dJointID dJointCreateHinge2 (dWorldID, dJointGroupID);
|
---|
| 172 | dJointID dJointCreateUniversal (dWorldID, dJointGroupID);
|
---|
| 173 | dJointID dJointCreateFixed (dWorldID, dJointGroupID);
|
---|
| 174 | dJointID dJointCreateNull (dWorldID, dJointGroupID);
|
---|
| 175 | dJointID dJointCreateAMotor (dWorldID, dJointGroupID);
|
---|
| 176 |
|
---|
| 177 | void dJointDestroy (dJointID);
|
---|
| 178 |
|
---|
| 179 | dJointGroupID dJointGroupCreate (int max_size);
|
---|
| 180 | void dJointGroupDestroy (dJointGroupID);
|
---|
| 181 | void dJointGroupEmpty (dJointGroupID);
|
---|
| 182 |
|
---|
| 183 | void dJointAttach (dJointID, dBodyID body1, dBodyID body2);
|
---|
| 184 | void dJointSetData (dJointID, void *data);
|
---|
| 185 | void *dJointGetData (dJointID);
|
---|
| 186 | int dJointGetType (dJointID);
|
---|
| 187 | dBodyID dJointGetBody (dJointID, int index);
|
---|
| 188 |
|
---|
| 189 | void dJointSetFeedback (dJointID, dJointFeedback *);
|
---|
| 190 | dJointFeedback *dJointGetFeedback (dJointID);
|
---|
| 191 |
|
---|
| 192 | void dJointSetBallAnchor (dJointID, dReal x, dReal y, dReal z);
|
---|
| 193 | void dJointSetHingeAnchor (dJointID, dReal x, dReal y, dReal z);
|
---|
| 194 | void dJointSetHingeAxis (dJointID, dReal x, dReal y, dReal z);
|
---|
| 195 | void dJointSetHingeParam (dJointID, int parameter, dReal value);
|
---|
| 196 | void dJointAddHingeTorque(dJointID joint, dReal torque);
|
---|
| 197 | void dJointSetSliderAxis (dJointID, dReal x, dReal y, dReal z);
|
---|
| 198 | void dJointSetSliderParam (dJointID, int parameter, dReal value);
|
---|
| 199 | void dJointAddSliderForce(dJointID joint, dReal force);
|
---|
| 200 | void dJointSetHinge2Anchor (dJointID, dReal x, dReal y, dReal z);
|
---|
| 201 | void dJointSetHinge2Axis1 (dJointID, dReal x, dReal y, dReal z);
|
---|
| 202 | void dJointSetHinge2Axis2 (dJointID, dReal x, dReal y, dReal z);
|
---|
| 203 | void dJointSetHinge2Param (dJointID, int parameter, dReal value);
|
---|
| 204 | void dJointAddHinge2Torques(dJointID joint, dReal torque1, dReal torque2);
|
---|
| 205 | void dJointSetUniversalAnchor (dJointID, dReal x, dReal y, dReal z);
|
---|
| 206 | void dJointSetUniversalAxis1 (dJointID, dReal x, dReal y, dReal z);
|
---|
| 207 | void dJointSetUniversalAxis2 (dJointID, dReal x, dReal y, dReal z);
|
---|
| 208 | void dJointSetUniversalParam (dJointID, int parameter, dReal value);
|
---|
| 209 | void dJointAddUniversalTorques(dJointID joint, dReal torque1, dReal torque2);
|
---|
| 210 | void dJointSetFixed (dJointID);
|
---|
| 211 | void dJointSetAMotorNumAxes (dJointID, int num);
|
---|
| 212 | void dJointSetAMotorAxis (dJointID, int anum, int rel,
|
---|
| 213 | dReal x, dReal y, dReal z);
|
---|
| 214 | void dJointSetAMotorAngle (dJointID, int anum, dReal angle);
|
---|
| 215 | void dJointSetAMotorParam (dJointID, int parameter, dReal value);
|
---|
| 216 | void dJointSetAMotorMode (dJointID, int mode);
|
---|
| 217 | void dJointAddAMotorTorques (dJointID, dReal torque1, dReal torque2, dReal torque3);
|
---|
| 218 |
|
---|
| 219 | void dJointGetBallAnchor (dJointID, dVector3 result);
|
---|
| 220 | void dJointGetBallAnchor2 (dJointID, dVector3 result);
|
---|
| 221 | void dJointGetHingeAnchor (dJointID, dVector3 result);
|
---|
| 222 | void dJointGetHingeAnchor2 (dJointID, dVector3 result);
|
---|
| 223 | void dJointGetHingeAxis (dJointID, dVector3 result);
|
---|
| 224 | dReal dJointGetHingeParam (dJointID, int parameter);
|
---|
| 225 | dReal dJointGetHingeAngle (dJointID);
|
---|
| 226 | dReal dJointGetHingeAngleRate (dJointID);
|
---|
| 227 | dReal dJointGetSliderPosition (dJointID);
|
---|
| 228 | dReal dJointGetSliderPositionRate (dJointID);
|
---|
| 229 | void dJointGetSliderAxis (dJointID, dVector3 result);
|
---|
| 230 | dReal dJointGetSliderParam (dJointID, int parameter);
|
---|
| 231 | void dJointGetHinge2Anchor (dJointID, dVector3 result);
|
---|
| 232 | void dJointGetHinge2Anchor2 (dJointID, dVector3 result);
|
---|
| 233 | void dJointGetHinge2Axis1 (dJointID, dVector3 result);
|
---|
| 234 | void dJointGetHinge2Axis2 (dJointID, dVector3 result);
|
---|
| 235 | dReal dJointGetHinge2Param (dJointID, int parameter);
|
---|
| 236 | dReal dJointGetHinge2Angle1 (dJointID);
|
---|
| 237 | dReal dJointGetHinge2Angle1Rate (dJointID);
|
---|
| 238 | dReal dJointGetHinge2Angle2Rate (dJointID);
|
---|
| 239 | void dJointGetUniversalAnchor (dJointID, dVector3 result);
|
---|
| 240 | void dJointGetUniversalAnchor2 (dJointID, dVector3 result);
|
---|
| 241 | void dJointGetUniversalAxis1 (dJointID, dVector3 result);
|
---|
| 242 | void dJointGetUniversalAxis2 (dJointID, dVector3 result);
|
---|
| 243 | dReal dJointGetUniversalParam (dJointID, int parameter);
|
---|
| 244 | dReal dJointGetUniversalAngle1 (dJointID);
|
---|
| 245 | dReal dJointGetUniversalAngle2 (dJointID);
|
---|
| 246 | dReal dJointGetUniversalAngle1Rate (dJointID);
|
---|
| 247 | dReal dJointGetUniversalAngle2Rate (dJointID);
|
---|
| 248 | int dJointGetAMotorNumAxes (dJointID);
|
---|
| 249 | void dJointGetAMotorAxis (dJointID, int anum, dVector3 result);
|
---|
| 250 | int dJointGetAMotorAxisRel (dJointID, int anum);
|
---|
| 251 | dReal dJointGetAMotorAngle (dJointID, int anum);
|
---|
| 252 | dReal dJointGetAMotorAngleRate (dJointID, int anum);
|
---|
| 253 | dReal dJointGetAMotorParam (dJointID, int parameter);
|
---|
| 254 | int dJointGetAMotorMode (dJointID);
|
---|
| 255 |
|
---|
| 256 | int dAreConnected (dBodyID, dBodyID);
|
---|
| 257 | int dAreConnectedExcluding (dBodyID, dBodyID, int joint_type);
|
---|
| 258 |
|
---|
| 259 | /*
|
---|
| 260 | This code is part of the Plane2D ODE joint
|
---|
| 261 | by psero@gmx.de
|
---|
| 262 | Wed Apr 23 18:53:43 CEST 2003
|
---|
| 263 |
|
---|
| 264 | Add this code to the file: include/ode/objects.h
|
---|
| 265 | */
|
---|
| 266 |
|
---|
| 267 |
|
---|
| 268 | dJointID dJointCreatePlane2D (dWorldID, dJointGroupID);
|
---|
| 269 |
|
---|
| 270 | void dJointSetPlane2DXParam (dJointID, int parameter, dReal value);
|
---|
| 271 | void dJointSetPlane2DYParam (dJointID, int parameter, dReal value);
|
---|
| 272 | void dJointSetPlane2DAngleParam (dJointID, int parameter, dReal value);
|
---|
| 273 |
|
---|
| 274 |
|
---|
| 275 | #ifdef __cplusplus
|
---|
| 276 | }
|
---|
| 277 | #endif
|
---|
| 278 |
|
---|
| 279 | #endif
|
---|