23 #ifndef _ODE_COLLISION_H_
24 #define _ODE_COLLISION_H_
26 #include <ode/common.h>
27 #include <ode/collision_space.h>
28 #include <ode/contact.h>
410 dGeomCommonControlClass = 0,
411 dGeomColliderControlClass = 1
416 dGeomCommonAnyControlCode = 0,
418 dGeomColliderSetMergeSphereContactsControlCode = 1,
419 dGeomColliderGetMergeSphereContactsControlCode = 2
424 dGeomColliderMergeContactsValue__Default = 0,
425 dGeomColliderMergeContactsValue_None = 1,
426 dGeomColliderMergeContactsValue_Normals = 2,
427 dGeomColliderMergeContactsValue_Full = 3
471 dGeomID geom, dReal px, dReal py, dReal pz,
489 dGeomID geom, dReal px, dReal py, dReal pz,
504 dGeomID geom, dReal px, dReal py, dReal pz,
519 dGeomID geom, dReal px, dReal py, dReal pz,
743 #define CONTACTS_UNIMPORTANT 0x80000000
890 dSimpleSpaceClass = dFirstSpaceClass,
892 dSweepAndPruneSpaceClass,
894 dLastSpaceClass = dQuadTreeSpaceClass,
897 dLastUserClass = dFirstUserClass + dMaxUserClasses - 1,
967 unsigned int _planecount,
969 unsigned int _pointcount,
unsigned int *_polygons);
971 ODE_API
void dGeomSetConvex (
dGeomID g,
975 unsigned int _pointcount,
unsigned int *_polygons);
1040 ODE_API dReal dGeomBoxPointDepth (
dGeomID box, dReal x, dReal y, dReal z);
1043 ODE_API
dGeomID dCreatePlane (
dSpaceID space, dReal a, dReal b, dReal c, dReal d);
1044 ODE_API
void dGeomPlaneSetParams (
dGeomID plane, dReal a, dReal b, dReal c, dReal d);
1045 ODE_API
void dGeomPlaneGetParams (
dGeomID plane, dVector4 result);
1046 ODE_API dReal dGeomPlanePointDepth (
dGeomID plane, dReal x, dReal y, dReal z);
1048 ODE_API
dGeomID dCreateCapsule (
dSpaceID space, dReal radius, dReal length);
1049 ODE_API
void dGeomCapsuleSetParams (
dGeomID ccylinder, dReal radius, dReal length);
1050 ODE_API
void dGeomCapsuleGetParams (
dGeomID ccylinder, dReal *radius, dReal *length);
1051 ODE_API dReal dGeomCapsulePointDepth (
dGeomID ccylinder, dReal x, dReal y, dReal z);
1054 #define dCreateCCylinder dCreateCapsule
1055 #define dGeomCCylinderSetParams dGeomCapsuleSetParams
1056 #define dGeomCCylinderGetParams dGeomCapsuleGetParams
1057 #define dGeomCCylinderPointDepth dGeomCapsulePointDepth
1058 #define dCCylinderClass dCapsuleClass
1060 ODE_API
dGeomID dCreateCylinder (
dSpaceID space, dReal radius, dReal length);
1061 ODE_API
void dGeomCylinderSetParams (
dGeomID cylinder, dReal radius, dReal length);
1062 ODE_API
void dGeomCylinderGetParams (
dGeomID cylinder, dReal *radius, dReal *length);
1065 ODE_API
void dGeomRaySetLength (
dGeomID ray, dReal length);
1066 ODE_API dReal dGeomRayGetLength (
dGeomID ray);
1067 ODE_API
void dGeomRaySet (
dGeomID ray, dReal px, dReal py, dReal pz,
1068 dReal dx, dReal dy, dReal dz);
1069 ODE_API
void dGeomRayGet (
dGeomID ray, dVector3 start, dVector3 dir);
1076 ODE_API
void dGeomRaySetParams (
dGeomID g,
int FirstContact,
int BackfaceCull);
1077 ODE_API
void dGeomRayGetParams (
dGeomID g,
int *FirstContact,
int *BackfaceCull);
1078 ODE_API
void dGeomRaySetClosestHit (
dGeomID g,
int closestHit);
1079 ODE_API
int dGeomRayGetClosestHit (
dGeomID g);
1081 #include "collision_trimesh.h"
1086 ODE_API
void dGeomTransformSetCleanup (
dGeomID g,
int mode);
1087 ODE_API
int dGeomTransformGetCleanup (
dGeomID g);
1088 ODE_API
void dGeomTransformSetInfo (
dGeomID g,
int mode);
1089 ODE_API
int dGeomTransformGetInfo (
dGeomID g);
1142 dHeightfieldDataID data,
int bPlaceable );
1214 dReal width, dReal depth,
int widthSamples,
int depthSamples,
1215 dReal scale, dReal offset, dReal thickness,
int bWrap );
1261 const unsigned char* pHeightData,
int bCopyHeightData,
1262 dReal width, dReal depth,
int widthSamples,
int depthSamples,
1263 dReal scale, dReal offset, dReal thickness,
int bWrap );
1309 const short* pHeightData,
int bCopyHeightData,
1310 dReal width, dReal depth,
int widthSamples,
int depthSamples,
1311 dReal scale, dReal offset, dReal thickness,
int bWrap );
1359 const float* pHeightData,
int bCopyHeightData,
1360 dReal width, dReal depth,
int widthSamples,
int depthSamples,
1361 dReal scale, dReal offset, dReal thickness,
int bWrap );
1409 const double* pHeightData,
int bCopyHeightData,
1410 dReal width, dReal depth,
int widthSamples,
int depthSamples,
1411 dReal scale, dReal offset, dReal thickness,
int bWrap );
1431 dReal minHeight, dReal maxHeight );
1463 ODE_API
void dClosestLineSegmentPoints (
const dVector3 a1,
const dVector3 a2,
1464 const dVector3 b1,
const dVector3 b2,
1465 dVector3 cp1, dVector3 cp2);
1467 ODE_API
int dBoxTouchesBox (
const dVector3 _p1,
const dMatrix3 R1,
1468 const dVector3 side1,
const dVector3 _p2,
1469 const dMatrix3 R2,
const dVector3 side2);
1472 ODE_API
int dBoxBox (
const dVector3 p1,
const dMatrix3 R1,
1473 const dVector3 side1,
const dVector3 p2,
1474 const dMatrix3 R2,
const dVector3 side2,
1475 dVector3 normal, dReal *depth,
int *return_code,
1478 ODE_API
void dInfiniteAABB (
dGeomID geom, dReal aabb[6]);
1484 typedef void dGetAABBFn (
dGeomID, dReal aabb[6]);
1487 typedef dColliderFn * dGetColliderFnFn (
int num);
1488 typedef void dGeomDtorFn (
dGeomID o);
1493 dGetColliderFnFn *collider;
1495 dAABBTestFn *aabb_test;
1499 ODE_API
int dCreateGeomClass (
const dGeomClass *classptr);
1500 ODE_API
void * dGeomGetClassData (
dGeomID);
1501 ODE_API
dGeomID dCreateGeom (
int classnum);
ODE_API void dGeomSetOffsetWorldQuaternion(dGeomID geom, const dQuaternion)
Set the offset rotation of a geom from its body.
Definition: heightfield.h:48
ODE_API int dGeomIsOffset(dGeomID geom)
Check to see whether the geom has an offset.
ODE_API const dReal * dGeomGetOffsetRotation(dGeomID geom)
Get the offset rotation matrix of a geom.
ODE_API void dSetColliderOverride(int i, int j, dColliderFn *fn)
Sets a custom collider function for two geom classes.
Definition: collision_kernel.cpp:274
ODE_API void dGeomSetCategoryBits(dGeomID geom, unsigned long bits)
Set the "category" bitfield for the given geom.
ODE_API void dGeomHeightfieldDataSetBounds(dHeightfieldDataID d, dReal minHeight, dReal maxHeight)
Manually set the minimum and maximum height bounds.
Definition: heightfield.cpp:868
ODE_API int dGeomIsEnabled(dGeomID geom)
Check to see if a geom is enabled.
ODE_API dHeightfieldDataID dGeomHeightfieldDataCreate(void)
Creates a new empty dHeightfieldDataID.
Definition: heightfield.cpp:693
ODE_API void dGeomVectorFromWorld(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Convert from world to geom-local coordinates.
Definition: collision_kernel.cpp:851
ODE_API void dGeomSetOffsetQuaternion(dGeomID geom, const dQuaternion Q)
Set the local offset rotation of a geom from its body.
ODE_API void dSpaceCollide2(dGeomID space1, dGeomID space2, void *data, dNearCallback *callback)
Determines which geoms from one space may potentially intersect with geoms from another space...
ODE_API dReal dGeomSpherePointDepth(dGeomID sphere, dReal x, dReal y, dReal z)
Calculate the depth of the a given point within a sphere.
Definition: sphere.cpp:95
ODE_API void dGeomSetCollideBits(dGeomID geom, unsigned long bits)
Set the "collide" bitfield for the given geom.
ODE_API dGeomID dCreateHeightfield(dSpaceID space, dHeightfieldDataID data, int bPlaceable)
Creates a heightfield geom.
Definition: heightfield.cpp:886
ODE_API dBodyID dGeomGetBody(dGeomID geom)
Get the body associated with a placeable geom.
ODE_API void dGeomSetOffsetWorldRotation(dGeomID geom, const dMatrix3 R)
Set the offset rotation of a geom from its body.
ODE_API void dGeomSetPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the position vector of a placeable geom.
ODE_API dReal dGeomSphereGetRadius(dGeomID sphere)
Retrieves the radius of a sphere geom.
Definition: sphere.cpp:87
ODE_API void dGeomSetBody(dGeomID geom, dBodyID body)
Set the body associated with a placeable geom.
ODE_API dSpaceID dGeomGetSpace(dGeomID)
Query for the space containing a particular geom.
ODE_API unsigned long dGeomGetCategoryBits(dGeomID)
Get the "category" bitfield for the given geom.
ODE_API const dReal * dGeomGetOffsetPosition(dGeomID geom)
Get the offset position vector of a geom.
ODE_API dHeightfieldDataID dGeomHeightfieldGetHeightfieldData(dGeomID g)
Gets the dHeightfieldDataID bound to a heightfield geom.
Definition: heightfield.cpp:899
ODE_API void dGeomSetQuaternion(dGeomID geom, const dQuaternion Q)
Set the rotation of a placeable geom.
dReal dHeightfieldGetHeight(void *p_user_data, int x, int z)
Callback prototype.
Definition: collision.h:1118
ODE_API void dGeomHeightfieldDataBuildDouble(dHeightfieldDataID d, const double *pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap)
Configures a dHeightfieldDataID to use height data in double precision floating point format...
Definition: heightfield.cpp:830
ODE_API void dGeomCopyRotation(dGeomID geom, dMatrix3 R)
Get the rotation matrix of a placeable geom.
ODE_API const dReal * dGeomGetRotation(dGeomID geom)
Get the rotation matrix of a placeable geom.
ODE_API void dGeomHeightfieldDataBuildShort(dHeightfieldDataID d, const short *pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap)
Configures a dHeightfieldDataID to use height data in short format.
Definition: heightfield.cpp:759
Definition: collision.h:1491
ODE_API void dGeomGetOffsetQuaternion(dGeomID geom, dQuaternion result)
Get the offset rotation quaternion of a geom.
ODE_API void dGeomSetOffsetRotation(dGeomID geom, const dMatrix3 R)
Set the local offset rotation matrix of a geom from its body.
ODE_API void dGeomSphereSetRadius(dGeomID sphere, dReal radius)
Set the radius of a sphere geom.
Definition: sphere.cpp:76
ODE_API void dGeomHeightfieldSetHeightfieldData(dGeomID g, dHeightfieldDataID d)
Assigns a dHeightfieldDataID to a heightfield geom.
Definition: heightfield.cpp:892
ODE_API void dSpaceCollide(dSpaceID space, void *data, dNearCallback *callback)
Determines which pairs of geoms in a space may potentially intersect, and calls the callback function...
Definition: ode/src/objects.h:131
ODE_API void dGeomHeightfieldDataDestroy(dHeightfieldDataID d)
Destroys a dHeightfieldDataID.
Definition: heightfield.cpp:876
ODE_API void dGeomHeightfieldDataBuildSingle(dHeightfieldDataID d, const float *pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap)
Configures a dHeightfieldDataID to use height data in single precision floating point format...
Definition: heightfield.cpp:795
void dNearCallback(void *data, dGeomID o1, dGeomID o2)
User callback for geom-geom collision testing.
Definition: collision_space.h:49
ODE_API void dGeomDisable(dGeomID geom)
Disable a geom.
ODE_API int dGeomIsSpace(dGeomID geom)
Determing if a geom is a space.
ODE_API int dCollide(dGeomID o1, dGeomID o2, int flags, dContactGeom *contact, int skip)
Given two geoms o1 and o2 that potentially intersect, generate contact information for them...
ODE_API void dGeomVectorToWorld(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Convert from geom-local to world coordinates.
Definition: collision_kernel.cpp:830
ODE_API void dGeomGetAABB(dGeomID geom, dReal aabb[6])
Return the axis-aligned bounding box.
ODE_API void dGeomBoxSetLengths(dGeomID box, dReal lx, dReal ly, dReal lz)
Set the side lengths of the given box.
Definition: box.cpp:86
ODE_API void dGeomEnable(dGeomID geom)
Enable a geom.
ODE_API unsigned long dGeomGetCollideBits(dGeomID)
Get the "collide" bitfield for the given geom.
ODE_API void dGeomClearOffset(dGeomID geom)
Clear any offset from the geom.
ODE_API void dGeomDestroy(dGeomID geom)
Destroy a geom, removing it from any space.
ODE_API void dGeomBoxGetLengths(dGeomID box, dVector3 result)
Get the side lengths of a box.
Definition: box.cpp:99
Definition: collision_kernel.h:96
Definition: collision_kernel.h:202
ODE_API void dGeomSetRotation(dGeomID geom, const dMatrix3 R)
Set the rotation matrix of a placeable geom.
ODE_API dGeomID dCreateSphere(dSpaceID space, dReal radius)
Create a sphere geom of the given radius, and return its ID.
Definition: sphere.cpp:70
ODE_API void dGeomHeightfieldDataBuildByte(dHeightfieldDataID d, const unsigned char *pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap)
Configures a dHeightfieldDataID to use height data in byte format.
Definition: heightfield.cpp:723
ODE_API int dGeomLowLevelControl(dGeomID geom, int controlClass, int controlCode, void *dataValue, int *dataSize)
Execute low level control operation for geometry.
ODE_API const dReal * dGeomGetPosition(dGeomID geom)
Get the position vector of a placeable geom.
ODE_API void dGeomGetPosRelPoint(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
takes a point in global coordinates and returns the point's position in geom-relative coordinates...
Definition: collision_kernel.cpp:809
ODE_API void * dGeomGetData(dGeomID geom)
Get the user-defined data pointer stored in the geom.
ODE_API void dGeomSetData(dGeomID geom, void *data)
Set the user-defined data pointer stored in the geom.
ODE_API int dGeomGetClass(dGeomID geom)
Given a geom, this returns its class.
ODE_API void dGeomSetOffsetPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the local offset position of a geom from its body.
ODE_API void dGeomGetQuaternion(dGeomID geom, dQuaternion result)
Get the rotation quaternion of a placeable geom.
ODE_API void dGeomCopyOffsetPosition(dGeomID geom, dVector3 pos)
Copy the offset position vector of a geom.
ODE_API void dGeomHeightfieldDataBuildCallback(dHeightfieldDataID d, void *pUserData, dHeightfieldGetHeight *pCallback, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap)
Configures a dHeightfieldDataID to use a callback to retrieve height data.
Definition: heightfield.cpp:699
ODE_API void dGeomSetOffsetWorldPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the offset position of a geom from its body.
ODE_API void dGeomGetRelPointPos(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Get world position of a relative point on geom.
Definition: collision_kernel.cpp:784
ODE_API dGeomID dCreateBox(dSpaceID space, dReal lx, dReal ly, dReal lz)
Create a box geom with the provided side lengths.
Definition: box.cpp:80
ODE_API void dGeomCopyOffsetRotation(dGeomID geom, dMatrix3 R)
Copy the offset rotation matrix of a geom.
ODE_API void dGeomCopyPosition(dGeomID geom, dVector3 pos)
Copy the position of a geom into a vector.