|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ode4j.ode.OdeHelper
public abstract class OdeHelper
This is the general helper class for ode4j.
It provides:
initOde2()
Constructor Summary | |
---|---|
OdeHelper()
|
Method Summary | |
---|---|
static int |
allocateODEDataForThread(int uiAllocateFlags)
Deprecated. TZ I guess this can be removed? |
static boolean |
areConnected(DBody b1,
DBody b2)
Utility function. |
static boolean |
areConnectedExcluding(DBody body1,
DBody body2,
java.lang.Class<? extends DJoint>... jointType)
Utility function. |
static boolean |
checkConfiguration(java.lang.String extension)
Helper to check for a token in the ODE configuration string. |
static void |
closeODE()
Close ODE after it is not needed any more. |
static int |
collide(DGeom o1,
DGeom o2,
int flags,
DContactGeomBuffer contacts)
Given two geoms o1 and o2 that potentially intersect, generate contact information for them. |
static DJoint |
connectingJoint(DBody b1,
DBody b2)
|
static java.util.List<DJoint> |
connectingJointList(DBody b1,
DBody b2)
|
static DAMotorJoint |
createAMotorJoint(DWorld world)
Create a new joint of the A-motor type. |
static DAMotorJoint |
createAMotorJoint(DWorld world,
DJointGroup group)
Create a new joint of the A-motor type. |
static DBallJoint |
createBallJoint(DWorld world)
Create a new joint of the ball type. |
static DBallJoint |
createBallJoint(DWorld world,
DJointGroup group)
Create a new joint of the ball type. |
static DBody |
createBody(DWorld w)
Create a body in given world. |
static DBox |
createBox(double lx,
double ly,
double lz)
Create a box geom with the provided side lengths. |
static DBox |
createBox(DSpace space,
double lx,
double ly,
double lz)
Create a box geom with the provided side lengths. |
static DCapsule |
createCapsule(double radius,
double length)
|
static DCapsule |
createCapsule(DSpace space,
double radius,
double length)
|
static DContactJoint |
createContactJoint(DWorld world,
DContact c)
Create a new joint of the contact type. |
static DContactJoint |
createContactJoint(DWorld world,
DJointGroup group,
DContact c)
Create a new joint of the contact type. |
static DConvex |
createConvex(double[] planes,
int planecount,
double[] points,
int pointcount,
int[] polygons)
|
static DConvex |
createConvex(DSpace space,
double[] planes,
int planecount,
double[] points,
int pointcount,
int[] polygons)
|
static DCylinder |
createCylinder(double radius,
double length)
|
static DCylinder |
createCylinder(DSpace space,
double radius,
double length)
|
static DFixedJoint |
createFixedJoint(DWorld world)
Create a new joint of the fixed type. |
static DFixedJoint |
createFixedJoint(DWorld world,
DJointGroup group)
Create a new joint of the fixed type. |
static DGeomTransform |
createGeomTransform()
Deprecated. TZ: Please do not use DGeomTransform. |
static DGeomTransform |
createGeomTransform(DSpace space)
Deprecated. TZ: Please do not use DGeomTransform. |
static DHashSpace |
createHashSpace()
|
static DHashSpace |
createHashSpace(DSpace space)
|
static DHeightfield |
createHeightfield(DSpace space,
DHeightfieldData data,
boolean bPlaceable)
Creates a heightfield geom. |
static DHeightfieldData |
createHeightfieldData()
Creates a new empty dHeightfieldData. |
static DHinge2Joint |
createHinge2Joint(DWorld world)
Create a new joint of the hinge2 type. |
static DHinge2Joint |
createHinge2Joint(DWorld world,
DJointGroup group)
Create a new joint of the hinge2 type. |
static DHingeJoint |
createHingeJoint(DWorld world)
Create a new joint of the hinge type. |
static DHingeJoint |
createHingeJoint(DWorld world,
DJointGroup group)
Create a new joint of the hinge type. |
static DJoint.DJointFeedback |
createJointFeedback()
Create a new joint feedback. |
static DJointGroup |
createJointGroup()
Create a joint group. |
static DLMotorJoint |
createLMotorJoint(DWorld world)
Create a new joint of the L-motor type. |
static DLMotorJoint |
createLMotorJoint(DWorld world,
DJointGroup group)
Create a new joint of the L-motor type. |
static DMass |
createMass()
|
static DNullJoint |
createNullJoint(DWorld world)
|
static DNullJoint |
createNullJoint(DWorld world,
DJointGroup group)
|
static DPistonJoint |
createPistonJoint(DWorld world)
Create a new joint of the Piston type. |
static DPistonJoint |
createPistonJoint(DWorld world,
DJointGroup group)
Create a new joint of the Piston type. |
static DPlane |
createPlane(DSpace space,
double a,
double b,
double c,
double d)
|
static DPlane2DJoint |
createPlane2DJoint(DWorld world)
Create a new joint of the plane-2d type. |
static DPlane2DJoint |
createPlane2DJoint(DWorld world,
DJointGroup group)
Create a new joint of the plane-2d type. |
static DPRJoint |
createPRJoint(DWorld world)
Create a new joint of the PR (Prismatic and Rotoide) type. |
static DPRJoint |
createPRJoint(DWorld world,
DJointGroup group)
Create a new joint of the PR (Prismatic and Rotoide) type. |
static DPUJoint |
createPUJoint(DWorld world)
Create a new joint of the PU (Prismatic and Universal) type. |
static DPUJoint |
createPUJoint(DWorld world,
DJointGroup group)
Create a new joint of the PU (Prismatic and Universal) type. |
static DQuadTreeSpace |
createQuadTreeSpace(DSpace space,
DVector3C Center,
DVector3C Extents,
int Depth)
|
static DQuadTreeSpace |
createQuadTreeSpace(DVector3C Center,
DVector3C Extents,
int Depth)
|
static DRay |
createRay(DSpace space,
double length)
|
static DRay |
createRay(int length)
|
static DSapSpace |
createSapSpace(DSapSpace.AXES axes)
|
static DSapSpace |
createSapSpace(DSpace space,
DSapSpace.AXES axes)
|
static DSimpleSpace |
createSimpleSpace()
|
static DSimpleSpace |
createSimpleSpace(DSpace space)
|
static DSliderJoint |
createSliderJoint(DWorld world)
Create a new joint of the slider type. |
static DSliderJoint |
createSliderJoint(DWorld world,
DJointGroup group)
Create a new joint of the slider type. |
static DSphere |
createSphere(double radius)
Create a sphere geom of the given radius, and return its ID. |
static DSphere |
createSphere(DSpace space,
double radius)
Create a sphere geom of the given radius, and return its ID. |
static DTriMesh |
createTriMesh(DSpace space,
DTriMeshData Data,
DTriMesh.DTriCallback Callback,
DTriMesh.DTriArrayCallback ArrayCallback,
DTriMesh.DTriRayCallback RayCallback)
Trimesh class Construction. |
static DTriMeshData |
createTriMeshData()
These don't make much sense now, but they will later when we add more features. |
static DUniversalJoint |
createUniversalJoint(DWorld world)
Create a new joint of the universal type. |
static DUniversalJoint |
createUniversalJoint(DWorld world,
DJointGroup group)
Create a new joint of the universal type. |
static DWorld |
createWorld()
Create a new, empty world and return its ID number. |
static java.lang.String |
getConfiguration()
getConfiguration returns the specific ODE build configuration as a string of tokens. |
static java.lang.String |
getVersion()
|
static void |
initODE()
Deprecated. Please use initOde2() instead. |
static int |
initODE2(int uiInitFlags)
Initializes ODE library. |
static void |
setColliderOverride(int i,
int j,
DColliderFn fn)
Sets a custom collider function for two geom classes. |
static void |
spaceCollide(DSpace space,
java.lang.Object data,
DGeom.DNearCallback callback)
Determines which pairs of geoms in a space may potentially intersect, and calls the callback function for each candidate pair. |
static void |
spaceCollide2(DGeom space1,
DGeom space2,
java.lang.Object data,
DGeom.DNearCallback callback)
Determines which geoms from one space may potentially intersect with geoms from another space, and calls the callback function for each candidate pair. |
static void |
worldExportDIF(DWorld world,
java.io.File f,
java.lang.String string)
Deprecated. TZ: Currently not implemented. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OdeHelper()
Method Detail |
---|
public static DJointGroup createJointGroup()
public static DJoint.DJointFeedback createJointFeedback()
public static DAMotorJoint createAMotorJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DAMotorJoint createAMotorJoint(DWorld world)
public static DBallJoint createBallJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DBallJoint createBallJoint(DWorld world)
public static DContactJoint createContactJoint(DWorld world, DJointGroup group, DContact c)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DContactJoint createContactJoint(DWorld world, DContact c)
public static DFixedJoint createFixedJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DFixedJoint createFixedJoint(DWorld world)
public static DHingeJoint createHingeJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DHingeJoint createHingeJoint(DWorld world)
public static DHinge2Joint createHinge2Joint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DHinge2Joint createHinge2Joint(DWorld world)
public static DLMotorJoint createLMotorJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DLMotorJoint createLMotorJoint(DWorld world)
public static DNullJoint createNullJoint(DWorld world, DJointGroup group)
public static DNullJoint createNullJoint(DWorld world)
public static DPistonJoint createPistonJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given
joint group.public static DPistonJoint createPistonJoint(DWorld world)
public static DPlane2DJoint createPlane2DJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DPlane2DJoint createPlane2DJoint(DWorld world)
public static DPRJoint createPRJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DPRJoint createPRJoint(DWorld world)
public static DPUJoint createPUJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DPUJoint createPUJoint(DWorld world)
public static DSliderJoint createSliderJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DSliderJoint createSliderJoint(DWorld world)
public static DUniversalJoint createUniversalJoint(DWorld world, DJointGroup group)
group
- set to null to allocate the joint normally.
If it is nonzero the joint is allocated in the given joint group.public static DUniversalJoint createUniversalJoint(DWorld world)
public static DWorld createWorld()
public static DMass createMass()
public static DBody createBody(DWorld w)
public static DSimpleSpace createSimpleSpace()
public static DSimpleSpace createSimpleSpace(DSpace space)
public static DSapSpace createSapSpace(DSapSpace.AXES axes)
axes
- DSapSpace.AXES
public static DSapSpace createSapSpace(DSpace space, DSapSpace.AXES axes)
space
- axes
- DSapSpace.AXES
public static DHashSpace createHashSpace()
public static DHashSpace createHashSpace(DSpace space)
public static DQuadTreeSpace createQuadTreeSpace(DVector3C Center, DVector3C Extents, int Depth)
public static DQuadTreeSpace createQuadTreeSpace(DSpace space, DVector3C Center, DVector3C Extents, int Depth)
public static DBox createBox(double lx, double ly, double lz)
lx
- the length of the box along the X axisly
- the length of the box along the Y axislz
- the length of the box along the Z axis
DGeom.destroy()
,
DBox.setLengths(DVector3C)
,
DBox.setLengths(double, double, double)
public static DBox createBox(DSpace space, double lx, double ly, double lz)
space
- a space to contain the new geom. May be null.lx
- the length of the box along the X axisly
- the length of the box along the Y axislz
- the length of the box along the Z axis
DGeom.destroy()
,
DBox.setLengths(DVector3C)
,
DBox.setLengths(double, double, double)
public static DCapsule createCapsule(double radius, double length)
public static DCapsule createCapsule(DSpace space, double radius, double length)
public static DConvex createConvex(double[] planes, int planecount, double[] points, int pointcount, int[] polygons)
public static DConvex createConvex(DSpace space, double[] planes, int planecount, double[] points, int pointcount, int[] polygons)
public static DCylinder createCylinder(double radius, double length)
public static DCylinder createCylinder(DSpace space, double radius, double length)
public static DGeomTransform createGeomTransform()
public static DGeomTransform createGeomTransform(DSpace space)
public static DPlane createPlane(DSpace space, double a, double b, double c, double d)
public static DRay createRay(int length)
public static DRay createRay(DSpace space, double length)
public static DSphere createSphere(double radius)
radius
- the radius of the sphere.
DGeom.destroy()
,
DSphere.setRadius(double)
public static DSphere createSphere(DSpace space, double radius)
space
- a space to contain the new geom. May be null.radius
- the radius of the sphere.
DGeom.destroy()
,
DSphere.setRadius(double)
public static void initODE()
dInitODE is obsolete. dInitODE2 is to be used for library initialization. A call to dInitODE is equal to the following initialization sequence
initODE2(0);
allocateODEDataForThread(dAllocateMaskAll);
initODE2(int)
,
allocateODEDataForThread(int)
public static int initODE2(int uiInitFlags)
This function must be called to initialize ODE library before first use. If initialization succeeds the function may not be called again until library is closed with a call to dCloseODE.
The uiInitFlags parameter specifies initialization options to be used. These can be combination of zero or more dInitODEFlags flags.
uiInitFlags
- Initialization options bitmask
#initODEFlags
,
closeODE()
,
DSpace.setManualCleanup(int)
public static void closeODE()
The function is required to be called when program does not need ODE features any more. The call to dCloseODE releases all the resources allocated for library including all the thread local data that might be allocated for all the threads that were using ODE.
dCloseODE is a paired function for dInitODE2 and must only be called after successful library initialization.
initODE2(int)
,
#dCleanupODEAllDataForThread
public static int collide(DGeom o1, DGeom o2, int flags, DContactGeomBuffer contacts)
Internally, this just calls the correct class-specific collision functions for o1 and o2.
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).
public static boolean areConnected(DBody b1, DBody b2)
public static boolean areConnectedExcluding(DBody body1, DBody body2, java.lang.Class<? extends DJoint>... jointType)
body1
- A body to check.body2
- A body to check.jointType
- is a set of subclasses of DJoint.
This is useful for deciding whether to add contact joints between two bodies:
if they are already connected by non-contact joints then it may not be
appropriate to add contacts, however it is okay to add more contact between-
bodies that already have contacts.
public static boolean checkConfiguration(java.lang.String extension)
extension
- A configuration token, see dGetConfiguration for details
public static java.lang.String getConfiguration()
public static java.lang.String getVersion()
public static void worldExportDIF(DWorld world, java.io.File f, java.lang.String string)
world
- f
- string
- public static int allocateODEDataForThread(int uiAllocateFlags)
uiAllocateFlags
- Allocation options bitmask.
#dAllocateODEDataFlags
,
#dCleanupODEAllDataForThread
public static DHeightfield createHeightfield(DSpace space, DHeightfieldData data, boolean bPlaceable)
Uses the information in the given dHeightfieldData to construct a geom representing a heightfield in a collision space.
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.
public static DHeightfieldData createHeightfieldData()
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.
public static DTriMesh createTriMesh(DSpace space, DTriMeshData Data, DTriMesh.DTriCallback Callback, DTriMesh.DTriArrayCallback ArrayCallback, DTriMesh.DTriRayCallback RayCallback)
public static DTriMeshData createTriMeshData()
public static void spaceCollide(DSpace space, java.lang.Object data, DGeom.DNearCallback callback)
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.#spaceCollide2(DGeom, DGeom, Object, DNearCallback)
,
DSpace#collide(Object, DNearCallback)
public static void spaceCollide2(DGeom space1, DGeom space2, java.lang.Object data, DGeom.DNearCallback callback)
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.#spaceCollide(DSpace, Object, DNearCallback)
,
DSpace.setSublevel(int)
public static void setColliderOverride(int i, int j, DColliderFn fn)
i
- The first geom class handled by this colliderj
- The second geom class handled by this colliderfn
- The collider function to use to determine collisions.public static DJoint connectingJoint(DBody b1, DBody b2)
public static java.util.List<DJoint> connectingJointList(DBody b1, DBody b2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |