Package com.jme3.scene.shape
Class Dome
java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.Dome
- All Implemented Interfaces:
Savable
,JmeCloneable
,Cloneable
A hemisphere.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of planar segments along the z-axis of the dome.int
Get the number of samples radially around the main axis of the dome.float
Get the radius of the dome.boolean
Are the triangles connected in such a way as to present a view out from the dome or not.void
read
(JmeImporter importer) void
updateGeometry
(Vector3f center, int planes, int radialSamples, float radius, boolean insideView) Rebuilds the dome with a new set of parameters.void
write
(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
-
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
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
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
-
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
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Throws:
IOException
-