Class Torus

All Implemented Interfaces:
Pickable, Hintable, Renderable, Savable

public class Torus extends Mesh
  • Field Details

    • _circleSamples

      protected int _circleSamples
    • _radialSamples

      protected int _radialSamples
    • _tubeRadius

      protected double _tubeRadius
    • _centerRadius

      protected double _centerRadius
    • _viewInside

      protected boolean _viewInside
  • Constructor Details

    • Torus

      public Torus()
      private constructor for Savable use only.
    • Torus

      public Torus(String name, int circleSamples, int radialSamples, double tubeRadius, double centerRadius)
      Constructs a new Torus. Center is the origin, but the Torus may be transformed.
      Parameters:
      name - The name of the Torus.
      circleSamples - The number of samples along the circles.
      radialSamples - The number of samples along the radial.
      tubeRadius - the radius of the torus tube.
      centerRadius - The distance from the center of the torus hole to the center of the torus tube.
  • Method Details

    • isViewFromInside

      public boolean isViewFromInside()
      Returns:
      true if the normals are inverted to point into the torus so that the face is oriented for a viewer inside the torus. false (the default) for exterior viewing.
    • setViewFromInside

      public void setViewFromInside(boolean viewInside)
      Parameters:
      viewInside - if true, the normals are inverted to point into the torus so that the face is oriented for a viewer inside the torus. Default is false (for outside viewing)
    • 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: