Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.runtime
Class DefaultHumanoidManager

java.lang.Object
  extended byorg.web3d.vrml.nodes.runtime.DefaultHumanoidManager
All Implemented Interfaces:
NodeManager

public class DefaultHumanoidManager
extends java.lang.Object
implements NodeManager

Manager for HAnimHumanoid nodes and their contained sets of children.

Keeps track of all humanoids and makes sure that they update every frame.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Constructor Summary
DefaultHumanoidManager()
          Create a new, empty instance of the humanoid manager.
 
Method Summary
 void addManagedNode(VRMLNodeType node)
          Add a node of the require type to be managed.
 void clear()
          Force clearing all currently managed nodes from this manager now.
 boolean evaluatePostEventModel()
          Ask whether this manager should run after the event model has been evaluated for this frame.
 boolean evaluatePreEventModel()
          Ask whether this manager needs to be run before the event model has been evaluated for this frame.
 void executePostEventModel(long time)
          Run the post-event modelling for this frame now.
 void executePreEventModel(long time)
          Run the pre-event modelling for this frame now.
 int[] getManagedNodeTypes()
          Get the list of node type IDs that this manager wants to handle.
 boolean initialize()
          Initialise the node manager now with any per-manager setup that is needed.
 void removeManagedNode(VRMLNodeType node)
          Remove a node of the require type to be managed.
 void resetTimeZero()
          Reset the local time zero for the manager.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 void setVRMLClock(VRMLClock clk)
          Set the VRMLClock instance in use by this manager.
 void shutdown()
          Shutdown the node manager now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHumanoidManager

public DefaultHumanoidManager()
Create a new, empty instance of the humanoid manager.

Method Detail

initialize

public boolean initialize()
Initialise the node manager now with any per-manager setup that is needed. If this returns false, then the node manager is assumed to have failed some part of the setup and will be removed from the system

Specified by:
initialize in interface NodeManager
Returns:
true if initialisation was successful

shutdown

public void shutdown()
Shutdown the node manager now. If this is using any external resources it should remove those now as the entire application is about to die

Specified by:
shutdown in interface NodeManager

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Specified by:
setErrorReporter in interface NodeManager
Parameters:
reporter - The instance to use or null

setVRMLClock

public void setVRMLClock(VRMLClock clk)
Set the VRMLClock instance in use by this manager. Ignored for this manager.

Specified by:
setVRMLClock in interface NodeManager
Parameters:
clk - A reference to the clock to use

resetTimeZero

public void resetTimeZero()
Reset the local time zero for the manager. This is called when a new root world has been loaded and any manager that needs to rely on delta time from the start of the world loading can reset it's local reference from the passed in VRMLClock instance.

Specified by:
resetTimeZero in interface NodeManager

getManagedNodeTypes

public int[] getManagedNodeTypes()
Get the list of node type IDs that this manager wants to handle. These should be the constants from TypeConstants.

Specified by:
getManagedNodeTypes in interface NodeManager
Returns:
A list of managed node identifiers

evaluatePreEventModel

public boolean evaluatePreEventModel()
Ask whether this manager needs to be run before the event model has been evaluated for this frame.

Specified by:
evaluatePreEventModel in interface NodeManager
Returns:
true if this is to be run pre-event model, false otherwise

evaluatePostEventModel

public boolean evaluatePostEventModel()
Ask whether this manager should run after the event model has been evaluated for this frame.

Specified by:
evaluatePostEventModel in interface NodeManager
Returns:
true if this is post event model, false otherwise

addManagedNode

public void addManagedNode(VRMLNodeType node)
Add a node of the require type to be managed.

Specified by:
addManagedNode in interface NodeManager
Parameters:
node - The node instance to add for management

removeManagedNode

public void removeManagedNode(VRMLNodeType node)
Remove a node of the require type to be managed.

Specified by:
removeManagedNode in interface NodeManager
Parameters:
node - The node instance to add for management

executePreEventModel

public void executePreEventModel(long time)
Run the pre-event modelling for this frame now. This is a blocking call and does not return until the event model is complete for this frame. The time should be system clock time, not VRML time.

Specified by:
executePreEventModel in interface NodeManager
Parameters:
time - The timestamp of this frame to evaluate

executePostEventModel

public void executePostEventModel(long time)
Run the post-event modelling for this frame now. This is a blocking call and does not return until the event model is complete for this frame. The time should be system clock time, not VRML time.

Specified by:
executePostEventModel in interface NodeManager
Parameters:
time - The timestamp of this frame to evaluate

clear

public void clear()
Force clearing all currently managed nodes from this manager now. This is used to indicate that a new world is about to be loaded and everything should be cleaned out now.

Specified by:
clear in interface NodeManager

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium