|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DGeom
Common base class for all geometries.
Nested Class Summary | |
---|---|
static class |
DGeom.COLLIDER_MERGE_CONTACTS_VALUE
|
static class |
DGeom.CONTROL_CLASS
|
static class |
DGeom.CONTROL_CODE
|
static interface |
DGeom.DataValue
Deprecated. not implemented yet. |
static interface |
DGeom.DNearCallback
User callback for geom-geom collision testing. |
Field Summary | |
---|---|
static int |
dBoxClass
|
static int |
dCapsuleClass
|
static int |
dConvexClass
|
static int |
dCylinderClass
|
static int |
dFirstSpaceClass
|
static int |
dFirstUserClass
ID of the first user defined class. |
static int |
dGeomNumClasses
|
static int |
dGeomTransformClass
|
static int |
dHashSpaceClass
|
static int |
dHeightfieldClass
|
static int |
dLastSpaceClass
|
static int |
dLastUserClass
|
static int |
dMaxUserClasses
the maximum number of user classes that are supported. |
static int |
dPlaneClass
|
static int |
dQuadTreeSpaceClass
|
static int |
dRayClass
|
static int |
dSimpleSpaceClass
|
static int |
dSphereClass
class numbers - each geometry object needs a unique number. |
static int |
dSweepAndPruneSpaceClass
|
static int |
dTriMeshClass
|
Method Summary | |
---|---|
void |
clearOffset()
Clear any offset from the geom. |
void |
collide2(DGeom g,
java.lang.Object data,
DGeom.DNearCallback callback)
|
void |
copyOffsetPosition(DVector3 pos)
Copy the offset position vector of a geom. |
void |
copyOffsetRotation(DMatrix3 R)
Copy the offset rotation matrix of a geom. |
void |
copyPosition(DVector3 pos)
Copy the position of a geom into a vector. |
void |
copyRotation(DMatrix3 R)
Get the rotation matrix of a placeable geom. |
void |
destroy()
Destroy a geom, removing it from any space. |
void |
DESTRUCTOR()
|
void |
disable()
Disable a geom. |
void |
enable()
Enable a geom. |
DAABBC |
getAABB()
Return the axis-aligned bounding box. |
DBody |
getBody()
Get the body associated with a placeable geom. |
long |
getCategoryBits()
Get the "category" bitfield for the given geom. |
int |
getClassID()
Given a geom, this returns its class. |
long |
getCollideBits()
Get the "collide" bitfield for the given geom. |
java.lang.Object |
getData()
Get the user-defined data pointer stored in the geom. |
DVector3C |
getOffsetPosition()
Get the offset position vector of a geom. |
void |
getOffsetQuaternion(DQuaternion result)
Get the offset rotation quaternion of a geom. |
DMatrix3C |
getOffsetRotation()
Get the offset rotation matrix of a geom. |
DVector3C |
getPosition()
Get the position vector of a placeable geom. |
void |
getPosRelPoint(double px,
double py,
double pz,
DVector3 result)
Takes a point in global coordinates and returns the point's position in geom-relative coordinates. |
DQuaternionC |
getQuaternion()
Get the rotation quaternion of a placeable geom. |
void |
getRelPointPos(double px,
double py,
double pz,
DVector3 result)
Get world position of a relative point on geom. |
DMatrix3C |
getRotation()
Get the rotation matrix of a placeable geom. |
DSpace |
getSpace()
Query for the space containing a particular geom. |
boolean |
isEnabled()
Check to see if a geom is enabled. |
boolean |
isOffset()
Check to see whether the geom has an offset. |
boolean |
lowLevelControl(DGeom.CONTROL_CLASS controlClass,
DGeom.CONTROL_CODE controlCode,
DGeom.DataValue dataValue,
org.cpp4j.java.RefInt dataSize)
Execute low level control operation for geometry. |
void |
setBody(DBody body)
Set the body associated with a placeable geom. |
void |
setCategoryBits(long bits)
Set the "category" bitfield for the given geom. |
void |
setCollideBits(long bits)
Set the "collide" bitfield for the given geom. |
void |
setData(java.lang.Object data)
Set the user-defined data pointer stored in the geom. |
void |
setOffsetPosition(double x,
double y,
double z)
Set the local offset position of a geom from its body. |
void |
setOffsetQuaternion(DQuaternionC q)
Set the local offset rotation of a geom from its body. |
void |
setOffsetRotation(DMatrix3C R)
Set the local offset rotation matrix of a geom from its body. |
void |
setOffsetWorldPosition(double x,
double y,
double z)
Set the offset position of a geom from its body. |
void |
setOffsetWorldQuaternion(DQuaternionC q)
Set the offset rotation of a geom from its body. |
void |
setOffsetWorldRotation(DMatrix3C R)
Set the offset rotation of a geom from its body. |
void |
setPosition(double x,
double y,
double z)
Set the position vector of a placeable geom. |
void |
setPosition(DVector3C xyz)
Set the position vector of a placeable geom. |
void |
setQuaternion(DQuaternionC quat)
Set the rotation of a placeable geom. |
void |
setRotation(DMatrix3C R)
Set the rotation matrix of a placeable geom. |
void |
vectorFromWorld(double px,
double py,
double pz,
DVector3 result)
Convert from world to geom-local coordinates. |
void |
vectorToWorld(double px,
double py,
double pz,
DVector3 result)
Convert from geom-local to world coordinates. |
Field Detail |
---|
static final int dMaxUserClasses
static final int dSphereClass
static final int dBoxClass
static final int dCapsuleClass
static final int dCylinderClass
static final int dPlaneClass
static final int dRayClass
static final int dConvexClass
static final int dGeomTransformClass
static final int dTriMeshClass
static final int dHeightfieldClass
static final int dFirstSpaceClass
static final int dSimpleSpaceClass
static final int dHashSpaceClass
static final int dSweepAndPruneSpaceClass
static final int dQuadTreeSpaceClass
static final int dLastSpaceClass
static final int dFirstUserClass
static final int dLastUserClass
static final int dGeomNumClasses
Method Detail |
---|
void DESTRUCTOR()
void destroy()
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.
int getClassID()
The ODE classes are:
User-defined class will return their own number.
DSpace getSpace()
void setData(java.lang.Object data)
data
- the data pointer to be storedjava.lang.Object getData()
void setBody(DBody body)
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.
body
- the body to attach to the geomDBody getBody()
setBody(DBody)
void setPosition(double x, double y, double z)
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.
x
- the new X coordinate.y
- the new Y coordinate.z
- the new Z coordinate.DBody.setPosition(double, double, double)
void setPosition(DVector3C xyz)
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.
xyz
- the new X, Y and Z coordinate.DBody.setPosition(DVector3C)
DVector3C getPosition()
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.
DBody.getPosition()
void copyPosition(DVector3 pos)
pos
- a copy of the geom positiongetPosition()
void setRotation(DMatrix3C R)
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.
R
- the new rotation matrix.DBody.setRotation(DMatrix3C)
DMatrix3C getRotation()
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.
DBody.getRotation()
void copyRotation(DMatrix3 R)
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.
R
- a copy of the geom rotationgetRotation()
void setQuaternion(DQuaternionC quat)
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.
quat
- the new rotation.DBody.setQuaternion(DQuaternionC)
DQuaternionC getQuaternion()
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.
DBody.getQuaternion()
DAABBC getAABB()
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.
void setCategoryBits(long bits)
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.
bits
- the new bitfield valuevoid setCollideBits(long bits)
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.
bits
- the new bitfield valuelong getCategoryBits()
setCategoryBits(long)
long getCollideBits()
setCollideBits(long)
void enable()
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.
disable()
,
isEnabled()
void disable()
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.
enable()
,
isEnabled()
boolean isEnabled()
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.
disable()
,
enable()
void collide2(DGeom g, java.lang.Object data, DGeom.DNearCallback callback)
boolean lowLevelControl(DGeom.CONTROL_CLASS controlClass, DGeom.CONTROL_CODE controlCode, DGeom.DataValue dataValue, org.cpp4j.java.RefInt dataSize)
dGeomCommonAnyControlCode applies to any control class and returns success if
at least one control code is available for the given class with given geom.
Currently there are the folliwing control classes supported:
For dGeomColliderControlClass there are the following codes available:
controlClass
- the control classcontrolCode
- the control code for the classdataValue
- the control argument pointerdataSize
- the control argument size provided or expected
void getRelPointPos(double px, double py, double pz, DVector3 result)
result
- will contain the result.void getPosRelPoint(double px, double py, double pz, DVector3 result)
result
- will contain the result.void vectorToWorld(double px, double py, double pz, DVector3 result)
result
- will contain the result.void vectorFromWorld(double px, double py, double pz, DVector3 result)
result
- will contain the result.DVector3C getOffsetPosition()
Returns the positional offset of the geom in local coordinates. If the geom has no offset, this function returns the zero vector.
void copyOffsetPosition(DVector3 pos)
Returns the positional offset of the geom in local coordinates. If the geom has no offset, this function returns the zero vector.
pos
- returns the offset positionvoid setOffsetPosition(double x, double y, double z)
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.
x
- the new X coordinate.y
- the new Y coordinate.z
- the new Z coordinate.DMatrix3C getOffsetRotation()
Returns the rotational offset of the geom in local coordinates. If the geom has no offset, this function returns the identity matrix.
void copyOffsetRotation(DMatrix3 R)
Returns the rotational offset of the geom in local coordinates. If the geom has no offset, this function returns the identity matrix.
R
- returns the rotation matrix.void setOffsetRotation(DMatrix3C R)
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.
R
- the new rotation matrix.void getOffsetQuaternion(DQuaternion result)
result
- a copy of the rotation quaternion.void setOffsetQuaternion(DQuaternionC q)
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.
q
- the new rotation.void setOffsetWorldPosition(double x, double y, double z)
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.
x
- the new X coordinate.y
- the new Y coordinate.z
- the new Z coordinate.void setOffsetWorldRotation(DMatrix3C R)
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.
R
- the new rotation matrix.void setOffsetWorldQuaternion(DQuaternionC q)
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.
q
- the new rotation.void clearOffset()
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.
boolean isOffset()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |