Class Dome

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

public class Dome extends Mesh
A hemisphere.
  • Constructor Details

    • Dome

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

      public Dome(int planes, int radialSamples, float radius)
      Constructs a dome for use as a SkyDome. The SkyDome is centered at the origin and only visible from the inside.
      Parameters:
      planes - The number of planes along the Z-axis. Must be >= 2. Influences how round the arch of the dome is.
      radialSamples - The number of samples along the radial. Influences how round the base of the dome is.
      radius - Radius of the dome.
      See Also:
    • Dome

      public Dome(Vector3f center, int planes, int radialSamples, float radius)
      Constructs a dome visible from the inside, e.g. for use as a SkyDome. All geometry data buffers are updated automatically.
      For a cone, set planes=2. For a pyramid, set radialSamples=4 and planes=2. Increasing planes and radialSamples increase the quality of the dome.
      Parameters:
      center - Center of the dome.
      planes - The number of planes along the Z-axis. Must be >= 2. Influences how round the arch of the dome is.
      radialSamples - The number of samples along the radial. Influences how round the base of the dome is.
      radius - The radius of the dome.
    • Dome

      public Dome(Vector3f center, int planes, int radialSamples, float radius, boolean insideView)
      Constructs a dome. Use this constructor for half-sphere, pyramids, or cones. All geometry data buffers are updated automatically.
      For a cone, set planes=2. For a pyramid, set radialSamples=4 and planes=2. Setting higher values for planes and radialSamples increases the quality of the half-sphere.
      Parameters:
      center - Center of the dome.
      planes - The number of planes along the Z-axis. Must be >= 2. Influences how round the arch of the dome is.
      radialSamples - The number of samples along the radial. Influences how round the base of the dome is.
      radius - The radius of the dome.
      insideView - If true, the dome is only visible from the inside, like a SkyDome. If false, the dome is only visible from the outside.
  • Method Details

    • getCenter

      public Vector3f getCenter()
    • getPlanes

      public int getPlanes()
      Get the number of planar segments along the z-axis of the dome.
      Returns:
      the count
    • getRadialSamples

      public int getRadialSamples()
      Get the number of samples radially around the main axis of the dome.
      Returns:
      the count
    • getRadius

      public float getRadius()
      Get the radius of the dome.
      Returns:
      the radius (in mesh units)
    • isInsideView

      public boolean isInsideView()
      Are the triangles connected in such a way as to present a view out from the dome or not.
      Returns:
      true if visible from inside, false if visible from outside
    • updateGeometry

      public void updateGeometry(Vector3f center, int planes, int radialSamples, float radius, boolean insideView)
      Rebuilds the dome with a new set of parameters.
      Parameters:
      center - the new center of the dome.
      planes - the number of planes along the Z-axis.
      radialSamples - the new number of radial samples of the dome.
      radius - the new radius of the dome.
      insideView - should the dome be set up to be viewed from the inside looking out.
    • 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