public class MeshInstance extends Pose

A MeshInstance is a Pose containing a Mesh.

The local Pose information can be used to adjust the center of rotation.

  • Constructor Details

    • MeshInstance

      public MeshInstance()
    • MeshInstance

      public MeshInstance(String name)
  • Method Details

    • getComponents

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

      public void setMesh(Mesh mesh)
      Set the mesh for this instance.
      Parameters:
      mesh - the mesh to set.
    • getMesh

      public Mesh getMesh()
    • 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 Pose
      Returns:
      the JSON object.
    • 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.
    • adjustLocal

      public void adjustLocal()
    • intersect

      public RayHit intersect(Ray ray)
      transform the ray into local space and test for intersection.
      Parameters:
      ray - the ray in world space
      Returns:
      the ray hit in world space, or null if no hit.