Xj3D VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLRigidBodyNodeType

All Superinterfaces:
FrameStateListener, VRMLNode, VRMLNodeType

public interface VRMLRigidBodyNodeType
extends VRMLNodeType

Representation of single RigidBody object in the rigid body physics model.

See the specification definition at http://www.xj3d.org/extensions/rigid_physics.html

Version:
$Revision: 1.3 $
Author:
Justin Couch

Method Summary
 VRMLNodeType[] getGeometry()
          Get the geometry list, provides a live reference not a copy.
 VRMLNodeType getMassDensityModel()
          Fetch the reference to the node that represents the mass density model.
 Body getODEBody()
          Get the ODE object that represents the body to evaluate.
 int numGeometry()
          Get the number of valid geometry that this body has as sub objects.
 void setGeometry(VRMLNodeType[] geometry, int numValid)
          Set the collection of geometry nodes that this body should use to render the main scene transformation.
 void setMassDensityModel(VRMLNodeType node)
          Set the node that should be used to represent the mass density model.
 void setODEWorld(World wld)
          Set the parent world that this body belongs to.
 void updateNodeFromODE()
          Update the local fields after the physics model has been evaluated.
 void updateODEFromNode()
          Update any pre-evaluation values for the body.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, getFieldValue, getMetadataObject, getRefCount, 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

setODEWorld

public void setODEWorld(World wld)
Set the parent world that this body belongs to. A null value clears the world and indicates the physics model or body is no longer in use by this world (eg deletes it).

Parameters:
wld - The new world instance to use or null

getODEBody

public Body getODEBody()
Get the ODE object that represents the body to evaluate.

Returns:
The body object representing this node

updateODEFromNode

public void updateODEFromNode()
Update any pre-evaluation values for the body. For example, forces applied to the body need to be reset every frame as ODE will zero out force and torque values after every frame.


updateNodeFromODE

public void updateNodeFromODE()
Update the local fields after the physics model has been evaluated. For example the position and orientation are most likely to have changed, so these should be read back from ODE and updated in the local fields.


numGeometry

public int numGeometry()
Get the number of valid geometry that this body has as sub objects.

Returns:
A number greater than or equal to zero

getGeometry

public VRMLNodeType[] getGeometry()
Get the geometry list, provides a live reference not a copy. The number of valid values is available from numGeometry();

Returns:
An array of VRMLNodeTypes

setGeometry

public void setGeometry(VRMLNodeType[] geometry,
                        int numValid)
Set the collection of geometry nodes that this body should use to render the main scene transformation. If passed a zero for numValid this method will remove all current values.

Geometry is allowed to be one of the grouping nodes or a shape node type. However, if you provide something like a LOD or Switch, don't expect anything to actually work correctly.

Parameters:
geometry - Array of new geometry 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 X3DRigidBodyNode instance

getMassDensityModel

public VRMLNodeType getMassDensityModel()
Fetch the reference to the node that represents the mass density model.

Returns:
The reference to the node defining the mass model

setMassDensityModel

public void setMassDensityModel(VRMLNodeType node)
                         throws InvalidFieldValueException
Set the node that should be used to represent the mass density model. Setting a value of null will clear the current model in use and return the system to a spherical model.

The valid body nodes are Sphere, Box and Cone.

Parameters:
node - The new instance to use or null
Throws:
InvalidFieldValueException - This was not a valid node type

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium