java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.RigidBody3D

public class RigidBody3D extends Node
RigidBody3D is a Node that represents a rigid body.
  • Constructor Details

    • RigidBody3D

      public RigidBody3D()
    • RigidBody3D

      public RigidBody3D(String name)
  • Method Details

    • getComponents

      public void getComponents(List<JPanel> list)
      Description copied from class: Node
      Build a Swing Component that represents this Node.
      Overrides:
      getComponents in class Node
      Parameters:
      list - the list to add components to.
    • 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 Node
      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 Node
      Parameters:
      json - the JSON object to read from.
    • getMass

      public double getMass()
    • setMass

      public void setMass(double mass)
      Set the mass of this rigid body.
      Parameters:
      mass - the mass of this rigid body.
      Throws:
      IllegalArgumentException - if mass is less than zero.