Package com.ardor3d.scenegraph.shape
Class Sphere
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.scenegraph.shape.Sphere
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
Sphere represents a 3D object with all points equi-distance from a center point.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal Vector3
the center of the sphereprotected int
double
the distance from the center point each point falls onprotected Sphere.TextureMode
protected boolean
protected int
Fields inherited from class com.ardor3d.scenegraph.Mesh
_defaultColor, _isVisible, _lightState, _meshData, _modelBound, _states, RENDER_VERTEX_ONLY
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
ConstructorDescriptionSphere()
Constructs a sphere.Constructs a sphere with center at the originSphere
(String name, ReadOnlyVector3 center, int zSamples, int radialSamples, double radius) Constructs a sphere.Sphere
(String name, ReadOnlyVector3 center, int zSamples, int radialSamples, double radius, Sphere.TextureMode textureMode) Constructs a sphere. -
Method Summary
Modifier and TypeMethodDescriptionReturns the center of this sphere.double
boolean
void
read
(InputCapsule capsule) void
setData
(ReadOnlyVector3 center, int zSamples, int radialSamples, double radius) Changes the information of the sphere into the given values.void
setTextureMode
(Sphere.TextureMode textureMode) void
setViewFromInside
(boolean viewInside) void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.Mesh
applyWorldRenderStates, draw, getClassTag, getDefaultColor, getLightState, getMeshData, getModelBound, getModelBound, getWorldNormals, getWorldRenderState, getWorldVectors, intersectsPrimitivesWhere, intersectsWorldBound, intersectsWorldBoundsWhere, isVisible, makeCopy, makeInstanced, render, render, renderArrays, renderVBO, reorderIndices, reorderVertexData, reorderVertexData, setDefaultColor, setDefaultColor, setLightState, setMeshData, setModelBound, setModelBound, setRandomColors, setSolidColor, setVisible, sortLights, supportsBoundsIntersectionRecord, supportsPrimitivesIntersectionRecord, updateModelBound, updateWorldBound
Methods inherited from class com.ardor3d.scenegraph.Spatial
acceptVisitor, addController, addTranslation, addTranslation, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyDown, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateChildren, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, updateWorldRenderStates, updateWorldTransform, worldToLocal
-
Field Details
-
_zSamples
protected int _zSamples -
_radialSamples
protected int _radialSamples -
_radius
public double _radiusthe distance from the center point each point falls on -
_center
the center of the sphere -
_textureMode
-
_viewInside
protected boolean _viewInside
-
-
Constructor Details
-
Sphere
public Sphere() -
Sphere
Constructs a sphere. By default the Sphere has not geometry data or center.- Parameters:
name
- The name of the sphere.
-
Sphere
Constructs a sphere with center at the origin- Parameters:
name
- Name of sphere.zSamples
- The samples along the Z.radialSamples
- The samples along the radial.radius
- Radius of the sphere.
-
Sphere
Constructs a sphere. All geometry data buffers are updated automatically. Both zSamples and radialSamples increase the quality of the generated sphere.- Parameters:
name
- Name of the sphere.center
- Center of the sphere.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(String name, ReadOnlyVector3 center, int zSamples, int radialSamples, double radius, Sphere.TextureMode textureMode) Constructs a sphere. All geometry data buffers are updated automatically. Both zSamples and radialSamples increase the quality of the generated sphere.- Parameters:
name
- Name of the sphere.center
- Center of the sphere.zSamples
- The number of samples along the Z.radialSamples
- The number of samples along the radial.radius
- The radius of the sphere.textureMode
- the mode to use when setting uv coordinates for this Sphere.
-
-
Method Details
-
setData
Changes the information of the sphere into the given values.- Parameters:
center
- The new center of the sphere.zSamples
- The new number of zSamples of the sphere.radialSamples
- The new number of radial samples of the sphere.radius
- The new radius of the sphere.
-
getCenter
Returns the center of this sphere.- Returns:
- The sphere's center.
-
isViewFromInside
public boolean isViewFromInside()- Returns:
- true if the normals are inverted to point into the sphere so that the face is oriented for a viewer inside the sphere. false (the default) for exterior viewing.
-
setViewFromInside
public void setViewFromInside(boolean viewInside) - Parameters:
viewInside
- if true, the normals are inverted to point into the sphere so that the face is oriented for a viewer inside the sphere. Default is false (for outside viewing)
-
getTextureMode
- Returns:
- Returns the textureMode.
-
setTextureMode
- Parameters:
textureMode
- The textureMode to set.
-
getRadius
public double getRadius() -
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Parameters:
capsule
- the capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Parameters:
capsule
- the input capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-