Package com.jme3.scene.shape
Class Sphere
java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.Sphere
- All Implemented Interfaces:
Savable,JmeCloneable,Cloneable
Sphere represents a 3D object with all points equidistant
from a center point.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intfloatthe distance from the center point each point falls onprotected Sphere.TextureModeprotected intprotected booleanprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfloatintvoidread(JmeImporter importer) voidsetTextureMode(Sphere.TextureMode textureMode) voidupdateGeometry(int zSamples, int radialSamples, float radius) Changes the information of the sphere into the given values.voidupdateGeometry(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior) voidwrite(JmeExporter e) Methods inherited from class com.jme3.scene.Mesh
addMorphTarget, clearBuffer, clearCollisionData, clone, cloneFields, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getInstanceCount, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getMorphIndex, getMorphTarget, getMorphTargetNames, getMorphTargets, getNumLodLevels, getPatchVertexCount, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, hasMorphTargets, isAnimated, isAnimatedByBone, isAnimatedByJoint, jmeClone, prepareForAnim, removeMorphTarget, removeMorphTarget, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPatchVertexCount, setStatic, setStreamed, updateBound, updateCounts
-
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 radiusthe distance from the center point each point falls on -
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 axisinterior- Not yet documented
-
-
Method Details
-
getRadialSamples
public int getRadialSamples() -
getRadius
public float getRadius() -
getTextureMode
- Returns:
- Returns the textureMode.
-
getZSamples
public int getZSamples() -
setTextureMode
- 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
- Specified by:
readin interfaceSavable- Overrides:
readin classMesh- Throws:
IOException
-
write
- Specified by:
writein interfaceSavable- Overrides:
writein classMesh- Throws:
IOException
-