Class TrailMesh

All Implemented Interfaces:
Pickable, Hintable, Renderable, Savable

public class TrailMesh extends Mesh
TrailMesh
  • Constructor Details

    • TrailMesh

      public TrailMesh(String name, int nrTrailSections)
      Creates a new TrailMesh.
      Parameters:
      name - Name of Spatial
      nrTrailSections - Number of sections the TrailMesh should consist of. Number of vertices in the mesh will be nrTrailSections * 2.
  • Method Details

    • setTrailFront

      public void setTrailFront(Vector3 position, float width, float tpf)
      Update the front position of the trail.
      Parameters:
      position - New position of the trail front
      width - Width of the trail
      tpf - Current time per frame
    • setTrailFront

      public void setTrailFront(ReadOnlyVector3 position, ReadOnlyVector3 tangent, double width, double tpf)
      Update the front position of the trail.
      Parameters:
      position - New position of the trail front
      tangent - Specifies the gradient of the trail (if facingmode is set to tangent)
      width - Width of the trail
      tpf - Current time per frame
    • update

      public void update(ReadOnlyVector3 camPos)
      Update the vertices of the trail.
      Parameters:
      camPos - Camera position used for billboarding.
    • invalidate

      public void invalidate()
    • resetPosition

      public void resetPosition(ReadOnlyVector3 position)
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Mesh
      Parameters:
      capsule - the capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also:
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Mesh
      Parameters:
      capsule - the input capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also:
    • setUpdateSpeed

      public void setUpdateSpeed(float updateSpeed)
    • getUpdateSpeed

      public float getUpdateSpeed()
    • setUpdateMode

      public void setUpdateMode(TrailMesh.UpdateMode updateMode)
    • getUpdateMode

      public TrailMesh.UpdateMode getUpdateMode()
    • setFacingMode

      public void setFacingMode(TrailMesh.FacingMode facingMode)
    • getFacingMode

      public TrailMesh.FacingMode getFacingMode()
    • getTrailData

      public LinkedList<TrailMesh.TrailData> getTrailData()
      Get the mesh data to modify it manually. If data is modified, invalidate() method call is required.
      Returns:
      the mesh data