collision.h   collision.h 
skipping to change at line 536 skipping to change at line 536
* *
* @param geom the geom to query. * @param geom the geom to query.
* @param result a copy of the rotation quaternion. * @param result a copy of the rotation quaternion.
* @ingroup collide * @ingroup collide
*/ */
ODE_API void dGeomGetOffsetQuaternion (dGeomID geom, dQuaternion result); ODE_API void dGeomGetOffsetQuaternion (dGeomID geom, dQuaternion result);
/* ************************************************************************ */ /* ************************************************************************ */
/* collision detection */ /* collision detection */
/**
*
* @brief Given two geoms o1 and o2 that potentially intersect,
* generate contact information for them.
*
* Internally, this just calls the correct class-specific collision
* functions for o1 and o2.
*
* @param o1 The first geom to test.
* @param o2 The second geom to test.
*
* @param flags The flags specify how contacts should be generated if
* the geoms touch. The lower 16 bits of flags is an integer that
* specifies the maximum number of contact points to generate. Note
* that if this number is zero, this function just pretends that it is
* one -- in other words you can not ask for zero contacts. All other bits
* in flags must be zero. In the future the other bits may be used to
* select from different contact generation strategies.
*
* @param contact Points to an array of dContactGeom structures. The array
* must be able to hold at least the maximum number of contacts. These
* dContactGeom structures may be embedded within larger structures in the
* array -- the skip parameter is the byte offset from one dContactGeom to
* the next in the array. If skip is sizeof(dContactGeom) then contact
* points to a normal (C-style) array. It is an error for skip to be smalle
r
* than sizeof(dContactGeom).
*
* @returns If the geoms intersect, this function returns the number of con
tact
* points generated (and updates the contact array), otherwise it returns 0
* (and the contact array is not touched).
*
* @remarks If a space is passed as o1 or o2 then this function will collid
e
* all objects contained in o1 with all objects contained in o2, and return
* the resulting contact points. This method for colliding spaces with geom
s
* (or spaces with spaces) provides no user control over the individual
* collisions. To get that control, use dSpaceCollide or dSpaceCollide2 ins
tead.
*
* @remarks If o1 and o2 are the same geom then this function will do nothi
ng
* and return 0. Technically speaking an object intersects with itself, but
it
* is not useful to find contact points in this case.
*
* @remarks This function does not care if o1 and o2 are in the same space
or not
* (or indeed if they are in any space at all).
*
* @ingroup collide
*/
ODE_API int dCollide (dGeomID o1, dGeomID o2, int flags, dContactGeom *cont act, ODE_API int dCollide (dGeomID o1, dGeomID o2, int flags, dContactGeom *cont act,
int skip); int skip);
/**
* @brief Determines which pairs of geoms in a space may potentially inters
ect,
* and calls the callback function for each candidate pair.
*
* @param space The space to test.
*
* @param data Passed from dSpaceCollide directly to the callback
* function. Its meaning is user defined. The o1 and o2 arguments are the
* geoms that may be near each other.
*
* @param callback A callback function is of type @ref dNearCallback.
*
* @remarks Other spaces that are contained within the colliding space are
* not treated specially, i.e. they are not recursed into. The callback
* function may be passed these contained spaces as one or both geom
* arguments.
*
* @remarks dSpaceCollide() is guaranteed to pass all intersecting geom
* pairs to the callback function, but may also pass close but
* non-intersecting pairs. The number of these calls depends on the
* internal algorithms used by the space. Thus you should not expect
* that dCollide will return contacts for every pair passed to the
* callback.
*
* @sa dSpaceCollide2
* @ingroup collide
*/
ODE_API void dSpaceCollide (dSpaceID space, void *data, dNearCallback *call back); ODE_API void dSpaceCollide (dSpaceID space, void *data, dNearCallback *call back);
ODE_API void dSpaceCollide2 (dGeomID o1, dGeomID o2, void *data,
dNearCallback *callback); /**
* @brief Determines which geoms from one space may potentially intersect w
ith
* geoms from another space, and calls the callback function for each candi
date
* pair.
*
* @param space1 The first space to test.
*
* @param space2 The second space to test.
*
* @param data Passed from dSpaceCollide directly to the callback
* function. Its meaning is user defined. The o1 and o2 arguments are the
* geoms that may be near each other.
*
* @param callback A callback function is of type @ref dNearCallback.
*
* @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.
* when there are spaces that contain other spaces.
*
* @remarks Other spaces that are contained within the colliding space are
* not treated specially, i.e. they are not recursed into. The callback
* function may be passed these contained spaces as one or both geom
* arguments.
*
* @remarks dSpaceCollide2() is guaranteed to pass all intersecting geom
* pairs to the callback function, but may also pass close but
* non-intersecting pairs. The number of these calls depends on the
* internal algorithms used by the space. Thus you should not expect
* that dCollide will return contacts for every pair passed to the
* callback.
*
* @sa dSpaceCollide
* @ingroup collide
*/
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
}; };
/* class numbers - each geometry object needs a unique number */ /* class numbers - each geometry object needs a unique number */
enum { enum {
dSphereClass = 0, dSphereClass = 0,
dBoxClass, dBoxClass,
dCapsuleClass, dCapsuleClass,
dCylinderClass, dCylinderClass,
dPlaneClass, dPlaneClass,
dRayClass, dRayClass,
dConvexClass, dConvexClass,
dGeomTransformClass, dGeomTransformClass,
dTriMeshClass, dTriMeshClass,
dHeightfieldClass,
dFirstSpaceClass, dFirstSpaceClass,
dSimpleSpaceClass = dFirstSpaceClass, dSimpleSpaceClass = dFirstSpaceClass,
dHashSpaceClass, dHashSpaceClass,
dQuadTreeSpaceClass, dQuadTreeSpaceClass,
dLastSpaceClass = dQuadTreeSpaceClass, dLastSpaceClass = dQuadTreeSpaceClass,
dFirstUserClass, dFirstUserClass,
dLastUserClass = dFirstUserClass + dMaxUserClasses - 1, dLastUserClass = dFirstUserClass + dMaxUserClasses - 1,
dGeomNumClasses dGeomNumClasses
}; };
/**
* @defgroup collide_sphere Sphere Class
* @ingroup collide
*/
/**
* @brief Create a sphere geom of the given radius, and return its ID.
*
* @param space a space to contain the new geom. May be null.
* @param radius the radius of the sphere.
*
* @returns A new sphere geom.
*
* @remarks The point of reference for a sphere is its center.
*
* @sa dGeomDestroy
* @sa dGeomSphereSetRadius
* @ingroup collide_sphere
*/
ODE_API dGeomID dCreateSphere (dSpaceID space, dReal radius); ODE_API dGeomID dCreateSphere (dSpaceID space, dReal radius);
/**
* @brief Set the radius of a sphere geom.
*
* @param sphere the sphere to set.
* @param radius the new radius.
*
* @sa dGeomSphereGetRadius
* @ingroup collide_sphere
*/
ODE_API void dGeomSphereSetRadius (dGeomID sphere, dReal radius); ODE_API void dGeomSphereSetRadius (dGeomID sphere, dReal radius);
/**
* @brief Retrieves the radius of a sphere geom.
*
* @param sphere the sphere to query.
*
* @sa dGeomSphereSetRadius
* @ingroup collide_sphere
*/
ODE_API dReal dGeomSphereGetRadius (dGeomID sphere); ODE_API dReal dGeomSphereGetRadius (dGeomID sphere);
/**
* @brief Calculate the depth of the a given point within a sphere.
*
* @param sphere the sphere to query.
* @param x the X coordinate of the point.
* @param y the Y coordinate of the point.
* @param z the Z coordinate of the point.
*
* @returns The depth of the point. Points inside the sphere will have a
* positive depth, points outside it will have a negative depth, and points
* on the surface will have a depth of zero.
*
* @ingroup collide_sphere
*/
ODE_API dReal dGeomSpherePointDepth (dGeomID sphere, dReal x, dReal y, dRea l z); ODE_API dReal dGeomSpherePointDepth (dGeomID sphere, dReal x, dReal y, dRea l z);
//--> Convex Functions //--> Convex Functions
ODE_API dGeomID dCreateConvex (dSpaceID space, ODE_API dGeomID dCreateConvex (dSpaceID space,
dReal *_planes, dReal *_planes,
unsigned int _planecount, unsigned int _planecount,
dReal *_points, dReal *_points,
unsigned int _pointcount,unsigned int *_polyg ons); unsigned int _pointcount,unsigned int *_polyg ons);
ODE_API void dGeomSetConvex (dGeomID g, ODE_API void dGeomSetConvex (dGeomID g,
dReal *_planes, dReal *_planes,
unsigned int _count, unsigned int _count,
dReal *_points, dReal *_points,
unsigned int _pointcount,unsigned int *_polygon s); unsigned int _pointcount,unsigned int *_polygon s);
//<-- Convex Functions //<-- Convex Functions
/**
* @defgroup collide_box Box Class
* @ingroup collide
*/
/**
* @brief Create a box geom with the provided side lengths.
*
* @param space a space to contain the new geom. May be null.
* @param lx the length of the box along the X axis
* @param ly the length of the box along the Y axis
* @param lz the length of the box along the Z axis
*
* @returns A new box geom.
*
* @remarks The point of reference for a box is its center.
*
* @sa dGeomDestroy
* @sa dGeomBoxSetLengths
* @ingroup collide_box
*/
ODE_API dGeomID dCreateBox (dSpaceID space, dReal lx, dReal ly, dReal lz); ODE_API dGeomID dCreateBox (dSpaceID space, dReal lx, dReal ly, dReal lz);
/**
* @brief Set the side lengths of the given box.
*
* @param box the box to set
* @param lx the length of the box along the X axis
* @param ly the length of the box along the Y axis
* @param lz the length of the box along the Z axis
*
* @sa dGeomBoxGetLengths
* @ingroup collide_box
*/
ODE_API void dGeomBoxSetLengths (dGeomID box, dReal lx, dReal ly, dReal lz) ; ODE_API void dGeomBoxSetLengths (dGeomID box, dReal lx, dReal ly, dReal lz) ;
/**
* @brief Get the side lengths of a box.
*
* @param box the box to query
* @param result the returned side lengths
*
* @sa dGeomBoxSetLengths
* @ingroup collide_box
*/
ODE_API void dGeomBoxGetLengths (dGeomID box, dVector3 result); ODE_API void dGeomBoxGetLengths (dGeomID box, dVector3 result);
/**
* @brief Return the depth of a point in a box.
*
* @param box the box to query
* @param x the X coordinate of the point to test.
* @param y the Y coordinate of the point to test.
* @param z the Z coordinate of the point to test.
*
* @returns The depth of the point. Points inside the box will have a
* positive depth, points outside it will have a negative depth, and points
* on the surface will have a depth of zero.
*/
ODE_API dReal dGeomBoxPointDepth (dGeomID box, dReal x, dReal y, dReal z); ODE_API dReal dGeomBoxPointDepth (dGeomID box, dReal x, dReal y, dReal z);
ODE_API dGeomID dCreatePlane (dSpaceID space, dReal a, dReal b, dReal c, dR eal d); ODE_API dGeomID dCreatePlane (dSpaceID space, dReal a, dReal b, dReal c, dR eal d);
ODE_API void dGeomPlaneSetParams (dGeomID plane, dReal a, dReal b, dReal c, dReal d); ODE_API void dGeomPlaneSetParams (dGeomID plane, dReal a, dReal b, dReal c, dReal d);
ODE_API void dGeomPlaneGetParams (dGeomID plane, dVector4 result); ODE_API void dGeomPlaneGetParams (dGeomID plane, dVector4 result);
ODE_API dReal dGeomPlanePointDepth (dGeomID plane, dReal x, dReal y, dReal z); ODE_API dReal dGeomPlanePointDepth (dGeomID plane, dReal x, dReal y, dReal z);
ODE_API dGeomID dCreateCapsule (dSpaceID space, dReal radius, dReal length) ; ODE_API dGeomID dCreateCapsule (dSpaceID space, dReal radius, dReal length) ;
ODE_API void dGeomCapsuleSetParams (dGeomID ccylinder, dReal radius, dReal length); ODE_API void dGeomCapsuleSetParams (dGeomID ccylinder, dReal radius, dReal length);
ODE_API void dGeomCapsuleGetParams (dGeomID ccylinder, dReal *radius, dReal *length); ODE_API void dGeomCapsuleGetParams (dGeomID ccylinder, dReal *radius, dReal *length);
skipping to change at line 646 skipping to change at line 864
ODE_API dGeomID dCreateGeomTransform (dSpaceID space); ODE_API dGeomID dCreateGeomTransform (dSpaceID space);
ODE_API void dGeomTransformSetGeom (dGeomID g, dGeomID obj); ODE_API void dGeomTransformSetGeom (dGeomID g, dGeomID obj);
ODE_API dGeomID dGeomTransformGetGeom (dGeomID g); ODE_API dGeomID dGeomTransformGetGeom (dGeomID g);
ODE_API void dGeomTransformSetCleanup (dGeomID g, int mode); ODE_API void dGeomTransformSetCleanup (dGeomID g, int mode);
ODE_API int dGeomTransformGetCleanup (dGeomID g); ODE_API int dGeomTransformGetCleanup (dGeomID g);
ODE_API void dGeomTransformSetInfo (dGeomID g, int mode); ODE_API void dGeomTransformSetInfo (dGeomID g, int mode);
ODE_API int dGeomTransformGetInfo (dGeomID g); ODE_API int dGeomTransformGetInfo (dGeomID g);
/* ************************************************************************ */ /* ************************************************************************ */
/* heightfield functions */
// Data storage for heightfield data.
struct dxHeightfieldData;
typedef struct dxHeightfieldData* dHeightfieldDataID;
/**
* @brief Callback prototype
*
* Used by the callback heightfield data type to sample a height for a
* given cell position.
*
* @param p_user_data User data specified when creating the dHeightfieldDat
aID
* @param x The index of a sample in the local x axis. It is a value
* in the range zero to ( nWidthSamples - 1 ).
* @param x The index of a sample in the local z axis. It is a value
* in the range zero to ( nDepthSamples - 1 ).
*
* @return The sample height which is then scaled and offset using the
* values specified when the heightfield data was created.
*
* @ingroup collide
*/
typedef dReal dHeightfieldGetHeight( void* p_user_data, int x, int z );
/**
* @brief Creates a heightfield geom.
*
* Uses the information in the given dHeightfieldDataID to construct
* a geom representing a heightfield in a collision space.
*
* @param space The space to add the geom to.
* @param data The dHeightfieldDataID created by dGeomHeightfieldDataCreate
and
* setup by dGeomHeightfieldDataBuildCallback, dGeomHeightfieldDataBuildByt
e,
* dGeomHeightfieldDataBuildShort or dGeomHeightfieldDataBuildFloat.
* @param bPlaceable If non-zero this geom can be transformed in the world
using the
* usual functions such as dGeomSetPosition and dGeomSetRotation. If the ge
om is
* not set as placeable, then it uses a fixed orientation where the global
y axis
* represents the dynamic 'height' of the heightfield.
*
* @return A geom id to reference this geom in other calls.
*
* @ingroup collide
*/
ODE_API dGeomID dCreateHeightfield( dSpaceID space,
dHeightfieldDataID data, int bPlacea
ble );
/**
* @brief Creates a new empty dHeightfieldDataID.
*
* Allocates a new dHeightfieldDataID and returns it. You must call
* dGeomHeightfieldDataDestroy to destroy it after the geom has been remove
d.
* The dHeightfieldDataID value is used when specifying a data format type.
*
* @return A dHeightfieldDataID for use with dGeomHeightfieldDataBuildCallb
ack,
* dGeomHeightfieldDataBuildByte, dGeomHeightfieldDataBuildShort or
* dGeomHeightfieldDataBuildFloat.
* @ingroup collide
*/
ODE_API dHeightfieldDataID dGeomHeightfieldDataCreate();
/**
* @brief Destroys a dHeightfieldDataID.
*
* Deallocates a given dHeightfieldDataID and all managed resources.
*
* @param d A dHeightfieldDataID created by dGeomHeightfieldDataCreate
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataDestroy( dHeightfieldDataID d );
/**
* @brief Configures a dHeightfieldDataID to use a callback to
* retrieve height data.
*
* Before a dHeightfieldDataID can be used by a geom it must be
* configured to specify the format of the height data.
* This call specifies that the heightfield data is computed by
* the user and it should use the given callback when determining
* the height of a given element of it's shape.
*
* @param d A new dHeightfieldDataID created by dGeomHeightfieldDataCreate
*
* @param width Specifies the total 'width' of the heightfield along
* the geom's local x axis.
* @param depth Specifies the total 'depth' of the heightfield along
* the geom's local z axis.
*
* @param widthSamples Specifies the number of vertices to sample
* along the width of the heightfield. Each vertex has a corresponding
* height value which forms the overall shape.
* Naturally this value must be at least two or more.
* @param depthSamples Specifies the number of vertices to sample
* along the depth of the heightfield.
*
* @param scale A uniform scale applied to all raw height data.
* @param offset An offset applied to the scaled height data.
*
* @param thickness A value subtracted from the lowest height
* value which in effect adds an additional cuboid to the base of the
* heightfield. This is used to prevent geoms from looping under the
* desired terrain and not registering as a collision. Note that the
* thickness is not affected by the scale or offset parameters.
*
* @param bWrap If non-zero the heightfield will infinitely tile in both
* directions along the local x and z axes. If zero the heightfield is
* bounded from zero to width in the local x axis, and zero to depth in
* the local z axis.
*
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataBuildCallback( dHeightfieldDataID d,
void* pUserData, dHeightfieldGetHeight* pCal
lback,
dReal width, dReal depth, int widthSamples,
int depthSamples,
dReal scale, dReal offset, dReal thickness,
int bWrap );
/**
* @brief Configures a dHeightfieldDataID to use height data in byte format
.
*
* Before a dHeightfieldDataID can be used by a geom it must be
* configured to specify the format of the height data.
* This call specifies that the heightfield data is stored as a rectangular
* array of bytes (8 bit unsigned) representing the height at each sample p
oint.
*
* @param d A new dHeightfieldDataID created by dGeomHeightfieldDataCreate
*
* @param pHeightData A pointer to the height data.
* @param bCopyHeightData When non-zero the height data is copied to an
* internal store. When zero the height data is accessed by reference and
* so must persist throughout the lifetime of the heightfield.
*
* @param width Specifies the total 'width' of the heightfield along
* the geom's local x axis.
* @param depth Specifies the total 'depth' of the heightfield along
* the geom's local z axis.
*
* @param widthSamples Specifies the number of vertices to sample
* along the width of the heightfield. Each vertex has a corresponding
* height value which forms the overall shape.
* Naturally this value must be at least two or more.
* @param depthSamples Specifies the number of vertices to sample
* along the depth of the heightfield.
*
* @param scale A uniform scale applied to all raw height data.
* @param offset An offset applied to the scaled height data.
*
* @param thickness A value subtracted from the lowest height
* value which in effect adds an additional cuboid to the base of the
* heightfield. This is used to prevent geoms from looping under the
* desired terrain and not registering as a collision. Note that the
* thickness is not affected by the scale or offset parameters.
*
* @param bWrap If non-zero the heightfield will infinitely tile in both
* directions along the local x and z axes. If zero the heightfield is
* bounded from zero to width in the local x axis, and zero to depth in
* the local z axis.
*
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataBuildByte( dHeightfieldDataID d,
const unsigned char* pHeightData, int bCopyH
eightData,
dReal width, dReal depth, int widthSamples,
int depthSamples,
dReal scale, dReal offset, dReal thickness,
int bWrap );
/**
* @brief Configures a dHeightfieldDataID to use height data in short forma
t.
*
* Before a dHeightfieldDataID can be used by a geom it must be
* configured to specify the format of the height data.
* This call specifies that the heightfield data is stored as a rectangular
* array of shorts (16 bit signed) representing the height at each sample p
oint.
*
* @param d A new dHeightfieldDataID created by dGeomHeightfieldDataCreate
*
* @param pHeightData A pointer to the height data.
* @param bCopyHeightData When non-zero the height data is copied to an
* internal store. When zero the height data is accessed by reference and
* so must persist throughout the lifetime of the heightfield.
*
* @param width Specifies the total 'width' of the heightfield along
* the geom's local x axis.
* @param depth Specifies the total 'depth' of the heightfield along
* the geom's local z axis.
*
* @param widthSamples Specifies the number of vertices to sample
* along the width of the heightfield. Each vertex has a corresponding
* height value which forms the overall shape.
* Naturally this value must be at least two or more.
* @param depthSamples Specifies the number of vertices to sample
* along the depth of the heightfield.
*
* @param scale A uniform scale applied to all raw height data.
* @param offset An offset applied to the scaled height data.
*
* @param thickness A value subtracted from the lowest height
* value which in effect adds an additional cuboid to the base of the
* heightfield. This is used to prevent geoms from looping under the
* desired terrain and not registering as a collision. Note that the
* thickness is not affected by the scale or offset parameters.
*
* @param bWrap If non-zero the heightfield will infinitely tile in both
* directions along the local x and z axes. If zero the heightfield is
* bounded from zero to width in the local x axis, and zero to depth in
* the local z axis.
*
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataBuildShort( dHeightfieldDataID d,
const short* pHeightData, int bCopyHeightDat
a,
dReal width, dReal depth, int widthSamples,
int depthSamples,
dReal scale, dReal offset, dReal thickness,
int bWrap );
/**
* @brief Configures a dHeightfieldDataID to use height data in
* single precision floating point format.
*
* Before a dHeightfieldDataID can be used by a geom it must be
* configured to specify the format of the height data.
* This call specifies that the heightfield data is stored as a rectangular
* array of single precision floats representing the height at each
* sample point.
*
* @param d A new dHeightfieldDataID created by dGeomHeightfieldDataCreate
*
* @param pHeightData A pointer to the height data.
* @param bCopyHeightData When non-zero the height data is copied to an
* internal store. When zero the height data is accessed by reference and
* so must persist throughout the lifetime of the heightfield.
*
* @param width Specifies the total 'width' of the heightfield along
* the geom's local x axis.
* @param depth Specifies the total 'depth' of the heightfield along
* the geom's local z axis.
*
* @param widthSamples Specifies the number of vertices to sample
* along the width of the heightfield. Each vertex has a corresponding
* height value which forms the overall shape.
* Naturally this value must be at least two or more.
* @param depthSamples Specifies the number of vertices to sample
* along the depth of the heightfield.
*
* @param scale A uniform scale applied to all raw height data.
* @param offset An offset applied to the scaled height data.
*
* @param thickness A value subtracted from the lowest height
* value which in effect adds an additional cuboid to the base of the
* heightfield. This is used to prevent geoms from looping under the
* desired terrain and not registering as a collision. Note that the
* thickness is not affected by the scale or offset parameters.
*
* @param bWrap If non-zero the heightfield will infinitely tile in both
* directions along the local x and z axes. If zero the heightfield is
* bounded from zero to width in the local x axis, and zero to depth in
* the local z axis.
*
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataBuildSingle( dHeightfieldDataID d,
const float* pHeightData, int bCopyHeightDat
a,
dReal width, dReal depth, int widthSamples,
int depthSamples,
dReal scale, dReal offset, dReal thickness,
int bWrap );
/**
* @brief Configures a dHeightfieldDataID to use height data in
* double precision floating point format.
*
* Before a dHeightfieldDataID can be used by a geom it must be
* configured to specify the format of the height data.
* This call specifies that the heightfield data is stored as a rectangular
* array of double precision floats representing the height at each
* sample point.
*
* @param d A new dHeightfieldDataID created by dGeomHeightfieldDataCreate
*
* @param pHeightData A pointer to the height data.
* @param bCopyHeightData When non-zero the height data is copied to an
* internal store. When zero the height data is accessed by reference and
* so must persist throughout the lifetime of the heightfield.
*
* @param width Specifies the total 'width' of the heightfield along
* the geom's local x axis.
* @param depth Specifies the total 'depth' of the heightfield along
* the geom's local z axis.
*
* @param widthSamples Specifies the number of vertices to sample
* along the width of the heightfield. Each vertex has a corresponding
* height value which forms the overall shape.
* Naturally this value must be at least two or more.
* @param depthSamples Specifies the number of vertices to sample
* along the depth of the heightfield.
*
* @param scale A uniform scale applied to all raw height data.
* @param offset An offset applied to the scaled height data.
*
* @param thickness A value subtracted from the lowest height
* value which in effect adds an additional cuboid to the base of the
* heightfield. This is used to prevent geoms from looping under the
* desired terrain and not registering as a collision. Note that the
* thickness is not affected by the scale or offset parameters.
*
* @param bWrap If non-zero the heightfield will infinitely tile in both
* directions along the local x and z axes. If zero the heightfield is
* bounded from zero to width in the local x axis, and zero to depth in
* the local z axis.
*
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataBuildDouble( dHeightfieldDataID d,
const double* pHeightData, int bCopyHeightDa
ta,
dReal width, dReal depth, int widthSamples,
int depthSamples,
dReal scale, dReal offset, dReal thickness,
int bWrap );
/**
* @brief Manually set the minimum and maximum height bounds.
*
* This call allows you to set explicit min / max values after initial
* creation typically for callback heightfields which default to +/- infini
ty,
* or those whose data has changed. This must be set prior to binding with
a
* geom, as the the AABB is not recomputed after it's first generation.
*
* @remarks The minimum and maximum values are used to compute the AABB
* for the heightfield which is used for early rejection of collisions.
* A close fit will yield a more efficient collision check.
*
* @param d A dHeightfieldDataID created by dGeomHeightfieldDataCreate
* @param min_height The new minimum height value. Scale, offset and thickn
ess is then applied.
* @param max_height The new maximum height value. Scale and offset is then
applied.
* @ingroup collide
*/
ODE_API void dGeomHeightfieldDataSetBounds( dHeightfieldDataID d,
dReal minHeight, dReal maxHeight );
/**
* @brief Assigns a dHeightfieldDataID to a heightfield geom.
*
* Associates the given dHeightfieldDataID with a heightfield geom.
* This is done without affecting the GEOM_PLACEABLE flag.
*
* @param g A geom created by dCreateHeightfield
* @param d A dHeightfieldDataID created by dGeomHeightfieldDataCreate
* @ingroup collide
*/
ODE_API void dGeomHeightfieldSetHeightfieldData( dGeomID g, dHeightfieldDat
aID d );
/**
* @brief Gets the dHeightfieldDataID bound to a heightfield geom.
*
* Returns the dHeightfieldDataID associated with a heightfield geom.
*
* @param g A geom created by dCreateHeightfield
* @return The dHeightfieldDataID which may be NULL if none was assigned.
* @ingroup collide
*/
ODE_API dHeightfieldDataID dGeomHeightfieldGetHeightfieldData( dGeomID g );
/* ************************************************************************
*/
/* utility functions */ /* utility functions */
ODE_API void dClosestLineSegmentPoints (const dVector3 a1, const dVector3 a 2, ODE_API void dClosestLineSegmentPoints (const dVector3 a1, const dVector3 a 2,
const dVector3 b1, const dVector3 b2, const dVector3 b1, const dVector3 b2,
dVector3 cp1, dVector3 cp2); dVector3 cp1, dVector3 cp2);
ODE_API int dBoxTouchesBox (const dVector3 _p1, const dMatrix3 R1, ODE_API int dBoxTouchesBox (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);
 End of changes. 13 change blocks. 
2 lines changed or deleted 622 lines changed or added


 collision_space.h   collision_space.h 
skipping to change at line 34 skipping to change at line 34
#define _ODE_COLLISION_SPACE_H_ #define _ODE_COLLISION_SPACE_H_
#include <ode/common.h> #include <ode/common.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct dContactGeom; struct dContactGeom;
/**
* @brief User callback for geom-geom collision testing.
*
* @param data The user data object, as passed to dSpaceCollide.
* @param o1 The first geom being tested.
* @param o2 The second geom being test.
*
* @remarks The callback function can call dCollide on o1 and o2 to generat
e
* contact points between each pair. Then these contact points may be added
* to the simulation as contact joints. The user's callback function can of
* course chose not to call dCollide for any pair, e.g. if the user decides
* that those pairs should not interact.
*
* @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);
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);
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added


 common.h   common.h 
skipping to change at line 75 skipping to change at line 75
* is printed. * is printed.
* DEBUGMSG just prints out a message * DEBUGMSG just prints out a message
*/ */
#ifndef dNODEBUG #ifndef dNODEBUG
#ifdef __GNUC__ #ifdef __GNUC__
#define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ #define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \
"assertion \"" #a "\" failed in %s() [%s]",__FUNCTION__,__FILE__); "assertion \"" #a "\" failed in %s() [%s]",__FUNCTION__,__FILE__);
#define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ #define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \
msg " in %s()", __FUNCTION__); msg " in %s()", __FUNCTION__);
#define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, \ #define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT,
msg " in %s()", __FUNCTION__); \
msg " in %s() File %s Line %d", __FUNCTION__, __FILE__,__LINE__);
#else #else
#define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ #define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \
"assertion \"" #a "\" failed in %s:%d",__FILE__,__LINE__); "assertion \"" #a "\" failed in %s:%d",__FILE__,__LINE__);
#define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ #define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \
msg " (%s:%d)", __FILE__,__LINE__); msg " (%s:%d)", __FILE__,__LINE__);
#define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, \ #define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, \
msg " (%s:%d)", __FILE__,__LINE__); msg " (%s:%d)", __FILE__,__LINE__);
#endif #endif
#else #else
#define dIASSERT(a) ; #define dIASSERT(a) ;
skipping to change at line 190 skipping to change at line 190
#define dEFFICIENT_SIZE(x) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1) #define dEFFICIENT_SIZE(x) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)
/* alloca aligned to the EFFICIENT_ALIGNMENT. note that this can waste /* alloca aligned to the EFFICIENT_ALIGNMENT. note that this can waste
* up to 15 bytes per allocation, depending on what alloca() returns. * up to 15 bytes per allocation, depending on what alloca() returns.
*/ */
#define dALLOCA16(n) \ #define dALLOCA16(n) \
((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1)))))) ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))
// Use the error-checking memory allocation system. Becuase this system us es heap // 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 // (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 // simulate larger scenes, as well as handle out-of-memory errors in a som ewhat
// graceful manner // graceful manner
// #define dUSE_MALLOC_FOR_ALLOCA // #define dUSE_MALLOC_FOR_ALLOCA
#ifdef dUSE_MALLOC_FOR_ALLOCA #ifdef dUSE_MALLOC_FOR_ALLOCA
enum { enum {
d_MEMORY_OK = 0, /* no memory errors */ d_MEMORY_OK = 0, /* no memory errors */
d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */ d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */
skipping to change at line 244 skipping to change at line 244
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
}; };
/* 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;
 End of changes. 3 change blocks. 
4 lines changed or deleted 6 lines changed or added


 config.h   config.h 
skipping to change at line 196 skipping to change at line 196
/* Name of package */ /* Name of package */
#define PACKAGE "ODE" #define PACKAGE "ODE"
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "ode@q12.org" #define PACKAGE_BUGREPORT "ode@q12.org"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "ODE" #define PACKAGE_NAME "ODE"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "ODE 0.6.0-rc1" #define PACKAGE_STRING "ODE 0.6.1"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ode" #define PACKAGE_TARNAME "ode"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "0.6.0-rc1" #define PACKAGE_VERSION "0.6.1"
/* is this a pentium on a gcc-based platform? */ /* is this a pentium on a gcc-based platform? */
#define PENTIUM 1 #define PENTIUM 1
/* Define to the type of arg 1 for `select'. */ /* Define to the type of arg 1 for `select'. */
#define SELECT_TYPE_ARG1 int #define SELECT_TYPE_ARG1 int
/* Define to the type of args 2, 3 and 4 for `select'. */ /* Define to the type of args 2, 3 and 4 for `select'. */
#define SELECT_TYPE_ARG234 (fd_set *) #define SELECT_TYPE_ARG234 (fd_set *)
skipping to change at line 246 skipping to change at line 246
automatically deduced at run-time. automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */ STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */ /* #undef STACK_DIRECTION */
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version number of package */ /* Version number of package */
#define VERSION "0.6.0-rc1" #define VERSION "0.6.1"
/* Define to 1 if your processor stores words with the most significant byt e /* Define to 1 if your processor stores words with the most significant byt e
first (like Motorola and SPARC, unlike Intel and VAX). */ first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */ /* #undef WORDS_BIGENDIAN */
/* is this a X86_64 system on a gcc-based platform? */ /* is this a X86_64 system on a gcc-based platform? */
/* #undef X86_64_SYSTEM */ /* #undef X86_64_SYSTEM */
/* Define to 1 if the X Window System is missing or not being used. */ /* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */ /* #undef X_DISPLAY_MISSING */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 mass.h   mass.h 
skipping to change at line 35 skipping to change at line 35
#include <ode/common.h> #include <ode/common.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct dMass; struct dMass;
typedef struct dMass dMass; typedef struct dMass dMass;
/**
* Check if a mass structure has valid value.
* The function check if the mass and innertia matrix are positive definits
*
* @param m A mass structure to check
*
* @return 1 if both codition are met
*/
ODE_API int dMassCheck(const dMass *m);
ODE_API void dMassSetZero (dMass *); ODE_API void dMassSetZero (dMass *);
ODE_API void dMassSetParameters (dMass *, dReal themass, ODE_API void dMassSetParameters (dMass *, dReal themass,
dReal cgx, dReal cgy, dReal cgz, dReal cgx, dReal cgy, dReal cgz,
dReal I11, dReal I22, dReal I33, dReal I11, dReal I22, dReal I33,
dReal I12, dReal I13, dReal I23); dReal I12, dReal I13, dReal I23);
ODE_API void dMassSetSphere (dMass *, dReal density, dReal radius); ODE_API void dMassSetSphere (dMass *, dReal density, dReal radius);
ODE_API void dMassSetSphereTotal (dMass *, dReal total_mass, dReal radius); ODE_API void dMassSetSphereTotal (dMass *, dReal total_mass, dReal radius);
 End of changes. 1 change blocks. 
0 lines changed or deleted 10 lines changed or added


 objects.h   objects.h 
skipping to change at line 560 skipping to change at line 560
*/ */
ODE_API void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z); ODE_API void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z);
/** /**
* @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
*/ */
ODE_API const dReal * dBodyGetPosition (dBodyID); ODE_API const dReal * dBodyGetPosition (dBodyID);
/** /**
* @brief Copy the position of a body into a vector.
* @ingroup bodies
* @param body the body to query
* @param pos a copy of the body position
* @sa dBodyGetPosition
*/
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 Get the rotation of a body. * @brief Get the rotation of a body.
* @ingroup bodies * @ingroup bodies
* @return pointer to 4 scalars that represent the quaternion. * @return pointer to 4 scalars that represent the quaternion.
*/ */
ODE_API const dReal * dBodyGetQuaternion (dBodyID); ODE_API const dReal * dBodyGetQuaternion (dBodyID);
/** /**
* @brief Copy the orientation of a body into a quaternion.
* @ingroup bodies
* @param body the body to query
* @param quat a copy of the orientation quaternion
* @sa dBodyGetQuaternion
*/
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);
skipping to change at line 1010 skipping to change at line 1029
/** /**
* @brief Create a new joint of the L-motor type. * @brief Create a new joint of the L-motor 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 dJointCreateLMotor (dWorldID, dJointGroupID); ODE_API dJointID dJointCreateLMotor (dWorldID, dJointGroupID);
/** /**
* @brief Create a new joint of the plane-2d 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 dJointCreatePlane2D (dWorldID, dJointGroupID);
/**
* @brief Destroy a joint. * @brief Destroy a joint.
* @ingroup joints * @ingroup joints
* *
* disconnects it from its attached bodies and removing it from the world. * disconnects it from its attached bodies and removing it from the world.
* However, if the joint is a member of a group then this function has no * However, if the joint is a member of a group then this function has no
* effect - to destroy that joint the group must be emptied or destroyed. * effect - to destroy that joint the group must be emptied or destroyed.
*/ */
ODE_API void dJointDestroy (dJointID); ODE_API void dJointDestroy (dJointID);
/** /**
skipping to change at line 1331 skipping to change at line 1358
*/ */
ODE_API void dJointSetLMotorAxis (dJointID, int anum, int rel, dReal x, dRe al y, dReal z); ODE_API void dJointSetLMotorAxis (dJointID, int anum, int rel, dReal x, dRe al y, dReal z);
/** /**
* @brief set joint parameter * @brief set joint parameter
* @ingroup joints * @ingroup joints
*/ */
ODE_API void dJointSetLMotorParam (dJointID, int parameter, dReal value); ODE_API void dJointSetLMotorParam (dJointID, int parameter, dReal value);
/** /**
* @ingroup joints
*/
ODE_API void dJointSetPlane2DXParam (dJointID, int parameter, dReal value);
/**
* @ingroup joints
*/
ODE_API void dJointSetPlane2DYParam (dJointID, int parameter, dReal value);
/**
* @ingroup joints
*/
ODE_API void dJointSetPlane2DAngleParam (dJointID, int parameter, dReal val
ue);
/**
* @brief Get the joint anchor point, in world coordinates. * @brief Get the joint anchor point, in world coordinates.
* *
* This returns the point on body 1. If the joint is perfectly satisfied, * This returns the point on body 1. If the joint is perfectly satisfied,
* this will be the same as the point on body 2. * this will be the same as the point on body 2.
*/ */
ODE_API void dJointGetBallAnchor (dJointID, dVector3 result); ODE_API void dJointGetBallAnchor (dJointID, dVector3 result);
/** /**
* @brief Get the joint anchor point, in world coordinates. * @brief Get the joint anchor point, in world coordinates.
* *
 End of changes. 5 change blocks. 
0 lines changed or deleted 44 lines changed or added


 odemath.h   odemath.h 
skipping to change at line 43 skipping to change at line 43
/* /*
* macro to access elements i,j in an NxM matrix A, independent of the * macro to access elements i,j in an NxM matrix A, independent of the
* matrix storage convention. * matrix storage convention.
*/ */
#define dACCESS33(A,i,j) ((A)[(i)*4+(j)]) #define dACCESS33(A,i,j) ((A)[(i)*4+(j)])
/* /*
* Macro to test for valid floating point values * Macro to test for valid floating point values
*/ */
#define dVALIDVEC3(v) (!(dIsNan(v[0]) | dIsNan(v[1]) | dIsNan(v[2]))) #define dVALIDVEC3(v) (!(dIsNan(v[0]) || dIsNan(v[1]) || dIsNan(v[2])))
#define dVALIDVEC4(v) (!(dIsNan(v[0]) | dIsNan(v[2]) | dIsNan(v[2]) | dIsNa #define dVALIDVEC4(v) (!(dIsNan(v[0]) || dIsNan(v[2]) || dIsNan(v[2]) || dI
n(v[3]))) sNan(v[3])))
#define dVALIDMAT(m) (!(dIsNan(m[0]) | dIsNan(m[2]) | dIsNan(m[2]) | dIsNan #define dVALIDMAT3(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI
(m[3]) | dIsNan(m[4]) | dIsNan(m[5]) | dIsNan(m[6]) | dIsNan(m[7]) | dIsNan sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7])
(m[8]) | dIsNan(m[9]) | dIsNan(m[10]) | dIsNan(m[11]))) || dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11])))
#define dVALIDMAT4(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI
sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7])
|| dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11]) || dIsNan
(m[12]) || dIsNan(m[13]) || dIsNan(m[14]) || dIsNan(m[15]) ))
/*
* General purpose vector operations with other vectors or constants.
*/
#define dOP(a,op,b,c) \
(a)[0] = ((b)[0]) op ((c)[0]); \
(a)[1] = ((b)[1]) op ((c)[1]); \
(a)[2] = ((b)[2]) op ((c)[2]);
#define dOPC(a,op,b,c) \
(a)[0] = ((b)[0]) op (c); \
(a)[1] = ((b)[1]) op (c); \
(a)[2] = ((b)[2]) op (c);
#define dOPE(a,op,b) \
(a)[0] op ((b)[0]); \
(a)[1] op ((b)[1]); \
(a)[2] op ((b)[2]);
#define dOPEC(a,op,c) \
(a)[0] op (c); \
(a)[1] op (c); \
(a)[2] op (c);
/*
* Length, and squared length helpers. dLENGTH returns the length of a dVec
tor3.
* dLENGTHSQUARED return the squared length of a dVector3.
*/
#define dLENGTHSQUARED(a) (((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2])
*((a)[2]))
#ifdef __cplusplus
PURE_INLINE dReal dLENGTH (const dReal *a) { return dSqrt(dLENGTHSQUARED(a)
); }
#else
#define dLENGTH(a) ( dSqrt( ((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2]
)*((a)[2]) ) )
#endif /* __cplusplus */
/* /*
* 3-way dot product. dDOTpq means that elements of `a' and `b' are spaced * 3-way dot product. dDOTpq means that elements of `a' and `b' are spaced
* p and q indexes apart respectively. dDOT() means dDOT11. * p and q indexes apart respectively. dDOT() means dDOT11.
* in C++ we could use function templates to get all the versions of these * in C++ we could use function templates to get all the versions of these
* functions - but on some compilers this will result in sub-optimal code. * functions - but on some compilers this will result in sub-optimal code.
*/ */
#define dDOTpq(a,b,p,q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*( q)]) #define dDOTpq(a,b,p,q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*( q)])
 End of changes. 1 change blocks. 
6 lines changed or deleted 52 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/