Class Torus

java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.Torus
All Implemented Interfaces:
Savable, JmeCloneable, Cloneable

public class Torus extends Mesh
An ordinary (single holed) torus.

The center is by default the origin.

  • Constructor Details

    • Torus

      public Torus()
    • Torus

      public Torus(int circleSamples, int radialSamples, float innerRadius, float outerRadius)
      Constructs a new Torus. Center is the origin, but the Torus may be transformed.
      Parameters:
      circleSamples - The number of samples along the circles.
      radialSamples - The number of samples along the radial.
      innerRadius - minor radius of the torus
      outerRadius - major radius of the torus
  • Method Details

    • getCircleSamples

      public int getCircleSamples()
    • getInnerRadius

      public float getInnerRadius()
    • getOuterRadius

      public float getOuterRadius()
    • getRadialSamples

      public int getRadialSamples()
    • read

      public void read(JmeImporter importer) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Mesh
      Throws:
      IOException
    • updateGeometry

      public void updateGeometry(int circleSamples, int radialSamples, float innerRadius, float outerRadius)
      Rebuilds this torus based on a new set of parameters.
      Parameters:
      circleSamples - the number of samples along the circles.
      radialSamples - the number of samples along the radial.
      innerRadius - minor radius of the torus
      outerRadius - major radius of the torus
    • write

      public void write(JmeExporter e) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Mesh
      Throws:
      IOException