Package com.ardor3d.scenegraph.shape
Class GeoSphere
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.scenegraph.shape.GeoSphere
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
GeoSphere - generate a polygon mesh approximating a sphere by recursive subdivision. First approximation is an
octahedron; each level of refinement increases the number of polygons by a factor of 4.
Shared vertices are not retained, so numerical errors may produce cracks between polygons at high subdivision levels.
Initial idea and text from C-Sourcecode by Jon Leech 3/24/89
-
Nested Class Summary
-
Field Summary
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
ConstructorDescriptionDefault Constructor for Savable use.GeoSphere
(String name, boolean useIcosahedron, double radius, int maxlevels, GeoSphere.TextureMode textureMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected Vector3
createMidpoint
(Vector3 a, Vector3 b) Compute the average of two vectors.double
boolean
void
setTextureMode
(GeoSphere.TextureMode textureMode) 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, read, render, render, renderArrays, renderVBO, reorderIndices, reorderVertexData, reorderVertexData, setDefaultColor, setDefaultColor, setLightState, setMeshData, setModelBound, setModelBound, setRandomColors, setSolidColor, setVisible, sortLights, supportsBoundsIntersectionRecord, supportsPrimitivesIntersectionRecord, updateModelBound, updateWorldBound, write
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
-
Constructor Details
-
GeoSphere
public GeoSphere(String name, boolean useIcosahedron, double radius, int maxlevels, GeoSphere.TextureMode textureMode) - Parameters:
name
- name of the spatialuseIcosahedron
- true to start with a 20 triangle mesh, false to start with a 8 triangle meshradius
- the radius of this spheremaxlevels
- an integer >= 1 setting the recursion leveltextureMode
- the texture mode to use when generating texture coordinates
-
GeoSphere
public GeoSphere()Default Constructor for Savable use.
-
-
Method Details
-
getRadius
public double getRadius() -
isUsingIcosahedron
public boolean isUsingIcosahedron() -
setTextureMode
-
getTextureMode
-
createMidpoint
Compute the average of two vectors.- Parameters:
a
- first vectorb
- second vector- Returns:
- the average of two points
-