Xj3D VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLNBodyGroupNodeType

All Superinterfaces:
FrameStateListener, VRMLNode, VRMLNodeType

public interface VRMLNBodyGroupNodeType
extends VRMLNodeType

Representation of collection of collidable objects that can be evaluated as a single group. See the specification definition at http://www.xj3d.org/extensions/rigid_physics.html

A collection is the root node of a set of objects that can be interacted. This node does not have an equivalent X3D abstract node type.

In the interest of optimisations, the group can be told whether or not one or more sensors are interested in knowing the output of this node or not. If they are not, then there is no need to bring any of the results back up into the java world before pushing the values on into the rigid body model.

Version:
$Revision: 1.4 $
Author:
Justin Couch

Method Summary
 void applyContacts()
          Apply the contacts right now.
 void delete()
          This node is about to be deleted due to a change in loaded world.
 void evaluateCollisions()
          Tell the group to evaluate its contents now.
 BulkContact getContacts()
          Fetch the most recent set of contacts that have been evaluated for this space.
 boolean isEnabled()
          Is this group enabled for use right now?
 int numContacts()
          Fetch the number of contacts that were generated during the last evaluation.
 void setOwningWorld(World wld)
          Set the owning world for this collision space.
 
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

setOwningWorld

public void setOwningWorld(World wld)
Set the owning world for this collision space. This is a hack to get around a bad assumption made by ODE - that there is only ever one world current at time. This is the owner world of this collsion system.

Parameters:
wld - The world instance we're using.

evaluateCollisions

public void evaluateCollisions()
Tell the group to evaluate its contents now. This will generate contacts as needed.


delete

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


numContacts

public int numContacts()
Fetch the number of contacts that were generated during the last evaluation. Needed so that we can iterate through the BulkContact object returned from getContacts().

Returns:
A non-negative size indicator

getContacts

public BulkContact getContacts()
Fetch the most recent set of contacts that have been evaluated for this space. The bulk object can be used to step through all the available contacts that were generated.

Returns:
The set of bulk contacts generated

applyContacts

public void applyContacts()
Apply the contacts right now. All processing is complete, so it's fine to continue the evaluation from before.


isEnabled

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

Returns:
true if this is enabled

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium