All Implemented Interfaces:
PoseChangeListener, EventListener
Direct Known Subclasses:
CreatureController, ODEBody, ODEJoint, ODEPlane

public class ODENode extends Pose

Base class for all Node that implement ODE4J.

ODE Nodes like ODEHinge need to be able to find the subject nodes to which the hinge connects. These subjects are not guaranteed to exist during load. They *are* guaranteed at the first call to update(double) after loading.

This class is responsible for calling onFirstUpdate() once at the start of the first update(double). No physics calculations should be done in the constructor or in onAttach().

the flag to run onFirstUpdate() again will be reset if:

  • the node is detached
  • the node is deserialized
  • Constructor Details

    • ODENode

      public ODENode()
    • ODENode

      public ODENode(String name)
  • Method Details

    • update

      public void update(double dt)
      Description copied from class: Node
      Called every frame.
      Overrides:
      update in class Node
      Parameters:
      dt - the time since the last frame.
    • fromJSON

      public void fromJSON(org.json.JSONObject from)
      Description copied from class: Node
      Deserialize this node and its children from a JSON object and its children. Classes that override this method should call super.fromJSON(). When they do it will trigger the creation of child nodes. The child nodes will then call their own fromJSON() methods.
      Overrides:
      fromJSON in class Pose
      Parameters:
      from - the JSON object to read from.