Package com.ardor3d.scenegraph
Class Line
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.scenegraph.Line
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
-
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
ConstructorDescriptionLine()
Constructs a new line with the given name.Line
(String name, ReadOnlyVector3[] vertex, ReadOnlyVector3[] normal, ReadOnlyColorRGBA[] color, ReadOnlyVector2[] texture) Constructor instantiates a newLine
object with a given set of data.Line
(String name, FloatBuffer vertex, FloatBuffer normal, FloatBuffer color, FloatBufferData coords) Constructor instantiates a newLine
object with a given set of data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendCircle
(double radius, double x, double y, int segments, boolean insideOut) Puts a circle into vertex and normal buffer at the current buffer position.float
int
short
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
setLineWidth
(float lineWidth) Sets the width of the line when drawn.void
setStippleFactor
(int stippleFactor) void
setStipplePattern
(short stipplePattern) The stipple or pattern to use when drawing this line. 0xFFFF is a solid line.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
-
Line
public Line() -
Line
Constructs a new line with the given name. By default, the line has no information.- Parameters:
name
- The name of the line.
-
Line
public Line(String name, FloatBuffer vertex, FloatBuffer normal, FloatBuffer color, FloatBufferData coords) Constructor instantiates a newLine
object with a given set of data. Any data can be null except for the vertex list. If vertices are null an exception will be thrown.- Parameters:
name
- the name of the scene element. This is required for identification and comparison purposes.vertex
- the vertices that make up the lines.normal
- the normals of the lines.color
- the color of each point of the lines.coords
- the texture coordinates of the lines.
-
Line
public Line(String name, ReadOnlyVector3[] vertex, ReadOnlyVector3[] normal, ReadOnlyColorRGBA[] color, ReadOnlyVector2[] texture) Constructor instantiates a newLine
object with a given set of data. Any data can be null except for the vertex list. If vertices are null an exception will be thrown.- Parameters:
name
- the name of the scene element. This is required for identification and comparison purposes.vertex
- the vertices that make up the lines.normal
- the normals of the lines.color
- the color of each point of the lines.texture
- the texture coordinates of the lines.
-
-
Method Details
-
appendCircle
public void appendCircle(double radius, double x, double y, int segments, boolean insideOut) Puts a circle into vertex and normal buffer at the current buffer position. The buffers are enlarged and copied if they are too small.- Parameters:
radius
- radius of the circlex
- x coordinate of circle centery
- y coordinate of circle centersegments
- number of line segments the circle is built frominsideOut
- false for normal winding (ccw), true for clockwise winding
-
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.
-
getLineWidth
public float getLineWidth()- Returns:
- the width of this line.
-
setLineWidth
public void setLineWidth(float lineWidth) Sets the width of the line when drawn. Non anti-aliased line widths are rounded to the nearest whole number by opengl.- Parameters:
lineWidth
- The lineWidth to set.
-
getStipplePattern
public short getStipplePattern()- Returns:
- the set stipplePattern. 0xFFFF means no stipple.
-
setStipplePattern
public void setStipplePattern(short stipplePattern) The stipple or pattern to use when drawing this line. 0xFFFF is a solid line.- Parameters:
stipplePattern
- a 16bit short whose bits describe the pattern to use when drawing this line
-
getStippleFactor
public int getStippleFactor()- Returns:
- the set stippleFactor.
-
setStippleFactor
public void setStippleFactor(int stippleFactor) - Parameters:
stippleFactor
- magnification factor to apply to the stipple pattern.
-
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
-