ODE  0.13.1
 All Data Structures Functions Variables Typedefs Enumerations Groups
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_DEPRECATED ODE_API void dGeomRaySetParams (dGeomID g, int FirstContact, int BackfaceCull);
1077 ODE_API_DEPRECATED ODE_API void dGeomRayGetParams (dGeomID g, int *FirstContact, int *BackfaceCull);
1078 ODE_API void dGeomRaySetFirstContact (dGeomID g, int firstContact);
1079 ODE_API int dGeomRayGetFirstContact (dGeomID g);
1080 ODE_API void dGeomRaySetBackfaceCull (dGeomID g, int backfaceCull);
1081 ODE_API int dGeomRayGetBackfaceCull (dGeomID g);
1082 ODE_API void dGeomRaySetClosestHit (dGeomID g, int closestHit);
1083 ODE_API int dGeomRayGetClosestHit (dGeomID g);
1084 
1085 #include "collision_trimesh.h"
1086 
1087 ODE_API_DEPRECATED ODE_API dGeomID dCreateGeomTransform (dSpaceID space);
1088 ODE_API_DEPRECATED ODE_API void dGeomTransformSetGeom (dGeomID g, dGeomID obj);
1089 ODE_API_DEPRECATED ODE_API dGeomID dGeomTransformGetGeom (dGeomID g);
1090 ODE_API_DEPRECATED ODE_API void dGeomTransformSetCleanup (dGeomID g, int mode);
1091 ODE_API_DEPRECATED ODE_API int dGeomTransformGetCleanup (dGeomID g);
1092 ODE_API_DEPRECATED ODE_API void dGeomTransformSetInfo (dGeomID g, int mode);
1093 ODE_API_DEPRECATED ODE_API int dGeomTransformGetInfo (dGeomID g);
1094 
1095 
1096 /* ************************************************************************ */
1097 /* heightfield functions */
1098 
1099 
1100 /* Data storage for heightfield data.*/
1101 struct dxHeightfieldData;
1102 typedef struct dxHeightfieldData* dHeightfieldDataID;
1103 
1104 
1122 typedef dReal dHeightfieldGetHeight( void* p_user_data, int x, int z );
1123 
1124 
1125 
1145 ODE_API dGeomID dCreateHeightfield( dSpaceID space,
1146  dHeightfieldDataID data, int bPlaceable );
1147 
1148 
1161 ODE_API dHeightfieldDataID dGeomHeightfieldDataCreate(void);
1162 
1163 
1172 ODE_API void dGeomHeightfieldDataDestroy( dHeightfieldDataID d );
1173 
1174 
1175 
1216 ODE_API void dGeomHeightfieldDataBuildCallback( dHeightfieldDataID d,
1217  void* pUserData, dHeightfieldGetHeight* pCallback,
1218  dReal width, dReal depth, int widthSamples, int depthSamples,
1219  dReal scale, dReal offset, dReal thickness, int bWrap );
1220 
1264 ODE_API void dGeomHeightfieldDataBuildByte( dHeightfieldDataID d,
1265  const unsigned char* pHeightData, int bCopyHeightData,
1266  dReal width, dReal depth, int widthSamples, int depthSamples,
1267  dReal scale, dReal offset, dReal thickness, int bWrap );
1268 
1312 ODE_API void dGeomHeightfieldDataBuildShort( dHeightfieldDataID d,
1313  const short* pHeightData, int bCopyHeightData,
1314  dReal width, dReal depth, int widthSamples, int depthSamples,
1315  dReal scale, dReal offset, dReal thickness, int bWrap );
1316 
1362 ODE_API void dGeomHeightfieldDataBuildSingle( dHeightfieldDataID d,
1363  const float* pHeightData, int bCopyHeightData,
1364  dReal width, dReal depth, int widthSamples, int depthSamples,
1365  dReal scale, dReal offset, dReal thickness, int bWrap );
1366 
1412 ODE_API void dGeomHeightfieldDataBuildDouble( dHeightfieldDataID d,
1413  const double* pHeightData, int bCopyHeightData,
1414  dReal width, dReal depth, int widthSamples, int depthSamples,
1415  dReal scale, dReal offset, dReal thickness, int bWrap );
1416 
1434 ODE_API void dGeomHeightfieldDataSetBounds( dHeightfieldDataID d,
1435  dReal minHeight, dReal maxHeight );
1436 
1437 
1448 ODE_API void dGeomHeightfieldSetHeightfieldData( dGeomID g, dHeightfieldDataID d );
1449 
1450 
1460 ODE_API dHeightfieldDataID dGeomHeightfieldGetHeightfieldData( dGeomID g );
1461 
1462 
1463 
1464 /* ************************************************************************ */
1465 /* utility functions */
1466 
1467 ODE_API void dClosestLineSegmentPoints (const dVector3 a1, const dVector3 a2,
1468  const dVector3 b1, const dVector3 b2,
1469  dVector3 cp1, dVector3 cp2);
1470 
1471 ODE_API int dBoxTouchesBox (const dVector3 _p1, const dMatrix3 R1,
1472  const dVector3 side1, const dVector3 _p2,
1473  const dMatrix3 R2, const dVector3 side2);
1474 
1475 /* The meaning of flags parameter is the same as in dCollide()*/
1476 ODE_API int dBoxBox (const dVector3 p1, const dMatrix3 R1,
1477  const dVector3 side1, const dVector3 p2,
1478  const dMatrix3 R2, const dVector3 side2,
1479  dVector3 normal, dReal *depth, int *return_code,
1480  int flags, dContactGeom *contact, int skip);
1481 
1482 ODE_API void dInfiniteAABB (dGeomID geom, dReal aabb[6]);
1483 
1484 
1485 /* ************************************************************************ */
1486 /* custom classes */
1487 
1488 typedef void dGetAABBFn (dGeomID, dReal aabb[6]);
1489 typedef int dColliderFn (dGeomID o1, dGeomID o2,
1490  int flags, dContactGeom *contact, int skip);
1491 typedef dColliderFn * dGetColliderFnFn (int num);
1492 typedef void dGeomDtorFn (dGeomID o);
1493 typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]);
1494 
1495 typedef struct dGeomClass {
1496  int bytes;
1497  dGetColliderFnFn *collider;
1498  dGetAABBFn *aabb;
1499  dAABBTestFn *aabb_test;
1500  dGeomDtorFn *dtor;
1501 } dGeomClass;
1502 
1503 ODE_API int dCreateGeomClass (const dGeomClass *classptr);
1504 ODE_API void * dGeomGetClassData (dGeomID);
1505 ODE_API dGeomID dCreateGeom (int classnum);
1506 
1515 ODE_API void dSetColliderOverride (int i, int j, dColliderFn *fn);
1516 
1517 
1518 /* ************************************************************************ */
1519 
1520 #ifdef __cplusplus
1521 }
1522 #endif
1523 
1524 #endif
void dGeomClearOffset(dGeomID geom)
Clear any offset from the geom.
unsigned long dGeomGetCollideBits(dGeomID)
Get the &quot;collide&quot; bitfield for the given geom.
void dGeomHeightfieldDataDestroy(dHeightfieldDataID d)
Destroys a dHeightfieldDataID.
void dGeomDisable(dGeomID geom)
Disable a geom.
unsigned long dGeomGetCategoryBits(dGeomID)
Get the &quot;category&quot; bitfield for the given geom.
const dReal * dGeomGetOffsetPosition(dGeomID geom)
Get the offset position vector of a geom.
dHeightfieldDataID dGeomHeightfieldDataCreate(void)
Creates a new empty dHeightfieldDataID.
void dGeomSetOffsetPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the local offset position of a geom from its body.
void dGeomSetCategoryBits(dGeomID geom, unsigned long bits)
Set the &quot;category&quot; bitfield for the given geom.
void dSetColliderOverride(int i, int j, dColliderFn *fn)
Sets a custom collider function for two geom classes.
void dSpaceCollide2(dGeomID space1, dGeomID space2, void *data, dNearCallback *callback)
Determines which geoms from one space may potentially intersect with geoms from another space...
int dGeomIsOffset(dGeomID geom)
Check to see whether the geom has an offset.
void dGeomSetOffsetRotation(dGeomID geom, const dMatrix3 R)
Set the local offset rotation matrix of a geom from its body.
Describe the contact point between two geoms.
Definition: contact.h:88
void dGeomCopyRotation(dGeomID geom, dMatrix3 R)
Get the rotation matrix of a placeable geom.
void dGeomGetOffsetQuaternion(dGeomID geom, dQuaternion result)
Get the offset rotation quaternion of a geom.
void dGeomGetPosRelPoint(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
takes a point in global coordinates and returns the point&#39;s position in geom-relative coordinates...
void dGeomSetCollideBits(dGeomID geom, unsigned long bits)
Set the &quot;collide&quot; bitfield for the given geom.
const dReal * dGeomGetPosition(dGeomID geom)
Get the position vector of a placeable geom.
void dGeomGetQuaternion(dGeomID geom, dQuaternion result)
Get the rotation quaternion of a placeable geom.
dSpaceID dGeomGetSpace(dGeomID)
Query for the space containing a particular geom.
void dGeomSetPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the position vector of a placeable geom.
dGeomID dCreateSphere(dSpaceID space, dReal radius)
Create a sphere geom of the given radius, and return its ID.
dReal dGeomSphereGetRadius(dGeomID sphere)
Retrieves the radius of a sphere geom.
dHeightfieldDataID dGeomHeightfieldGetHeightfieldData(dGeomID g)
Gets the dHeightfieldDataID bound to a heightfield geom.
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.
void dGeomBoxGetLengths(dGeomID box, dVector3 result)
Get the side lengths of a box.
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...
dReal dHeightfieldGetHeight(void *p_user_data, int x, int z)
Callback prototype.
Definition: collision.h:1122
void dGeomGetRelPointPos(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Get world position of a relative point on geom.
void dGeomSetData(dGeomID geom, void *data)
Set the user-defined data pointer stored in the geom.
void dGeomSetOffsetWorldPosition(dGeomID geom, dReal x, dReal y, dReal z)
Set the offset position of a geom from its body.
Definition: collision.h:1495
void dGeomCopyPosition(dGeomID geom, dVector3 pos)
Copy the position of a geom into a vector.
void dGeomSphereSetRadius(dGeomID sphere, dReal radius)
Set the radius of a sphere geom.
const dReal * dGeomGetOffsetRotation(dGeomID geom)
Get the offset rotation matrix of a geom.
void dGeomEnable(dGeomID geom)
Enable a geom.
void dSpaceCollide(dSpaceID space, void *data, dNearCallback *callback)
Determines which pairs of geoms in a space may potentially intersect, and calls the callback function...
void dGeomSetBody(dGeomID geom, dBodyID body)
Set the body associated with a placeable geom.
dReal dGeomSpherePointDepth(dGeomID sphere, dReal x, dReal y, dReal z)
Calculate the depth of the a given point within a sphere.
void dGeomSetQuaternion(dGeomID geom, const dQuaternion Q)
Set the rotation of a placeable geom.
void dNearCallback(void *data, dGeomID o1, dGeomID o2)
User callback for geom-geom collision testing.
Definition: collision_space.h:49
int dGeomIsSpace(dGeomID geom)
Determing if a geom is a space.
void dGeomSetOffsetWorldRotation(dGeomID geom, const dMatrix3 R)
Set the offset rotation of a geom from its body.
dBodyID dGeomGetBody(dGeomID geom)
Get the body associated with a placeable geom.
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...
const dReal * dGeomGetRotation(dGeomID geom)
Get the rotation matrix of a placeable geom.
void dGeomBoxSetLengths(dGeomID box, dReal lx, dReal ly, dReal lz)
Set the side lengths of the given box.
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.
int dGeomLowLevelControl(dGeomID geom, int controlClass, int controlCode, void *dataValue, int *dataSize)
Execute low level control operation for geometry.
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.
void dGeomHeightfieldSetHeightfieldData(dGeomID g, dHeightfieldDataID d)
Assigns a dHeightfieldDataID to a heightfield geom.
void dGeomVectorToWorld(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Convert from geom-local to world coordinates.
void dGeomHeightfieldDataSetBounds(dHeightfieldDataID d, dReal minHeight, dReal maxHeight)
Manually set the minimum and maximum height bounds.
void dGeomSetOffsetQuaternion(dGeomID geom, const dQuaternion Q)
Set the local offset rotation of a geom from its body.
void dGeomCopyOffsetRotation(dGeomID geom, dMatrix3 R)
Copy the offset rotation matrix of a geom.
void dGeomSetRotation(dGeomID geom, const dMatrix3 R)
Set the rotation matrix of a placeable geom.
dGeomID dCreateBox(dSpaceID space, dReal lx, dReal ly, dReal lz)
Create a box geom with the provided side lengths.
int dGeomGetClass(dGeomID geom)
Given a geom, this returns its class.
void dGeomSetOffsetWorldQuaternion(dGeomID geom, const dQuaternion)
Set the offset rotation of a geom from its body.
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...
void * dGeomGetData(dGeomID geom)
Get the user-defined data pointer stored in the geom.
dGeomID dCreateHeightfield(dSpaceID space, dHeightfieldDataID data, int bPlaceable)
Creates a heightfield geom.
void dGeomGetAABB(dGeomID geom, dReal aabb[6])
Return the axis-aligned bounding box.
int dGeomIsEnabled(dGeomID geom)
Check to see if a geom is enabled.
void dGeomCopyOffsetPosition(dGeomID geom, dVector3 pos)
Copy the offset position vector of a geom.
void dGeomVectorFromWorld(dGeomID geom, dReal px, dReal py, dReal pz, dVector3 result)
Convert from world to geom-local coordinates.
void dGeomDestroy(dGeomID geom)
Destroy a geom, removing it from any space.