Please review any and all PUBLIC repositories, groups, and associated files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Commit 73dc1eeb authored by Norbraten, Terry's avatar Norbraten, Terry
Browse files

[Terry N.] refactor for proper pre/post event model processing

parent 2693ab78
......@@ -164,13 +164,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
// Methods defined by NodeManager
//-------------------------------------------------------------
/**
* 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
*
* @return true if initialization was successful
*/
@Override
public boolean initialize() {
try {
......@@ -178,7 +171,7 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
Boolean ret_val = Boolean.FALSE;
try {
ret_val = !Odejava.init();
ret_val = Odejava.init();
} catch (NoClassDefFoundError ncdfe) {
System.err.println("Unable to initialise ODE due "
+ "to missing class definitions: "
......@@ -193,7 +186,7 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
System.err.println("Failed to partake priviledged action to load "
+ "odejava libs: " + pae.getMessage());
}
return !odeLoadFailed;
return odeLoadFailed;
}
@Override
......@@ -204,14 +197,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
}
}
/**
* 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.
*
* @param reporter The instance to use or null
*/
@Override
public void setErrorReporter(ErrorReporter reporter) {
errorReporter = reporter;
......@@ -221,19 +206,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
errorReporter = DefaultErrorReporter.getDefaultReporter();
}
/**
* Get the list of component names that this manager would normally manage.
* The component definition is assumed to be the same across all versions
* of the specifications that the browser supports. The level of the
* component is assumed to be the lowest level supported (ie if the given
* level fails, then levels above this cannot be supported, but those below
* can still be).
* <p>
* Mostly this is used for when initialization fails and we wish to disable
* support for loading of nodes in that component.
*
* @return The collection of components that this manager supports
*/
@Override
public ComponentInfo[] getSupportedComponents() {
return new ComponentInfo[] {
......@@ -241,24 +213,12 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
};
}
/**
* Set the VRMLClock instance in use by this manager. Ignored for this
* manager.
*
* @param clk A reference to the clock to use
*/
@Override
public void setVRMLClock(VRMLClock clk) {
clock = clk;
lastTime = clk.getWallTime();
}
/**
* 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 {@link VRMLClock} instance.
*/
@Override
public void resetTimeZero() {
lastTime = clock.getWallTime();
......@@ -267,12 +227,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
deltaT = 0.02f;
}
/**
* Get the list of node type IDs that this manager wants to handle. These
* should be the constants from {@link org.web3d.vrml.lang.TypeConstants}.
*
* @return A list of managed node identifiers
*/
@Override
public int[] getManagedNodeTypes() {
return MANAGED_NODE_TYPES;
......@@ -280,25 +234,14 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
@Override
public boolean evaluatePreEventModel() {
return initialize();
return true;
}
/**
* Ask whether this manager should run after the event model has been
* evaluated for this frame.
*
* @return true if this is post event model, false otherwise
*/
@Override
public boolean evaluatePostEventModel() {
return initialize();
return true;
}
/**
* Add a node of the require type to be managed.
*
* @param node The node instance to add for management
*/
@Override
public void addManagedNode(VRMLNodeType node) {
int type = node.getPrimaryType();
......@@ -371,11 +314,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
}
}
/**
* Remove a node of the require type to be managed.
*
* @param node The node instance to remove from management
*/
@Override
public void removeManagedNode(VRMLNodeType node) {
int type = node.getPrimaryType();
......@@ -434,13 +372,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
}
}
/**
* Run the pre-event modeling 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.
*
* @param time The timestamp of this frame to evaluate
*/
@Override
public void executePreEventModel(long time) {
......@@ -494,13 +425,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
}
}
/**
* Run the post-event modeling 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.
*
* @param time The timestamp of this frame to evaluate
*/
@Override
public void executePostEventModel(long time) {
......@@ -546,11 +470,6 @@ public class DefaultRigidBodyPhysicsManager implements NodeManager {
}
}
/**
* 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.
*/
@Override
public void clear() {
int size = joints.size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment