com.jme3.scene.shape
Class Sphere

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

public class Sphere
extends Mesh

Sphere represents a 3D object with all points equidistance from a center point.


Nested Class Summary
static class Sphere.TextureMode
           
 
Nested classes/interfaces inherited from class com.jme3.scene.Mesh
Mesh.Mode
 
Field Summary
protected  boolean interior
           
protected  int radialSamples
           
 float radius
          the distance from the center point each point falls on
protected  Sphere.TextureMode textureMode
           
protected  int triCount
           
protected  boolean useEvenSlices
           
protected  int vertCount
           
protected  int zSamples
           
 
Constructor Summary
Sphere()
          Serialization only.
Sphere(int zSamples, int radialSamples, float radius)
          Constructs a sphere.
Sphere(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior)
          Constructs a sphere.
 
Method Summary
 int getRadialSamples()
           
 float getRadius()
           
 Sphere.TextureMode getTextureMode()
           
 int getZSamples()
           
 void read(JmeImporter e)
           
 void setTextureMode(Sphere.TextureMode textureMode)
           
 void updateGeometry(int zSamples, int radialSamples, float radius)
          Changes the information of the sphere into the given values.
 void updateGeometry(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior)
           
 void write(JmeExporter e)
           
 
Methods inherited from class com.jme3.scene.Mesh
clearBuffer, clone, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getNumLodLevels, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, prepareForAnim, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPointSize, setStatic, setStreamed, updateBound, updateCounts
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

Sphere

public 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 Detail

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 e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Mesh
Throws:
java.io.IOException

write

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