Package com.ardor3d.scenegraph
Class Point
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.scenegraph.Point
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
Point
defines a collection of vertices that are rendered as single points or textured sprites depending
on PointType.-
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
ConstructorDescriptionPoint()
Point
(Point.PointType type) Point
(String name, ReadOnlyVector3[] vertex, ReadOnlyVector3[] normal, ReadOnlyColorRGBA[] color, ReadOnlyVector2[] texture) Constructor instantiates a newPoint
object with a given set of data.Point
(String name, FloatBuffer vertex, FloatBuffer normal, FloatBuffer color, FloatBufferData coords) Constructor instantiates a newPoint
object with a given set of data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
enableDistanceAttenuation
(boolean bool) Default attenuation coefficient is calculated to work best with pointSize = 1.float
float
float
boolean
boolean
makeCopy
(boolean shareGeometricData) Create a copy of this spatial.void
read
(InputCapsule capsule) void
Render the object using the supplied renderer instance.void
setAntialiased
(boolean antialiased) Sets whether the point should be antialiased.void
setDistanceAttenuationCoefficients
(float a, float b, float c) Distance Attenuation Equation:
x = distance from the eye
Derived Size = clamp( pointSize * sqrt( attenuation(x) ) )
attenuation(x) = 1 / (a + b*x + c*x^2)void
setMaxPointSize
(float maxSize) When DistanceAttenuation is enabled, the points maximum size will get clamped to this value.void
setMinPointSize
(float minSize) When DistanceAttenuation is enabled, the points minimum size will get clamped to this value.void
setPointSize
(float size) Sets the pixel width of the point when drawn.void
setPointType
(Point.PointType pointType) 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, makeInstanced, 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
-
Constructor Details
-
Point
public Point() -
Point
-
Point
public Point(String name, ReadOnlyVector3[] vertex, ReadOnlyVector3[] normal, ReadOnlyColorRGBA[] color, ReadOnlyVector2[] texture) Constructor instantiates a newPoint
object with a given set of data. Any data may be null, except the vertex array. If this is null an exception is thrown.- Parameters:
name
- the name of the scene element. This is required for identification and comparison purposes.vertex
- the vertices or points.normal
- the normals of the points.color
- the color of the points.texture
- the texture coordinates of the points.
-
Point
public Point(String name, FloatBuffer vertex, FloatBuffer normal, FloatBuffer color, FloatBufferData coords) Constructor instantiates a newPoint
object with a given set of data. Any data may be null, except the vertex array. If this is null an exception is thrown.- Parameters:
name
- the name of the scene element. This is required for identification and comparison purposes.vertex
- the vertices or points.normal
- the normals of the points.color
- the color of the points.coords
- the texture coordinates of the points.
-
-
Method Details
-
isPointSprite
public boolean isPointSprite() -
enableDistanceAttenuation
public void enableDistanceAttenuation(boolean bool) Default attenuation coefficient is calculated to work best with pointSize = 1.- Parameters:
bool
-true
to enable the distance attenuation
-
setDistanceAttenuationCoefficients
public void setDistanceAttenuationCoefficients(float a, float b, float c) Distance Attenuation Equation:
x = distance from the eye
Derived Size = clamp( pointSize * sqrt( attenuation(x) ) )
attenuation(x) = 1 / (a + b*x + c*x^2)Default coefficients used are(they should work best with pointSize=1):
a = 0, b = 0, c = 0.000004f
This should give(without taking regards to the max,min pointSize clamping):
1. A size of 1 pixel at distance of 500 units.
Derived Size = 1/(0.000004*500^2) = 1
2. A size of 25 pixel at distance of 100 units.
3. A size of 2500 at a distance of 10 units.- Parameters:
a
- constant term in the attenuation equationb
- linear term in the attenuation equationc
- quadratic term in the attenuation equation- See Also:
-
isAntialiased
public boolean isAntialiased()- Returns:
- true if points are to be drawn antialiased
-
setAntialiased
public void setAntialiased(boolean antialiased) Sets whether the point should be antialiased. May decrease performance. If you want to enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE.- Parameters:
antialiased
- true if the line should be antialiased.
-
getPointType
-
setPointType
-
getPointSize
public float getPointSize()- Returns:
- the pixel size of each point.
-
setPointSize
public void setPointSize(float size) Sets the pixel width of the point when drawn. Non anti-aliased point sizes are rounded to the nearest whole number by opengl.- Parameters:
size
- The size to set.
-
setMaxPointSize
public void setMaxPointSize(float maxSize) When DistanceAttenuation is enabled, the points maximum size will get clamped to this value.- Parameters:
maxSize
- the points maximum size to set
-
getMaxPointSize
public float getMaxPointSize()- Returns:
- the points maximum size
-
setMinPointSize
public void setMinPointSize(float minSize) When DistanceAttenuation is enabled, the points minimum size will get clamped to this value.- Parameters:
minSize
- the points minimum size to set
-
getMinPointSize
public float getMinPointSize()- Returns:
- the points minimum size
-
makeCopy
Description copied from class:Spatial
Create a copy of this spatial. -
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:
-
render
Description copied from interface:Renderable
Render the object using the supplied renderer instance.- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classMesh
- Parameters:
renderer
- the renderer
-