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 | /* StepFast1 functions */ |
---|
50 | |
---|
51 | void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations); |
---|
52 | void dWorldSetAutoEnableDepthSF1(dWorldID, int autoEnableDepth); |
---|
53 | |
---|
54 | int dWorldGetAutoEnableDepthSF1(dWorldID); |
---|
55 | |
---|
56 | void dBodySetAutoDisableThresholdSF1(dBodyID, dReal autoDisableThreshold); |
---|
57 | |
---|
58 | /* These functions are not yet implemented by ODE. */ |
---|
59 | /* |
---|
60 | dReal dBodyGetAutoDisableThresholdSF1(dBodyID); |
---|
61 | |
---|
62 | void dBodySetAutoDisableStepsSF1(dBodyID, int AutoDisableSteps); |
---|
63 | |
---|
64 | int dBodyGetAutoDisableStepsSF1(dBodyID); |
---|
65 | |
---|
66 | void dBodySetAutoDisableSF1(dBodyID, int doAutoDisable); |
---|
67 | |
---|
68 | int dBodyGetAutoDisableSF1(dBodyID); |
---|
69 | */ |
---|
70 | |
---|
71 | /* bodies */ |
---|
72 | |
---|
73 | dBodyID dBodyCreate (dWorldID); |
---|
74 | void dBodyDestroy (dBodyID); |
---|
75 | |
---|
76 | void dBodySetData (dBodyID, void *data); |
---|
77 | void *dBodyGetData (dBodyID); |
---|
78 | |
---|
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); |
---|
89 | |
---|
90 | void dBodySetMass (dBodyID, const dMass *mass); |
---|
91 | void dBodyGetMass (dBodyID, dMass *mass); |
---|
92 | |
---|
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); |
---|
105 | |
---|
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); |
---|
110 | |
---|
111 | void dBodyGetRelPointPos (dBodyID, dReal px, dReal py, dReal pz, |
---|
112 | dVector3 result); |
---|
113 | void dBodyGetRelPointVel (dBodyID, dReal px, dReal py, dReal pz, |
---|
114 | dVector3 result); |
---|
115 | void dBodyGetPointVel (dBodyID, dReal px, dReal py, dReal pz, |
---|
116 | dVector3 result); |
---|
117 | void dBodyGetPosRelPoint (dBodyID, dReal px, dReal py, dReal pz, |
---|
118 | dVector3 result); |
---|
119 | void dBodyVectorToWorld (dBodyID, dReal px, dReal py, dReal pz, |
---|
120 | dVector3 result); |
---|
121 | void dBodyVectorFromWorld (dBodyID, dReal px, dReal py, dReal pz, |
---|
122 | dVector3 result); |
---|
123 | |
---|
124 | void dBodySetFiniteRotationMode (dBodyID, int mode); |
---|
125 | void dBodySetFiniteRotationAxis (dBodyID, dReal x, dReal y, dReal z); |
---|
126 | |
---|
127 | int dBodyGetFiniteRotationMode (dBodyID); |
---|
128 | void dBodyGetFiniteRotationAxis (dBodyID, dVector3 result); |
---|
129 | |
---|
130 | int dBodyGetNumJoints (dBodyID b); |
---|
131 | dJointID dBodyGetJoint (dBodyID, int index); |
---|
132 | |
---|
133 | void dBodyEnable (dBodyID); |
---|
134 | void dBodyDisable (dBodyID); |
---|
135 | int dBodyIsEnabled (dBodyID); |
---|
136 | |
---|
137 | void dBodySetGravityMode (dBodyID b, int mode); |
---|
138 | int dBodyGetGravityMode (dBodyID b); |
---|
139 | |
---|
140 | |
---|
141 | /* joints */ |
---|
142 | |
---|
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); |
---|
152 | |
---|
153 | void dJointDestroy (dJointID); |
---|
154 | |
---|
155 | dJointGroupID dJointGroupCreate (int max_size); |
---|
156 | void dJointGroupDestroy (dJointGroupID); |
---|
157 | void dJointGroupEmpty (dJointGroupID); |
---|
158 | |
---|
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); |
---|
164 | |
---|
165 | void dJointSetFeedback (dJointID, dJointFeedback *); |
---|
166 | dJointFeedback *dJointGetFeedback (dJointID); |
---|
167 | |
---|
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 | /*************************************************************************/ |
---|
179 | |
---|
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); |
---|
206 | |
---|
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); |
---|
243 | |
---|
244 | int dAreConnected (dBodyID, dBodyID); |
---|
245 | int dAreConnectedExcluding (dBodyID, dBodyID, int joint_type); |
---|
246 | |
---|
247 | |
---|
248 | #ifdef __cplusplus |
---|
249 | } |
---|
250 | #endif |
---|
251 | |
---|
252 | #endif |
---|