All Implemented Interfaces:
PoseChangeListener, EventListener

public class ODECapsule extends ODEBody
Wrapper for a ODE4J capsule.
  • Constructor Details

    • ODECapsule

      public ODECapsule()
    • ODECapsule

      public ODECapsule(String name)
  • Method Details

    • getComponents

      public void getComponents(List<JPanel> list)
      Description copied from class: Pose
      Build a Swing Component that represents this Node.
      Overrides:
      getComponents in class ODEBody
      Parameters:
      list - the list to add components to.
    • getRadius

      public double getRadius()
    • getLength

      public double getLength()
    • setRadiusAndLength

      public void setRadiusAndLength(double radius, double length)
      Sets the radius and the length, then updates the mesh.
      Parameters:
      radius -
      length -
    • setRadius

      public void setRadius(double radius)
      Sets the radius of the capsule. does not update the mesh.
      Parameters:
      radius -
    • setLength

      public void setLength(double length)
      Sets the length of the capsule. does not update the mesh.
      Parameters:
      length -
    • updateSize

      public void updateSize()
    • toJSON

      public org.json.JSONObject toJSON()
      Description copied from class: Node
      Serialize this node and its children to a JSON object and its children. Classes that override this method should call super.toJSON() first, then add to the object returned.
      Overrides:
      toJSON in class ODEBody
      Returns:
      the JSON object.
    • fromJSON

      public void fromJSON(org.json.JSONObject json)
      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 ODEBody
      Parameters:
      json - the JSON object to read from.