collision.h   collision.h 
skipping to change at line 29 skipping to change at line 29
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
#ifndef _ODE_COLLISION_H_ #ifndef _ODE_COLLISION_H_
#define _ODE_COLLISION_H_ #define _ODE_COLLISION_H_
#include <ode/common.h> #include <ode/common.h>
#include <ode/collision_space.h> #include <ode/collision_space.h>
#include <ode/contact.h> #include <ode/contact.h>
// Include odeinit.h for backward compatibility as some of initialization A
PIs
// were initally declared in current header.
#include <ode/odeinit.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* @defgroup collide Collision Detection * @defgroup collide Collision Detection
* *
* ODE has two main components: a dynamics simulation engine and a collisio n * ODE has two main components: a dynamics simulation engine and a collisio n
* detection engine. The collision engine is given information about the * detection engine. The collision engine is given information about the
skipping to change at line 694 skipping to change at line 697
* *
* @remarks This function can also test a single non-space geom against a * @remarks This function can also test a single non-space geom against a
* space. This function is useful when there is a collision hierarchy, i.e. * space. This function is useful when there is a collision hierarchy, i.e.
* when there are spaces that contain other spaces. * when there are spaces that contain other spaces.
* *
* @remarks Other spaces that are contained within the colliding space are * @remarks Other spaces that are contained within the colliding space are
* not treated specially, i.e. they are not recursed into. The callback * not treated specially, i.e. they are not recursed into. The callback
* function may be passed these contained spaces as one or both geom * function may be passed these contained spaces as one or both geom
* arguments. * arguments.
* *
* @remarks Sublevel value of space affects how the spaces are iterated.
* Both spaces are recursed only if their sublevels match. Otherwise, only
* the space with greater sublevel is recursed and the one with lesser subl
evel
* is used as a geom itself.
*
* @remarks dSpaceCollide2() is guaranteed to pass all intersecting geom * @remarks dSpaceCollide2() is guaranteed to pass all intersecting geom
* pairs to the callback function, but may also pass close but * pairs to the callback function, but may also pass close but
* non-intersecting pairs. The number of these calls depends on the * non-intersecting pairs. The number of these calls depends on the
* internal algorithms used by the space. Thus you should not expect * internal algorithms used by the space. Thus you should not expect
* that dCollide will return contacts for every pair passed to the * that dCollide will return contacts for every pair passed to the
* callback. * callback.
* *
* @sa dSpaceCollide * @sa dSpaceCollide
* @sa dSpaceSetSublevel
* @ingroup collide * @ingroup collide
*/ */
ODE_API void dSpaceCollide2 (dGeomID space1, dGeomID space2, void *data, dN earCallback *callback); ODE_API void dSpaceCollide2 (dGeomID space1, dGeomID space2, void *data, dN earCallback *callback);
/* ************************************************************************ */ /* ************************************************************************ */
/* standard classes */ /* standard classes */
/* the maximum number of user classes that are supported */ /* the maximum number of user classes that are supported */
enum { enum {
dMaxUserClasses = 4 dMaxUserClasses = 4
skipping to change at line 730 skipping to change at line 739
dPlaneClass, dPlaneClass,
dRayClass, dRayClass,
dConvexClass, dConvexClass,
dGeomTransformClass, dGeomTransformClass,
dTriMeshClass, dTriMeshClass,
dHeightfieldClass, dHeightfieldClass,
dFirstSpaceClass, dFirstSpaceClass,
dSimpleSpaceClass = dFirstSpaceClass, dSimpleSpaceClass = dFirstSpaceClass,
dHashSpaceClass, dHashSpaceClass,
dSweepAndPruneSpaceClass, // SAP
dQuadTreeSpaceClass, dQuadTreeSpaceClass,
dLastSpaceClass = dQuadTreeSpaceClass, dLastSpaceClass = dQuadTreeSpaceClass,
dFirstUserClass, dFirstUserClass,
dLastUserClass = dFirstUserClass + dMaxUserClasses - 1, dLastUserClass = dFirstUserClass + dMaxUserClasses - 1,
dGeomNumClasses dGeomNumClasses
}; };
/** /**
* @defgroup collide_sphere Sphere Class * @defgroup collide_sphere Sphere Class
skipping to change at line 1294 skipping to change at line 1304
const dMatrix3 R2, const dVector3 side2); const dMatrix3 R2, const dVector3 side2);
// The meaning of flags parameter is the same as in dCollide() // The meaning of flags parameter is the same as in dCollide()
ODE_API int dBoxBox (const dVector3 p1, const dMatrix3 R1, ODE_API int dBoxBox (const dVector3 p1, const dMatrix3 R1,
const dVector3 side1, const dVector3 p2, const dVector3 side1, const dVector3 p2,
const dMatrix3 R2, const dVector3 side2, const dMatrix3 R2, const dVector3 side2,
dVector3 normal, dReal *depth, int *return_code, dVector3 normal, dReal *depth, int *return_code,
int flags, dContactGeom *contact, int skip); int flags, dContactGeom *contact, int skip);
ODE_API void dInfiniteAABB (dGeomID geom, dReal aabb[6]); ODE_API void dInfiniteAABB (dGeomID geom, dReal aabb[6]);
ODE_API void dInitODE(void);
ODE_API void dCloseODE(void);
/* ************************************************************************ */ /* ************************************************************************ */
/* custom classes */ /* custom classes */
typedef void dGetAABBFn (dGeomID, dReal aabb[6]); typedef void dGetAABBFn (dGeomID, dReal aabb[6]);
typedef int dColliderFn (dGeomID o1, dGeomID o2, typedef int dColliderFn (dGeomID o1, dGeomID o2,
int flags, dContactGeom *contact, int skip); int flags, dContactGeom *contact, int skip);
typedef dColliderFn * dGetColliderFnFn (int num); typedef dColliderFn * dGetColliderFnFn (int num);
typedef void dGeomDtorFn (dGeomID o); typedef void dGeomDtorFn (dGeomID o);
typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]); typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]);
skipping to change at line 1319 skipping to change at line 1327
dGetColliderFnFn *collider; dGetColliderFnFn *collider;
dGetAABBFn *aabb; dGetAABBFn *aabb;
dAABBTestFn *aabb_test; dAABBTestFn *aabb_test;
dGeomDtorFn *dtor; dGeomDtorFn *dtor;
} dGeomClass; } dGeomClass;
ODE_API int dCreateGeomClass (const dGeomClass *classptr); ODE_API int dCreateGeomClass (const dGeomClass *classptr);
ODE_API void * dGeomGetClassData (dGeomID); ODE_API void * dGeomGetClassData (dGeomID);
ODE_API dGeomID dCreateGeom (int classnum); ODE_API dGeomID dCreateGeom (int classnum);
/**
* @brief Sets a custom collider function for two geom classes.
*
* @param i The first geom class handled by this collider
* @param j The second geom class handled by this collider
* @param fn The collider function to use to determine collisions.
* @ingroup collide
*/
ODE_API void dSetColliderOverride (int i, int j, dColliderFn *fn);
/* ************************************************************************ */ /* ************************************************************************ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 6 change blocks. 
2 lines changed or deleted 22 lines changed or added


 collision_space.h   collision_space.h 
skipping to change at line 55 skipping to change at line 55
* that those pairs should not interact. * that those pairs should not interact.
* *
* @ingroup collide * @ingroup collide
*/ */
typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2);
ODE_API dSpaceID dSimpleSpaceCreate (dSpaceID space); ODE_API dSpaceID dSimpleSpaceCreate (dSpaceID space);
ODE_API dSpaceID dHashSpaceCreate (dSpaceID space); ODE_API dSpaceID dHashSpaceCreate (dSpaceID space);
ODE_API dSpaceID dQuadTreeSpaceCreate (dSpaceID space, dVector3 Center, dVe ctor3 Extents, int Depth); ODE_API dSpaceID dQuadTreeSpaceCreate (dSpaceID space, dVector3 Center, dVe ctor3 Extents, int Depth);
// SAP
// Order XZY or ZXY usually works best, if your Y is up.
#define dSAP_AXES_XYZ ((0)|(1<<2)|(2<<4))
#define dSAP_AXES_XZY ((0)|(2<<2)|(1<<4))
#define dSAP_AXES_YXZ ((1)|(0<<2)|(2<<4))
#define dSAP_AXES_YZX ((1)|(2<<2)|(0<<4))
#define dSAP_AXES_ZXY ((2)|(0<<2)|(1<<4))
#define dSAP_AXES_ZYX ((2)|(1<<2)|(0<<4))
ODE_API dSpaceID dSweepAndPruneSpaceCreate( dSpaceID space, int axisorder )
;
ODE_API void dSpaceDestroy (dSpaceID); ODE_API void dSpaceDestroy (dSpaceID);
ODE_API void dHashSpaceSetLevels (dSpaceID space, int minlevel, int maxleve l); ODE_API void dHashSpaceSetLevels (dSpaceID space, int minlevel, int maxleve l);
ODE_API void dHashSpaceGetLevels (dSpaceID space, int *minlevel, int *maxle vel); ODE_API void dHashSpaceGetLevels (dSpaceID space, int *minlevel, int *maxle vel);
ODE_API void dSpaceSetCleanup (dSpaceID space, int mode); ODE_API void dSpaceSetCleanup (dSpaceID space, int mode);
ODE_API int dSpaceGetCleanup (dSpaceID space); ODE_API int dSpaceGetCleanup (dSpaceID space);
/**
* @brief Sets sublevel value for a space.
*
* Sublevel affects how the space is handled in dSpaceCollide2 when it is co
llided
* with another space. If sublevels of both spaces match, the function itera
tes
* geometries of both spaces and collides them with each other. If sublevel
of one
* space is greater than the sublevel of another one, only the geometries of
the
* space with greater sublevel are iterated, another space is passed into
* collision callback as a geometry itself. By default all the spaces are as
signed
* zero sublevel.
*
* @note
* The space sublevel @e IS @e NOT automatically updated when one space is i
nserted
* into another or removed from one. It is a client's responsibility to upda
te sublevel
* value if necessary.
*
* @param space the space to modify
* @param sublevel the sublevel value to be assigned
* @ingroup collide
* @see dSpaceGetSublevel
* @see dSpaceCollide2
*/
ODE_API void dSpaceSetSublevel (dSpaceID space, int sublevel);
/**
* @brief Gets sublevel value of a space.
*
* Sublevel affects how the space is handled in dSpaceCollide2 when it is co
llided
* with another space. See @c dSpaceSetSublevel for more details.
*
* @param space the space to query
* @returns the sublevel value of the space
* @ingroup collide
* @see dSpaceSetSublevel
* @see dSpaceCollide2
*/
ODE_API int dSpaceGetSublevel (dSpaceID space);
ODE_API void dSpaceAdd (dSpaceID, dGeomID); ODE_API void dSpaceAdd (dSpaceID, dGeomID);
ODE_API void dSpaceRemove (dSpaceID, dGeomID); ODE_API void dSpaceRemove (dSpaceID, dGeomID);
ODE_API int dSpaceQuery (dSpaceID, dGeomID); ODE_API int dSpaceQuery (dSpaceID, dGeomID);
ODE_API void dSpaceClean (dSpaceID); ODE_API void dSpaceClean (dSpaceID);
ODE_API int dSpaceGetNumGeoms (dSpaceID); ODE_API int dSpaceGetNumGeoms (dSpaceID);
ODE_API dGeomID dSpaceGetGeom (dSpaceID, int i); ODE_API dGeomID dSpaceGetGeom (dSpaceID, int i);
/**
* @brief Given a space, this returns its class.
*
* The ODE classes are:
* @li dSimpleSpaceClass
* @li dHashSpaceClass
* @li dSweepAndPruneSpaceClass
* @li dQuadTreeSpaceClass
* @li dFirstUserClass
* @li dLastUserClass
*
* The class id not defined by the user should be between
* dFirstSpaceClass and dLastSpaceClass.
*
* User-defined class will return their own number.
*
* @param space the space to query
* @returns The space class ID.
* @ingroup collide
*/
ODE_API int dSpaceGetClass(dSpaceID space);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
0 lines changed or deleted 80 lines changed or added


 collision_trimesh.h   collision_trimesh.h 
skipping to change at line 67 skipping to change at line 67
/** /**
* We need to set the last transform after each time step for * We need to set the last transform after each time step for
* accurate collision response. These functions get and set that transform. * accurate collision response. These functions get and set that transform.
* It is stored per geom instance, rather than per dTriMeshDataID. * It is stored per geom instance, rather than per dTriMeshDataID.
*/ */
ODE_API void dGeomTriMeshSetLastTransform( dGeomID g, dMatrix4 last_trans ) ; ODE_API void dGeomTriMeshSetLastTransform( dGeomID g, dMatrix4 last_trans ) ;
ODE_API dReal* dGeomTriMeshGetLastTransform( dGeomID g ); ODE_API dReal* dGeomTriMeshGetLastTransform( dGeomID g );
/* /*
* Build TriMesh data with single precision used in vertex data . * Build a TriMesh data object with single precision vertex data.
*/ */
ODE_API void dGeomTriMeshDataBuildSingle(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildSingle(dTriMeshDataID g,
const void* Vertices, int VertexStride, in t VertexCount, const void* Vertices, int VertexStride, in t VertexCount,
const void* Indices, int IndexCount, int T riStride); const void* Indices, int IndexCount, int T riStride);
/* same again with a normals array (used as trimesh-trimesh optimization) * / /* same again with a normals array (used as trimesh-trimesh optimization) * /
ODE_API void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g,
const void* Vertices, int VertexStride, i nt VertexCount, const void* Vertices, int VertexStride, i nt VertexCount,
const void* Indices, int IndexCount, int TriStride, const void* Indices, int IndexCount, int TriStride,
const void* Normals); const void* Normals);
/* /*
* Build TriMesh data with double pricision used in vertex data . * Build a TriMesh data object with double precision vertex data.
*/ */
ODE_API void dGeomTriMeshDataBuildDouble(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildDouble(dTriMeshDataID g,
const void* Vertices, int VertexStride, i nt VertexCount, const void* Vertices, int VertexStride, i nt VertexCount,
const void* Indices, int IndexCount, int T riStride); const void* Indices, int IndexCount, int T riStride);
/* same again with a normals array (used as trimesh-trimesh optimization) * / /* same again with a normals array (used as trimesh-trimesh optimization) * /
ODE_API void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g,
const void* Vertices, int VertexStride, int VertexCount, const void* Vertices, int VertexStride, int VertexCount,
const void* Indices, int IndexCount, int TriStride, const void* Indices, int IndexCount, int TriStride,
const void* Normals); const void* Normals);
/* /*
* Simple build. Single/double precision based on dSINGLE/dDOUBLE! * Simple build. Single/double precision based on dSINGLE/dDOUBLE!
*/ */
ODE_API void dGeomTriMeshDataBuildSimple(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildSimple(dTriMeshDataID g,
const dReal* Vertices, int VertexCount, const dReal* Vertices, int VertexCount,
const int* Indices, int IndexCount); const dTriIndex* Indices, int IndexCount);
/* same again with a normals array (used as trimesh-trimesh optimization) * / /* same again with a normals array (used as trimesh-trimesh optimization) * /
ODE_API void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g, ODE_API void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g,
const dReal* Vertices, int VertexCount, const dReal* Vertices, int VertexCount,
const int* Indices, int IndexCount, const dTriIndex* Indices, int IndexCount,
const int* Normals); const int* Normals);
/* Preprocess the trimesh data to remove mark unnecessary edges and vertice s */ /* Preprocess the trimesh data to remove mark unnecessary edges and vertice s */
ODE_API void dGeomTriMeshDataPreprocess(dTriMeshDataID g); ODE_API void dGeomTriMeshDataPreprocess(dTriMeshDataID g);
/* Get and set the internal preprocessed trimesh data buffer, for loading a nd saving */ /* Get and set the internal preprocessed trimesh data buffer, for loading a nd saving */
ODE_API void dGeomTriMeshDataGetBuffer(dTriMeshDataID g, unsigned char** bu f, int* bufLen); ODE_API void dGeomTriMeshDataGetBuffer(dTriMeshDataID g, unsigned char** bu f, int* bufLen);
ODE_API void dGeomTriMeshDataSetBuffer(dTriMeshDataID g, unsigned char* buf ); ODE_API void dGeomTriMeshDataSetBuffer(dTriMeshDataID g, unsigned char* buf );
/* /*
* Per triangle callback. Allows the user to say if he wants a collision wi th * Per triangle callback. Allows the user to say if he wants a collision wi th
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 common.h   common.h 
skipping to change at line 25 skipping to change at line 25
* * * *
* This library is distributed in the hope that it will be useful, * * This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
#ifndef _ODE_COMMON_H_ #ifndef _ODE_COMMON_H_
#define _ODE_COMMON_H_ #define _ODE_COMMON_H_
#include <ode/config.h> #include <ode/odeconfig.h>
#include <ode/error.h> #include <ode/error.h>
#include <math.h> #include <math.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* configuration stuff */ /* configuration stuff */
/* the efficient alignment. most platforms align data structures to some
* number of bytes, but this is not always the most efficient alignment.
* for example, many x86 compilers align to 4 bytes, but on a pentium it
* is important to align doubles to 8 byte boundaries (for speed), and
* the 4 floats in a SIMD register to 16 byte boundaries. many other
* platforms have similar behavior. setting a larger alignment can waste
* a (very) small amount of memory. NOTE: this number must be a power of
* two. this is set to 16 by default.
*/
#define EFFICIENT_ALIGNMENT 16
/* constants */ /* constants */
/* pi and 1/sqrt(2) are defined here if necessary because they don't get /* pi and 1/sqrt(2) are defined here if necessary because they don't get
* defined in <math.h> on some platforms (like MS-Windows) * defined in <math.h> on some platforms (like MS-Windows)
*/ */
#ifndef M_PI #ifndef M_PI
#define M_PI REAL(3.1415926535897932384626433832795029) #define M_PI REAL(3.1415926535897932384626433832795029)
#endif #endif
#ifndef M_SQRT1_2 #ifndef M_SQRT1_2
skipping to change at line 115 skipping to change at line 104
#error You must #define dSINGLE or dDOUBLE #error You must #define dSINGLE or dDOUBLE
#endif #endif
// Detect if we've got both trimesh engines enabled. // Detect if we've got both trimesh engines enabled.
#if dTRIMESH_ENABLED #if dTRIMESH_ENABLED
#if dTRIMESH_OPCODE && dTRIMESH_GIMPACT #if dTRIMESH_OPCODE && dTRIMESH_GIMPACT
#error You can only #define dTRIMESH_OPCODE or dTRIMESH_GIMPACT, not both. #error You can only #define dTRIMESH_OPCODE or dTRIMESH_GIMPACT, not both.
#endif #endif
#endif // dTRIMESH_ENABLED #endif // dTRIMESH_ENABLED
// Define a type for indices, either 16 or 32 bit, based on build option
// TODO: Currently GIMPACT only supports 32 bit indices.
#if dTRIMESH_16BIT_INDICES
#if dTRIMESH_GIMPACT
typedef uint32 dTriIndex;
#else // dTRIMESH_GIMPACT
typedef uint16 dTriIndex;
#endif // dTRIMESH_GIMPACT
#else // dTRIMESH_16BIT_INDICES
typedef uint32 dTriIndex;
#endif // dTRIMESH_16BIT_INDICES
/* round an integer up to a multiple of 4, except that 0 and 1 are unmodifi ed /* round an integer up to a multiple of 4, except that 0 and 1 are unmodifi ed
* (used to compute matrix leading dimensions) * (used to compute matrix leading dimensions)
*/ */
#define dPAD(a) (((a) > 1) ? ((((a)-1)|3)+1) : (a)) #define dPAD(a) (((a) > 1) ? ((((a)-1)|3)+1) : (a))
/* these types are mainly just used in headers */ /* these types are mainly just used in headers */
typedef dReal dVector3[4]; typedef dReal dVector3[4];
typedef dReal dVector4[4]; typedef dReal dVector4[4];
typedef dReal dMatrix3[4*3]; typedef dReal dMatrix3[4*3];
typedef dReal dMatrix4[4*4]; typedef dReal dMatrix4[4*4];
skipping to change at line 193 skipping to change at line 194
#else #else
#define dIsNan(x) (_isnan(x)) #define dIsNan(x) (_isnan(x))
#endif #endif
#define dCopySign(a,b) (copysign((a),(b))) #define dCopySign(a,b) (copysign((a),(b)))
#else #else
#error You must #define dSINGLE or dDOUBLE #error You must #define dSINGLE or dDOUBLE
#endif #endif
/* utility */
/* round something up to be a multiple of the EFFICIENT_ALIGNMENT */
#define dEFFICIENT_SIZE(x) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)
/* alloca aligned to the EFFICIENT_ALIGNMENT. note that this can waste
* up to 15 bytes per allocation, depending on what alloca() returns.
*/
#define dALLOCA16(n) \
((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))
// Use the error-checking memory allocation system. Because this system us
es heap
// (malloc) instead of stack (alloca), it is slower. However, it allows y
ou to
// simulate larger scenes, as well as handle out-of-memory errors in a som
ewhat
// graceful manner
// #define dUSE_MALLOC_FOR_ALLOCA
#ifdef dUSE_MALLOC_FOR_ALLOCA
enum {
d_MEMORY_OK = 0, /* no memory errors */
d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error
*/
};
#endif
/* internal object types (all prefixed with `dx') */ /* internal object types (all prefixed with `dx') */
struct dxWorld; /* dynamics world */ struct dxWorld; /* dynamics world */
struct dxSpace; /* collision space */ struct dxSpace; /* collision space */
struct dxBody; /* rigid body (dynamics object) */ struct dxBody; /* rigid body (dynamics object) */
struct dxGeom; /* geometry (collision object) */ struct dxGeom; /* geometry (collision object) */
struct dxJoint; struct dxJoint;
struct dxJointNode; struct dxJointNode;
struct dxJointGroup; struct dxJointGroup;
skipping to change at line 249 skipping to change at line 222
enum { enum {
d_ERR_UNKNOWN = 0, /* unknown error */ d_ERR_UNKNOWN = 0, /* unknown error */
d_ERR_IASSERT, /* internal assertion failed */ d_ERR_IASSERT, /* internal assertion failed */
d_ERR_UASSERT, /* user assertion failed */ d_ERR_UASSERT, /* user assertion failed */
d_ERR_LCP /* user assertion failed */ d_ERR_LCP /* user assertion failed */
}; };
/* joint type numbers */ /* joint type numbers */
enum { typedef enum {
dJointTypeNone = 0, /* or "unknown" */ dJointTypeNone = 0, /* or "unknown" */
dJointTypeBall, dJointTypeBall,
dJointTypeHinge, dJointTypeHinge,
dJointTypeSlider, dJointTypeSlider,
dJointTypeContact, dJointTypeContact,
dJointTypeUniversal, dJointTypeUniversal,
dJointTypeHinge2, dJointTypeHinge2,
dJointTypeFixed, dJointTypeFixed,
dJointTypeNull, dJointTypeNull,
dJointTypeAMotor, dJointTypeAMotor,
dJointTypeLMotor, dJointTypeLMotor,
dJointTypePlane2D, dJointTypePlane2D,
dJointTypePR dJointTypePR,
}; dJointTypePU,
dJointTypePiston
} dJointType;
/* an alternative way of setting joint parameters, using joint parameter /* an alternative way of setting joint parameters, using joint parameter
* structures and member constants. we don't actually do this yet. * structures and member constants. we don't actually do this yet.
*/ */
/* /*
typedef struct dLimot { typedef struct dLimot {
int mode; int mode;
dReal lostop, histop; dReal lostop, histop;
dReal vel, fmax; dReal vel, fmax;
skipping to change at line 313 skipping to change at line 288
dParamFudgeFactor, \ dParamFudgeFactor, \
dParamBounce, \ dParamBounce, \
dParamCFM, \ dParamCFM, \
dParamStopERP, \ dParamStopERP, \
dParamStopCFM, \ dParamStopCFM, \
/* parameters for suspension */ \ /* parameters for suspension */ \
dParamSuspensionERP, \ dParamSuspensionERP, \
dParamSuspensionCFM, \ dParamSuspensionCFM, \
dParamERP, \ dParamERP, \
/////////////////////////////////////////////////////////////////////////
/////
/// \enum D_ALL_PARAM_NAMES_X
///
/// \var dParamGroup This is the starting value of the different group
/// (i.e. dParamGroup1, dParamGroup2, dParamGroup3)
/// It also helps in the use of parameter
/// (dParamGroup2 | dParamFMax) == dParamFMax2
/////////////////////////////////////////////////////////////////////////
/////
#define D_ALL_PARAM_NAMES_X(start,x) \ #define D_ALL_PARAM_NAMES_X(start,x) \
dParamGroup ## x = start, \
/* parameters for limits and motors */ \ /* parameters for limits and motors */ \
dParamLoStop ## x = start, \ dParamLoStop ## x = start, \
dParamHiStop ## x, \ dParamHiStop ## x, \
dParamVel ## x, \ dParamVel ## x, \
dParamFMax ## x, \ dParamFMax ## x, \
dParamFudgeFactor ## x, \ dParamFudgeFactor ## x, \
dParamBounce ## x, \ dParamBounce ## x, \
dParamCFM ## x, \ dParamCFM ## x, \
dParamStopERP ## x, \ dParamStopERP ## x, \
dParamStopCFM ## x, \ dParamStopCFM ## x, \
/* parameters for suspension */ \ /* parameters for suspension */ \
dParamSuspensionERP ## x, \ dParamSuspensionERP ## x, \
dParamSuspensionCFM ## x, \ dParamSuspensionCFM ## x, \
dParamERP ## x, dParamERP ## x,
enum { enum {
D_ALL_PARAM_NAMES(0) D_ALL_PARAM_NAMES(0)
dParamsInGroup, ///< Number of parameter in a group
D_ALL_PARAM_NAMES_X(0x000,1)
D_ALL_PARAM_NAMES_X(0x100,2) D_ALL_PARAM_NAMES_X(0x100,2)
D_ALL_PARAM_NAMES_X(0x200,3) D_ALL_PARAM_NAMES_X(0x200,3)
/* add a multiple of this constant to the basic parameter numbers to get /* add a multiple of this constant to the basic parameter numbers to get
* the parameters for the second, third etc axes. * the parameters for the second, third etc axes.
*/ */
dParamGroup=0x100 dParamGroup=0x100
}; };
/* angular motor mode numbers */ /* angular motor mode numbers */
enum{ enum {
dAMotorUser = 0, dAMotorUser = 0,
dAMotorEuler = 1 dAMotorEuler = 1
}; };
/* joint force feedback information */ /* joint force feedback information */
typedef struct dJointFeedback { typedef struct dJointFeedback {
dVector3 f1; /* force applied to body 1 */ dVector3 f1; /* force applied to body 1 */
dVector3 t1; /* torque applied to body 1 */ dVector3 t1; /* torque applied to body 1 */
dVector3 f2; /* force applied to body 2 */ dVector3 f2; /* force applied to body 2 */
skipping to change at line 366 skipping to change at line 352
/* private functions that must be implemented by the collision library: /* private functions that must be implemented by the collision library:
* (1) indicate that a geom has moved, (2) get the next geom in a body list . * (1) indicate that a geom has moved, (2) get the next geom in a body list .
* these functions are called whenever the position of geoms connected to a * these functions are called whenever the position of geoms connected to a
* body have changed, e.g. with dBodySetPosition(), dBodySetRotation(), or * body have changed, e.g. with dBodySetPosition(), dBodySetRotation(), or
* when the ODE step function updates the body state. * when the ODE step function updates the body state.
*/ */
void dGeomMoved (dGeomID); void dGeomMoved (dGeomID);
dGeomID dGeomGetBodyNext (dGeomID); dGeomID dGeomGetBodyNext (dGeomID);
/**
* dGetConfiguration returns the specific ODE build configuration as
* a string of tokens. The string can be parsed in a similar way to
* the OpenGL extension mechanism, the naming convention should be
* familiar too. The following extensions are reported:
*
* ODE
* ODE_single_precision
* ODE_double_precision
* ODE_EXT_no_debug
* ODE_EXT_trimesh
* ODE_EXT_opcode
* ODE_EXT_gimpact
* ODE_EXT_malloc_not_alloca
* ODE_EXT_gyroscopic
* ODE_OPC_16bit_indices
* ODE_OPC_new_collider
*/
ODE_API const char* dGetConfiguration (void);
/**
* Helper to check for a token in the ODE configuration string.
* Caution, this function is case sensitive.
*
* @param token A configuration token, see dGetConfiguration for details
*
* @return 1 if exact token is present, 0 if not present
*/
ODE_API int dCheckConfiguration( const char* token );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 11 change blocks. 
48 lines changed or deleted 62 lines changed or added


 contact.h   contact.h 
skipping to change at line 40 skipping to change at line 40
#endif #endif
enum { enum {
dContactMu2 = 0x001, dContactMu2 = 0x001,
dContactFDir1 = 0x002, dContactFDir1 = 0x002,
dContactBounce = 0x004, dContactBounce = 0x004,
dContactSoftERP = 0x008, dContactSoftERP = 0x008,
dContactSoftCFM = 0x010, dContactSoftCFM = 0x010,
dContactMotion1 = 0x020, dContactMotion1 = 0x020,
dContactMotion2 = 0x040, dContactMotion2 = 0x040,
dContactSlip1 = 0x080, dContactMotionN = 0x080,
dContactSlip2 = 0x100, dContactSlip1 = 0x100,
dContactSlip2 = 0x200,
dContactApprox0 = 0x0000, dContactApprox0 = 0x0000,
dContactApprox1_1 = 0x1000, dContactApprox1_1 = 0x1000,
dContactApprox1_2 = 0x2000, dContactApprox1_2 = 0x2000,
dContactApprox1 = 0x3000 dContactApprox1 = 0x3000
}; };
typedef struct dSurfaceParameters { typedef struct dSurfaceParameters {
/* must always be defined */ /* must always be defined */
int mode; int mode;
dReal mu; dReal mu;
/* only defined if the corresponding flag is set in mode */ /* only defined if the corresponding flag is set in mode */
dReal mu2; dReal mu2;
dReal bounce; dReal bounce;
dReal bounce_vel; dReal bounce_vel;
dReal soft_erp; dReal soft_erp;
dReal soft_cfm; dReal soft_cfm;
dReal motion1,motion2; dReal motion1,motion2,motionN;
dReal slip1,slip2; dReal slip1,slip2;
} dSurfaceParameters; } dSurfaceParameters;
/** /**
* @brief Describe the contact point between two geoms. * @brief Describe the contact point between two geoms.
* *
* If two bodies touch, or if a body touches a static feature in its * If two bodies touch, or if a body touches a static feature in its
* environment, the contact is represented by one or more "contact * environment, the contact is represented by one or more "contact
* points", described by dContactGeom. * points", described by dContactGeom.
* *
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added


 error.h   error.h 
skipping to change at line 28 skipping to change at line 28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
/* this comes from the `reuse' library. copy any changes back to the source */ /* this comes from the `reuse' library. copy any changes back to the source */
#ifndef _ODE_ERROR_H_ #ifndef _ODE_ERROR_H_
#define _ODE_ERROR_H_ #define _ODE_ERROR_H_
#include <ode/config.h> #include <ode/odeconfig.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* all user defined error functions have this type. error and debug functio ns /* all user defined error functions have this type. error and debug functio ns
* should not return. * should not return.
*/ */
typedef void dMessageFunction (int errnum, const char *msg, va_list ap); typedef void dMessageFunction (int errnum, const char *msg, va_list ap);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 memory.h   memory.h 
skipping to change at line 28 skipping to change at line 28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
/* this comes from the `reuse' library. copy any changes back to the source */ /* this comes from the `reuse' library. copy any changes back to the source */
#ifndef _ODE_MEMORY_H_ #ifndef _ODE_MEMORY_H_
#define _ODE_MEMORY_H_ #define _ODE_MEMORY_H_
#include "ode/config.h" #include <ode/odeconfig.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* function types to allocate and free memory */ /* function types to allocate and free memory */
typedef void * dAllocFunction (size_t size); typedef void * dAllocFunction (size_t size);
typedef void * dReallocFunction (void *ptr, size_t oldsize, size_t newsize) ; typedef void * dReallocFunction (void *ptr, size_t oldsize, size_t newsize) ;
typedef void dFreeFunction (void *ptr, size_t size); typedef void dFreeFunction (void *ptr, size_t size);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 objects.h   objects.h 
skipping to change at line 261 skipping to change at line 261
/** /**
* @brief Step the world using the StepFast1 algorithm. * @brief Step the world using the StepFast1 algorithm.
* @param stepsize the nr of seconds to advance the simulation. * @param stepsize the nr of seconds to advance the simulation.
* @param maxiterations The number of iterations to perform. * @param maxiterations The number of iterations to perform.
* @ingroup world * @ingroup world
*/ */
ODE_API void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations); ODE_API void dWorldStepFast1(dWorldID, dReal stepsize, int maxiterations);
/** /**
* @defgroup disable Automatic Enabling and Disabling * @defgroup disable Automatic Enabling and Disabling
* @ingroup world bodies
* *
* Every body can be enabled or disabled. Enabled bodies participate in the * Every body can be enabled or disabled. Enabled bodies participate in the
* simulation, while disabled bodies are turned off and do not get updated * simulation, while disabled bodies are turned off and do not get updated
* during a simulation step. New bodies are always created in the enabled s tate. * during a simulation step. New bodies are always created in the enabled s tate.
* *
* A disabled body that is connected through a joint to an enabled body wil l be * A disabled body that is connected through a joint to an enabled body wil l be
* automatically re-enabled at the next simulation step. * automatically re-enabled at the next simulation step.
* *
* Disabled bodies do not consume CPU time, therefore to speed up the simul ation * Disabled bodies do not consume CPU time, therefore to speed up the simul ation
* bodies should be disabled when they come to rest. This can be done autom atically * bodies should be disabled when they come to rest. This can be done autom atically
skipping to change at line 416 skipping to change at line 417
ODE_API int dWorldGetAutoDisableFlag (dWorldID); ODE_API int dWorldGetAutoDisableFlag (dWorldID);
/** /**
* @brief Set auto disable flag for newly created bodies. * @brief Set auto disable flag for newly created bodies.
* @ingroup disable * @ingroup disable
* @param do_auto_disable default is false. * @param do_auto_disable default is false.
*/ */
ODE_API void dWorldSetAutoDisableFlag (dWorldID, int do_auto_disable); ODE_API void dWorldSetAutoDisableFlag (dWorldID, int do_auto_disable);
/** /**
* @defgroup damping Damping
* @ingroup bodies world
*
* Damping serves two purposes: reduce simulation instability, and to allow
* the bodies to come to rest (and possibly auto-disabling them).
*
* Bodies are constructed using the world's current damping parameters. Set
ting
* the scales to 0 disables the damping.
*
* Here is how it is done: after every time step linear and angular
* velocities are tested against the corresponding thresholds. If they
* are above, they are multiplied by (1 - scale). So a negative scale value
* will actually increase the speed, and values greater than one will
* make the object oscillate every step; both can make the simulation unsta
ble.
*
* To disable damping just set the damping scale to zero.
*
* You can also limit the maximum angular velocity. In contrast to the damp
ing
* functions, the angular velocity is affected before the body is moved.
* This means that it will introduce errors in joints that are forcing the
body
* to rotate too fast. Some bodies have naturally high angular velocities
* (like cars' wheels), so you may want to give them a very high (like the
default,
* dInfinity) limit.
*
* @note The velocities are damped after the stepper function has moved the
* object. Otherwise the damping could introduce errors in joints. First th
e
* joint constraints are processed by the stepper (moving the body), then
* the damping is applied.
*
* @note The damping happens right after the moved callback is called; this
way
* it still possible use the exact velocities the body has acquired during
the
* step. You can even use the callback to create your own customized dampin
g.
*/
/**
* @brief Get the world's linear damping threshold.
* @ingroup damping
*/
ODE_API dReal dWorldGetLinearDampingThreshold (dWorldID w);
/**
* @brief Set the world's linear damping threshold.
* @param threshold The damping won't be applied if the linear speed is
* below this threshold. Default is 0.01.
* @ingroup damping
*/
ODE_API void dWorldSetLinearDampingThreshold(dWorldID w, dReal threshold);
/**
* @brief Get the world's angular damping threshold.
* @ingroup damping
*/
ODE_API dReal dWorldGetAngularDampingThreshold (dWorldID w);
/**
* @brief Set the world's angular damping threshold.
* @param threshold The damping won't be applied if the angular speed is
* below this threshold. Default is 0.01.
* @ingroup damping
*/
ODE_API void dWorldSetAngularDampingThreshold(dWorldID w, dReal threshold);
/**
* @brief Get the world's linear damping scale.
* @ingroup damping
*/
ODE_API dReal dWorldGetLinearDamping (dWorldID w);
/**
* @brief Set the world's linear damping scale.
* @param scale The linear damping scale that is to be applied to bodies.
* Default is 0 (no damping). Should be in the interval [0, 1].
* @ingroup damping
*/
ODE_API void dWorldSetLinearDamping (dWorldID w, dReal scale);
/**
* @brief Get the world's angular damping scale.
* @ingroup damping
*/
ODE_API dReal dWorldGetAngularDamping (dWorldID w);
/**
* @brief Set the world's angular damping scale.
* @param scale The angular damping scale that is to be applied to bodies.
* Default is 0 (no damping). Should be in the interval [0, 1].
* @ingroup damping
*/
ODE_API void dWorldSetAngularDamping(dWorldID w, dReal scale);
/**
* @brief Convenience function to set body linear and angular scales.
* @param linear_scale The linear damping scale that is to be applied to bo
dies.
* @param angular_scale The angular damping scale that is to be applied to
bodies.
* @ingroup damping
*/
ODE_API void dWorldSetDamping(dWorldID w,
dReal linear_scale,
dReal angular_scale);
/**
* @brief Get the default maximum angular speed.
* @ingroup damping
* @sa dBodyGetMaxAngularSpeed()
*/
ODE_API dReal dWorldGetMaxAngularSpeed (dWorldID w);
/**
* @brief Set the default maximum angular speed for new bodies.
* @ingroup damping
* @sa dBodySetMaxAngularSpeed()
*/
ODE_API void dWorldSetMaxAngularSpeed (dWorldID w, dReal max_speed);
/**
* @defgroup bodies Rigid Bodies * @defgroup bodies Rigid Bodies
* *
* A rigid body has various properties from the point of view of the * A rigid body has various properties from the point of view of the
* simulation. Some properties change over time: * simulation. Some properties change over time:
* *
* @li Position vector (x,y,z) of the body's point of reference. * @li Position vector (x,y,z) of the body's point of reference.
* Currently the point of reference must correspond to the body's cent er of mass. * Currently the point of reference must correspond to the body's cent er of mass.
* @li Linear velocity of the point of reference, a vector (vx,vy,vz). * @li Linear velocity of the point of reference, a vector (vx,vy,vz).
* @li Orientation of a body, represented by a quaternion (qs,qx,qy,qz) or * @li Orientation of a body, represented by a quaternion (qs,qx,qy,qz) or
* a 3x3 rotation matrix. * a 3x3 rotation matrix.
skipping to change at line 450 skipping to change at line 566
* in ODE (vectors, matrices etc) are relative to the body coordinate frame , and others * in ODE (vectors, matrices etc) are relative to the body coordinate frame , and others
* are relative to the global coordinate frame. * are relative to the global coordinate frame.
* *
* Note that the shape of a rigid body is not a dynamical property (except insofar as * Note that the shape of a rigid body is not a dynamical property (except insofar as
* it influences the various mass properties). It is only collision detecti on that cares * it influences the various mass properties). It is only collision detecti on that cares
* about the detailed shape of the body. * about the detailed shape of the body.
*/ */
/** /**
* @brief Get auto disable linear average threshold. * @brief Get auto disable linear average threshold.
* @ingroup bodies * @ingroup bodies disable
* @return the threshold * @return the threshold
*/ */
ODE_API dReal dBodyGetAutoDisableLinearThreshold (dBodyID); ODE_API dReal dBodyGetAutoDisableLinearThreshold (dBodyID);
/** /**
* @brief Set auto disable linear average threshold. * @brief Set auto disable linear average threshold.
* @ingroup bodies * @ingroup bodies disable
* @return the threshold * @return the threshold
*/ */
ODE_API void dBodySetAutoDisableLinearThreshold (dBodyID, dReal linear_ave rage_threshold); ODE_API void dBodySetAutoDisableLinearThreshold (dBodyID, dReal linear_ave rage_threshold);
/** /**
* @brief Get auto disable angular average threshold. * @brief Get auto disable angular average threshold.
* @ingroup bodies * @ingroup bodies disable
* @return the threshold * @return the threshold
*/ */
ODE_API dReal dBodyGetAutoDisableAngularThreshold (dBodyID); ODE_API dReal dBodyGetAutoDisableAngularThreshold (dBodyID);
/** /**
* @brief Set auto disable angular average threshold. * @brief Set auto disable angular average threshold.
* @ingroup bodies * @ingroup bodies disable
* @return the threshold * @return the threshold
*/ */
ODE_API void dBodySetAutoDisableAngularThreshold (dBodyID, dReal angular_a verage_threshold); ODE_API void dBodySetAutoDisableAngularThreshold (dBodyID, dReal angular_a verage_threshold);
/** /**
* @brief Get auto disable average size (samples count). * @brief Get auto disable average size (samples count).
* @ingroup bodies * @ingroup bodies disable
* @return the nr of steps/size. * @return the nr of steps/size.
*/ */
ODE_API int dBodyGetAutoDisableAverageSamplesCount (dBodyID); ODE_API int dBodyGetAutoDisableAverageSamplesCount (dBodyID);
/** /**
* @brief Set auto disable average buffer size (average steps). * @brief Set auto disable average buffer size (average steps).
* @ingroup bodies * @ingroup bodies disable
* @param average_samples_count the nr of samples to review. * @param average_samples_count the nr of samples to review.
*/ */
ODE_API void dBodySetAutoDisableAverageSamplesCount (dBodyID, unsigned int average_samples_count); ODE_API void dBodySetAutoDisableAverageSamplesCount (dBodyID, unsigned int average_samples_count);
/** /**
* @brief Get auto steps a body must be thought of as idle to disable * @brief Get auto steps a body must be thought of as idle to disable
* @ingroup bodies * @ingroup bodies disable
* @return the nr of steps * @return the nr of steps
*/ */
ODE_API int dBodyGetAutoDisableSteps (dBodyID); ODE_API int dBodyGetAutoDisableSteps (dBodyID);
/** /**
* @brief Set auto disable steps. * @brief Set auto disable steps.
* @ingroup bodies * @ingroup bodies disable
* @param steps the nr of steps. * @param steps the nr of steps.
*/ */
ODE_API void dBodySetAutoDisableSteps (dBodyID, int steps); ODE_API void dBodySetAutoDisableSteps (dBodyID, int steps);
/** /**
* @brief Get auto disable time. * @brief Get auto disable time.
* @ingroup bodies * @ingroup bodies disable
* @return nr of seconds * @return nr of seconds
*/ */
ODE_API dReal dBodyGetAutoDisableTime (dBodyID); ODE_API dReal dBodyGetAutoDisableTime (dBodyID);
/** /**
* @brief Set auto disable time. * @brief Set auto disable time.
* @ingroup bodies * @ingroup bodies disable
* @param time nr of seconds. * @param time nr of seconds.
*/ */
ODE_API void dBodySetAutoDisableTime (dBodyID, dReal time); ODE_API void dBodySetAutoDisableTime (dBodyID, dReal time);
/** /**
* @brief Get auto disable flag. * @brief Get auto disable flag.
* @ingroup bodies * @ingroup bodies disable
* @return 0 or 1 * @return 0 or 1
*/ */
ODE_API int dBodyGetAutoDisableFlag (dBodyID); ODE_API int dBodyGetAutoDisableFlag (dBodyID);
/** /**
* @brief Set auto disable flag. * @brief Set auto disable flag.
* @ingroup bodies * @ingroup bodies disable
* @param do_auto_disable 0 or 1 * @param do_auto_disable 0 or 1
*/ */
ODE_API void dBodySetAutoDisableFlag (dBodyID, int do_auto_disable); ODE_API void dBodySetAutoDisableFlag (dBodyID, int do_auto_disable);
/** /**
* @brief Set auto disable defaults. * @brief Set auto disable defaults.
* @remarks * @remarks
* Set the values for the body to those set as default for the world. * Set the values for the body to those set as default for the world.
* @ingroup bodies * @ingroup bodies disable
*/ */
ODE_API void dBodySetAutoDisableDefaults (dBodyID); ODE_API void dBodySetAutoDisableDefaults (dBodyID);
/** /**
* @brief Retrives the world attached to te given body. * @brief Retrieves the world attached to te given body.
* @remarks * @remarks
* *
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API dWorldID dBodyGetWorld (dBodyID); ODE_API dWorldID dBodyGetWorld (dBodyID);
/** /**
* @brief Create a body in given world. * @brief Create a body in given world.
* @remarks * @remarks
* Default mass parameters are at position (0,0,0). * Default mass parameters are at position (0,0,0).
skipping to change at line 631 skipping to change at line 747
/** /**
* @brief Get the position of a body. * @brief Get the position of a body.
* @ingroup bodies * @ingroup bodies
* @remarks * @remarks
* When getting, the returned values are pointers to internal data structur es, * When getting, the returned values are pointers to internal data structur es,
* so the vectors are valid until any changes are made to the rigid body * so the vectors are valid until any changes are made to the rigid body
* system structure. * system structure.
* @sa dBodyCopyPosition * @sa dBodyCopyPosition
*/ */
ODE_API const dReal * dBodyGetPosition (dBodyID); ODE_API const dReal * dBodyGetPosition (dBodyID);
/** /**
* @brief Copy the position of a body into a vector. * @brief Copy the position of a body into a vector.
* @ingroup bodies * @ingroup bodies
* @param body the body to query * @param body the body to query
* @param pos a copy of the body position * @param pos a copy of the body position
* @sa dBodyGetPosition * @sa dBodyGetPosition
*/ */
ODE_API void dBodyCopyPosition (dBodyID body, dVector3 pos); ODE_API void dBodyCopyPosition (dBodyID body, dVector3 pos);
/** /**
* @brief Get the rotation of a body. * @brief Get the rotation of a body.
* @ingroup bodies * @ingroup bodies
* @return pointer to a 4x3 rotation matrix. * @return pointer to a 4x3 rotation matrix.
*/ */
ODE_API const dReal * dBodyGetRotation (dBodyID); ODE_API const dReal * dBodyGetRotation (dBodyID);
/** /**
* @brief Copy the rotation of a body. * @brief Copy the rotation of a body.
* @ingroup bodies * @ingroup bodies
* @param body the body to query * @param body the body to query
* @param R a copy of the rotation matrix * @param R a copy of the rotation matrix
* @sa dBodyGetRotation * @sa dBodyGetRotation
*/ */
ODE_API void dBodyCopyRotation (dBodyID, dMatrix3 R); ODE_API void dBodyCopyRotation (dBodyID, dMatrix3 R);
skipping to change at line 678 skipping to change at line 794
* @param body the body to query * @param body the body to query
* @param quat a copy of the orientation quaternion * @param quat a copy of the orientation quaternion
* @sa dBodyGetQuaternion * @sa dBodyGetQuaternion
*/ */
ODE_API void dBodyCopyQuaternion(dBodyID body, dQuaternion quat); ODE_API void dBodyCopyQuaternion(dBodyID body, dQuaternion quat);
/** /**
* @brief Get the linear velocity of a body. * @brief Get the linear velocity of a body.
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API const dReal * dBodyGetLinearVel (dBodyID); ODE_API const dReal * dBodyGetLinearVel (dBodyID);
/** /**
* @brief Get the angular velocity of a body. * @brief Get the angular velocity of a body.
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API const dReal * dBodyGetAngularVel (dBodyID); ODE_API const dReal * dBodyGetAngularVel (dBodyID);
/** /**
* @brief Set the mass of a body. * @brief Set the mass of a body.
* @ingroup bodies * @ingroup bodies
skipping to change at line 756 skipping to change at line 872
/** /**
* @brief Return the current accumulated force vector. * @brief Return the current accumulated force vector.
* @return points to an array of 3 reals. * @return points to an array of 3 reals.
* @remarks * @remarks
* The returned values are pointers to internal data structures, so * The returned values are pointers to internal data structures, so
* the vectors are only valid until any changes are made to the rigid * the vectors are only valid until any changes are made to the rigid
* body system. * body system.
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API const dReal * dBodyGetForce (dBodyID); ODE_API const dReal * dBodyGetForce (dBodyID);
/** /**
* @brief Return the current accumulated torque vector. * @brief Return the current accumulated torque vector.
* @return points to an array of 3 reals. * @return points to an array of 3 reals.
* @remarks * @remarks
* The returned values are pointers to internal data structures, so * The returned values are pointers to internal data structures, so
* the vectors are only valid until any changes are made to the rigid * the vectors are only valid until any changes are made to the rigid
* body system. * body system.
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API const dReal * dBodyGetTorque (dBodyID); ODE_API const dReal * dBodyGetTorque (dBodyID);
/** /**
* @brief Set the body force accumulation vector. * @brief Set the body force accumulation vector.
* @remarks * @remarks
* This is mostly useful to zero the force and torque for deactivated bodie s * This is mostly useful to zero the force and torque for deactivated bodie s
* before they are reactivated, in the case where the force-adding function s * before they are reactivated, in the case where the force-adding function s
* were called on them while they were deactivated. * were called on them while they were deactivated.
* @ingroup bodies * @ingroup bodies
*/ */
ODE_API void dBodySetForce (dBodyID b, dReal x, dReal y, dReal z); ODE_API void dBodySetForce (dBodyID b, dReal x, dReal y, dReal z);
skipping to change at line 965 skipping to change at line 1081
ODE_API void dBodySetGravityMode (dBodyID b, int mode); ODE_API void dBodySetGravityMode (dBodyID b, int mode);
/** /**
* @brief Get whether the body is influenced by the world's gravity or not. * @brief Get whether the body is influenced by the world's gravity or not.
* @ingroup bodies * @ingroup bodies
* @return nonzero means gravity affects this body. * @return nonzero means gravity affects this body.
*/ */
ODE_API int dBodyGetGravityMode (dBodyID b); ODE_API int dBodyGetGravityMode (dBodyID b);
/** /**
* @brief Set the 'moved' callback of a body.
*
* Whenever a body has its position or rotation changed during the
* timestep, the callback will be called (with body as the argument).
* Use it to know which body may need an update in an external
* structure (like a 3D engine).
*
* @param b the body that needs to be watched.
* @param callback the callback to be invoked when the body moves. Set to z
ero
* to disable.
* @ingroup bodies
*/
ODE_API void dBodySetMovedCallback(dBodyID b, void (*callback)(dBodyID));
/**
* @brief Return the first geom associated with the body.
*
* You can traverse through the geoms by repeatedly calling
* dBodyGetNextGeom().
*
* @return the first geom attached to this body, or 0.
* @ingroup bodies
*/
ODE_API dGeomID dBodyGetFirstGeom (dBodyID b);
/**
* @brief returns the next geom associated with the same body.
* @param g a geom attached to some body.
* @return the next geom attached to the same body, or 0.
* @sa dBodyGetFirstGeom
* @ingroup bodies
*/
ODE_API dGeomID dBodyGetNextGeom (dGeomID g);
/**
* @brief Resets the damping settings to the current world's settings.
* @ingroup bodies damping
*/
ODE_API void dBodySetDampingDefaults(dBodyID b);
/**
* @brief Get the body's linear damping scale.
* @ingroup bodies damping
*/
ODE_API dReal dBodyGetLinearDamping (dBodyID b);
/**
* @brief Set the body's linear damping scale.
* @param scale The linear damping scale. Should be in the interval [0, 1].
* @ingroup bodies damping
* @remarks From now on the body will not use the world's linear damping
* scale until dBodySetDampingDefaults() is called.
* @sa dBodySetDampingDefaults()
*/
ODE_API void dBodySetLinearDamping(dBodyID b, dReal scale);
/**
* @brief Get the body's angular damping scale.
* @ingroup bodies damping
* @remarks If the body's angular damping scale was not set, this function
* returns the world's angular damping scale.
*/
ODE_API dReal dBodyGetAngularDamping (dBodyID b);
/**
* @brief Set the body's angular damping scale.
* @param scale The angular damping scale. Should be in the interval [0, 1]
.
* @ingroup bodies damping
* @remarks From now on the body will not use the world's angular damping
* scale until dBodyResetAngularDamping() is called.
* @sa dBodyResetAngularDamping()
*/
ODE_API void dBodySetAngularDamping(dBodyID b, dReal scale);
/**
* @brief Convenience function to set linear and angular scales at once.
* @param linear_scale The linear damping scale. Should be in the interval
[0, 1].
* @param angular_scale The angular damping scale. Should be in the interva
l [0, 1].
* @ingroup bodies damping
* @sa dBodySetLinearDamping() dBodySetAngularDamping()
*/
ODE_API void dBodySetDamping(dBodyID b, dReal linear_scale, dReal angular_s
cale);
/**
* @brief Get the body's linear damping threshold.
* @ingroup bodies damping
*/
ODE_API dReal dBodyGetLinearDampingThreshold (dBodyID b);
/**
* @brief Set the body's linear damping threshold.
* @param threshold The linear threshold to be used. Damping
* is only applied if the linear speed is above this limit.
* @ingroup bodies damping
*/
ODE_API void dBodySetLinearDampingThreshold(dBodyID b, dReal threshold);
/**
* @brief Get the body's angular damping threshold.
* @ingroup bodies damping
*/
ODE_API dReal dBodyGetAngularDampingThreshold (dBodyID b);
/**
* @brief Set the body's angular damping threshold.
* @param threshold The angular threshold to be used. Damping is
* only used if the angular speed is above this limit.
* @ingroup bodies damping
*/
ODE_API void dBodySetAngularDampingThreshold(dBodyID b, dReal threshold);
/**
* @brief Get the body's maximum angular speed.
* @ingroup damping bodies
* @sa dWorldGetMaxAngularSpeed()
*/
ODE_API dReal dBodyGetMaxAngularSpeed (dBodyID b);
/**
* @brief Set the body's maximum angular speed.
* @ingroup damping bodies
* @sa dWorldSetMaxAngularSpeed() dBodyResetMaxAngularSpeed()
* The default value is dInfinity, but it's a good idea to limit
* it at less than 500 if you build ODE with the gyroscopic term
* enabled.
*/
ODE_API void dBodySetMaxAngularSpeed(dBodyID b, dReal max_speed);
/**
* @defgroup joints Joints * @defgroup joints Joints
* *
* In real life a joint is something like a hinge, that is used to connect two * In real life a joint is something like a hinge, that is used to connect two
* objects. * objects.
* In ODE a joint is very similar: It is a relationship that is enforced be tween * In ODE a joint is very similar: It is a relationship that is enforced be tween
* two bodies so that they can only have certain positions and orientations * two bodies so that they can only have certain positions and orientations
* relative to each other. * relative to each other.
* This relationship is called a constraint -- the words joint and * This relationship is called a constraint -- the words joint and
* constraint are often used interchangeably. * constraint are often used interchangeably.
* *
skipping to change at line 1088 skipping to change at line 1333
ODE_API dJointID dJointCreateUniversal (dWorldID, dJointGroupID); ODE_API dJointID dJointCreateUniversal (dWorldID, dJointGroupID);
/** /**
* @brief Create a new joint of the PR (Prismatic and Rotoide) type. * @brief Create a new joint of the PR (Prismatic and Rotoide) type.
* @ingroup joints * @ingroup joints
* @param dJointGroupID set to 0 to allocate the joint normally. * @param dJointGroupID set to 0 to allocate the joint normally.
* If it is nonzero the joint is allocated in the given joint group. * If it is nonzero the joint is allocated in the given joint group.
*/ */
ODE_API dJointID dJointCreatePR (dWorldID, dJointGroupID); ODE_API dJointID dJointCreatePR (dWorldID, dJointGroupID);
/**
* @brief Create a new joint of the PU (Prismatic and Universal) type.
* @ingroup joints
* @param dJointGroupID set to 0 to allocate the joint normally.
* If it is nonzero the joint is allocated in the given joint group.
*/
ODE_API dJointID dJointCreatePU (dWorldID, dJointGroupID);
/**
* @brief Create a new joint of the Piston type.
* @ingroup joints
* @param dJointGroupID set to 0 to allocate the joint normally.
* If it is nonzero the joint is allocated in the gi
ven
* joint group.
*/
ODE_API dJointID dJointCreatePiston (dWorldID, dJointGroupID);
/** /**
* @brief Create a new joint of the fixed type. * @brief Create a new joint of the fixed type.
* @ingroup joints * @ingroup joints
* @param dJointGroupID set to 0 to allocate the joint normally. * @param dJointGroupID set to 0 to allocate the joint normally.
* If it is nonzero the joint is allocated in the given joint group. * If it is nonzero the joint is allocated in the given joint group.
*/ */
ODE_API dJointID dJointCreateFixed (dWorldID, dJointGroupID); ODE_API dJointID dJointCreateFixed (dWorldID, dJointGroupID);
ODE_API dJointID dJointCreateNull (dWorldID, dJointGroupID); ODE_API dJointID dJointCreateNull (dWorldID, dJointGroupID);
skipping to change at line 1157 skipping to change at line 1419
/** /**
* @brief Empty a joint group. * @brief Empty a joint group.
* @ingroup joints * @ingroup joints
* *
* All joints in the joint group will be destroyed, * All joints in the joint group will be destroyed,
* but the joint group itself will not be destroyed. * but the joint group itself will not be destroyed.
*/ */
ODE_API void dJointGroupEmpty (dJointGroupID); ODE_API void dJointGroupEmpty (dJointGroupID);
/** /**
* @brief Return the number of bodies attached to the joint
* @ingroup joints
*/
ODE_API int dJointGetNumBodies(dJointID);
/**
* @brief Attach the joint to some new bodies. * @brief Attach the joint to some new bodies.
* @ingroup joints * @ingroup joints
* *
* If the joint is already attached, it will be detached from the old bodie s * If the joint is already attached, it will be detached from the old bodie s
* first. * first.
* To attach this joint to only one body, set body1 or body2 to zero - a ze ro * To attach this joint to only one body, set body1 or body2 to zero - a ze ro
* body refers to the static environment. * body refers to the static environment.
* Setting both bodies to zero puts the joint into "limbo", i.e. it will * Setting both bodies to zero puts the joint into "limbo", i.e. it will
* have no effect on the simulation. * have no effect on the simulation.
* @remarks * @remarks
skipping to change at line 1187 skipping to change at line 1455
/** /**
* @brief Get the user-data pointer * @brief Get the user-data pointer
* @ingroup joints * @ingroup joints
*/ */
ODE_API void *dJointGetData (dJointID); ODE_API void *dJointGetData (dJointID);
/** /**
* @brief Get the type of the joint * @brief Get the type of the joint
* @ingroup joints * @ingroup joints
* @return the type, being one of these: * @return the type, being one of these:
* \li JointTypeBall * \li dJointTypeBall
* \li JointTypeHinge * \li dJointTypeHinge
* \li JointTypeSlider * \li dJointTypeSlider
* \li JointTypeContact * \li dJointTypeContact
* \li JointTypeUniversal * \li dJointTypeUniversal
* \li JointTypeHinge2 * \li dJointTypeHinge2
* \li JointTypeFixed * \li dJointTypeFixed
* \li JointTypeAMotor * \li dJointTypeNull
* \li JointTypeLMotor * \li dJointTypeAMotor
* \li dJointTypeLMotor
* \li dJointTypePlane2D
* \li dJointTypePR
* \li dJointTypePU
* \li dJointTypePiston
*/ */
ODE_API int dJointGetType (dJointID); ODE_API dJointType dJointGetType (dJointID);
/** /**
* @brief Return the bodies that this joint connects. * @brief Return the bodies that this joint connects.
* @ingroup joints * @ingroup joints
* @param index return the first (0) or second (1) body. * @param index return the first (0) or second (1) body.
* @remarks * @remarks
* If one of these returned body IDs is zero, the joint connects the other body * If one of these returned body IDs is zero, the joint connects the other body
* to the static environment. * to the static environment.
* If both body IDs are zero, the joint is in ``limbo'' and has no effect o n * If both body IDs are zero, the joint is in ``limbo'' and has no effect o n
* the simulation. * the simulation.
skipping to change at line 1404 skipping to change at line 1677
/** /**
* @brief Applies the torque about the rotoide axis of the PR joint * @brief Applies the torque about the rotoide axis of the PR joint
* *
* That is, it applies a torque with specified magnitude in the direction * That is, it applies a torque with specified magnitude in the direction
* of the rotoide axis, to body 1, and with the same magnitude but in oppos ite * of the rotoide axis, to body 1, and with the same magnitude but in oppos ite
* direction to body 2. This function is just a wrapper for dBodyAddTorque( )} * direction to body 2. This function is just a wrapper for dBodyAddTorque( )}
* @ingroup joints * @ingroup joints
*/ */
ODE_API void dJointAddPRTorque (dJointID j, dReal torque); ODE_API void dJointAddPRTorque (dJointID j, dReal torque);
/**
* @brief set anchor
* @ingroup joints
*/
ODE_API void dJointSetPUAnchor (dJointID, dReal x, dReal y, dReal z);
/**
* @brief set anchor
* @ingroup joints
*/
ODE_API void dJointSetPUAnchorDelta (dJointID, dReal x, dReal y, dReal z,
dReal dx, dReal dy, dReal dz);
/**
* @brief set the axis for the first axis or the universal articulation
* @ingroup joints
*/
ODE_API void dJointSetPUAxis1 (dJointID, dReal x, dReal y, dReal z);
/**
* @brief set the axis for the second axis or the universal articulation
* @ingroup joints
*/
ODE_API void dJointSetPUAxis2 (dJointID, dReal x, dReal y, dReal z);
/**
* @brief set the axis for the prismatic articulation
* @ingroup joints
*/
ODE_API void dJointSetPUAxis3 (dJointID, dReal x, dReal y, dReal z);
/**
* @brief set the axis for the prismatic articulation
* @ingroup joints
* @note This function was added for convenience it is the same as
* dJointSetPUAxis3
*/
ODE_API void dJointSetPUAxisP (dJointID id, dReal x, dReal y, dReal z);
/**
* @brief set joint parameter
* @ingroup joints
*
* @note parameterX where X equal 2 refer to parameter for second axis of
the
* universal articulation
* @note parameterX where X equal 3 refer to parameter for prismatic
* articulation
*/
ODE_API void dJointSetPUParam (dJointID, int parameter, dReal value);
/**
* @brief Applies the torque about the rotoide axis of the PU joint
*
* That is, it applies a torque with specified magnitude in the direction
* of the rotoide axis, to body 1, and with the same magnitude but in opp
osite
* direction to body 2. This function is just a wrapper for dBodyAddTorqu
e()}
* @ingroup joints
*/
ODE_API void dJointAddPUTorque (dJointID j, dReal torque);
/**
* @brief set the joint axis
* @ingroup joints
*/
ODE_API void dJointSetPistonAnchor (dJointID, dReal x, dReal y, dReal z);
/**
* @brief set the joint axis
* @ingroup joints
*/
ODE_API void dJointSetPistonAxis (dJointID, dReal x, dReal y, dReal z);
/**
* This function set prismatic axis of the joint and also set the positio
n
* of the joint.
*
* @ingroup joints
* @param j The joint affected by this function
* @param x The x component of the axis
* @param y The y component of the axis
* @param z The z component of the axis
* @param dx The Initial position of the prismatic join in the x directio
n
* @param dy The Initial position of the prismatic join in the y directio
n
* @param dz The Initial position of the prismatic join in the z directio
n
*/
ODE_API void dJointSetPistonAxisDelta (dJointID j, dReal x, dReal y, dRea
l z, dReal ax, dReal ay, dReal az);
/**
* @brief set joint parameter
* @ingroup joints
*/
ODE_API void dJointSetPistonParam (dJointID, int parameter, dReal value);
/**
* @brief Applies the given force in the slider's direction.
*
* That is, it applies a force with specified magnitude, in the direction
of
* prismatic's axis, to body1, and with the same magnitude but opposite
* direction to body2. This function is just a wrapper for dBodyAddForce
().
* @ingroup joints
*/
ODE_API void dJointAddPistonForce (dJointID joint, dReal force);
/** /**
* @brief Call this on the fixed joint after it has been attached to * @brief Call this on the fixed joint after it has been attached to
* remember the current desired relative offset and desired relative * remember the current desired relative offset and desired relative
* rotation between the bodies. * rotation between the bodies.
* @ingroup joints * @ingroup joints
*/ */
ODE_API void dJointSetFixed (dJointID); ODE_API void dJointSetFixed (dJointID);
/* /*
* @brief Sets joint parameter * @brief Sets joint parameter
skipping to change at line 1788 skipping to change at line 2164
* @ingroup joints * @ingroup joints
*/ */
ODE_API void dJointGetPRAxis2 (dJointID, dVector3 result); ODE_API void dJointGetPRAxis2 (dJointID, dVector3 result);
/** /**
* @brief get joint parameter * @brief get joint parameter
* @ingroup joints * @ingroup joints
*/ */
ODE_API dReal dJointGetPRParam (dJointID, int parameter); ODE_API dReal dJointGetPRParam (dJointID, int parameter);
/** /**
* @brief Get the joint anchor point, in world coordinates.
* @return the point on body 1. If the joint is perfectly satisfied,
* this will be the same as the point on body 2.
* @ingroup joints
*/
ODE_API void dJointGetPUAnchor (dJointID, dVector3 result);
/**
* @brief Get the PU linear position (i.e. the prismatic's extension)
*
* When the axis is set, the current position of the attached bodies is
* examined and that position will be the zero position.
*
* The position is the "oriented" length between the
* position = (Prismatic axis) dot_product [(body1 + offset) - (body2 + a
nchor2)]
*
* @ingroup joints
*/
ODE_API dReal dJointGetPUPosition (dJointID);
/**
* @brief Get the PR linear position's time derivative
*
* @ingroup joints
*/
ODE_API dReal dJointGetPUPositionRate (dJointID);
/**
* @brief Get the first axis of the universal component of the joint
* @ingroup joints
*/
ODE_API void dJointGetPUAxis1 (dJointID, dVector3 result);
/**
* @brief Get the second axis of the Universal component of the joint
* @ingroup joints
*/
ODE_API void dJointGetPUAxis2 (dJointID, dVector3 result);
/**
* @brief Get the prismatic axis
* @ingroup joints
*/
ODE_API void dJointGetPUAxis3 (dJointID, dVector3 result);
/**
* @brief Get the prismatic axis
* @ingroup joints
*
* @note This function was added for convenience it is the same as
* dJointGetPUAxis3
*/
ODE_API void dJointGetPUAxisP (dJointID id, dVector3 result);
/**
* @brief Get both angles at the same time.
* @ingroup joints
*
* @param joint The Prismatic universal joint for which we want to calc
ulate the angles
* @param angle1 The angle between the body1 and the axis 1
* @param angle2 The angle between the body2 and the axis 2
*
* @note This function combine dJointGetPUAngle1 and dJointGetPUAngle2 to
gether
* and try to avoid redundant calculation
*/
ODE_API void dJointGetPUAngles (dJointID, dReal *angle1, dReal *angle2);
/**
* @brief Get angle
* @ingroup joints
*/
ODE_API dReal dJointGetPUAngle1 (dJointID);
/**
* @brief * @brief Get time derivative of angle1
*
* @ingroup joints
*/
ODE_API dReal dJointGetPUAngle1Rate (dJointID);
/**
* @brief Get angle
* @ingroup joints
*/
ODE_API dReal dJointGetPUAngle2 (dJointID);
/**
* @brief * @brief Get time derivative of angle2
*
* @ingroup joints
*/
ODE_API dReal dJointGetPUAngle2Rate (dJointID);
/**
* @brief get joint parameter
* @ingroup joints
*/
ODE_API dReal dJointGetPUParam (dJointID, int parameter);
/**
* @brief Get the Piston linear position (i.e. the piston's extension)
*
* When the axis is set, the current position of the attached bodies is
* examined and that position will be the zero position.
* @ingroup joints
*/
ODE_API dReal dJointGetPistonPosition (dJointID);
/**
* @brief Get the piston linear position's time derivative.
* @ingroup joints
*/
ODE_API dReal dJointGetPistonPositionRate (dJointID);
/**
* @brief Get the Piston angular position (i.e. the twist between the 2
bodies)
*
* When the axis is set, the current position of the attached bodies is
* examined and that position will be the zero position.
* @ingroup joints
*/
ODE_API dReal dJointGetPistonAngle (dJointID);
/**
* @brief Get the piston angular position's time derivative.
* @ingroup joints
*/
ODE_API dReal dJointGetPistonAngleRate (dJointID);
/**
* @brief Get the joint anchor
*
* This returns the point on body 1. If the joint is perfectly satisfied,
* this will be the same as the point on body 2 in direction perpendicula
r
* to the prismatic axis.
*
* @ingroup joints
*/
ODE_API void dJointGetPistonAnchor (dJointID, dVector3 result);
/**
* @brief Get the joint anchor w.r.t. body 2
*
* This returns the point on body 2. You can think of a Piston
* joint as trying to keep the result of dJointGetPistonAnchor() and
* dJointGetPistonAnchor2() the same in the direction perpendicular to th
e
* pirsmatic axis. If the joint is perfectly satisfied,
* this function will return the same value as dJointGetPistonAnchor() to
* within roundoff errors. dJointGetPistonAnchor2() can be used, along wi
th
* dJointGetPistonAnchor(), to see how far the joint has come apart.
*
* @ingroup joints
*/
ODE_API void dJointGetPistonAnchor2 (dJointID, dVector3 result);
/**
* @brief Get the prismatic axis (This is also the rotoide axis.
* @ingroup joints
*/
ODE_API void dJointGetPistonAxis (dJointID, dVector3 result);
/**
* @brief get joint parameter
* @ingroup joints
*/
ODE_API dReal dJointGetPistonParam (dJointID, int parameter);
/**
* @brief Get the number of angular axes that will be controlled by the * @brief Get the number of angular axes that will be controlled by the
* AMotor. * AMotor.
* @param num can range from 0 (which effectively deactivates the * @param num can range from 0 (which effectively deactivates the
* joint) to 3. * joint) to 3.
* This is automatically set to 3 in dAMotorEuler mode. * This is automatically set to 3 in dAMotorEuler mode.
* @ingroup joints * @ingroup joints
*/ */
ODE_API int dJointGetAMotorNumAxes (dJointID); ODE_API int dJointGetAMotorNumAxes (dJointID);
/** /**
 End of changes. 28 change blocks. 
30 lines changed or deleted 608 lines changed or added


 ode.h   ode.h 
skipping to change at line 28 skipping to change at line 28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
#ifndef _ODE_ODE_H_ #ifndef _ODE_ODE_H_
#define _ODE_ODE_H_ #define _ODE_ODE_H_
/* include *everything* here */ /* include *everything* here */
#include <ode/config.h> #include <ode/odeconfig.h>
#include <ode/compatibility.h> #include <ode/compatibility.h>
#include <ode/common.h> #include <ode/common.h>
#include <ode/odeinit.h>
#include <ode/contact.h> #include <ode/contact.h>
#include <ode/error.h> #include <ode/error.h>
#include <ode/memory.h> #include <ode/memory.h>
#include <ode/odemath.h> #include <ode/odemath.h>
#include <ode/matrix.h> #include <ode/matrix.h>
#include <ode/timer.h> #include <ode/timer.h>
#include <ode/rotation.h> #include <ode/rotation.h>
#include <ode/mass.h> #include <ode/mass.h>
#include <ode/misc.h> #include <ode/misc.h>
#include <ode/objects.h> #include <ode/objects.h>
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 odecpp.h   odecpp.h 
skipping to change at line 29 skipping to change at line 29
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
/* C++ interface for non-collision stuff */ /* C++ interface for non-collision stuff */
#ifndef _ODE_ODECPP_H_ #ifndef _ODE_ODECPP_H_
#define _ODE_ODECPP_H_ #define _ODE_ODECPP_H_
#ifdef __cplusplus #ifdef __cplusplus
#include <ode/error.h> //namespace ode {
class dWorld { class dWorld {
dWorldID _id; dWorldID _id;
// intentionally undefined, don't use these // intentionally undefined, don't use these
dWorld (const dWorld &); dWorld (const dWorld &);
void operator= (const dWorld &); void operator= (const dWorld &);
public: public:
dWorld() dWorld()
skipping to change at line 51 skipping to change at line 51
~dWorld() ~dWorld()
{ dWorldDestroy (_id); } { dWorldDestroy (_id); }
dWorldID id() const dWorldID id() const
{ return _id; } { return _id; }
operator dWorldID() const operator dWorldID() const
{ return _id; } { return _id; }
void setGravity (dReal x, dReal y, dReal z) void setGravity (dReal x, dReal y, dReal z)
{ dWorldSetGravity (_id,x,y,z); } { dWorldSetGravity (_id,x,y,z); }
void setGravity (const dVector3 g)
{ setGravity (g[0], g[1], g[2]); }
void getGravity (dVector3 g) const void getGravity (dVector3 g) const
{ dWorldGetGravity (_id,g); } { dWorldGetGravity (_id,g); }
void setERP (dReal erp) void setERP (dReal erp)
{ dWorldSetERP(_id, erp); } { dWorldSetERP(_id, erp); }
dReal getERP() const dReal getERP() const
{ return dWorldGetERP(_id); } { return dWorldGetERP(_id); }
void setCFM (dReal cfm) void setCFM (dReal cfm)
{ dWorldSetCFM(_id, cfm); } { dWorldSetCFM(_id, cfm); }
dReal getCFM() const dReal getCFM() const
{ return dWorldGetCFM(_id); } { return dWorldGetCFM(_id); }
void step (dReal stepsize) void step (dReal stepsize)
{ dWorldStep (_id,stepsize); } { dWorldStep (_id,stepsize); }
void stepFast1 (dReal stepsize, int maxiterations) void stepFast1 (dReal stepsize, int maxiterations)
{ dWorldStepFast1 (_id,stepsize,maxiterations); } { dWorldStepFast1 (_id,stepsize,maxiterations); }
void setAutoEnableDepthSF1(dWorldID, int depth) void setAutoEnableDepthSF1(dWorldID, int depth)
{ dWorldSetAutoEnableDepthSF1 (_id, depth); } { dWorldSetAutoEnableDepthSF1 (_id, depth); }
int getAutoEnableDepthSF1(dWorldID) int getAutoEnableDepthSF1(dWorldID) const
{ return dWorldGetAutoEnableDepthSF1 (_id); } { return dWorldGetAutoEnableDepthSF1 (_id); }
void quickStep(dReal stepsize)
{ dWorldQuickStep (_id, stepsize); }
void setQuickStepNumIterations(int num)
{ dWorldSetQuickStepNumIterations (_id, num); }
int getQuickStepNumIterations() const
{ return dWorldGetQuickStepNumIterations (_id); }
void setQuickStepW(dReal over_relaxation)
{ dWorldSetQuickStepW (_id, over_relaxation); }
dReal getQuickStepW() const
{ return dWorldGetQuickStepW (_id); }
void setAutoDisableLinearThreshold (dReal threshold) void setAutoDisableLinearThreshold (dReal threshold)
{ dWorldSetAutoDisableLinearThreshold (_id,threshold); } { dWorldSetAutoDisableLinearThreshold (_id,threshold); }
dReal getAutoDisableLinearThreshold() dReal getAutoDisableLinearThreshold() const
{ return dWorldGetAutoDisableLinearThreshold (_id); } { return dWorldGetAutoDisableLinearThreshold (_id); }
void setAutoDisableAngularThreshold (dReal threshold) void setAutoDisableAngularThreshold (dReal threshold)
{ dWorldSetAutoDisableAngularThreshold (_id,threshold); } { dWorldSetAutoDisableAngularThreshold (_id,threshold); }
dReal getAutoDisableAngularThreshold() dReal getAutoDisableAngularThreshold() const
{ return dWorldGetAutoDisableAngularThreshold (_id); } { return dWorldGetAutoDisableAngularThreshold (_id); }
void setAutoDisableSteps (int steps) void setAutoDisableSteps (int steps)
{ dWorldSetAutoDisableSteps (_id,steps); } { dWorldSetAutoDisableSteps (_id,steps); }
int getAutoDisableSteps() int getAutoDisableSteps() const
{ return dWorldGetAutoDisableSteps (_id); } { return dWorldGetAutoDisableSteps (_id); }
void setAutoDisableTime (dReal time) void setAutoDisableTime (dReal time)
{ dWorldSetAutoDisableTime (_id,time); } { dWorldSetAutoDisableTime (_id,time); }
dReal getAutoDisableTime() dReal getAutoDisableTime() const
{ return dWorldGetAutoDisableTime (_id); } { return dWorldGetAutoDisableTime (_id); }
void setAutoDisableFlag (int do_auto_disable) void setAutoDisableFlag (int do_auto_disable)
{ dWorldSetAutoDisableFlag (_id,do_auto_disable); } { dWorldSetAutoDisableFlag (_id,do_auto_disable); }
int getAutoDisableFlag() int getAutoDisableFlag() const
{ return dWorldGetAutoDisableFlag (_id); } { return dWorldGetAutoDisableFlag (_id); }
dReal getLinearDampingThreshold() const
{ return dWorldGetLinearDampingThreshold(_id); }
void setLinearDampingThreshold(dReal threshold)
{ dWorldSetLinearDampingThreshold(_id, threshold); }
dReal getAngularDampingThreshold() const
{ return dWorldGetAngularDampingThreshold(_id); }
void setAngularDampingThreshold(dReal threshold)
{ dWorldSetAngularDampingThreshold(_id, threshold); }
dReal getLinearDamping() const
{ return dWorldGetLinearDamping(_id); }
void setLinearDamping(dReal scale)
{ dWorldSetLinearDamping(_id, scale); }
dReal getAngularDamping() const
{ return dWorldGetAngularDamping(_id); }
void setAngularDamping(dReal scale)
{ dWorldSetAngularDamping(_id, scale); }
void setDamping(dReal linear_scale, dReal angular_scale)
{ dWorldSetDamping(_id, linear_scale, angular_scale); }
dReal getMaxAngularSpeed() const
{ return dWorldGetMaxAngularSpeed(_id); }
void setMaxAngularSpeed(dReal max_speed)
{ dWorldSetMaxAngularSpeed(_id, max_speed); }
void setContactSurfaceLayer(dReal depth)
{ dWorldSetContactSurfaceLayer (_id, depth); }
dReal getContactSurfaceLayer() const
{ return dWorldGetContactSurfaceLayer (_id); }
void impulseToForce (dReal stepsize, dReal ix, dReal iy, dReal iz, void impulseToForce (dReal stepsize, dReal ix, dReal iy, dReal iz,
dVector3 force) dVector3 force)
{ dWorldImpulseToForce (_id,stepsize,ix,iy,iz,force); } { dWorldImpulseToForce (_id,stepsize,ix,iy,iz,force); }
}; };
class dBody { class dBody {
dBodyID _id; dBodyID _id;
// intentionally undefined, don't use these // intentionally undefined, don't use these
dBody (const dBody &); dBody (const dBody &);
void operator= (const dBody &); void operator= (const dBody &);
public: public:
dBody() dBody()
{ _id = 0; } { _id = 0; }
dBody (dWorldID world) dBody (dWorldID world)
{ _id = dBodyCreate (world); } { _id = dBodyCreate (world); }
dBody (dWorld& world)
{ _id = dBodyCreate (world.id()); }
~dBody() ~dBody()
{ if (_id) dBodyDestroy (_id); } { if (_id) dBodyDestroy (_id); }
void create (dWorldID world) { void create (dWorldID world) {
if (_id) dBodyDestroy (_id); if (_id) dBodyDestroy (_id);
_id = dBodyCreate (world); _id = dBodyCreate (world);
} }
void create (dWorld& world) {
create(world.id());
}
dBodyID id() const dBodyID id() const
{ return _id; } { return _id; }
operator dBodyID() const operator dBodyID() const
{ return _id; } { return _id; }
void setData (void *data) void setData (void *data)
{ dBodySetData (_id,data); } { dBodySetData (_id,data); }
void *getData() const void *getData() const
{ return dBodyGetData (_id); } { return dBodyGetData (_id); }
void setPosition (dReal x, dReal y, dReal z) void setPosition (dReal x, dReal y, dReal z)
{ dBodySetPosition (_id,x,y,z); } { dBodySetPosition (_id,x,y,z); }
void setPosition (const dVector3 p)
{ setPosition(p[0], p[1], p[2]); }
void setRotation (const dMatrix3 R) void setRotation (const dMatrix3 R)
{ dBodySetRotation (_id,R); } { dBodySetRotation (_id,R); }
void setQuaternion (const dQuaternion q) void setQuaternion (const dQuaternion q)
{ dBodySetQuaternion (_id,q); } { dBodySetQuaternion (_id,q); }
void setLinearVel (dReal x, dReal y, dReal z) void setLinearVel (dReal x, dReal y, dReal z)
{ dBodySetLinearVel (_id,x,y,z); } { dBodySetLinearVel (_id,x,y,z); }
void setLinearVel (const dVector3 v)
{ setLinearVel(v[0], v[1], v[2]); }
void setAngularVel (dReal x, dReal y, dReal z) void setAngularVel (dReal x, dReal y, dReal z)
{ dBodySetAngularVel (_id,x,y,z); } { dBodySetAngularVel (_id,x,y,z); }
void setAngularVel (const dVector3 v)
{ setAngularVel (v[0], v[1], v[2]); }
const dReal * getPosition() const const dReal * getPosition() const
{ return dBodyGetPosition (_id); } { return dBodyGetPosition (_id); }
const dReal * getRotation() const const dReal * getRotation() const
{ return dBodyGetRotation (_id); } { return dBodyGetRotation (_id); }
const dReal * getQuaternion() const const dReal * getQuaternion() const
{ return dBodyGetQuaternion (_id); } { return dBodyGetQuaternion (_id); }
const dReal * getLinearVel() const const dReal * getLinearVel() const
{ return dBodyGetLinearVel (_id); } { return dBodyGetLinearVel (_id); }
const dReal * getAngularVel() const const dReal * getAngularVel() const
{ return dBodyGetAngularVel (_id); } { return dBodyGetAngularVel (_id); }
void setMass (const dMass *mass) void setMass (const dMass *mass)
{ dBodySetMass (_id,mass); } { dBodySetMass (_id,mass); }
void getMass (dMass *mass) const void setMass (const dMass &mass)
{ dBodyGetMass (_id,mass); } { setMass (&mass); }
dMass getMass () const
{ dMass mass; dBodyGetMass (_id,&mass); return mass; }
void addForce (dReal fx, dReal fy, dReal fz) void addForce (dReal fx, dReal fy, dReal fz)
{ dBodyAddForce (_id, fx, fy, fz); } { dBodyAddForce (_id, fx, fy, fz); }
void addForce (const dVector3 f)
{ addForce (f[0], f[1], f[2]); }
void addTorque (dReal fx, dReal fy, dReal fz) void addTorque (dReal fx, dReal fy, dReal fz)
{ dBodyAddTorque (_id, fx, fy, fz); } { dBodyAddTorque (_id, fx, fy, fz); }
void addTorque (const dVector3 t)
{ addTorque(t[0], t[1], t[2]); }
void addRelForce (dReal fx, dReal fy, dReal fz) void addRelForce (dReal fx, dReal fy, dReal fz)
{ dBodyAddRelForce (_id, fx, fy, fz); } { dBodyAddRelForce (_id, fx, fy, fz); }
void addRelForce (const dVector3 f)
{ addRelForce (f[0], f[1], f[2]); }
void addRelTorque (dReal fx, dReal fy, dReal fz) void addRelTorque (dReal fx, dReal fy, dReal fz)
{ dBodyAddRelTorque (_id, fx, fy, fz); } { dBodyAddRelTorque (_id, fx, fy, fz); }
void addRelTorque (const dVector3 t)
{ addRelTorque (t[0], t[1], t[2]); }
void addForceAtPos (dReal fx, dReal fy, dReal fz, void addForceAtPos (dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz) dReal px, dReal py, dReal pz)
{ dBodyAddForceAtPos (_id, fx, fy, fz, px, py, pz); } { dBodyAddForceAtPos (_id, fx, fy, fz, px, py, pz); }
void addForceAtPos (const dVector3 f, const dVector3 p)
{ addForceAtPos (f[0], f[1], f[2], p[0], p[1], p[2]); }
void addForceAtRelPos (dReal fx, dReal fy, dReal fz, void addForceAtRelPos (dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz) dReal px, dReal py, dReal pz)
{ dBodyAddForceAtRelPos (_id, fx, fy, fz, px, py, pz); } { dBodyAddForceAtRelPos (_id, fx, fy, fz, px, py, pz); }
void addForceAtRelPos (const dVector3 f, const dVector3 p)
{ addForceAtRelPos (f[0], f[1], f[2], p[0], p[1], p[2]); }
void addRelForceAtPos (dReal fx, dReal fy, dReal fz, void addRelForceAtPos (dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz) dReal px, dReal py, dReal pz)
{ dBodyAddRelForceAtPos (_id, fx, fy, fz, px, py, pz); } { dBodyAddRelForceAtPos (_id, fx, fy, fz, px, py, pz); }
void addRelForceAtPos (const dVector3 f, const dVector3 p)
{ addRelForceAtPos (f[0], f[1], f[2], p[0], p[1], p[2]); }
void addRelForceAtRelPos (dReal fx, dReal fy, dReal fz, void addRelForceAtRelPos (dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz) dReal px, dReal py, dReal pz)
{ dBodyAddRelForceAtRelPos (_id, fx, fy, fz, px, py, pz); } { dBodyAddRelForceAtRelPos (_id, fx, fy, fz, px, py, pz); }
void addRelForceAtRelPos (const dVector3 f, const dVector3 p)
{ addRelForceAtRelPos (f[0], f[1], f[2], p[0], p[1], p[2]); }
const dReal * getForce() const const dReal * getForce() const
{ return dBodyGetForce(_id); } { return dBodyGetForce(_id); }
const dReal * getTorque() const const dReal * getTorque() const
{ return dBodyGetTorque(_id); } { return dBodyGetTorque(_id); }
void setForce (dReal x, dReal y, dReal z) void setForce (dReal x, dReal y, dReal z)
{ dBodySetForce (_id,x,y,z); } { dBodySetForce (_id,x,y,z); }
void setForce (const dVector3 f)
{ setForce (f[0], f[1], f[2]); }
void setTorque (dReal x, dReal y, dReal z) void setTorque (dReal x, dReal y, dReal z)
{ dBodySetTorque (_id,x,y,z); } { dBodySetTorque (_id,x,y,z); }
void setTorque (const dVector3 t)
{ setTorque (t[0], t[1], t[2]); }
void enable() void enable()
{ dBodyEnable (_id); } { dBodyEnable (_id); }
void disable() void disable()
{ dBodyDisable (_id); } { dBodyDisable (_id); }
int isEnabled() const bool isEnabled() const
{ return dBodyIsEnabled (_id); } { return bool(dBodyIsEnabled (_id)); }
void getRelPointPos (dReal px, dReal py, dReal pz, dVector3 result) const void getRelPointPos (dReal px, dReal py, dReal pz, dVector3 result) const
{ dBodyGetRelPointPos (_id, px, py, pz, result); } { dBodyGetRelPointPos (_id, px, py, pz, result); }
void getRelPointPos (const dVector3 p, dVector3 result) const
{ getRelPointPos (p[0], p[1], p[2], result); }
void getRelPointVel (dReal px, dReal py, dReal pz, dVector3 result) const void getRelPointVel (dReal px, dReal py, dReal pz, dVector3 result) const
{ dBodyGetRelPointVel (_id, px, py, pz, result); } { dBodyGetRelPointVel (_id, px, py, pz, result); }
void getRelPointVel (const dVector3 p, dVector3 result) const
{ getRelPointVel (p[0], p[1], p[2], result); }
void getPointVel (dReal px, dReal py, dReal pz, dVector3 result) const void getPointVel (dReal px, dReal py, dReal pz, dVector3 result) const
{ dBodyGetPointVel (_id,px,py,pz,result); } { dBodyGetPointVel (_id, px, py, pz, result); }
void getPointVel (const dVector3 p, dVector3 result) const
{ getPointVel (p[0], p[1], p[2], result); }
void getPosRelPoint (dReal px, dReal py, dReal pz, dVector3 result) const void getPosRelPoint (dReal px, dReal py, dReal pz, dVector3 result) const
{ dBodyGetPosRelPoint (_id,px,py,pz,result); } { dBodyGetPosRelPoint (_id, px, py, pz, result); }
void getPosRelPoint (const dVector3 p, dVector3 result) const
{ getPosRelPoint (p[0], p[1], p[2], result); }
void vectorToWorld (dReal px, dReal py, dReal pz, dVector3 result) const void vectorToWorld (dReal px, dReal py, dReal pz, dVector3 result) const
{ dBodyVectorToWorld (_id,px,py,pz,result); } { dBodyVectorToWorld (_id, px, py, pz, result); }
void vectorToWorld (const dVector3 p, dVector3 result) const
{ vectorToWorld (p[0], p[1], p[2], result); }
void vectorFromWorld (dReal px, dReal py, dReal pz, dVector3 result) cons t void vectorFromWorld (dReal px, dReal py, dReal pz, dVector3 result) cons t
{ dBodyVectorFromWorld (_id,px,py,pz,result); } { dBodyVectorFromWorld (_id,px,py,pz,result); }
void vectorFromWorld (const dVector3 p, dVector3 result) const
{ vectorFromWorld (p[0], p[1], p[2], result); }
void setFiniteRotationMode (int mode) void setFiniteRotationMode (bool mode)
{ dBodySetFiniteRotationMode (_id, mode); } { dBodySetFiniteRotationMode (_id, mode); }
void setFiniteRotationAxis (dReal x, dReal y, dReal z) void setFiniteRotationAxis (dReal x, dReal y, dReal z)
{ dBodySetFiniteRotationAxis (_id, x, y, z); } { dBodySetFiniteRotationAxis (_id, x, y, z); }
void setFiniteRotationAxis (const dVector3 a)
{ setFiniteRotationAxis (a[0], a[1], a[2]); }
int getFiniteRotationMode() const bool getFiniteRotationMode() const
{ return dBodyGetFiniteRotationMode (_id); } { return bool(dBodyGetFiniteRotationMode (_id)); }
void getFiniteRotationAxis (dVector3 result) const void getFiniteRotationAxis (dVector3 result) const
{ dBodyGetFiniteRotationAxis (_id, result); } { dBodyGetFiniteRotationAxis (_id, result); }
int getNumJoints() const int getNumJoints() const
{ return dBodyGetNumJoints (_id); } { return dBodyGetNumJoints (_id); }
dJointID getJoint (int index) const dJointID getJoint (int index) const
{ return dBodyGetJoint (_id, index); } { return dBodyGetJoint (_id, index); }
void setGravityMode (int mode) void setGravityMode (bool mode)
{ dBodySetGravityMode (_id,mode); } { dBodySetGravityMode (_id,mode); }
int getGravityMode() const bool getGravityMode() const
{ return dBodyGetGravityMode (_id); } { return bool(dBodyGetGravityMode (_id)); }
int isConnectedTo (dBodyID body) const bool isConnectedTo (dBodyID body) const
{ return dAreConnected (_id, body); } { return bool(dAreConnected (_id, body)); }
void setAutoDisableLinearThreshold (dReal threshold) void setAutoDisableLinearThreshold (dReal threshold)
{ dBodySetAutoDisableLinearThreshold (_id,threshold); } { dBodySetAutoDisableLinearThreshold (_id,threshold); }
dReal getAutoDisableLinearThreshold() dReal getAutoDisableLinearThreshold() const
{ return dBodyGetAutoDisableLinearThreshold (_id); } { return dBodyGetAutoDisableLinearThreshold (_id); }
void setAutoDisableAngularThreshold (dReal threshold) void setAutoDisableAngularThreshold (dReal threshold)
{ dBodySetAutoDisableAngularThreshold (_id,threshold); } { dBodySetAutoDisableAngularThreshold (_id,threshold); }
dReal getAutoDisableAngularThreshold() dReal getAutoDisableAngularThreshold() const
{ return dBodyGetAutoDisableAngularThreshold (_id); } { return dBodyGetAutoDisableAngularThreshold (_id); }
void setAutoDisableSteps (int steps) void setAutoDisableSteps (int steps)
{ dBodySetAutoDisableSteps (_id,steps); } { dBodySetAutoDisableSteps (_id,steps); }
int getAutoDisableSteps() int getAutoDisableSteps() const
{ return dBodyGetAutoDisableSteps (_id); } { return dBodyGetAutoDisableSteps (_id); }
void setAutoDisableTime (dReal time) void setAutoDisableTime (dReal time)
{ dBodySetAutoDisableTime (_id,time); } { dBodySetAutoDisableTime (_id,time); }
dReal getAutoDisableTime() dReal getAutoDisableTime() const
{ return dBodyGetAutoDisableTime (_id); } { return dBodyGetAutoDisableTime (_id); }
void setAutoDisableFlag (int do_auto_disable) void setAutoDisableFlag (bool do_auto_disable)
{ dBodySetAutoDisableFlag (_id,do_auto_disable); } { dBodySetAutoDisableFlag (_id,do_auto_disable); }
int getAutoDisableFlag() bool getAutoDisableFlag() const
{ return dBodyGetAutoDisableFlag (_id); } { return bool(dBodyGetAutoDisableFlag (_id)); }
dReal getLinearDamping() const
{ return dBodyGetLinearDamping(_id); }
void setLinearDamping(dReal scale)
{ dBodySetLinearDamping(_id, scale); }
dReal getAngularDamping() const
{ return dBodyGetAngularDamping(_id); }
void setAngularDamping(dReal scale)
{ dBodySetAngularDamping(_id, scale); }
void setDamping(dReal linear_scale, dReal angular_scale)
{ dBodySetDamping(_id, linear_scale, angular_scale); }
dReal getLinearDampingThreshold() const
{ return dBodyGetLinearDampingThreshold(_id); }
void setLinearDampingThreshold(dReal threshold) const
{ dBodySetLinearDampingThreshold(_id, threshold); }
dReal getAngularDampingThreshold() const
{ return dBodyGetAngularDampingThreshold(_id); }
void setAngularDampingThreshold(dReal threshold)
{ dBodySetAngularDampingThreshold(_id, threshold); }
void setDampingDefaults()
{ dBodySetDampingDefaults(_id); }
dReal getMaxAngularSpeed() const
{ return dBodyGetMaxAngularSpeed(_id); }
void setMaxAngularSpeed(dReal max_speed)
{ dBodySetMaxAngularSpeed(_id, max_speed); }
}; };
class dJointGroup { class dJointGroup {
dJointGroupID _id; dJointGroupID _id;
// intentionally undefined, don't use these // intentionally undefined, don't use these
dJointGroup (const dJointGroup &); dJointGroup (const dJointGroup &);
void operator= (const dJointGroup &); void operator= (const dJointGroup &);
public: public:
skipping to change at line 276 skipping to change at line 403
_id = dJointGroupCreate (0); _id = dJointGroupCreate (0);
} }
dJointGroupID id() const dJointGroupID id() const
{ return _id; } { return _id; }
operator dJointGroupID() const operator dJointGroupID() const
{ return _id; } { return _id; }
void empty() void empty()
{ dJointGroupEmpty (_id); } { dJointGroupEmpty (_id); }
void clear()
{ empty(); }
}; };
class dJoint { class dJoint {
private: private:
// intentionally undefined, don't use these // intentionally undefined, don't use these
dJoint (const dJoint &) ; dJoint (const dJoint &) ;
void operator= (const dJoint &); void operator= (const dJoint &);
protected: protected:
dJointID _id; dJointID _id;
public: public:
dJoint() dJoint()
{ _id = 0; } { _id = 0; }
~dJoint() virtual ~dJoint() // :( Destructor must be virtual to suppress compiler w arning "class XXX has virtual functions but non-virtual destructor"
{ if (_id) dJointDestroy (_id); } { if (_id) dJointDestroy (_id); }
dJointID id() const dJointID id() const
{ return _id; } { return _id; }
operator dJointID() const operator dJointID() const
{ return _id; } { return _id; }
int getNumBodies() const
{ return dJointGetNumBodies(_id); }
void attach (dBodyID body1, dBodyID body2) void attach (dBodyID body1, dBodyID body2)
{ dJointAttach (_id, body1, body2); } { dJointAttach (_id, body1, body2); }
void attach (dBody& body1, dBody& body2)
{ attach(body1.id(), body2.id()); }
void setData (void *data) void setData (void *data)
{ dJointSetData (_id, data); } { dJointSetData (_id, data); }
void *getData() const void *getData() const
{ return dJointGetData (_id); } { return dJointGetData (_id); }
int getType() const dJointType getType() const
{ return dJointGetType (_id); } { return dJointGetType (_id); }
dBodyID getBody (int index) const dBodyID getBody (int index) const
{ return dJointGetBody (_id, index); } { return dJointGetBody (_id, index); }
void setFeedback(dJointFeedback *fb) void setFeedback(dJointFeedback *fb)
{ dJointSetFeedback(_id, fb); } { dJointSetFeedback(_id, fb); }
dJointFeedback *getFeedback() const dJointFeedback *getFeedback() const
{ return dJointGetFeedback(_id); } { return dJointGetFeedback(_id); }
// If not implemented it will do nothing as describe in the doc
virtual void setParam (int, dReal) {};
virtual dReal getParam (int) const { return 0; }
}; };
class dBallJoint : public dJoint { class dBallJoint : public dJoint {
private: private:
// intentionally undefined, don't use these // intentionally undefined, don't use these
dBallJoint (const dBallJoint &); dBallJoint (const dBallJoint &);
void operator= (const dBallJoint &); void operator= (const dBallJoint &);
public: public:
dBallJoint() { } dBallJoint() { }
dBallJoint (dWorldID world, dJointGroupID group=0) dBallJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateBall (world, group); } { _id = dJointCreateBall (world, group); }
dBallJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateBall (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateBall (world, group); _id = dJointCreateBall (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z) void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetBallAnchor (_id, x, y, z); } { dJointSetBallAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor (a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const void getAnchor (dVector3 result) const
{ dJointGetBallAnchor (_id, result); } { dJointGetBallAnchor (_id, result); }
void getAnchor2 (dVector3 result) const void getAnchor2 (dVector3 result) const
{ dJointGetBallAnchor2 (_id, result); } { dJointGetBallAnchor2 (_id, result); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetBallParam (_id, parameter, value); } { dJointSetBallParam (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetBallParam (_id, parameter); } { return dJointGetBallParam (_id, parameter); }
// TODO: expose params through methods
} ; } ;
class dHingeJoint : public dJoint { class dHingeJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dHingeJoint (const dHingeJoint &); dHingeJoint (const dHingeJoint &);
void operator = (const dHingeJoint &); void operator = (const dHingeJoint &);
public: public:
dHingeJoint() { } dHingeJoint() { }
dHingeJoint (dWorldID world, dJointGroupID group=0) dHingeJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateHinge (world, group); } { _id = dJointCreateHinge (world, group); }
dHingeJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateHinge (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateHinge (world, group); _id = dJointCreateHinge (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z) void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetHingeAnchor (_id, x, y, z); } { dJointSetHingeAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor (a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const void getAnchor (dVector3 result) const
{ dJointGetHingeAnchor (_id, result); } { dJointGetHingeAnchor (_id, result); }
void getAnchor2 (dVector3 result) const void getAnchor2 (dVector3 result) const
{ dJointGetHingeAnchor2 (_id, result); } { dJointGetHingeAnchor2 (_id, result); }
void setAxis (dReal x, dReal y, dReal z) void setAxis (dReal x, dReal y, dReal z)
{ dJointSetHingeAxis (_id, x, y, z); } { dJointSetHingeAxis (_id, x, y, z); }
void setAxis (const dVector3 a)
{ setAxis(a[0], a[1], a[2]); }
void getAxis (dVector3 result) const void getAxis (dVector3 result) const
{ dJointGetHingeAxis (_id, result); } { dJointGetHingeAxis (_id, result); }
dReal getAngle() const dReal getAngle() const
{ return dJointGetHingeAngle (_id); } { return dJointGetHingeAngle (_id); }
dReal getAngleRate() const dReal getAngleRate() const
{ return dJointGetHingeAngleRate (_id); } { return dJointGetHingeAngleRate (_id); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetHingeParam (_id, parameter, value); } { dJointSetHingeParam (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetHingeParam (_id, parameter); } { return dJointGetHingeParam (_id, parameter); }
// TODO: expose params through methods
void addTorque (dReal torque) void addTorque (dReal torque)
{ dJointAddHingeTorque(_id, torque); } { dJointAddHingeTorque(_id, torque); }
}; };
class dSliderJoint : public dJoint { class dSliderJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dSliderJoint (const dSliderJoint &); dSliderJoint (const dSliderJoint &);
void operator = (const dSliderJoint &); void operator = (const dSliderJoint &);
public: public:
dSliderJoint() { } dSliderJoint() { }
dSliderJoint (dWorldID world, dJointGroupID group=0) dSliderJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateSlider (world, group); } { _id = dJointCreateSlider (world, group); }
dSliderJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateSlider (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateSlider (world, group); _id = dJointCreateSlider (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAxis (dReal x, dReal y, dReal z) void setAxis (dReal x, dReal y, dReal z)
{ dJointSetSliderAxis (_id, x, y, z); } { dJointSetSliderAxis (_id, x, y, z); }
void setAxis (const dVector3 a)
{ setAxis (a[0], a[1], a[2]); }
void getAxis (dVector3 result) const void getAxis (dVector3 result) const
{ dJointGetSliderAxis (_id, result); } { dJointGetSliderAxis (_id, result); }
dReal getPosition() const dReal getPosition() const
{ return dJointGetSliderPosition (_id); } { return dJointGetSliderPosition (_id); }
dReal getPositionRate() const dReal getPositionRate() const
{ return dJointGetSliderPositionRate (_id); } { return dJointGetSliderPositionRate (_id); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetSliderParam (_id, parameter, value); } { dJointSetSliderParam (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetSliderParam (_id, parameter); } { return dJointGetSliderParam (_id, parameter); }
// TODO: expose params through methods
void addForce (dReal force) void addForce (dReal force)
{ dJointAddSliderForce(_id, force); } { dJointAddSliderForce(_id, force); }
}; };
class dUniversalJoint : public dJoint { class dUniversalJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dUniversalJoint (const dUniversalJoint &); dUniversalJoint (const dUniversalJoint &);
void operator = (const dUniversalJoint &); void operator = (const dUniversalJoint &);
public: public:
dUniversalJoint() { } dUniversalJoint() { }
dUniversalJoint (dWorldID world, dJointGroupID group=0) dUniversalJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateUniversal (world, group); } { _id = dJointCreateUniversal (world, group); }
dUniversalJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateUniversal (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateUniversal (world, group); _id = dJointCreateUniversal (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z) void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetUniversalAnchor (_id, x, y, z); } { dJointSetUniversalAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor(a[0], a[1], a[2]); }
void setAxis1 (dReal x, dReal y, dReal z) void setAxis1 (dReal x, dReal y, dReal z)
{ dJointSetUniversalAxis1 (_id, x, y, z); } { dJointSetUniversalAxis1 (_id, x, y, z); }
void setAxis1 (const dVector3 a)
{ setAxis1 (a[0], a[1], a[2]); }
void setAxis2 (dReal x, dReal y, dReal z) void setAxis2 (dReal x, dReal y, dReal z)
{ dJointSetUniversalAxis2 (_id, x, y, z); } { dJointSetUniversalAxis2 (_id, x, y, z); }
void setParam (int parameter, dReal value) void setAxis2 (const dVector3 a)
{ dJointSetUniversalParam (_id, parameter, value); } { setAxis2 (a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const void getAnchor (dVector3 result) const
{ dJointGetUniversalAnchor (_id, result); } { dJointGetUniversalAnchor (_id, result); }
void getAnchor2 (dVector3 result) const void getAnchor2 (dVector3 result) const
{ dJointGetUniversalAnchor2 (_id, result); } { dJointGetUniversalAnchor2 (_id, result); }
void getAxis1 (dVector3 result) const void getAxis1 (dVector3 result) const
{ dJointGetUniversalAxis1 (_id, result); } { dJointGetUniversalAxis1 (_id, result); }
void getAxis2 (dVector3 result) const void getAxis2 (dVector3 result) const
{ dJointGetUniversalAxis2 (_id, result); } { dJointGetUniversalAxis2 (_id, result); }
dReal getParam (int parameter) const
virtual void setParam (int parameter, dReal value)
{ dJointSetUniversalParam (_id, parameter, value); }
virtual dReal getParam (int parameter) const
{ return dJointGetUniversalParam (_id, parameter); } { return dJointGetUniversalParam (_id, parameter); }
void getAngles(dReal *angle1, dReal *angle2) const // TODO: expose params through methods
void getAngles(dReal *angle1, dReal *angle2) const
{ dJointGetUniversalAngles (_id, angle1, angle2); } { dJointGetUniversalAngles (_id, angle1, angle2); }
dReal getAngle1() const dReal getAngle1() const
{ return dJointGetUniversalAngle1 (_id); } { return dJointGetUniversalAngle1 (_id); }
dReal getAngle1Rate() const dReal getAngle1Rate() const
{ return dJointGetUniversalAngle1Rate (_id); } { return dJointGetUniversalAngle1Rate (_id); }
dReal getAngle2() const dReal getAngle2() const
{ return dJointGetUniversalAngle2 (_id); } { return dJointGetUniversalAngle2 (_id); }
dReal getAngle2Rate() const dReal getAngle2Rate() const
{ return dJointGetUniversalAngle2Rate (_id); } { return dJointGetUniversalAngle2Rate (_id); }
skipping to change at line 480 skipping to change at line 654
class dHinge2Joint : public dJoint { class dHinge2Joint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dHinge2Joint (const dHinge2Joint &); dHinge2Joint (const dHinge2Joint &);
void operator = (const dHinge2Joint &); void operator = (const dHinge2Joint &);
public: public:
dHinge2Joint() { } dHinge2Joint() { }
dHinge2Joint (dWorldID world, dJointGroupID group=0) dHinge2Joint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateHinge2 (world, group); } { _id = dJointCreateHinge2 (world, group); }
dHinge2Joint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateHinge2 (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateHinge2 (world, group); _id = dJointCreateHinge2 (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z) void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetHinge2Anchor (_id, x, y, z); } { dJointSetHinge2Anchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor(a[0], a[1], a[2]); }
void setAxis1 (dReal x, dReal y, dReal z) void setAxis1 (dReal x, dReal y, dReal z)
{ dJointSetHinge2Axis1 (_id, x, y, z); } { dJointSetHinge2Axis1 (_id, x, y, z); }
void setAxis1 (const dVector3 a)
{ setAxis1 (a[0], a[1], a[2]); }
void setAxis2 (dReal x, dReal y, dReal z) void setAxis2 (dReal x, dReal y, dReal z)
{ dJointSetHinge2Axis2 (_id, x, y, z); } { dJointSetHinge2Axis2 (_id, x, y, z); }
void setAxis2 (const dVector3 a)
{ setAxis2 (a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const void getAnchor (dVector3 result) const
{ dJointGetHinge2Anchor (_id, result); } { dJointGetHinge2Anchor (_id, result); }
void getAnchor2 (dVector3 result) const void getAnchor2 (dVector3 result) const
{ dJointGetHinge2Anchor2 (_id, result); } { dJointGetHinge2Anchor2 (_id, result); }
void getAxis1 (dVector3 result) const void getAxis1 (dVector3 result) const
{ dJointGetHinge2Axis1 (_id, result); } { dJointGetHinge2Axis1 (_id, result); }
void getAxis2 (dVector3 result) const void getAxis2 (dVector3 result) const
{ dJointGetHinge2Axis2 (_id, result); } { dJointGetHinge2Axis2 (_id, result); }
dReal getAngle1() const dReal getAngle1() const
{ return dJointGetHinge2Angle1 (_id); } { return dJointGetHinge2Angle1 (_id); }
dReal getAngle1Rate() const dReal getAngle1Rate() const
{ return dJointGetHinge2Angle1Rate (_id); } { return dJointGetHinge2Angle1Rate (_id); }
dReal getAngle2Rate() const dReal getAngle2Rate() const
{ return dJointGetHinge2Angle2Rate (_id); } { return dJointGetHinge2Angle2Rate (_id); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetHinge2Param (_id, parameter, value); } { dJointSetHinge2Param (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetHinge2Param (_id, parameter); } { return dJointGetHinge2Param (_id, parameter); }
// TODO: expose params through methods
void addTorques(dReal torque1, dReal torque2) void addTorques(dReal torque1, dReal torque2)
{ dJointAddHinge2Torques(_id, torque1, torque2); } { dJointAddHinge2Torques(_id, torque1, torque2); }
}; };
class dPRJoint : public dJoint { class dPRJoint : public dJoint {
dPRJoint (const dPRJoint &); dPRJoint (const dPRJoint &);
void operator = (const dPRJoint &); void operator = (const dPRJoint &);
public: public:
dPRJoint() { } dPRJoint() { }
dPRJoint (dWorldID world, dJointGroupID group=0) dPRJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreatePR (world, group); } { _id = dJointCreatePR (world, group); }
dPRJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreatePR (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreatePR (world, group); _id = dJointCreatePR (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z) void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetPRAnchor (_id, x, y, z); } { dJointSetPRAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor (a[0], a[1], a[2]); }
void setAxis1 (dReal x, dReal y, dReal z) void setAxis1 (dReal x, dReal y, dReal z)
{ dJointSetPRAxis1 (_id, x, y, z); } { dJointSetPRAxis1 (_id, x, y, z); }
void setAxis1 (const dVector3 a)
{ setAxis1(a[0], a[1], a[2]); }
void setAxis2 (dReal x, dReal y, dReal z) void setAxis2 (dReal x, dReal y, dReal z)
{ dJointSetPRAxis2 (_id, x, y, z); } { dJointSetPRAxis2 (_id, x, y, z); }
void setAxis2 (const dVector3 a)
{ setAxis2(a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const void getAnchor (dVector3 result) const
{ dJointGetPRAnchor (_id, result); } { dJointGetPRAnchor (_id, result); }
void getAxis1 (dVector3 result) const void getAxis1 (dVector3 result) const
{ dJointGetPRAxis1 (_id, result); } { dJointGetPRAxis1 (_id, result); }
void getAxis2 (dVector3 result) const void getAxis2 (dVector3 result) const
{ dJointGetPRAxis2 (_id, result); } { dJointGetPRAxis2 (_id, result); }
dReal getPosition() const dReal getPosition() const
{ return dJointGetPRPosition (_id); } { return dJointGetPRPosition (_id); }
dReal getPositionRate() const dReal getPositionRate() const
{ return dJointGetPRPositionRate (_id); } { return dJointGetPRPositionRate (_id); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetPRParam (_id, parameter, value); } { dJointSetPRParam (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetPRParam (_id, parameter); } { return dJointGetPRParam (_id, parameter); }
}; };
class dFixedJoint : public dJoint { class dPUJoint : public dJoint
{
dPUJoint (const dPUJoint &);
void operator = (const dPUJoint &);
public:
dPUJoint() { }
dPUJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreatePU (world, group); }
dPUJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreatePU (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0)
{
if (_id) dJointDestroy (_id);
_id = dJointCreatePU (world, group);
}
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetPUAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor (a[0], a[1], a[2]); }
void setAxis1 (dReal x, dReal y, dReal z)
{ dJointSetPUAxis1 (_id, x, y, z); }
void setAxis1 (const dVector3 a)
{ setAxis1(a[0], a[1], a[2]); }
void setAxis2 (dReal x, dReal y, dReal z)
{ dJointSetPUAxis2 (_id, x, y, z); }
void setAxis3 (dReal x, dReal y, dReal z)
{ dJointSetPUAxis3 (_id, x, y, z); }
void setAxis3 (const dVector3 a)
{ setAxis3(a[0], a[1], a[2]); }
void setAxisP (dReal x, dReal y, dReal z)
{ dJointSetPUAxis3 (_id, x, y, z); }
void setAxisP (const dVector3 a)
{ setAxisP(a[0], a[1], a[2]); }
virtual void getAnchor (dVector3 result) const
{ dJointGetPUAnchor (_id, result); }
void getAxis1 (dVector3 result) const
{ dJointGetPUAxis1 (_id, result); }
void getAxis2 (dVector3 result) const
{ dJointGetPUAxis2 (_id, result); }
void getAxis3 (dVector3 result) const
{ dJointGetPUAxis3 (_id, result); }
void getAxisP (dVector3 result) const
{ dJointGetPUAxis3 (_id, result); }
dReal getAngle1() const
{ return dJointGetPUAngle1 (_id); }
dReal getAngle1Rate() const
{ return dJointGetPUAngle1Rate (_id); }
dReal getAngle2() const
{ return dJointGetPUAngle2 (_id); }
dReal getAngle2Rate() const
{ return dJointGetPUAngle2Rate (_id); }
dReal getPosition() const
{ return dJointGetPUPosition (_id); }
dReal getPositionRate() const
{ return dJointGetPUPositionRate (_id); }
virtual void setParam (int parameter, dReal value)
{ dJointSetPUParam (_id, parameter, value); }
virtual dReal getParam (int parameter) const
{ return dJointGetPUParam (_id, parameter); }
// TODO: expose params through methods
};
class dPistonJoint : public dJoint
{
// intentionally undefined, don't use these
dPistonJoint (const dPistonJoint &);
void operator = (const dPistonJoint &);
public:
dPistonJoint() { }
dPistonJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreatePiston (world, group); }
dPistonJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreatePiston (world, group); }
void create (dWorldID world, dJointGroupID group=0)
{
if (_id) dJointDestroy (_id);
_id = dJointCreatePiston (world, group);
}
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setAnchor (dReal x, dReal y, dReal z)
{ dJointSetPistonAnchor (_id, x, y, z); }
void setAnchor (const dVector3 a)
{ setAnchor (a[0], a[1], a[2]); }
void getAnchor (dVector3 result) const
{ dJointGetPistonAnchor (_id, result); }
void getAnchor2 (dVector3 result) const
{ dJointGetPistonAnchor2 (_id, result); }
void setAxis (dReal x, dReal y, dReal z)
{ dJointSetPistonAxis (_id, x, y, z); }
void setAxis (const dVector3 a)
{ setAxis(a[0], a[1], a[2]); }
void getAxis (dVector3 result) const
{ dJointGetPistonAxis (_id, result); }
dReal getPosition() const
{ return dJointGetPistonPosition (_id); }
dReal getPositionRate() const
{ return dJointGetPistonPositionRate (_id); }
virtual void setParam (int parameter, dReal value)
{ dJointSetPistonParam (_id, parameter, value); }
virtual dReal getParam (int parameter) const
{ return dJointGetPistonParam (_id, parameter); }
// TODO: expose params through methods
void addForce (dReal force)
{ dJointAddPistonForce (_id, force); }
};
class dFixedJoint : public dJoint
{
// intentionally undefined, don't use these // intentionally undefined, don't use these
dFixedJoint (const dFixedJoint &); dFixedJoint (const dFixedJoint &);
void operator = (const dFixedJoint &); void operator = (const dFixedJoint &);
public: public:
dFixedJoint() { } dFixedJoint() { }
dFixedJoint (dWorldID world, dJointGroupID group=0) dFixedJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateFixed (world, group); } { _id = dJointCreateFixed (world, group); }
dFixedJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateFixed (world, group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateFixed (world, group); _id = dJointCreateFixed (world, group);
} }
void create (dWorld& world, dJointGroup group=0)
{ create(world.id(), group); }
void set() void set()
{ dJointSetFixed (_id); } { dJointSetFixed (_id); }
void setParam (int parameter, dReal value) virtual void setParam (int parameter, dReal value)
{ dJointSetFixedParam (_id, parameter, value); } { dJointSetFixedParam (_id, parameter, value); }
dReal getParam (int parameter) const virtual dReal getParam (int parameter) const
{ return dJointGetFixedParam (_id, parameter); } { return dJointGetFixedParam (_id, parameter); }
// TODO: expose params through methods
}; };
class dContactJoint : public dJoint { class dContactJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dContactJoint (const dContactJoint &); dContactJoint (const dContactJoint &);
void operator = (const dContactJoint &); void operator = (const dContactJoint &);
public: public:
dContactJoint() { } dContactJoint() { }
dContactJoint (dWorldID world, dJointGroupID group, dContact *contact) dContactJoint (dWorldID world, dJointGroupID group, dContact *contact)
{ _id = dJointCreateContact (world, group, contact); } { _id = dJointCreateContact (world, group, contact); }
dContactJoint (dWorld& world, dJointGroupID group, dContact *contact)
{ _id = dJointCreateContact (world.id(), group, contact); }
void create (dWorldID world, dJointGroupID group, dContact *contact) { void create (dWorldID world, dJointGroupID group, dContact *contact) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateContact (world, group, contact); _id = dJointCreateContact (world, group, contact);
} }
void create (dWorld& world, dJointGroupID group, dContact *contact)
{ create(world.id(), group, contact); }
}; };
class dNullJoint : public dJoint { class dNullJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dNullJoint (const dNullJoint &); dNullJoint (const dNullJoint &);
void operator = (const dNullJoint &); void operator = (const dNullJoint &);
public: public:
dNullJoint() { } dNullJoint() { }
dNullJoint (dWorldID world, dJointGroupID group=0) dNullJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateNull (world, group); } { _id = dJointCreateNull (world, group); }
dNullJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateNull (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateNull (world, group); _id = dJointCreateNull (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
}; };
class dAMotorJoint : public dJoint { class dAMotorJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dAMotorJoint (const dAMotorJoint &); dAMotorJoint (const dAMotorJoint &);
void operator = (const dAMotorJoint &); void operator = (const dAMotorJoint &);
public: public:
dAMotorJoint() { } dAMotorJoint() { }
dAMotorJoint (dWorldID world, dJointGroupID group=0) dAMotorJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateAMotor (world, group); } { _id = dJointCreateAMotor (world, group); }
dAMotorJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateAMotor (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateAMotor (world, group); _id = dJointCreateAMotor (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setMode (int mode) void setMode (int mode)
{ dJointSetAMotorMode (_id, mode); } { dJointSetAMotorMode (_id, mode); }
int getMode() const int getMode() const
{ return dJointGetAMotorMode (_id); } { return dJointGetAMotorMode (_id); }
void setNumAxes (int num) void setNumAxes (int num)
{ dJointSetAMotorNumAxes (_id, num); } { dJointSetAMotorNumAxes (_id, num); }
int getNumAxes() const int getNumAxes() const
{ return dJointGetAMotorNumAxes (_id); } { return dJointGetAMotorNumAxes (_id); }
void setAxis (int anum, int rel, dReal x, dReal y, dReal z) void setAxis (int anum, int rel, dReal x, dReal y, dReal z)
{ dJointSetAMotorAxis (_id, anum, rel, x, y, z); } { dJointSetAMotorAxis (_id, anum, rel, x, y, z); }
void setAxis (int anum, int rel, const dVector3 a)
{ setAxis(anum, rel, a[0], a[1], a[2]); }
void getAxis (int anum, dVector3 result) const void getAxis (int anum, dVector3 result) const
{ dJointGetAMotorAxis (_id, anum, result); } { dJointGetAMotorAxis (_id, anum, result); }
int getAxisRel (int anum) const int getAxisRel (int anum) const
{ return dJointGetAMotorAxisRel (_id, anum); } { return dJointGetAMotorAxisRel (_id, anum); }
void setAngle (int anum, dReal angle) void setAngle (int anum, dReal angle)
{ dJointSetAMotorAngle (_id, anum, angle); } { dJointSetAMotorAngle (_id, anum, angle); }
dReal getAngle (int anum) const dReal getAngle (int anum) const
{ return dJointGetAMotorAngle (_id, anum); } { return dJointGetAMotorAngle (_id, anum); }
dReal getAngleRate (int anum) dReal getAngleRate (int anum)
{ return dJointGetAMotorAngleRate (_id,anum); } { return dJointGetAMotorAngleRate (_id,anum); }
void setParam (int parameter, dReal value) void setParam (int parameter, dReal value)
{ dJointSetAMotorParam (_id, parameter, value); } { dJointSetAMotorParam (_id, parameter, value); }
dReal getParam (int parameter) const dReal getParam (int parameter) const
{ return dJointGetAMotorParam (_id, parameter); } { return dJointGetAMotorParam (_id, parameter); }
// TODO: expose params through methods
void addTorques(dReal torque1, dReal torque2, dReal torque3) void addTorques(dReal torque1, dReal torque2, dReal torque3)
{ dJointAddAMotorTorques(_id, torque1, torque2, torque3); } { dJointAddAMotorTorques(_id, torque1, torque2, torque3); }
}; };
class dLMotorJoint : public dJoint { class dLMotorJoint : public dJoint {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dLMotorJoint (const dLMotorJoint &); dLMotorJoint (const dLMotorJoint &);
void operator = (const dLMotorJoint &); void operator = (const dLMotorJoint &);
public: public:
dLMotorJoint() { } dLMotorJoint() { }
dLMotorJoint (dWorldID world, dJointGroupID group=0) dLMotorJoint (dWorldID world, dJointGroupID group=0)
{ _id = dJointCreateLMotor (world, group); } { _id = dJointCreateLMotor (world, group); }
dLMotorJoint (dWorld& world, dJointGroupID group=0)
{ _id = dJointCreateLMotor (world.id(), group); }
void create (dWorldID world, dJointGroupID group=0) { void create (dWorldID world, dJointGroupID group=0) {
if (_id) dJointDestroy (_id); if (_id) dJointDestroy (_id);
_id = dJointCreateLMotor (world, group); _id = dJointCreateLMotor (world, group);
} }
void create (dWorld& world, dJointGroupID group=0)
{ create(world.id(), group); }
void setNumAxes (int num) void setNumAxes (int num)
{ dJointSetLMotorNumAxes (_id, num); } { dJointSetLMotorNumAxes (_id, num); }
int getNumAxes() const int getNumAxes() const
{ return dJointGetLMotorNumAxes (_id); } { return dJointGetLMotorNumAxes (_id); }
void setAxis (int anum, int rel, dReal x, dReal y, dReal z) void setAxis (int anum, int rel, dReal x, dReal y, dReal z)
{ dJointSetLMotorAxis (_id, anum, rel, x, y, z); } { dJointSetLMotorAxis (_id, anum, rel, x, y, z); }
void setAxis (int anum, int rel, const dVector3 a)
{ setAxis(anum, rel, a[0], a[1], a[2]); }
void getAxis (int anum, dVector3 result) const void getAxis (int anum, dVector3 result) const
{ dJointGetLMotorAxis (_id, anum, result); } { dJointGetLMotorAxis (_id, anum, result); }
void setParam (int parameter, dReal value) void setParam (int parameter, dReal value)
{ dJointSetLMotorParam (_id, parameter, value); } { dJointSetLMotorParam (_id, parameter, value); }
dReal getParam (int parameter) const dReal getParam (int parameter) const
{ return dJointGetLMotorParam (_id, parameter); } { return dJointGetLMotorParam (_id, parameter); }
// TODO: expose params through methods
}; };
//}
#endif #endif
#endif #endif
// Local variables:
// mode:c++
// c-basic-offset:2
// End:
 End of changes. 116 change blocks. 
51 lines changed or deleted 400 lines changed or added


 odecpp_collision.h   odecpp_collision.h 
skipping to change at line 29 skipping to change at line 29
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
/* C++ interface for new collision API */ /* C++ interface for new collision API */
#ifndef _ODE_ODECPP_COLLISION_H_ #ifndef _ODE_ODECPP_COLLISION_H_
#define _ODE_ODECPP_COLLISION_H_ #define _ODE_ODECPP_COLLISION_H_
#ifdef __cplusplus #ifdef __cplusplus
#include <ode/error.h> //#include <ode/error.h>
//namespace ode {
class dGeom { class dGeom {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dGeom (dGeom &); dGeom (dGeom &);
void operator= (dGeom &); void operator= (dGeom &);
protected: protected:
dGeomID _id; dGeomID _id;
public: public:
skipping to change at line 266 skipping to change at line 268
if (_id) dGeomDestroy (_id); if (_id) dGeomDestroy (_id);
_id = dCreateCapsule (space,radius,length); _id = dCreateCapsule (space,radius,length);
} }
void setParams (dReal radius, dReal length) void setParams (dReal radius, dReal length)
{ dGeomCapsuleSetParams (_id, radius, length); } { dGeomCapsuleSetParams (_id, radius, length); }
void getParams (dReal *radius, dReal *length) const void getParams (dReal *radius, dReal *length) const
{ dGeomCapsuleGetParams (_id,radius,length); } { dGeomCapsuleGetParams (_id,radius,length); }
}; };
class dCylinder : public dGeom {
// intentionally undefined, don't use these
dCylinder (dCylinder &);
void operator= (dCylinder &);
public:
dCylinder() { }
dCylinder (dSpaceID space, dReal radius, dReal length)
{ _id = dCreateCylinder (space,radius,length); }
void create (dSpaceID space, dReal radius, dReal length) {
if (_id) dGeomDestroy (_id);
_id = dCreateCylinder (space,radius,length);
}
void setParams (dReal radius, dReal length)
{ dGeomCylinderSetParams (_id, radius, length); }
void getParams (dReal *radius, dReal *length) const
{ dGeomCylinderGetParams (_id,radius,length); }
};
class dRay : public dGeom { class dRay : public dGeom {
// intentionally undefined, don't use these // intentionally undefined, don't use these
dRay (dRay &); dRay (dRay &);
void operator= (dRay &); void operator= (dRay &);
public: public:
dRay() { } dRay() { }
dRay (dSpaceID space, dReal length) dRay (dSpaceID space, dReal length)
{ _id = dCreateRay (space,length); } { _id = dCreateRay (space,length); }
skipping to change at line 332 skipping to change at line 355
{ dGeomTransformSetCleanup (_id,mode); } { dGeomTransformSetCleanup (_id,mode); }
int getCleanup () int getCleanup ()
{ return dGeomTransformGetCleanup (_id); } { return dGeomTransformGetCleanup (_id); }
void setInfo (int mode) void setInfo (int mode)
{ dGeomTransformSetInfo (_id,mode); } { dGeomTransformSetInfo (_id,mode); }
int getInfo() int getInfo()
{ return dGeomTransformGetInfo (_id); } { return dGeomTransformGetInfo (_id); }
}; };
//}
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
1 lines changed or deleted 26 lines changed or added


 odemath.h   odemath.h 
skipping to change at line 69 skipping to change at line 69
(a)[2] = ((b)[2]) op (c); (a)[2] = ((b)[2]) op (c);
#define dOPE(a,op,b) \ #define dOPE(a,op,b) \
(a)[0] op ((b)[0]); \ (a)[0] op ((b)[0]); \
(a)[1] op ((b)[1]); \ (a)[1] op ((b)[1]); \
(a)[2] op ((b)[2]); (a)[2] op ((b)[2]);
#define dOPEC(a,op,c) \ #define dOPEC(a,op,c) \
(a)[0] op (c); \ (a)[0] op (c); \
(a)[1] op (c); \ (a)[1] op (c); \
(a)[2] op (c); (a)[2] op (c);
/// Define an equation with operatos
/// For example this function can be used to replace
/// <PRE>
/// for (int i=0; i<3; ++i)
/// a[i] += b[i] + c[i];
/// </PRE>
#define dOPE2(a,op1,b,op2,c) \
(a)[0] op1 ((b)[0]) op2 ((c)[0]); \
(a)[1] op1 ((b)[1]) op2 ((c)[1]); \
(a)[2] op1 ((b)[2]) op2 ((c)[2]);
/* /*
* Length, and squared length helpers. dLENGTH returns the length of a dVec tor3. * Length, and squared length helpers. dLENGTH returns the length of a dVec tor3.
* dLENGTHSQUARED return the squared length of a dVector3. * dLENGTHSQUARED return the squared length of a dVector3.
*/ */
#define dLENGTHSQUARED(a) (((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2]) *((a)[2])) #define dLENGTHSQUARED(a) (((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2]) *((a)[2]))
#ifdef __cplusplus #ifdef __cplusplus
PURE_INLINE dReal dLENGTH (const dReal *a) { return dSqrt(dLENGTHSQUARED(a) ); } PURE_INLINE dReal dLENGTH (const dReal *a) { return dSqrt(dLENGTHSQUARED(a) ); }
skipping to change at line 237 skipping to change at line 248
(A)[6] op dDOT((B+4),(C+8)); \ (A)[6] op dDOT((B+4),(C+8)); \
(A)[8] op dDOT((B+8),(C)); \ (A)[8] op dDOT((B+8),(C)); \
(A)[9] op dDOT((B+8),(C+4)); \ (A)[9] op dDOT((B+8),(C+4)); \
(A)[10] op dDOT((B+8),(C+8)); \ (A)[10] op dDOT((B+8),(C+8)); \
} while(0) } while(0)
#ifdef __cplusplus #ifdef __cplusplus
#define DECL template <class TA, class TB, class TC> PURE_INLINE void #define DECL template <class TA, class TB, class TC> PURE_INLINE void
/*
Note: NEVER call any of these functions/macros with the same variable for A
and C,
it is not equivalent to A*=B.
*/
DECL dMULTIPLY0_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_331(A,= ,B,C); } DECL dMULTIPLY0_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_331(A,= ,B,C); }
DECL dMULTIPLY1_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_331(A,= ,B,C); } DECL dMULTIPLY1_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_331(A,= ,B,C); }
DECL dMULTIPLY0_133(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_133(A,= ,B,C); } DECL dMULTIPLY0_133(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_133(A,= ,B,C); }
DECL dMULTIPLY0_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_333(A,= ,B,C); } DECL dMULTIPLY0_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_333(A,= ,B,C); }
DECL dMULTIPLY1_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_333(A,= ,B,C); } DECL dMULTIPLY1_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_333(A,= ,B,C); }
DECL dMULTIPLY2_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP2_333(A,= ,B,C); } DECL dMULTIPLY2_333(TA *A, const TB *B, const TC *C) { dMULTIPLYOP2_333(A,= ,B,C); }
DECL dMULTIPLYADD0_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_331( A,+=,B,C); } DECL dMULTIPLYADD0_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_331( A,+=,B,C); }
DECL dMULTIPLYADD1_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_331( A,+=,B,C); } DECL dMULTIPLYADD1_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP1_331( A,+=,B,C); }
DECL dMULTIPLYADD0_133(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_133( A,+=,B,C); } DECL dMULTIPLYADD0_133(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_133( A,+=,B,C); }
skipping to change at line 278 skipping to change at line 294
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* normalize 3x1 and 4x1 vectors (i.e. scale them to unit length) * normalize 3x1 and 4x1 vectors (i.e. scale them to unit length)
*/ */
ODE_API int dSafeNormalize3 (dVector3 a);
ODE_API int dSafeNormalize4 (dVector4 a);
// For some reason demo_chain1.c does not understand "inline" keyword. #if defined(__ODE__)
int _dSafeNormalize3 (dVector3 a);
int _dSafeNormalize4 (dVector4 a);
static __inline void _dNormalize3(dVector3 a) static __inline void _dNormalize3(dVector3 a)
{ {
int bNormalizationResult = dSafeNormalize3(a); int bNormalizationResult = _dSafeNormalize3(a);
dIASSERT(bNormalizationResult); dIASSERT(bNormalizationResult);
dVARIABLEUSED(bNormalizationResult); dVARIABLEUSED(bNormalizationResult);
} }
static __inline void _dNormalize4(dVector4 a) static __inline void _dNormalize4(dVector4 a)
{ {
int bNormalizationResult = dSafeNormalize4(a); int bNormalizationResult = _dSafeNormalize4(a);
dIASSERT(bNormalizationResult); dIASSERT(bNormalizationResult);
dVARIABLEUSED(bNormalizationResult); dVARIABLEUSED(bNormalizationResult);
} }
#endif // defined(__ODE__)
// For DLL export // For DLL export
ODE_API int dSafeNormalize3 (dVector3 a);
ODE_API int dSafeNormalize4 (dVector4 a);
ODE_API void dNormalize3 (dVector3 a); // Potentially asserts on zero vec ODE_API void dNormalize3 (dVector3 a); // Potentially asserts on zero vec
ODE_API void dNormalize4 (dVector4 a); // Potentially asserts on zero vec ODE_API void dNormalize4 (dVector4 a); // Potentially asserts on zero vec
#if defined(__ODE__)
// For internal use // For internal use
#define dSafeNormalize3(a) _dSafeNormalize3(a)
#define dSafeNormalize4(a) _dSafeNormalize4(a)
#define dNormalize3(a) _dNormalize3(a) #define dNormalize3(a) _dNormalize3(a)
#define dNormalize4(a) _dNormalize4(a) #define dNormalize4(a) _dNormalize4(a)
#endif // defined(__ODE__)
/* /*
* given a unit length "normal" vector n, generate vectors p and q vectors * given a unit length "normal" vector n, generate vectors p and q vectors
* that are an orthonormal basis for the plane space perpendicular to n. * that are an orthonormal basis for the plane space perpendicular to n.
* i.e. this makes p,q such that n,p,q are all perpendicular to each other. * i.e. this makes p,q such that n,p,q are all perpendicular to each other.
* q will equal n x p. if n is not unit length then p will be unit length b ut * q will equal n x p. if n is not unit length then p will be unit length b ut
* q wont be. * q wont be.
*/ */
ODE_API void dPlaneSpace (const dVector3 n, dVector3 p, dVector3 q); ODE_API void dPlaneSpace (const dVector3 n, dVector3 p, dVector3 q);
 End of changes. 11 change blocks. 
5 lines changed or deleted 34 lines changed or added


 timer.h   timer.h 
skipping to change at line 26 skipping to change at line 26
* This library is distributed in the hope that it will be useful, * * This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. * * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* * * *
*************************************************************************/ *************************************************************************/
#ifndef _ODE_TIMER_H_ #ifndef _ODE_TIMER_H_
#define _ODE_TIMER_H_ #define _ODE_TIMER_H_
#include <ode/config.h> #include <ode/odeconfig.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* stop watch objects */ /* stop watch objects */
typedef struct dStopwatch { typedef struct dStopwatch {
double time; /* total clock count */ double time; /* total clock count */
unsigned long cc[2]; /* clock count since last `start' */ unsigned long cc[2]; /* clock count since last `start' */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/