org.ode4j.cpp.internal
Class ApiCppCollision

java.lang.Object
  extended by org.ode4j.cpp.internal.ApiCppTimer
      extended by org.ode4j.cpp.internal.ApiCppCollisionTrimesh
          extended by org.ode4j.cpp.internal.ApiCppCollisionSpace
              extended by org.ode4j.cpp.internal.ApiCppCollision
Direct Known Subclasses:
ApiCppExportDIF

public abstract class ApiCppCollision
extends ApiCppCollisionSpace


Nested Class Summary
static interface ApiCppCollision.dAABBTestFn
           
static class ApiCppCollision.dGeomClass
           
static interface ApiCppCollision.dGeomDtorFn
           
static interface ApiCppCollision.dGetAABBFn
           
static interface ApiCppCollision.dGetColliderFnFn
           
 
Field Summary
 
Fields inherited from class org.ode4j.cpp.internal.ApiCppCollisionSpace
dSAP_AXES_XYZ, dSAP_AXES_XZY, dSAP_AXES_YXZ, dSAP_AXES_YZX, dSAP_AXES_ZXY, dSAP_AXES_ZYX
 
Constructor Summary
ApiCppCollision()
           
 
Method Summary
static int dBoxBox(DVector3 p1, DMatrix3 R1, DVector3 side1, DVector3 p2, DMatrix3 R2, DVector3 side2, DVector3 normal, org.cpp4j.java.RefDouble depth, org.cpp4j.java.RefInt return_code, int flags, DContactGeomBuffer contacts)
           
static boolean dBoxTouchesBox(DVector3 p1, DMatrix3 R1, DVector3 side1, DVector3 p2, DMatrix3 R2, DVector3 side2)
           
static int dCollide(DGeom o1, DGeom o2, int flags, DContactGeomBuffer contacts)
           
static DBox dCreateBox(DSpace space, double lx, double ly, double lz)
           
static DCapsule dCreateCapsule(DSpace space, double radius, double length)
           
static DConvex dCreateConvex(DSpace space, double[] planes, int planecount, double[] points, int pointcount, int[] polygons)
           
static DCylinder dCreateCylinder(DSpace space, double radius, double length)
           
static DGeomTransform dCreateGeomTransform(DSpace space)
          TZ @deprecated (see Wiki)
static DGeom dCreateHeightfield(DSpace space, DHeightfieldData data, boolean bPlaceable)
           
static DPlane dCreatePlane(DSpace space, double a, double b, double c, double d)
           
static DRay dCreateRay(DSpace space, double length)
           
static DSphere dCreateSphere(DSpace space, double radius)
           
static void dGeomBoxGetLengths(DBox box, DVector3 result)
           
static double dGeomBoxPointDepth(DBox box, double x, double y, double z)
           
static void dGeomBoxSetLengths(DBox box, double lx, double ly, double lz)
           
static void dGeomCapsuleGetParams(DCapsule ccylinder, org.cpp4j.java.RefDouble radius, org.cpp4j.java.RefDouble length)
           
static double dGeomCapsulePointDepth(DCapsule ccylinder, double x, double y, double z)
           
static void dGeomCapsuleSetParams(DCapsule ccylinder, double radius, double length)
           
static void dGeomClearOffset(DGeom geom)
           
static void dGeomCopyOffsetPosition(DGeom geom, DVector3 pos)
           
static void dGeomCopyOffsetRotation(DGeom geom, DMatrix3 R)
           
static void dGeomCopyPosition(DGeom geom, DVector3 pos)
           
static void dGeomCopyRotation(DGeom geom, DMatrix3 R)
           
static void dGeomCylinderGetParams(DCylinder cylinder, org.cpp4j.java.RefDouble radius, org.cpp4j.java.RefDouble length)
           
static void dGeomCylinderSetParams(DCylinder cylinder, double radius, double length)
           
static void dGeomDestroy(DGeom geom)
           
static void dGeomDisable(DGeom geom)
           
static void dGeomEnable(DGeom geom)
           
static void dGeomGetAABB(DGeom geom, DAABB aabb)
           
static DBody dGeomGetBody(DGeom geom)
           
static long dGeomGetCategoryBits(DGeom geom)
           
static int dGeomGetClass(DGeom geom)
           
static long dGeomGetCollideBits(DGeom geom)
           
static java.lang.Object dGeomGetData(DGeom geom)
           
static DVector3C dGeomGetOffsetPosition(DGeom geom)
           
static void dGeomGetOffsetQuaternion(DGeom geom, DQuaternion result)
           
static DMatrix3C dGeomGetOffsetRotation(DGeom geom)
           
static DVector3C dGeomGetPosition(DGeom geom)
           
static void dGeomGetQuaternion(DGeom geom, DQuaternion result)
           
static DMatrix3C dGeomGetRotation(DGeom geom)
           
static DSpace dGeomGetSpace(DGeom geom)
           
static void dGeomHeightfieldDataBuildByte(DHeightfieldData d, byte[] pHeightData, boolean bCopyHeightData, double width, double depth, int widthSamples, int depthSamples, double scale, double offset, double thickness, boolean bWrap)
           
static void dGeomHeightfieldDataBuildCallback(DHeightfieldData d, java.lang.Object[] pUserData, DHeightfield.DHeightfieldGetHeight pCallback, double width, double depth, int widthSamples, int depthSamples, double scale, double offset, double thickness, boolean bWrap)
           
static DHeightfieldData dGeomHeightfieldDataCreate()
           
static void dGeomHeightfieldDataDestroy(DHeightfieldData d)
           
static void dGeomHeightfieldDataSetBounds(DHeightfieldData d, double minHeight, double maxHeight)
           
static DHeightfieldData dGeomHeightfieldGetHeightfieldData(DHeightfield g)
           
static void dGeomHeightfieldSetHeightfieldData(DHeightfield g, DHeightfieldData d)
           
static boolean dGeomIsEnabled(DGeom geom)
           
static boolean dGeomIsOffset(DGeom geom)
           
static boolean dGeomIsSpace(DGeom geom)
           
static void dGeomPlaneGetParams(DPlane plane, DVector4 result)
           
static double dGeomPlanePointDepth(DPlane plane, double x, double y, double z)
           
static void dGeomPlaneSetParams(DPlane plane, double a, double b, double c, double d)
           
static void dGeomRayGet(DRay ray, DVector3 start, DVector3 dir)
           
static boolean dGeomRayGetClosestHit(DRay g)
           
static double dGeomRayGetLength(DRay ray)
           
static void dGeomRayGetParams(DRay g, org.cpp4j.java.RefBoolean firstContact, org.cpp4j.java.RefBoolean backfaceCull)
           
static void dGeomRaySet(DRay ray, double px, double py, double pz, double dx, double dy, double dz)
           
static void dGeomRaySetClosestHit(DRay g, boolean closestHit)
           
static void dGeomRaySetLength(DRay ray, double length)
           
static void dGeomRaySetParams(DRay g, boolean firstContact, boolean backfaceCull)
          Set/get ray flags that influence ray collision detection.
static void dGeomSetBody(DGeom geom, DBody body)
           
static void dGeomSetCategoryBits(DGeom geom, long bits)
           
static void dGeomSetCollideBits(DGeom geom, long bits)
           
static void dGeomSetConvex(DConvex g, double[] _planes, int _count, double[] _points, int _pointcount, int[] _polygons)
           
static void dGeomSetData(DGeom geom, java.lang.Object data)
           
static void dGeomSetOffsetPosition(DGeom geom, double x, double y, double z)
           
static void dGeomSetOffsetQuaternion(DGeom geom, DQuaternionC Q)
           
static void dGeomSetOffsetRotation(DGeom geom, DMatrix3C R)
           
static void dGeomSetOffsetWorldPosition(DGeom geom, double x, double y, double z)
           
static void dGeomSetOffsetWorldQuaternion(DGeom geom, DQuaternionC q)
           
static void dGeomSetOffsetWorldRotation(DGeom geom, DMatrix3C R)
           
static void dGeomSetPosition(DGeom geom, double x, double y, double z)
           
static void dGeomSetQuaternion(DGeom geom, DQuaternionC quat)
           
static void dGeomSetRotation(DGeom geom, DMatrix3C R)
           
static double dGeomSphereGetRadius(DSphere sphere)
           
static double dGeomSpherePointDepth(DSphere sphere, double x, double y, double z)
           
static void dGeomSphereSetRadius(DSphere sphere, double radius)
           
static DGeom dGeomTransformGetGeom(DGeomTransform g)
          TZ @deprecated (see Wiki)
static void dGeomTransformSetCleanup(DGeomTransform g, boolean mode)
          TZ @deprecated (see Wiki)
static void dGeomTransformSetGeom(DGeomTransform g, DGeom obj)
          TZ @deprecated (see Wiki)
static void dSetColliderOverride(int i, int j, DColliderFn fn)
           
static void dSpaceCollide(DSpace space, java.lang.Object data, DGeom.DNearCallback callback)
           
static void dSpaceCollide2(DGeom space1, DGeom space2, java.lang.Object data, DGeom.DNearCallback callback)
           
 
Methods inherited from class org.ode4j.cpp.internal.ApiCppCollisionSpace
dHashSpaceCreate, dHashSpaceGetLevels, dHashSpaceSetLevels, dQuadTreeSpaceCreate, dSimpleSpaceCreate, dSpaceAdd, dSpaceClean, dSpaceDestroy, dSpaceGetCleanup, dSpaceGetGeom, dSpaceGetManualCleanup, dSpaceGetNumGeoms, dSpaceGetSublevel, dSpaceQuery, dSpaceRemove, dSpaceSetCleanup, dSpaceSetManualCleanup, dSpaceSetSublevel, dSweepAndPruneSpaceCreate
 
Methods inherited from class org.ode4j.cpp.internal.ApiCppCollisionTrimesh
dCreateTriMesh, dGeomTriMeshDataBuildSingle, dGeomTriMeshDataCreate, dGeomTriMeshDataDestroy, dGeomTriMeshSetLastTransform
 
Methods inherited from class org.ode4j.cpp.internal.ApiCppTimer
dTimerEnd, dTimerNow, dTimerReport, dTimerStart
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApiCppCollision

public ApiCppCollision()
Method Detail

dGeomDestroy

public static void dGeomDestroy(DGeom geom)
Parameters:
geom - the geom to be destroyed.
Brief:
Destroy a geom, removing it from any space. Destroy a geom, removing it from any space it is in first. This one function destroys a geom of any type, but to create a geom you must call a creation function for that type. When a space is destroyed, if its cleanup mode is 1 (the default) then all the geoms in that space are automatically destroyed as well.

dGeomSetData

public static void dGeomSetData(DGeom geom,
                                java.lang.Object data)
Parameters:
geom - the geom to hold the data
data - the data pointer to be stored
Brief:
Set the user-defined data pointer stored in the geom.

dGeomGetData

public static java.lang.Object dGeomGetData(DGeom geom)
Parameters:
geom - the geom containing the data
Brief:
Get the user-defined data pointer stored in the geom.

dGeomSetBody

public static void dGeomSetBody(DGeom geom,
                                DBody body)
Parameters:
geom - the geom to connect
body - the body to attach to the geom
Brief:
Set the body associated with a placeable geom. Setting a body on a geom automatically combines the position vector and rotation matrix of the body and geom, so that setting the position or orientation of one will set the value for both objects. Setting a body ID of zero gives the geom its own position and rotation, independent from any body. If the geom was previously connected to a body then its new independent position/rotation is set to the current position/rotation of the body. Calling these functions on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomGetBody

public static DBody dGeomGetBody(DGeom geom)
Parameters:
geom - the geom to query.
See Also:
dGeomSetBody(DGeom, DBody)
Brief:
Get the body associated with a placeable geom.

dGeomSetPosition

public static void dGeomSetPosition(DGeom geom,
                                    double x,
                                    double y,
                                    double z)
Parameters:
geom - the geom to set.
x - the new X coordinate.
y - the new Y coordinate.
z - the new Z coordinate.
See Also:
ApiCppBody.dBodySetPosition(DBody, double, double, double)
Brief:
Set the position vector of a placeable geom. If the geom is attached to a body, the body's position will also be changed. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomSetRotation

public static void dGeomSetRotation(DGeom geom,
                                    DMatrix3C R)
Parameters:
geom - the geom to set.
R - the new rotation matrix.
See Also:
ApiCppBody.dBodySetRotation(DBody, DMatrix3)
Brief:
Set the rotation matrix of a placeable geom. If the geom is attached to a body, the body's rotation will also be changed. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomSetQuaternion

public static void dGeomSetQuaternion(DGeom geom,
                                      DQuaternionC quat)
Parameters:
geom - the geom to set.
quat - the new rotation.
See Also:
ApiCppBody.dBodySetQuaternion(DBody, DQuaternion)
Brief:
Set the rotation of a placeable geom. If the geom is attached to a body, the body's rotation will also be changed. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomGetPosition

public static final DVector3C dGeomGetPosition(DGeom geom)
Parameters:
geom - the geom to query.
Returns:
A pointer to the geom's position vector.
See Also:
ApiCppBody.dBodyGetPosition(DBody)
Brief:
Get the position vector of a placeable geom. If the geom is attached to a body, the body's position will be returned. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.
Remark:
The returned value is a pointer to the geom's internal data structure. It is valid until any changes are made to the geom.

dGeomCopyPosition

public static void dGeomCopyPosition(DGeom geom,
                                     DVector3 pos)
Parameters:
geom - the geom to query
pos - a copy of the geom position
See Also:
dGeomGetPosition(DGeom)
Brief:
Copy the position of a geom into a vector.

dGeomGetRotation

public static final DMatrix3C dGeomGetRotation(DGeom geom)
Parameters:
geom - the geom to query.
Returns:
A pointer to the geom's rotation matrix.
See Also:
ApiCppBody.dBodyGetRotation(DBody)
Brief:
Get the rotation matrix of a placeable geom. If the geom is attached to a body, the body's rotation will be returned. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.
Remark:
The returned value is a pointer to the geom's internal data structure. It is valid until any changes are made to the geom.

dGeomCopyRotation

public static void dGeomCopyRotation(DGeom geom,
                                     DMatrix3 R)
Parameters:
geom - the geom to query.
R - a copy of the geom rotation
See Also:
dGeomGetRotation(DGeom)
Brief:
Get the rotation matrix of a placeable geom. If the geom is attached to a body, the body's rotation will be returned. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomGetQuaternion

public static void dGeomGetQuaternion(DGeom geom,
                                      DQuaternion result)
Parameters:
geom - the geom to query.
result - a copy of the rotation quaternion.
See Also:
ApiCppBody.dBodyGetQuaternion(DBody)
Brief:
Get the rotation quaternion of a placeable geom. If the geom is attached to a body, the body's quaternion will be returned. Calling this function on a non-placeable geom results in a runtime error in the debug build of ODE.

dGeomGetAABB

public static void dGeomGetAABB(DGeom geom,
                                DAABB aabb)
Parameters:
geom - the geom to query
aabb - the returned bounding box
Brief:
Return the axis-aligned bounding box. Return in aabb an axis aligned bounding box that surrounds the given geom. The aabb array has elements (minx, maxx, miny, maxy, minz, maxz). If the geom is a space, a bounding box that surrounds all contained geoms is returned. This function may return a pre-computed cached bounding box, if it can determine that the geom has not moved since the last time the bounding box was computed.

dGeomIsSpace

public static boolean dGeomIsSpace(DGeom geom)
Parameters:
geom - the geom to query
Returns:
Non-zero if the geom is a space, zero otherwise.
Brief:
Determing if a geom is a space.

dGeomGetSpace

public static DSpace dGeomGetSpace(DGeom geom)
Parameters:
geom - the geom to query
Returns:
The space that contains the geom, or NULL if the geom is not contained by a space.
Brief:
Query for the space containing a particular geom.

dGeomGetClass

public static int dGeomGetClass(DGeom geom)
Parameters:
geom - the geom to query
Returns:
The geom class ID.
Brief:
Given a geom, this returns its class. The ODE classes are:
  • dSphereClass
  • dBoxClass
  • dCylinderClass
  • dPlaneClass
  • dRayClass
  • dConvexClass
  • dGeomTransformClass
  • dTriMeshClass
  • dSimpleSpaceClass
  • dHashSpaceClass
  • dQuadTreeSpaceClass
  • dFirstUserClass
  • dLastUserClass User-defined class will return their own number.

  • dGeomSetCategoryBits

    public static void dGeomSetCategoryBits(DGeom geom,
                                            long bits)
    Parameters:
    geom - the geom to set
    bits - the new bitfield value
    Brief:
    Set the "category" bitfield for the given geom. The category bitfield is used by spaces to govern which geoms will interact with each other. The bitfield is guaranteed to be at least 32 bits wide. The default category values for newly created geoms have all bits set.

    dGeomSetCollideBits

    public static void dGeomSetCollideBits(DGeom geom,
                                           long bits)
    Parameters:
    geom - the geom to set
    bits - the new bitfield value
    Brief:
    Set the "collide" bitfield for the given geom. The collide bitfield is used by spaces to govern which geoms will interact with each other. The bitfield is guaranteed to be at least 32 bits wide. The default category values for newly created geoms have all bits set.

    dGeomGetCategoryBits

    public static long dGeomGetCategoryBits(DGeom geom)
    Parameters:
    geom - the geom to set
    Returns:
    the bitfield value
    See Also:
    dGeomSetCategoryBits(DGeom, long)
    Brief:
    Get the "category" bitfield for the given geom.

    dGeomGetCollideBits

    public static long dGeomGetCollideBits(DGeom geom)
    Parameters:
    geom - the geom to set
    Returns:
    the bitfield value
    See Also:
    dGeomSetCollideBits(DGeom, long)
    Brief:
    Get the "collide" bitfield for the given geom.

    dGeomEnable

    public static void dGeomEnable(DGeom geom)
    Parameters:
    geom - the geom to enable
    See Also:
    dGeomDisable(DGeom), dGeomIsEnabled(DGeom)
    Brief:
    Enable a geom. Disabled geoms are completely ignored by dSpaceCollide and dSpaceCollide2, although they can still be members of a space. New geoms are created in the enabled state.

    dGeomDisable

    public static void dGeomDisable(DGeom geom)
    Parameters:
    geom - the geom to disable
    See Also:
    dGeomDisable(DGeom), dGeomIsEnabled(DGeom)
    Brief:
    Disable a geom. Disabled geoms are completely ignored by dSpaceCollide and dSpaceCollide2, although they can still be members of a space. New geoms are created in the enabled state.

    dGeomIsEnabled

    public static boolean dGeomIsEnabled(DGeom geom)
    Parameters:
    geom - the geom to query
    Returns:
    Non-zero if the geom is enabled, zero otherwise.
    See Also:
    dGeomDisable(DGeom), dGeomIsEnabled(DGeom)
    Brief:
    Check to see if a geom is enabled. Disabled geoms are completely ignored by dSpaceCollide and dSpaceCollide2, although they can still be members of a space. New geoms are created in the enabled state.

    dGeomSetOffsetPosition

    public static void dGeomSetOffsetPosition(DGeom geom,
                                              double x,
                                              double y,
                                              double z)
    Parameters:
    geom - the geom to set.
    x - the new X coordinate.
    y - the new Y coordinate.
    z - the new Z coordinate.
    Brief:
    Set the local offset position of a geom from its body. Sets the geom's positional offset in local coordinates. After this call, the geom will be at a new position determined from the body's position and the offset. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomSetOffsetRotation

    public static void dGeomSetOffsetRotation(DGeom geom,
                                              DMatrix3C R)
    Parameters:
    geom - the geom to set.
    R - the new rotation matrix.
    Brief:
    Set the local offset rotation matrix of a geom from its body. Sets the geom's rotational offset in local coordinates. After this call, the geom will be at a new position determined from the body's position and the offset. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomSetOffsetQuaternion

    public static void dGeomSetOffsetQuaternion(DGeom geom,
                                                DQuaternionC Q)
    Parameters:
    geom - the geom to set.
    Q - the new rotation.
    Brief:
    Set the local offset rotation of a geom from its body. Sets the geom's rotational offset in local coordinates. After this call, the geom will be at a new position determined from the body's position and the offset. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomSetOffsetWorldPosition

    public static void dGeomSetOffsetWorldPosition(DGeom geom,
                                                   double x,
                                                   double y,
                                                   double z)
    Parameters:
    geom - the geom to set.
    x - the new X coordinate.
    y - the new Y coordinate.
    z - the new Z coordinate.
    Brief:
    Set the offset position of a geom from its body. Sets the geom's positional offset to move it to the new world coordinates. After this call, the geom will be at the world position passed in, and the offset will be the difference from the current body position. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomSetOffsetWorldRotation

    public static void dGeomSetOffsetWorldRotation(DGeom geom,
                                                   DMatrix3C R)
    Parameters:
    geom - the geom to set.
    R - the new rotation matrix.
    Brief:
    Set the offset rotation of a geom from its body. Sets the geom's rotational offset to orient it to the new world rotation matrix. After this call, the geom will be at the world orientation passed in, and the offset will be the difference from the current body orientation. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomSetOffsetWorldQuaternion

    public static void dGeomSetOffsetWorldQuaternion(DGeom geom,
                                                     DQuaternionC q)
    Parameters:
    geom - the geom to set.
    q - the new rotation.
    Brief:
    Set the offset rotation of a geom from its body. Sets the geom's rotational offset to orient it to the new world rotation matrix. After this call, the geom will be at the world orientation passed in, and the offset will be the difference from the current body orientation. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

    dGeomClearOffset

    public static void dGeomClearOffset(DGeom geom)
    Parameters:
    geom - the geom to have its offset destroyed.
    Brief:
    Clear any offset from the geom. If the geom has an offset, it is eliminated and the geom is repositioned at the body's position. If the geom has no offset, this function does nothing. This is more efficient than calling dGeomSetOffsetPosition(zero) and dGeomSetOffsetRotation(identiy), because this function actually eliminates the offset, rather than leaving it as the identity transform.

    dGeomIsOffset

    public static boolean dGeomIsOffset(DGeom geom)
    Parameters:
    geom - the geom to query.
    Returns:
    Non-zero if the geom has an offset, zero otherwise.
    Brief:
    Check to see whether the geom has an offset. This function will return non-zero if the offset has been created. Note that there is a difference between a geom with no offset, and a geom with an offset that is the identity transform. In the latter case, although the observed behaviour is identical, there is a unnecessary computation involved because the geom will be applying the transform whenever it needs to recalculate its world position.

    dGeomGetOffsetPosition

    public static DVector3C dGeomGetOffsetPosition(DGeom geom)
    Parameters:
    geom - the geom to query.
    Returns:
    A pointer to the geom's offset vector.
    Brief:
    Get the offset position vector of a geom. Returns the positional offset of the geom in local coordinates. If the geom has no offset, this function returns the zero vector.
    Remark:
    The returned value is a pointer to the geom's internal data structure. It is valid until any changes are made to the geom.

    dGeomCopyOffsetPosition

    public static void dGeomCopyOffsetPosition(DGeom geom,
                                               DVector3 pos)
    Parameters:
    geom - the geom to query.
    pos - returns the offset position
    Brief:
    Copy the offset position vector of a geom. Returns the positional offset of the geom in local coordinates. If the geom has no offset, this function returns the zero vector.

    dGeomGetOffsetRotation

    public static DMatrix3C dGeomGetOffsetRotation(DGeom geom)
    Parameters:
    geom - the geom to query.
    Returns:
    A pointer to the geom's offset rotation matrix.
    Brief:
    Get the offset rotation matrix of a geom. Returns the rotational offset of the geom in local coordinates. If the geom has no offset, this function returns the identity matrix.
    Remark:
    The returned value is a pointer to the geom's internal data structure. It is valid until any changes are made to the geom.

    dGeomCopyOffsetRotation

    public static void dGeomCopyOffsetRotation(DGeom geom,
                                               DMatrix3 R)
    Parameters:
    geom - the geom to query.
    R - returns the rotation matrix.
    Brief:
    Copy the offset rotation matrix of a geom. Returns the rotational offset of the geom in local coordinates. If the geom has no offset, this function returns the identity matrix.

    dGeomGetOffsetQuaternion

    public static void dGeomGetOffsetQuaternion(DGeom geom,
                                                DQuaternion result)
    Parameters:
    geom - the geom to query.
    result - a copy of the rotation quaternion.
    Brief:
    Get the offset rotation quaternion of a geom. Returns the rotation offset of the geom as a quaternion. If the geom has no offset, the identity quaternion is returned.

    dCollide

    public static int dCollide(DGeom o1,
                               DGeom o2,
                               int flags,
                               DContactGeomBuffer contacts)
    Parameters:
    o1 - The first geom to test.
    o2 - The second geom to test.
    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. You must ask for at least one contact. Additionally, following bits may be set: CONTACTS_UNIMPORTANT -- just generate any contacts (skip contact refining). All other bits in flags must be set to zero. In the future the other bits may be used to select from different contact generation strategies.
    contacts - 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 smaller than sizeof(dContactGeom).
    Returns:
    If the geoms intersect, this function returns the number of contact points generated (and updates the contact array), otherwise it returns 0 (and the contact array is not touched).
    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.
    Remark:
    If a space is passed as o1 or o2 then this function will collide all objects contained in o1 with all objects contained in o2, and return the resulting contact points. This method for colliding spaces with geoms (or spaces with spaces) provides no user control over the individual collisions. To get that control, use dSpaceCollide or dSpaceCollide2 instead., If o1 and o2 are the same geom then this function will do nothing and return 0. Technically speaking an object intersects with itself, but it is not useful to find contact points in this case., 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).

    dSpaceCollide

    public static void dSpaceCollide(DSpace space,
                                     java.lang.Object data,
                                     DGeom.DNearCallback callback)
    Parameters:
    space - The space to test.
    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.
    callback - A callback function is of type @ref dNearCallback.
    See Also:
    #dSpaceCollide2(DGeom, DGeom, Object, DNearCallback)
    Brief:
    Determines which pairs of geoms in a space may potentially intersect, and calls the callback function for each candidate pair.
    Remark:
    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., 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.

    dSpaceCollide2

    public static void dSpaceCollide2(DGeom space1,
                                      DGeom space2,
                                      java.lang.Object data,
                                      DGeom.DNearCallback callback)
    Parameters:
    space1 - The first space to test.
    space2 - The second space to test.
    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.
    callback - A callback function is of type @ref dNearCallback.
    See Also:
    #dSpaceCollide(DSpace, Object, DNearCallback), ApiCppCollisionSpace.dSpaceSetSublevel(DSpace, int)
    Brief:
    Determines which geoms from one space may potentially intersect with geoms from another space, and calls the callback function for each candidate pair.
    Remark:
    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., 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., Sublevel value of space affects how the spaces are iterated. Both spaces are recursed only if their sublevels match. Otherwise, only the space with greater sublevel is recursed and the one with lesser sublevel is used as a geom itself., 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.

    dCreateSphere

    public static DSphere dCreateSphere(DSpace space,
                                        double radius)
    Parameters:
    space - a space to contain the new geom. May be null.
    radius - the radius of the sphere.
    Returns:
    A new sphere geom.
    See Also:
    dGeomDestroy(DGeom), dGeomSphereSetRadius(DSphere, double)
    Brief:
    Create a sphere geom of the given radius, and return its ID.
    Remark:
    The point of reference for a sphere is its center.

    dGeomSphereSetRadius

    public static void dGeomSphereSetRadius(DSphere sphere,
                                            double radius)
    Parameters:
    sphere - the sphere to set.
    radius - the new radius.
    See Also:
    dGeomSphereGetRadius(DSphere)
    Brief:
    Set the radius of a sphere geom.

    dGeomSphereGetRadius

    public static double dGeomSphereGetRadius(DSphere sphere)
    Parameters:
    sphere - the sphere to query.
    See Also:
    dGeomSphereSetRadius(DSphere, double)
    Brief:
    Retrieves the radius of a sphere geom.

    dGeomSpherePointDepth

    public static double dGeomSpherePointDepth(DSphere sphere,
                                               double x,
                                               double y,
                                               double z)
    Parameters:
    sphere - the sphere to query.
    x - the X coordinate of the point.
    y - the Y coordinate of the point.
    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.
    Brief:
    Calculate the depth of the a given point within a sphere.

    dCreateConvex

    public static DConvex dCreateConvex(DSpace space,
                                        double[] planes,
                                        int planecount,
                                        double[] points,
                                        int pointcount,
                                        int[] polygons)

    dGeomSetConvex

    public static void dGeomSetConvex(DConvex g,
                                      double[] _planes,
                                      int _count,
                                      double[] _points,
                                      int _pointcount,
                                      int[] _polygons)

    dCreateBox

    public static DBox dCreateBox(DSpace space,
                                  double lx,
                                  double ly,
                                  double lz)
    Parameters:
    space - a space to contain the new geom. May be null.
    lx - the length of the box along the X axis
    ly - the length of the box along the Y axis
    lz - the length of the box along the Z axis
    Returns:
    A new box geom.
    See Also:
    dGeomDestroy(DGeom), dGeomBoxSetLengths(DBox, double, double, double)
    Brief:
    Create a box geom with the provided side lengths.
    Remark:
    The point of reference for a box is its center.

    dGeomBoxSetLengths

    public static void dGeomBoxSetLengths(DBox box,
                                          double lx,
                                          double ly,
                                          double lz)
    Parameters:
    box - the box to set
    lx - the length of the box along the X axis
    ly - the length of the box along the Y axis
    lz - the length of the box along the Z axis
    See Also:
    dGeomBoxGetLengths(DBox, DVector3)
    Brief:
    Set the side lengths of the given box.

    dGeomBoxGetLengths

    public static void dGeomBoxGetLengths(DBox box,
                                          DVector3 result)
    Parameters:
    box - the box to query
    result - the returned side lengths
    See Also:
    dGeomBoxSetLengths(DBox, double, double, double)
    Brief:
    Get the side lengths of a box.

    dGeomBoxPointDepth

    public static double dGeomBoxPointDepth(DBox box,
                                            double x,
                                            double y,
                                            double z)
    Parameters:
    box - the box to query
    x - the X coordinate of the point to test.
    y - the Y coordinate of the point to test.
    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.
    Brief:
    Return the depth of a point in a box.

    dCreatePlane

    public static DPlane dCreatePlane(DSpace space,
                                      double a,
                                      double b,
                                      double c,
                                      double d)

    dGeomPlaneSetParams

    public static void dGeomPlaneSetParams(DPlane plane,
                                           double a,
                                           double b,
                                           double c,
                                           double d)

    dGeomPlaneGetParams

    public static void dGeomPlaneGetParams(DPlane plane,
                                           DVector4 result)

    dGeomPlanePointDepth

    public static double dGeomPlanePointDepth(DPlane plane,
                                              double x,
                                              double y,
                                              double z)

    dCreateCapsule

    public static DCapsule dCreateCapsule(DSpace space,
                                          double radius,
                                          double length)

    dGeomCapsuleSetParams

    public static void dGeomCapsuleSetParams(DCapsule ccylinder,
                                             double radius,
                                             double length)

    dGeomCapsuleGetParams

    public static void dGeomCapsuleGetParams(DCapsule ccylinder,
                                             org.cpp4j.java.RefDouble radius,
                                             org.cpp4j.java.RefDouble length)

    dGeomCapsulePointDepth

    public static double dGeomCapsulePointDepth(DCapsule ccylinder,
                                                double x,
                                                double y,
                                                double z)

    dCreateCylinder

    public static DCylinder dCreateCylinder(DSpace space,
                                            double radius,
                                            double length)

    dGeomCylinderSetParams

    public static void dGeomCylinderSetParams(DCylinder cylinder,
                                              double radius,
                                              double length)

    dGeomCylinderGetParams

    public static void dGeomCylinderGetParams(DCylinder cylinder,
                                              org.cpp4j.java.RefDouble radius,
                                              org.cpp4j.java.RefDouble length)

    dCreateRay

    public static DRay dCreateRay(DSpace space,
                                  double length)

    dGeomRaySetLength

    public static void dGeomRaySetLength(DRay ray,
                                         double length)

    dGeomRayGetLength

    public static double dGeomRayGetLength(DRay ray)

    dGeomRaySet

    public static void dGeomRaySet(DRay ray,
                                   double px,
                                   double py,
                                   double pz,
                                   double dx,
                                   double dy,
                                   double dz)

    dGeomRayGet

    public static void dGeomRayGet(DRay ray,
                                   DVector3 start,
                                   DVector3 dir)

    dGeomRaySetParams

    public static void dGeomRaySetParams(DRay g,
                                         boolean firstContact,
                                         boolean backfaceCull)
    Set/get ray flags that influence ray collision detection. These flags are currently only noticed by the trimesh collider, because they can make a major differences there.


    dGeomRayGetParams

    public static void dGeomRayGetParams(DRay g,
                                         org.cpp4j.java.RefBoolean firstContact,
                                         org.cpp4j.java.RefBoolean backfaceCull)

    dGeomRaySetClosestHit

    public static void dGeomRaySetClosestHit(DRay g,
                                             boolean closestHit)

    dGeomRayGetClosestHit

    public static boolean dGeomRayGetClosestHit(DRay g)

    dCreateGeomTransform

    public static DGeomTransform dCreateGeomTransform(DSpace space)
    TZ @deprecated (see Wiki)


    dGeomTransformSetGeom

    public static void dGeomTransformSetGeom(DGeomTransform g,
                                             DGeom obj)
    TZ @deprecated (see Wiki)


    dGeomTransformGetGeom

    public static DGeom dGeomTransformGetGeom(DGeomTransform g)
    TZ @deprecated (see Wiki)


    dGeomTransformSetCleanup

    public static void dGeomTransformSetCleanup(DGeomTransform g,
                                                boolean mode)
    TZ @deprecated (see Wiki)


    dCreateHeightfield

    public static DGeom dCreateHeightfield(DSpace space,
                                           DHeightfieldData data,
                                           boolean bPlaceable)
    Parameters:
    space - The space to add the geom to.
    data - The dHeightfieldData created by dGeomHeightfieldDataCreate and setup by dGeomHeightfieldDataBuildCallback, dGeomHeightfieldDataBuildByte, dGeomHeightfieldDataBuildShort or dGeomHeightfieldDataBuildFloat.
    bPlaceable - If non-zero this geom can be transformed in the world using the usual functions such as dGeomSetPosition and dGeomSetRotation. If the geom is not set as placeable, then it uses a fixed orientation where the global y axis represents the dynamic 'height' of the heightfield.
    Returns:
    A geom id to reference this geom in other calls.
    Brief:
    Creates a heightfield geom. Uses the information in the given dHeightfieldData to construct a geom representing a heightfield in a collision space.

    dGeomHeightfieldDataCreate

    public static DHeightfieldData dGeomHeightfieldDataCreate()
    Returns:
    A dHeightfieldData for use with dGeomHeightfieldDataBuildCallback, dGeomHeightfieldDataBuildByte, dGeomHeightfieldDataBuildShort or dGeomHeightfieldDataBuildFloat.
    Brief:
    Creates a new empty dHeightfieldData. Allocates a new dHeightfieldData and returns it. You must call dGeomHeightfieldDataDestroy to destroy it after the geom has been removed. The dHeightfieldData value is used when specifying a data format type.

    dGeomHeightfieldDataDestroy

    public static void dGeomHeightfieldDataDestroy(DHeightfieldData d)
    Parameters:
    d - A dHeightfieldData created by dGeomHeightfieldDataCreate
    Brief:
    Destroys a dHeightfieldData. Deallocates a given dHeightfieldData and all managed resources.

    dGeomHeightfieldDataBuildCallback

    public static void dGeomHeightfieldDataBuildCallback(DHeightfieldData d,
                                                         java.lang.Object[] pUserData,
                                                         DHeightfield.DHeightfieldGetHeight pCallback,
                                                         double width,
                                                         double depth,
                                                         int widthSamples,
                                                         int depthSamples,
                                                         double scale,
                                                         double offset,
                                                         double thickness,
                                                         boolean bWrap)
    Parameters:
    d - A new dHeightfieldData created by dGeomHeightfieldDataCreate
    width - Specifies the total 'width' of the heightfield along the geom's local x axis.
    depth - Specifies the total 'depth' of the heightfield along the geom's local z axis.
    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.
    depthSamples - Specifies the number of vertices to sample along the depth of the heightfield.
    scale - A uniform scale applied to all raw height data.
    offset - An offset applied to the scaled height data.
    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.
    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.
    Brief:
    Configures a dHeightfieldData to use a callback to retrieve height data. Before a dHeightfieldData 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.

    dGeomHeightfieldDataBuildByte

    public static void dGeomHeightfieldDataBuildByte(DHeightfieldData d,
                                                     byte[] pHeightData,
                                                     boolean bCopyHeightData,
                                                     double width,
                                                     double depth,
                                                     int widthSamples,
                                                     int depthSamples,
                                                     double scale,
                                                     double offset,
                                                     double thickness,
                                                     boolean bWrap)
    Parameters:
    d - A new dHeightfieldData created by dGeomHeightfieldDataCreate
    pHeightData - A pointer to the height data.
    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.
    width - Specifies the total 'width' of the heightfield along the geom's local x axis.
    depth - Specifies the total 'depth' of the heightfield along the geom's local z axis.
    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.
    depthSamples - Specifies the number of vertices to sample along the depth of the heightfield.
    scale - A uniform scale applied to all raw height data.
    offset - An offset applied to the scaled height data.
    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.
    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.
    Brief:
    Configures a dHeightfieldData to use height data in byte format. Before a dHeightfieldData 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 point.

    dGeomHeightfieldDataSetBounds

    public static void dGeomHeightfieldDataSetBounds(DHeightfieldData d,
                                                     double minHeight,
                                                     double maxHeight)
    Parameters:
    d - A dHeightfieldData created by dGeomHeightfieldDataCreate
    minHeight - The new minimum height value. Scale, offset and thickness is then applied.
    maxHeight - The new maximum height value. Scale and offset is then applied.
    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 +/- infinity, 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.
    Remark:
    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.

    dGeomHeightfieldSetHeightfieldData

    public static void dGeomHeightfieldSetHeightfieldData(DHeightfield g,
                                                          DHeightfieldData d)
    Parameters:
    g - A geom created by dCreateHeightfield
    d - A dHeightfieldData created by dGeomHeightfieldDataCreate
    Brief:
    Assigns a dHeightfieldData to a heightfield geom. Associates the given dHeightfieldData with a heightfield geom. This is done without affecting the GEOM_PLACEABLE flag.

    dGeomHeightfieldGetHeightfieldData

    public static DHeightfieldData dGeomHeightfieldGetHeightfieldData(DHeightfield g)
    Parameters:
    g - A geom created by dCreateHeightfield
    Returns:
    The dHeightfieldData which may be NULL if none was assigned.
    Brief:
    Gets the dHeightfieldData bound to a heightfield geom. Returns the dHeightfieldData associated with a heightfield geom.

    dBoxTouchesBox

    public static boolean dBoxTouchesBox(DVector3 p1,
                                         DMatrix3 R1,
                                         DVector3 side1,
                                         DVector3 p2,
                                         DMatrix3 R2,
                                         DVector3 side2)

    dBoxBox

    public static int dBoxBox(DVector3 p1,
                              DMatrix3 R1,
                              DVector3 side1,
                              DVector3 p2,
                              DMatrix3 R2,
                              DVector3 side2,
                              DVector3 normal,
                              org.cpp4j.java.RefDouble depth,
                              org.cpp4j.java.RefInt return_code,
                              int flags,
                              DContactGeomBuffer contacts)

    dSetColliderOverride

    public static void dSetColliderOverride(int i,
                                            int j,
                                            DColliderFn fn)
    Parameters:
    i - The first geom class handled by this collider
    j - The second geom class handled by this collider
    fn - The collider function to use to determine collisions.
    Brief:
    Sets a custom collider function for two geom classes.