Class Sphere

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

public class Sphere extends Mesh
Sphere represents a 3D object with all points equidistant from a center point.
  • Field Details

    • vertCount

      protected int vertCount
    • triCount

      protected int triCount
    • zSamples

      protected int zSamples
    • radialSamples

      protected int radialSamples
    • useEvenSlices

      protected boolean useEvenSlices
    • interior

      protected boolean interior
    • radius

      public float radius
      the distance from the center point each point falls on
    • textureMode

      protected Sphere.TextureMode textureMode
  • Constructor Details

    • Sphere

      protected Sphere()
      Serialization only. Do not use.
    • Sphere

      public Sphere(int zSamples, int radialSamples, float radius)
      Constructs a sphere. All geometry data buffers are updated automatically. Both zSamples and radialSamples increase the quality of the generated sphere.
      Parameters:
      zSamples - The number of samples along the Z.
      radialSamples - The number of samples along the radial.
      radius - The radius of the sphere.
    • Sphere

      public Sphere(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior)
      Constructs a sphere. Additional arg to evenly space latitudinal slices
      Parameters:
      zSamples - The number of samples along the Z.
      radialSamples - The number of samples along the radial.
      radius - The radius of the sphere.
      useEvenSlices - Slice sphere evenly along the Z axis
      interior - Not yet documented
  • Method Details

    • getRadialSamples

      public int getRadialSamples()
    • getRadius

      public float getRadius()
    • getTextureMode

      public Sphere.TextureMode getTextureMode()
      Returns:
      Returns the textureMode.
    • getZSamples

      public int getZSamples()
    • setTextureMode

      public void setTextureMode(Sphere.TextureMode textureMode)
      Parameters:
      textureMode - The textureMode to set.
    • updateGeometry

      public void updateGeometry(int zSamples, int radialSamples, float radius)
      Changes the information of the sphere into the given values.
      Parameters:
      zSamples - the number of zSamples of the sphere.
      radialSamples - the number of radial samples of the sphere.
      radius - the radius of the sphere.
    • updateGeometry

      public void updateGeometry(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior)
    • read

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

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