com.jme.scene
Class Point

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Geometry
          extended by com.jme.scene.Point
All Implemented Interfaces:
Savable, java.io.Serializable

public class Point
extends Geometry

Point defines a collection of vertices that are rendered as single points.

Version:
$Id: Point.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.Spatial
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode
 
Field Summary
protected  java.nio.IntBuffer indexBuffer
           
 
Fields inherited from class com.jme.scene.Geometry
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity
 
Fields inherited from class com.jme.scene.Spatial
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
Point()
           
Point(java.lang.String name, java.nio.FloatBuffer vertex, java.nio.FloatBuffer normal, java.nio.FloatBuffer color, TexCoords coords)
          Constructor instantiates a new Point object with a given set of data.
Point(java.lang.String name, Vector3f[] vertex, Vector3f[] normal, ColorRGBA[] color, Vector2f[] texture)
          Constructor instantiates a new Point object with a given set of data.
 
Method Summary
 void draw(Renderer r)
          draw prepares the geometry for rendering to the display.
 void findCollisions(Spatial scene, CollisionResults results)
          checks this spatial against a second spatial, any collisions are stored in the results object.
 void generateIndices()
           
 java.nio.IntBuffer getIndexBuffer()
           
 float getPointSize()
           
 boolean hasCollision(Spatial scene, boolean checkTriangles)
          Checks this spatial against a second spatial for collisions.
 boolean isAntialiased()
           
 void read(JMEImporter e)
           
 void reconstruct(java.nio.FloatBuffer vertices, java.nio.FloatBuffer normals, java.nio.FloatBuffer colors, TexCoords coords)
          reconstruct reinitializes the geometry with new data.
 void setAntialiased(boolean antialiased)
          Sets whether the point should be antialiased.
 void setIndexBuffer(java.nio.IntBuffer indices)
           
 void setPointSize(float size)
          Sets the pixel width of the point when drawn.
 void write(JMEExporter e)
           
 
Methods inherited from class com.jme.scene.Geometry
addTextureCoordinates, addTextureCoordinates, applyRenderState, checkTextureCoordinates, clearBuffers, clearTextureBuffers, copyTextureCoordinates, copyTextureCoordinates, findPick, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, getTriangleCount, getVBOInfo, getVertexBuffer, getVertexCount, getWorldCoords, getWorldNormals, hasDirtyVertices, isCastsShadows, lockMeshes, postdraw, predraw, randomVertex, resizeTextureIds, rotateNormals, rotatePoints, scaleTextureCoordinates, scaleTextureCoordinates, setBinormalBuffer, setCastsShadows, setColorBuffer, setDefaultColor, setDisplayListID, setFogCoordBuffer, setHasDirtyVertices, setLightState, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTangentBuffer, setTextureCoords, setTextureCoords, setTextureCoords, setVBOInfo, setVertexBuffer, setVertexCount, sortLights, translatePoints, translatePoints, unlockMeshes, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBounds, lockBranch, lockMeshes, lockShadows, lockTransforms, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, unlockShadows, unlockTransforms, updateGeometricState, updateRenderState, updateRenderState, updateWorldData, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, updateWorldVectors, worldToLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jme.util.export.Savable
getClassTag
 

Field Detail

indexBuffer

protected transient java.nio.IntBuffer indexBuffer
Constructor Detail

Point

public Point()

Point

public Point(java.lang.String name,
             Vector3f[] vertex,
             Vector3f[] normal,
             ColorRGBA[] color,
             Vector2f[] texture)
Constructor instantiates a new Point 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 comparision 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(java.lang.String name,
             java.nio.FloatBuffer vertex,
             java.nio.FloatBuffer normal,
             java.nio.FloatBuffer color,
             TexCoords coords)
Constructor instantiates a new Point 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 comparision 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 Detail

reconstruct

public void reconstruct(java.nio.FloatBuffer vertices,
                        java.nio.FloatBuffer normals,
                        java.nio.FloatBuffer colors,
                        TexCoords coords)
Description copied from class: Geometry
reconstruct reinitializes the geometry with new data. This will reuse the geometry object.

Overrides:
reconstruct in class Geometry
Parameters:
vertices - the new vertices to use.
normals - the new normals to use.
colors - the new colors to use.
coords - the new texture coordinates to use (position 0).

generateIndices

public void generateIndices()

findCollisions

public void findCollisions(Spatial scene,
                           CollisionResults results)
Description copied from class: Spatial
checks this spatial against a second spatial, any collisions are stored in the results object.

Specified by:
findCollisions in class Spatial
Parameters:
scene - the scene to test against.
results - the results of the collisions.

hasCollision

public boolean hasCollision(Spatial scene,
                            boolean checkTriangles)
Description copied from class: Spatial
Checks this spatial against a second spatial for collisions.

Specified by:
hasCollision in class Spatial
Parameters:
scene - the scene to test against.
checkTriangles - check for collisions on triangle accuracy level
Returns:
true if any collision were found

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.

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.

getIndexBuffer

public java.nio.IntBuffer getIndexBuffer()

setIndexBuffer

public void setIndexBuffer(java.nio.IntBuffer indices)

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class Geometry
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Geometry
Throws:
java.io.IOException

draw

public void draw(Renderer r)
Description copied from class: Geometry
draw prepares the geometry for rendering to the display. The renderstate is set and the subclass is responsible for rendering the actual data.

Overrides:
draw in class Geometry
Parameters:
r - the renderer that displays to the context.
See Also:
Spatial.draw(com.jme.renderer.Renderer)