source: GTP/trunk/Lib/Geom/OgreStuff/include/ode/objects.h @ 1809

Revision 1809, 12.0 KB checked in by gumbau, 18 years ago (diff)
Line 
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
31extern "C" {
32#endif
33
34/* world */
35
36dWorldID dWorldCreate();
37void dWorldDestroy (dWorldID);
38
39void dWorldSetGravity (dWorldID, dReal x, dReal y, dReal z);
40void dWorldGetGravity (dWorldID, dVector3 gravity);
41void dWorldSetERP (dWorldID, dReal erp);
42dReal dWorldGetERP (dWorldID);
43void dWorldSetCFM (dWorldID, dReal cfm);
44dReal dWorldGetCFM (dWorldID);
45void dWorldStep (dWorldID, dReal stepsize);
46void dWorldImpulseToForce (dWorldID, dReal stepsize,
47                           dReal ix, dReal iy, dReal iz, dVector3 force);
48
49/* World QuickStep functions */
50
51void dWorldQuickStep (dWorldID w, dReal stepsize);
52void dWorldSetQuickStepNumIterations (dWorldID, int num);
53int dWorldGetQuickStepNumIterations (dWorldID);
54void dWorldSetQuickStepW (dWorldID, dReal param);
55dReal dWorldGetQuickStepW (dWorldID);
56
57/* World contact parameter functions */
58
59void dWorldSetContactMaxCorrectingVel (dWorldID, dReal vel);
60dReal dWorldGetContactMaxCorrectingVel (dWorldID);
61void dWorldSetContactSurfaceLayer (dWorldID, dReal depth);
62dReal dWorldGetContactSurfaceLayer (dWorldID);
63
64/* StepFast1 functions */
65
66void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations);
67void dWorldSetAutoEnableDepthSF1(dWorldID, int autoEnableDepth);
68int dWorldGetAutoEnableDepthSF1(dWorldID);
69
70/* Auto-disable functions */
71
72dReal dWorldGetAutoDisableLinearThreshold (dWorldID);
73void  dWorldSetAutoDisableLinearThreshold (dWorldID, dReal linear_threshold);
74dReal dWorldGetAutoDisableAngularThreshold (dWorldID);
75void  dWorldSetAutoDisableAngularThreshold (dWorldID, dReal angular_threshold);
76int   dWorldGetAutoDisableSteps (dWorldID);
77void  dWorldSetAutoDisableSteps (dWorldID, int steps);
78dReal dWorldGetAutoDisableTime (dWorldID);
79void  dWorldSetAutoDisableTime (dWorldID, dReal time);
80int   dWorldGetAutoDisableFlag (dWorldID);
81void  dWorldSetAutoDisableFlag (dWorldID, int do_auto_disable);
82
83dReal dBodyGetAutoDisableLinearThreshold (dBodyID);
84void  dBodySetAutoDisableLinearThreshold (dBodyID, dReal linear_threshold);
85dReal dBodyGetAutoDisableAngularThreshold (dBodyID);
86void  dBodySetAutoDisableAngularThreshold (dBodyID, dReal angular_threshold);
87int   dBodyGetAutoDisableSteps (dBodyID);
88void  dBodySetAutoDisableSteps (dBodyID, int steps);
89dReal dBodyGetAutoDisableTime (dBodyID);
90void  dBodySetAutoDisableTime (dBodyID, dReal time);
91int   dBodyGetAutoDisableFlag (dBodyID);
92void  dBodySetAutoDisableFlag (dBodyID, int do_auto_disable);
93void  dBodySetAutoDisableDefaults (dBodyID);
94
95/* bodies */
96
97dBodyID dBodyCreate (dWorldID);
98void dBodyDestroy (dBodyID);
99
100void  dBodySetData (dBodyID, void *data);
101void *dBodyGetData (dBodyID);
102
103void dBodySetPosition   (dBodyID, dReal x, dReal y, dReal z);
104void dBodySetRotation   (dBodyID, const dMatrix3 R);
105void dBodySetQuaternion (dBodyID, const dQuaternion q);
106void dBodySetLinearVel  (dBodyID, dReal x, dReal y, dReal z);
107void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z);
108const dReal * dBodyGetPosition   (dBodyID);
109const dReal * dBodyGetRotation   (dBodyID);     /* ptr to 4x3 rot matrix */
110const dReal * dBodyGetQuaternion (dBodyID);
111const dReal * dBodyGetLinearVel  (dBodyID);
112const dReal * dBodyGetAngularVel (dBodyID);
113
114void dBodySetMass (dBodyID, const dMass *mass);
115void dBodyGetMass (dBodyID, dMass *mass);
116
117void dBodyAddForce            (dBodyID, dReal fx, dReal fy, dReal fz);
118void dBodyAddTorque           (dBodyID, dReal fx, dReal fy, dReal fz);
119void dBodyAddRelForce         (dBodyID, dReal fx, dReal fy, dReal fz);
120void dBodyAddRelTorque        (dBodyID, dReal fx, dReal fy, dReal fz);
121void dBodyAddForceAtPos       (dBodyID, dReal fx, dReal fy, dReal fz,
122                                        dReal px, dReal py, dReal pz);
123void dBodyAddForceAtRelPos    (dBodyID, dReal fx, dReal fy, dReal fz,
124                                        dReal px, dReal py, dReal pz);
125void dBodyAddRelForceAtPos    (dBodyID, dReal fx, dReal fy, dReal fz,
126                                        dReal px, dReal py, dReal pz);
127void dBodyAddRelForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
128                                        dReal px, dReal py, dReal pz);
129
130const dReal * dBodyGetForce   (dBodyID);
131const dReal * dBodyGetTorque  (dBodyID);
132void dBodySetForce  (dBodyID b, dReal x, dReal y, dReal z);
133void dBodySetTorque (dBodyID b, dReal x, dReal y, dReal z);
134
135void dBodyGetRelPointPos    (dBodyID, dReal px, dReal py, dReal pz,
136                             dVector3 result);
137void dBodyGetRelPointVel    (dBodyID, dReal px, dReal py, dReal pz,
138                             dVector3 result);
139void dBodyGetPointVel       (dBodyID, dReal px, dReal py, dReal pz,
140                             dVector3 result);
141void dBodyGetPosRelPoint    (dBodyID, dReal px, dReal py, dReal pz,
142                             dVector3 result);
143void dBodyVectorToWorld     (dBodyID, dReal px, dReal py, dReal pz,
144                             dVector3 result);
145void dBodyVectorFromWorld   (dBodyID, dReal px, dReal py, dReal pz,
146                             dVector3 result);
147
148void dBodySetFiniteRotationMode (dBodyID, int mode);
149void dBodySetFiniteRotationAxis (dBodyID, dReal x, dReal y, dReal z);
150
151int dBodyGetFiniteRotationMode (dBodyID);
152void dBodyGetFiniteRotationAxis (dBodyID, dVector3 result);
153
154int dBodyGetNumJoints (dBodyID b);
155dJointID dBodyGetJoint (dBodyID, int index);
156
157void dBodyEnable (dBodyID);
158void dBodyDisable (dBodyID);
159int dBodyIsEnabled (dBodyID);
160
161void dBodySetGravityMode (dBodyID b, int mode);
162int dBodyGetGravityMode (dBodyID b);
163
164
165/* joints */
166
167dJointID dJointCreateBall (dWorldID, dJointGroupID);
168dJointID dJointCreateHinge (dWorldID, dJointGroupID);
169dJointID dJointCreateSlider (dWorldID, dJointGroupID);
170dJointID dJointCreateContact (dWorldID, dJointGroupID, const dContact *);
171dJointID dJointCreateHinge2 (dWorldID, dJointGroupID);
172dJointID dJointCreateUniversal (dWorldID, dJointGroupID);
173dJointID dJointCreateFixed (dWorldID, dJointGroupID);
174dJointID dJointCreateNull (dWorldID, dJointGroupID);
175dJointID dJointCreateAMotor (dWorldID, dJointGroupID);
176
177void dJointDestroy (dJointID);
178
179dJointGroupID dJointGroupCreate (int max_size);
180void dJointGroupDestroy (dJointGroupID);
181void dJointGroupEmpty (dJointGroupID);
182
183void dJointAttach (dJointID, dBodyID body1, dBodyID body2);
184void dJointSetData (dJointID, void *data);
185void *dJointGetData (dJointID);
186int dJointGetType (dJointID);
187dBodyID dJointGetBody (dJointID, int index);
188
189void dJointSetFeedback (dJointID, dJointFeedback *);
190dJointFeedback *dJointGetFeedback (dJointID);
191
192void dJointSetBallAnchor (dJointID, dReal x, dReal y, dReal z);
193void dJointSetHingeAnchor (dJointID, dReal x, dReal y, dReal z);
194void dJointSetHingeAxis (dJointID, dReal x, dReal y, dReal z);
195void dJointSetHingeParam (dJointID, int parameter, dReal value);
196void dJointAddHingeTorque(dJointID joint, dReal torque);
197void dJointSetSliderAxis (dJointID, dReal x, dReal y, dReal z);
198void dJointSetSliderParam (dJointID, int parameter, dReal value);
199void dJointAddSliderForce(dJointID joint, dReal force);
200void dJointSetHinge2Anchor (dJointID, dReal x, dReal y, dReal z);
201void dJointSetHinge2Axis1 (dJointID, dReal x, dReal y, dReal z);
202void dJointSetHinge2Axis2 (dJointID, dReal x, dReal y, dReal z);
203void dJointSetHinge2Param (dJointID, int parameter, dReal value);
204void dJointAddHinge2Torques(dJointID joint, dReal torque1, dReal torque2);
205void dJointSetUniversalAnchor (dJointID, dReal x, dReal y, dReal z);
206void dJointSetUniversalAxis1 (dJointID, dReal x, dReal y, dReal z);
207void dJointSetUniversalAxis2 (dJointID, dReal x, dReal y, dReal z);
208void dJointSetUniversalParam (dJointID, int parameter, dReal value);
209void dJointAddUniversalTorques(dJointID joint, dReal torque1, dReal torque2);
210void dJointSetFixed (dJointID);
211void dJointSetAMotorNumAxes (dJointID, int num);
212void dJointSetAMotorAxis (dJointID, int anum, int rel,
213                          dReal x, dReal y, dReal z);
214void dJointSetAMotorAngle (dJointID, int anum, dReal angle);
215void dJointSetAMotorParam (dJointID, int parameter, dReal value);
216void dJointSetAMotorMode (dJointID, int mode);
217void dJointAddAMotorTorques (dJointID, dReal torque1, dReal torque2, dReal torque3);
218
219void dJointGetBallAnchor (dJointID, dVector3 result);
220void dJointGetBallAnchor2 (dJointID, dVector3 result);
221void dJointGetHingeAnchor (dJointID, dVector3 result);
222void dJointGetHingeAnchor2 (dJointID, dVector3 result);
223void dJointGetHingeAxis (dJointID, dVector3 result);
224dReal dJointGetHingeParam (dJointID, int parameter);
225dReal dJointGetHingeAngle (dJointID);
226dReal dJointGetHingeAngleRate (dJointID);
227dReal dJointGetSliderPosition (dJointID);
228dReal dJointGetSliderPositionRate (dJointID);
229void dJointGetSliderAxis (dJointID, dVector3 result);
230dReal dJointGetSliderParam (dJointID, int parameter);
231void dJointGetHinge2Anchor (dJointID, dVector3 result);
232void dJointGetHinge2Anchor2 (dJointID, dVector3 result);
233void dJointGetHinge2Axis1 (dJointID, dVector3 result);
234void dJointGetHinge2Axis2 (dJointID, dVector3 result);
235dReal dJointGetHinge2Param (dJointID, int parameter);
236dReal dJointGetHinge2Angle1 (dJointID);
237dReal dJointGetHinge2Angle1Rate (dJointID);
238dReal dJointGetHinge2Angle2Rate (dJointID);
239void dJointGetUniversalAnchor (dJointID, dVector3 result);
240void dJointGetUniversalAnchor2 (dJointID, dVector3 result);
241void dJointGetUniversalAxis1 (dJointID, dVector3 result);
242void dJointGetUniversalAxis2 (dJointID, dVector3 result);
243dReal dJointGetUniversalParam (dJointID, int parameter);
244dReal dJointGetUniversalAngle1 (dJointID);
245dReal dJointGetUniversalAngle2 (dJointID);
246dReal dJointGetUniversalAngle1Rate (dJointID);
247dReal dJointGetUniversalAngle2Rate (dJointID);
248int dJointGetAMotorNumAxes (dJointID);
249void dJointGetAMotorAxis (dJointID, int anum, dVector3 result);
250int dJointGetAMotorAxisRel (dJointID, int anum);
251dReal dJointGetAMotorAngle (dJointID, int anum);
252dReal dJointGetAMotorAngleRate (dJointID, int anum);
253dReal dJointGetAMotorParam (dJointID, int parameter);
254int dJointGetAMotorMode (dJointID);
255
256int dAreConnected (dBodyID, dBodyID);
257int 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
268dJointID dJointCreatePlane2D (dWorldID, dJointGroupID);
269
270void dJointSetPlane2DXParam (dJointID, int parameter, dReal value);
271void dJointSetPlane2DYParam (dJointID, int parameter, dReal value);
272void dJointSetPlane2DAngleParam (dJointID, int parameter, dReal value);
273
274
275#ifdef __cplusplus
276}
277#endif
278
279#endif
Note: See TracBrowser for help on using the repository browser.