public class Cylinder extends ProceduralMesh

Cylinder is a Mesh. It has a diameter of 1 and a height of 1. The origin is at the center of the cylinder.

  • Field Details

    • RESOLUTION_CIRCULAR

      public static final int RESOLUTION_CIRCULAR
      See Also:
    • RESOLUTION_LENGTH

      public static final int RESOLUTION_LENGTH
      See Also:
    • radius0

      public float radius0
    • radius1

      public float radius1
    • height

      public float height
  • Constructor Details

    • Cylinder

      public Cylinder()
    • Cylinder

      public Cylinder(double height, double radius0, double radius1)
  • Method Details

    • getEnglishName

      public String getEnglishName()
      Specified by:
      getEnglishName in class ProceduralMesh
    • updateModel

      public void updateModel()
      Description copied from class: ProceduralMesh
      Procedurally generate a list of triangles and update the bounding box.
      Specified by:
      updateModel in class ProceduralMesh
    • toJSON

      public org.json.JSONObject toJSON()
      Overrides:
      toJSON in class ProceduralMesh
    • fromJSON

      public void fromJSON(org.json.JSONObject jo)
      Overrides:
      fromJSON in class ProceduralMesh
    • setRadiusAndLength

      public void setRadiusAndLength(double radius, double length)
      Sets both radius's and the length of the cylinder.
      Parameters:
      radius -
      length -
    • setLength

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

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