Open Dynamics Engine
collision.h
1 /*************************************************************************
2  * *
3  * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. *
4  * All rights reserved. Email: russ@q12.org Web: www.q12.org *
5  * *
6  * This library is free software; you can redistribute it and/or *
7  * modify it under the terms of EITHER: *
8  * (1) The GNU Lesser General Public License as published by the Free *
9  * Software Foundation; either version 2.1 of the License, or (at *
10  * your option) any later version. The text of the GNU Lesser *
11  * General Public License is included with this library in the *
12  * file LICENSE.TXT. *
13  * (2) The BSD-style license that is included with this library in *
14  * the file LICENSE-BSD.TXT. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
19  * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
20  * *
21  *************************************************************************/
22 
23 #ifndef _ODE_COLLISION_H_
24 #define _ODE_COLLISION_H_
25 
26 #include <ode/common.h>
27 #include <ode/collision_space.h>
28 #include <ode/contact.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
49 /* ************************************************************************ */
50 /* general functions */
51 
65 ODE_API void dGeomDestroy (dGeomID geom);
66 
67 
75 ODE_API void dGeomSetData (dGeomID geom, void* data);
76 
77 
84 ODE_API void *dGeomGetData (dGeomID geom);
85 
86 
105 ODE_API void dGeomSetBody (dGeomID geom, dBodyID body);
106 
107 
114 ODE_API dBodyID dGeomGetBody (dGeomID geom);
115 
116 
131 ODE_API void dGeomSetPosition (dGeomID geom, dReal x, dReal y, dReal z);
132 
133 
146 ODE_API void dGeomSetRotation (dGeomID geom, const dMatrix3 R);
147 
148 
162 ODE_API void dGeomSetQuaternion (dGeomID geom, const dQuaternion Q);
163 
164 
181 ODE_API const dReal * dGeomGetPosition (dGeomID geom);
182 
183 
191 ODE_API void dGeomCopyPosition (dGeomID geom, dVector3 pos);
192 
193 
210 ODE_API const dReal * dGeomGetRotation (dGeomID geom);
211 
212 
226 ODE_API void dGeomCopyRotation(dGeomID geom, dMatrix3 R);
227 
228 
242 ODE_API void dGeomGetQuaternion (dGeomID geom, dQuaternion result);
243 
244 
261 ODE_API void dGeomGetAABB (dGeomID geom, dReal aabb[6]);
262 
263 
270 ODE_API int dGeomIsSpace (dGeomID geom);
271 
272 
280 ODE_API dSpaceID dGeomGetSpace (dGeomID);
281 
282 
307 ODE_API int dGeomGetClass (dGeomID geom);
308 
309 
322 ODE_API void dGeomSetCategoryBits (dGeomID geom, unsigned long bits);
323 
324 
337 ODE_API void dGeomSetCollideBits (dGeomID geom, unsigned long bits);
338 
339 
348 ODE_API unsigned long dGeomGetCategoryBits (dGeomID);
349 
350 
359 ODE_API unsigned long dGeomGetCollideBits (dGeomID);
360 
361 
374 ODE_API void dGeomEnable (dGeomID geom);
375 
376 
389 ODE_API void dGeomDisable (dGeomID geom);
390 
391 
405 ODE_API int dGeomIsEnabled (dGeomID geom);
406 
407 
408 enum
409 {
410  dGeomCommonControlClass = 0,
411  dGeomColliderControlClass = 1
412 };
413 
414 enum
415 {
416  dGeomCommonAnyControlCode = 0,
417 
418  dGeomColliderSetMergeSphereContactsControlCode = 1,
419  dGeomColliderGetMergeSphereContactsControlCode = 2
420 };
421 
422 enum
423 {
424  dGeomColliderMergeContactsValue__Default = 0, /* Used with Set... to restore default value*/
425  dGeomColliderMergeContactsValue_None = 1,
426  dGeomColliderMergeContactsValue_Normals = 2,
427  dGeomColliderMergeContactsValue_Full = 3
428 };
429 
457 ODE_API int dGeomLowLevelControl (dGeomID geom, int controlClass, int controlCode, void *dataValue, int *dataSize);
458 
459 
469 ODE_API void dGeomGetRelPointPos
470 (
471  dGeomID geom, dReal px, dReal py, dReal pz,
472  dVector3 result
473 );
474 
487 ODE_API void dGeomGetPosRelPoint
488 (
489  dGeomID geom, dReal px, dReal py, dReal pz,
490  dVector3 result
491 );
492 
502 ODE_API void dGeomVectorToWorld
503 (
504  dGeomID geom, dReal px, dReal py, dReal pz,
505  dVector3 result
506 );
507 
517 ODE_API void dGeomVectorFromWorld
518 (
519  dGeomID geom, dReal px, dReal py, dReal pz,
520  dVector3 result
521 );
522 
523 
524 /* ************************************************************************ */
525 /* geom offset from body */
526 
542 ODE_API void dGeomSetOffsetPosition (dGeomID geom, dReal x, dReal y, dReal z);
543 
544 
558 ODE_API void dGeomSetOffsetRotation (dGeomID geom, const dMatrix3 R);
559 
560 
574 ODE_API void dGeomSetOffsetQuaternion (dGeomID geom, const dQuaternion Q);
575 
576 
593 ODE_API void dGeomSetOffsetWorldPosition (dGeomID geom, dReal x, dReal y, dReal z);
594 
595 
610 ODE_API void dGeomSetOffsetWorldRotation (dGeomID geom, const dMatrix3 R);
611 
612 
627 ODE_API void dGeomSetOffsetWorldQuaternion (dGeomID geom, const dQuaternion);
628 
629 
643 ODE_API void dGeomClearOffset(dGeomID geom);
644 
645 
661 ODE_API int dGeomIsOffset(dGeomID geom);
662 
663 
677 ODE_API const dReal * dGeomGetOffsetPosition (dGeomID geom);
678 
679 
690 ODE_API void dGeomCopyOffsetPosition (dGeomID geom, dVector3 pos);
691 
692 
707 ODE_API const dReal * dGeomGetOffsetRotation (dGeomID geom);
708 
709 
721 ODE_API void dGeomCopyOffsetRotation (dGeomID geom, dMatrix3 R);
722 
723 
734 ODE_API void dGeomGetOffsetQuaternion (dGeomID geom, dQuaternion result);
735 
736 
737 /* ************************************************************************ */
738 /* collision detection */
739 
740 /*
741  * Just generate any contacts (disables any contact refining).
742  */
743 #define CONTACTS_UNIMPORTANT 0x80000000
744 
792 ODE_API int dCollide (dGeomID o1, dGeomID o2, int flags, dContactGeom *contact,
793  int skip);
794 
822 ODE_API void dSpaceCollide (dSpaceID space, void *data, dNearCallback *callback);
823 
824 
865 ODE_API void dSpaceCollide2 (dGeomID space1, dGeomID space2, void *data, dNearCallback *callback);
866 
867 
868 /* ************************************************************************ */
869 /* standard classes */
870 
871 /* the maximum number of user classes that are supported */
872 enum {
873  dMaxUserClasses = 4
874 };
875 
876 /* class numbers - each geometry object needs a unique number */
877 enum {
878  dSphereClass = 0,
879  dBoxClass,
880  dCapsuleClass,
881  dCylinderClass,
882  dPlaneClass,
883  dRayClass,
884  dConvexClass,
885  dGeomTransformClass,
886  dTriMeshClass,
887  dHeightfieldClass,
888 
889  dFirstSpaceClass,
890  dSimpleSpaceClass = dFirstSpaceClass,
891  dHashSpaceClass,
892  dSweepAndPruneSpaceClass, /* SAP */
893  dQuadTreeSpaceClass,
894  dLastSpaceClass = dQuadTreeSpaceClass,
895 
896  dFirstUserClass,
897  dLastUserClass = dFirstUserClass + dMaxUserClasses - 1,
898  dGeomNumClasses
899 };
900 
901 
921 ODE_API dGeomID dCreateSphere (dSpaceID space, dReal radius);
922 
923 
933 ODE_API void dGeomSphereSetRadius (dGeomID sphere, dReal radius);
934 
935 
944 ODE_API dReal dGeomSphereGetRadius (dGeomID sphere);
945 
946 
961 ODE_API dReal dGeomSpherePointDepth (dGeomID sphere, dReal x, dReal y, dReal z);
962 
963 
964 /*--> Convex Functions*/
965 ODE_API dGeomID dCreateConvex (dSpaceID space,
966  dReal *_planes,
967  unsigned int _planecount,
968  dReal *_points,
969  unsigned int _pointcount,unsigned int *_polygons);
970 
971 ODE_API void dGeomSetConvex (dGeomID g,
972  dReal *_planes,
973  unsigned int _count,
974  dReal *_points,
975  unsigned int _pointcount,unsigned int *_polygons);
976 /*<-- Convex Functions*/
977 
999 ODE_API dGeomID dCreateBox (dSpaceID space, dReal lx, dReal ly, dReal lz);
1000 
1001 
1013 ODE_API void dGeomBoxSetLengths (dGeomID box, dReal lx, dReal ly, dReal lz);
1014 
1015 
1025 ODE_API void dGeomBoxGetLengths (dGeomID box, dVector3 result);
1026 
1027 
1040 ODE_API dReal dGeomBoxPointDepth (dGeomID box, dReal x, dReal y, dReal z);
1041 
1042 
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);
1047 
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);
1052 
1053 /* For now we want to have a backwards compatible C-API, note: C++ API is not.*/
1054 #define dCreateCCylinder dCreateCapsule
1055 #define dGeomCCylinderSetParams dGeomCapsuleSetParams
1056 #define dGeomCCylinderGetParams dGeomCapsuleGetParams
1057 #define dGeomCCylinderPointDepth dGeomCapsulePointDepth
1058 #define dCCylinderClass dCapsuleClass
1059 
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);
1063 
1064 ODE_API dGeomID dCreateRay (dSpaceID space, 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);
1070 
1071 /*
1072  * Set/get ray flags that influence ray collision detection.
1073  * These flags are currently only noticed by the trimesh collider, because
1074  * they can make a major differences there.
1075  */
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);
1080 
1081 #include "collision_trimesh.h"
1082 
1083 ODE_API dGeomID dCreateGeomTransform (dSpaceID space);
1084 ODE_API void dGeomTransformSetGeom (dGeomID g, dGeomID obj);
1085 ODE_API dGeomID dGeomTransformGetGeom (dGeomID g);
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);
1090 
1091 
1092 /* ************************************************************************ */
1093 /* heightfield functions */
1094 
1095 
1096 /* Data storage for heightfield data.*/
1097 struct dxHeightfieldData;
1098 typedef struct dxHeightfieldData* dHeightfieldDataID;
1099 
1100 
1118 typedef dReal dHeightfieldGetHeight( void* p_user_data, int x, int z );
1119 
1120 
1121 
1141 ODE_API dGeomID dCreateHeightfield( dSpaceID space,
1142  dHeightfieldDataID data, int bPlaceable );
1143 
1144 
1157 ODE_API dHeightfieldDataID dGeomHeightfieldDataCreate(void);
1158 
1159 
1168 ODE_API void dGeomHeightfieldDataDestroy( dHeightfieldDataID d );
1169 
1170 
1171 
1212 ODE_API void dGeomHeightfieldDataBuildCallback( dHeightfieldDataID d,
1213  void* pUserData, dHeightfieldGetHeight* pCallback,
1214  dReal width, dReal depth, int widthSamples, int depthSamples,
1215  dReal scale, dReal offset, dReal thickness, int bWrap );
1216 
1260 ODE_API void dGeomHeightfieldDataBuildByte( dHeightfieldDataID d,
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 );
1264 
1308 ODE_API void dGeomHeightfieldDataBuildShort( dHeightfieldDataID d,
1309  const short* pHeightData, int bCopyHeightData,
1310  dReal width, dReal depth, int widthSamples, int depthSamples,
1311  dReal scale, dReal offset, dReal thickness, int bWrap );
1312 
1358 ODE_API void dGeomHeightfieldDataBuildSingle( dHeightfieldDataID d,
1359  const float* pHeightData, int bCopyHeightData,
1360  dReal width, dReal depth, int widthSamples, int depthSamples,
1361  dReal scale, dReal offset, dReal thickness, int bWrap );
1362 
1408 ODE_API void dGeomHeightfieldDataBuildDouble( dHeightfieldDataID d,
1409  const double* pHeightData, int bCopyHeightData,
1410  dReal width, dReal depth, int widthSamples, int depthSamples,
1411  dReal scale, dReal offset, dReal thickness, int bWrap );
1412 
1430 ODE_API void dGeomHeightfieldDataSetBounds( dHeightfieldDataID d,
1431  dReal minHeight, dReal maxHeight );
1432 
1433 
1444 ODE_API void dGeomHeightfieldSetHeightfieldData( dGeomID g, dHeightfieldDataID d );
1445 
1446 
1456 ODE_API dHeightfieldDataID dGeomHeightfieldGetHeightfieldData( dGeomID g );
1457 
1458 
1459 
1460 /* ************************************************************************ */
1461 /* utility functions */
1462 
1463 ODE_API void dClosestLineSegmentPoints (const dVector3 a1, const dVector3 a2,
1464  const dVector3 b1, const dVector3 b2,
1465  dVector3 cp1, dVector3 cp2);
1466 
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);
1470 
1471 /* The meaning of flags parameter is the same as in dCollide()*/
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,
1476  int flags, dContactGeom *contact, int skip);
1477 
1478 ODE_API void dInfiniteAABB (dGeomID geom, dReal aabb[6]);
1479 
1480 
1481 /* ************************************************************************ */
1482 /* custom classes */
1483 
1484 typedef void dGetAABBFn (dGeomID, dReal aabb[6]);
1485 typedef int dColliderFn (dGeomID o1, dGeomID o2,
1486  int flags, dContactGeom *contact, int skip);
1487 typedef dColliderFn * dGetColliderFnFn (int num);
1488 typedef void dGeomDtorFn (dGeomID o);
1489 typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]);
1490 
1491 typedef struct dGeomClass {
1492  int bytes;
1493  dGetColliderFnFn *collider;
1494  dGetAABBFn *aabb;
1495  dAABBTestFn *aabb_test;
1496  dGeomDtorFn *dtor;
1497 } dGeomClass;
1498 
1499 ODE_API int dCreateGeomClass (const dGeomClass *classptr);
1500 ODE_API void * dGeomGetClassData (dGeomID);
1501 ODE_API dGeomID dCreateGeom (int classnum);
1502 
1511 ODE_API void dSetColliderOverride (int i, int j, dColliderFn *fn);
1512 
1513 
1514 /* ************************************************************************ */
1515 
1516 #ifdef __cplusplus
1517 }
1518 #endif
1519 
1520 #endif
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
Describe the contact point between two geoms.
Definition: contact.h:88
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.