Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLRigidBodyGroupNodeType

All Superinterfaces:
FrameStateListener, VRMLNode, VRMLNodeType

public interface VRMLRigidBodyGroupNodeType
extends VRMLNodeType

Representation of the top-level collection of RigidBody objects in Xj3D.

A collection of rigid bodies is a collective of nodes that are evaluated as a single set of conditions that need to be solved.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Method Summary
 void delete()
          This node is about to be deleted due to a change in loaded world.
 void evaluateModel()
          Instruct the group node to evaluate itself right now based on the given time delta from the last time this was evaluated.
 VRMLNodeType[] getBodies()
          Get the body list, provides a live reference not a copy.
 void getGravity(float[] gravity)
          Get the current gravity vector applying to this collection.
 VRMLNodeType[] getJoints()
          Get the joint list, provides a live reference not a copy.
 boolean isEnabled()
          Is this group enabled for use right now?
 int numBodies()
          Get the number of valid bodies that this collection has
 int numJoints()
          Get the number of valid joints that this collection has
 void processInputContacts()
          Go through the list of input contacts, process them and send them off to ODE.
 void setBodies(VRMLNodeType[] bodies, int numValid)
          Set the collection of RigidBody nodes that this collection should manage.
 void setGravity(float[] gravity)
          Set the global gravity direction for this collection.
 void setJoints(VRMLNodeType[] joints, int numValid)
          Set the collection of Joint nodes that this collection should manage.
 void setTimestep(float deltaT)
          Adjust the model's timestep to the new value (in seconds).
 void updatePostSimulation()
          Update everything from ODE, back into the node fields.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Method Detail

processInputContacts

void processInputContacts()
Go through the list of input contacts, process them and send them off to ODE.


setTimestep

void setTimestep(float deltaT)
Adjust the model's timestep to the new value (in seconds). This is called periodically to adjust the timestep made based on the current frame rate to adjust the model.

Parameters:
deltaT - The time change in seconds

evaluateModel

void evaluateModel()
Instruct the group node to evaluate itself right now based on the given time delta from the last time this was evaluated. Does not check to see if the model is enabled first. That should be done by the user code.


updatePostSimulation

void updatePostSimulation()
Update everything from ODE, back into the node fields. This is done at the start of the next frame so that all the events, listeners etc fire at the right time in the event model.


delete

void delete()
This node is about to be deleted due to a change in loaded world. Clear up the ODE resources in use.


isEnabled

boolean isEnabled()
Is this group enabled for use right now?

Returns:
true if this is enabled

setGravity

void setGravity(float[] gravity)
Set the global gravity direction for this collection.

Parameters:
gravity - An array of 3 values for the gravity vector

getGravity

void getGravity(float[] gravity)
Get the current gravity vector applying to this collection.

Parameters:
gravity - An array to copy the values into

numJoints

int numJoints()
Get the number of valid joints that this collection has

Returns:
A number greater than or equal to zero

getJoints

VRMLNodeType[] getJoints()
Get the joint list, provides a live reference not a copy. The number of valid values is available from numJoints();

Returns:
An array of VRMLNodeTypes

setJoints

void setJoints(VRMLNodeType[] joints,
               int numValid)
Set the collection of Joint nodes that this collection should manage. If passed a zero for numValid this method will remove all current values.

Parameters:
joints - Array of new joint node instances to use
numValid - The number of valid values to get from the array
Throws:
InvalidFieldValueException - one of the provided nodes is not a X3DRigidJointNode instance

numBodies

int numBodies()
Get the number of valid bodies that this collection has

Returns:
A number greater than or equal to zero

getBodies

VRMLNodeType[] getBodies()
Get the body list, provides a live reference not a copy. The number of valid values is available from numBodies();

Returns:
An array of VRMLNodeTypes

setBodies

void setBodies(VRMLNodeType[] bodies,
               int numValid)
Set the collection of RigidBody nodes that this collection should manage. If passed a zero for numValid this method will remove all current values.

Parameters:
bodies - Array of new body node instances to use
numValid - The number of valid values to get from the array
Throws:
InvalidFieldValueException - one of the provided nodes is not a VRMLRigitBodyNodeType instance

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium