1
/*************************************************************************
3
* Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
4
* All rights reserved. Email: russ@q12.org Web: www.q12.org *
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 *
13
* (2) The BSD-style license that is included with this library in *
14
* the file LICENSE-BSD.TXT. *
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. *
21
*************************************************************************/
23
#ifndef _ODE_OBJECTS_H_
24
#define _ODE_OBJECTS_H_
26
#include <ode/common.h>
28
#include <ode/contact.h>
36
dWorldID dWorldCreate();
37
void dWorldDestroy (dWorldID);
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);
49
/* StepFast1 functions */
51
void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations);
52
void dWorldSetAutoEnableDepthSF1(dWorldID, int autoEnableDepth);
54
int dWorldGetAutoEnableDepthSF1(dWorldID);
56
void dBodySetAutoDisableThresholdSF1(dBodyID, dReal autoDisableThreshold);
58
/* These functions are not yet implemented by ODE. */
60
dReal dBodyGetAutoDisableThresholdSF1(dBodyID);
62
void dBodySetAutoDisableStepsSF1(dBodyID, int AutoDisableSteps);
64
int dBodyGetAutoDisableStepsSF1(dBodyID);
66
void dBodySetAutoDisableSF1(dBodyID, int doAutoDisable);
68
int dBodyGetAutoDisableSF1(dBodyID);
73
dBodyID dBodyCreate (dWorldID);
74
void dBodyDestroy (dBodyID);
76
void dBodySetData (dBodyID, void *data);
77
void *dBodyGetData (dBodyID);
79
void dBodySetPosition (dBodyID, dReal x, dReal y, dReal z);
80
void dBodySetRotation (dBodyID, const dMatrix3 R);
81
void dBodySetQuaternion (dBodyID, const dQuaternion q);
82
void dBodySetLinearVel (dBodyID, dReal x, dReal y, dReal z);
83
void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z);
84
const dReal * dBodyGetPosition (dBodyID);
85
const dReal * dBodyGetRotation (dBodyID); /* ptr to 4x3 rot matrix */
86
const dReal * dBodyGetQuaternion (dBodyID);
87
const dReal * dBodyGetLinearVel (dBodyID);
88
const dReal * dBodyGetAngularVel (dBodyID);
90
void dBodySetMass (dBodyID, const dMass *mass);
91
void dBodyGetMass (dBodyID, dMass *mass);
93
void dBodyAddForce (dBodyID, dReal fx, dReal fy, dReal fz);
94
void dBodyAddTorque (dBodyID, dReal fx, dReal fy, dReal fz);
95
void dBodyAddRelForce (dBodyID, dReal fx, dReal fy, dReal fz);
96
void dBodyAddRelTorque (dBodyID, dReal fx, dReal fy, dReal fz);
97
void dBodyAddForceAtPos (dBodyID, dReal fx, dReal fy, dReal fz,
98
dReal px, dReal py, dReal pz);
99
void dBodyAddForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
100
dReal px, dReal py, dReal pz);
101
void dBodyAddRelForceAtPos (dBodyID, dReal fx, dReal fy, dReal fz,
102
dReal px, dReal py, dReal pz);
103
void dBodyAddRelForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
104
dReal px, dReal py, dReal pz);
106
const dReal * dBodyGetForce (dBodyID);
107
const dReal * dBodyGetTorque (dBodyID);
108
void dBodySetForce (dBodyID b, dReal x, dReal y, dReal z);
109
void dBodySetTorque (dBodyID b, dReal x, dReal y, dReal z);
111
void dBodyGetRelPointPos (dBodyID, dReal px, dReal py, dReal pz,
113
void dBodyGetRelPointVel (dBodyID, dReal px, dReal py, dReal pz,
115
void dBodyGetPointVel (dBodyID, dReal px, dReal py, dReal pz,
117
void dBodyGetPosRelPoint (dBodyID, dReal px, dReal py, dReal pz,
119
void dBodyVectorToWorld (dBodyID, dReal px, dReal py, dReal pz,
121
void dBodyVectorFromWorld (dBodyID, dReal px, dReal py, dReal pz,
124
void dBodySetFiniteRotationMode (dBodyID, int mode);
125
void dBodySetFiniteRotationAxis (dBodyID, dReal x, dReal y, dReal z);
127
int dBodyGetFiniteRotationMode (dBodyID);
128
void dBodyGetFiniteRotationAxis (dBodyID, dVector3 result);
130
int dBodyGetNumJoints (dBodyID b);
131
dJointID dBodyGetJoint (dBodyID, int index);
133
void dBodyEnable (dBodyID);
134
void dBodyDisable (dBodyID);
135
int dBodyIsEnabled (dBodyID);
137
void dBodySetGravityMode (dBodyID b, int mode);
138
int dBodyGetGravityMode (dBodyID b);
143
dJointID dJointCreateBall (dWorldID, dJointGroupID);
144
dJointID dJointCreateHinge (dWorldID, dJointGroupID);
145
dJointID dJointCreateSlider (dWorldID, dJointGroupID);
146
dJointID dJointCreateContact (dWorldID, dJointGroupID, const dContact *);
147
dJointID dJointCreateHinge2 (dWorldID, dJointGroupID);
148
dJointID dJointCreateUniversal (dWorldID, dJointGroupID);
149
dJointID dJointCreateFixed (dWorldID, dJointGroupID);
150
dJointID dJointCreateNull (dWorldID, dJointGroupID);
151
dJointID dJointCreateAMotor (dWorldID, dJointGroupID);
153
void dJointDestroy (dJointID);
155
dJointGroupID dJointGroupCreate (int max_size);
156
void dJointGroupDestroy (dJointGroupID);
157
void dJointGroupEmpty (dJointGroupID);
159
void dJointAttach (dJointID, dBodyID body1, dBodyID body2);
160
void dJointSetData (dJointID, void *data);
161
void *dJointGetData (dJointID);
162
int dJointGetType (dJointID);
163
dBodyID dJointGetBody (dJointID, int index);
165
void dJointSetFeedback (dJointID, dJointFeedback *);
166
dJointFeedback *dJointGetFeedback (dJointID);
168
/******************** breakable joint contribution ***********************/
169
void dJointSetBreakable (dJointID, int b);
170
void dJointSetBreakCallback (dJointID, dJointBreakCallback *callbackFunc);
171
void dJointSetBreakMode (dJointID, int mode);
172
int dJointGetBreakMode (dJointID);
173
void dJointSetBreakForce (dJointID, int body, dReal x, dReal y, dReal z);
174
void dJointSetBreakTorque (dJointID, int body, dReal x, dReal y, dReal z);
175
int dJointIsBreakable (dJointID);
176
void dJointGetBreakForce (dJointID, int body, dReal *force);
177
void dJointGetBreakTorque (dJointID, int body, dReal *torque);
178
/*************************************************************************/
180
void dJointSetBallAnchor (dJointID, dReal x, dReal y, dReal z);
181
void dJointSetHingeAnchor (dJointID, dReal x, dReal y, dReal z);
182
void dJointSetHingeAxis (dJointID, dReal x, dReal y, dReal z);
183
void dJointSetHingeParam (dJointID, int parameter, dReal value);
184
void dJointAddHingeTorque(dJointID joint, dReal torque);
185
void dJointSetSliderAxis (dJointID, dReal x, dReal y, dReal z);
186
void dJointSetSliderParam (dJointID, int parameter, dReal value);
187
void dJointAddSliderForce(dJointID joint, dReal force);
188
void dJointSetHinge2Anchor (dJointID, dReal x, dReal y, dReal z);
189
void dJointSetHinge2Axis1 (dJointID, dReal x, dReal y, dReal z);
190
void dJointSetHinge2Axis2 (dJointID, dReal x, dReal y, dReal z);
191
void dJointSetHinge2Param (dJointID, int parameter, dReal value);
192
void dJointAddHinge2Torques(dJointID joint, dReal torque1, dReal torque2);
193
void dJointSetUniversalAnchor (dJointID, dReal x, dReal y, dReal z);
194
void dJointSetUniversalAxis1 (dJointID, dReal x, dReal y, dReal z);
195
void dJointSetUniversalAxis2 (dJointID, dReal x, dReal y, dReal z);
196
void dJointSetUniversalParam (dJointID, int parameter, dReal value);
197
void dJointAddUniversalTorques(dJointID joint, dReal torque1, dReal torque2);
198
void dJointSetFixed (dJointID);
199
void dJointSetAMotorNumAxes (dJointID, int num);
200
void dJointSetAMotorAxis (dJointID, int anum, int rel,
201
dReal x, dReal y, dReal z);
202
void dJointSetAMotorAngle (dJointID, int anum, dReal angle);
203
void dJointSetAMotorParam (dJointID, int parameter, dReal value);
204
void dJointSetAMotorMode (dJointID, int mode);
205
void dJointAddAMotorTorques (dJointID, dReal torque1, dReal torque2, dReal torque3);
207
void dJointGetBallAnchor (dJointID, dVector3 result);
208
void dJointGetBallAnchor2 (dJointID, dVector3 result);
209
void dJointGetHingeAnchor (dJointID, dVector3 result);
210
void dJointGetHingeAnchor2 (dJointID, dVector3 result);
211
void dJointGetHingeAxis (dJointID, dVector3 result);
212
dReal dJointGetHingeParam (dJointID, int parameter);
213
dReal dJointGetHingeAngle (dJointID);
214
dReal dJointGetHingeAngleRate (dJointID);
215
dReal dJointGetSliderPosition (dJointID);
216
dReal dJointGetSliderPositionRate (dJointID);
217
void dJointGetSliderAxis (dJointID, dVector3 result);
218
dReal dJointGetSliderParam (dJointID, int parameter);
219
void dJointGetHinge2Anchor (dJointID, dVector3 result);
220
void dJointGetHinge2Anchor2 (dJointID, dVector3 result);
221
void dJointGetHinge2Axis1 (dJointID, dVector3 result);
222
void dJointGetHinge2Axis2 (dJointID, dVector3 result);
223
dReal dJointGetHinge2Param (dJointID, int parameter);
224
dReal dJointGetHinge2Angle1 (dJointID);
225
dReal dJointGetHinge2Angle1Rate (dJointID);
226
dReal dJointGetHinge2Angle2Rate (dJointID);
227
void dJointGetUniversalAnchor (dJointID, dVector3 result);
228
void dJointGetUniversalAnchor2 (dJointID, dVector3 result);
229
void dJointGetUniversalAxis1 (dJointID, dVector3 result);
230
void dJointGetUniversalAxis2 (dJointID, dVector3 result);
231
dReal dJointGetUniversalParam (dJointID, int parameter);
232
dReal dJointGetUniversalAngle1 (dJointID);
233
dReal dJointGetUniversalAngle2 (dJointID);
234
dReal dJointGetUniversalAngle1Rate (dJointID);
235
dReal dJointGetUniversalAngle2Rate (dJointID);
236
int dJointGetAMotorNumAxes (dJointID);
237
void dJointGetAMotorAxis (dJointID, int anum, dVector3 result);
238
int dJointGetAMotorAxisRel (dJointID, int anum);
239
dReal dJointGetAMotorAngle (dJointID, int anum);
240
dReal dJointGetAMotorAngleRate (dJointID, int anum);
241
dReal dJointGetAMotorParam (dJointID, int parameter);
242
int dJointGetAMotorMode (dJointID);
244
int dAreConnected (dBodyID, dBodyID);
245
int dAreConnectedExcluding (dBodyID, dBodyID, int joint_type);