org.xith3d.scenegraph
Class GeomContainer

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.NodeComponent
          extended by org.xith3d.scenegraph.Geometry
              extended by org.xith3d.scenegraph.GeomContainer
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.VertexContainer
Direct Known Subclasses:
GeometryArray

public abstract class GeomContainer
extends Geometry

Master container for all types of geometry data. This container supports all the non indexed geometries and several methods of data management. In particular NIO, BYREF and INTERLEAVED is supported transparently


Nested Class Summary
static class GeomContainer.Type
           
 
Nested classes/interfaces inherited from class org.xith3d.scenegraph.Geometry
Geometry.Optimization
 
Field Summary
static int BY_REFERENCE
           
protected  GeomNioFloatData colors
           
static int COLORS
           
static int COORDINATES
           
protected  GeomNioFloatData coords
           
protected  int faceSize
           
static int INTERLEAVED
           
protected  GeomNioFloatData interleavedData
           
protected  GeomNioFloatData normals
           
static int NORMALS
           
protected  int numVertices
           
protected  GeomNioFloatData[] texCoords
           
static int TEXTURE_COORDINATES
           
static int VERTEX_ATTRIBUTES
           
protected  GeomNioFloatData[] vertexAttribs
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
GeomContainer(GeomContainer.Type type, int coordsSize, int vertexCount, int[] stripVertexCounts)
           
 
Method Summary
 void addData(float[] coordData, float[] texCoordData, float[] normalData, float[] colorData)
          Super fast method add a bunch of data right into the data elements.
 void addData(org.openmali.vecmath2.Tuple3f translate, int numVertices, float[] coordData, float[] texCoordData, float[] normalData, float alpha)
          Super fast method for moving a bunch of data into the data elements.
 void addData(org.openmali.vecmath2.Tuple3f translate, int numVertices, float[] coordData, float[] texCoordData, float[] normalData, float[] colorData)
          Super fast method for moving a bunch of data into the data elements.
 void calculateFaceNormals()
          This method calculates smooth face normals and applies them to the Geometry.
 void calculateFaceNormals(boolean apply, org.openmali.vecmath2.Vector3f[] faceNormals, org.openmali.vecmath2.Vector3f[] vertexNormals)
          This method calculates smooth face normals.
protected  void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate)
          
protected  void finalize()
          
 void flipNormals()
          Flips (inverts, negates) all the normals of this Geometry.
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all this NodeComponent and all child-components.
 void getColor(int vertexIndex, org.openmali.vecmath2.Colorf colorf)
          Gets the color of the vertex at the specified index.
 void getColor(int vertexIndex, float[] floatArray)
           
 GeomNioFloatData getColorData()
           
 float[] getColorRefFloat()
           
 void getColors(int vertexIndex, float[] floatArray)
           
 long getColorsOffset()
           
 int getColorsSize()
           
 void getCoordinate(int vertexIndex, float[] floatArray)
           
 void getCoordinate(int index, org.openmali.vecmath2.Tuple3f point)
           
 void getCoordinates(int vertexIndex, float[] floatArray)
           
 void getCoordinates(int vertexIndex, org.openmali.vecmath2.Tuple3f[] point3fArray)
           
 GeomNioFloatData getCoordinatesData()
           
 long getCoordinatesOffset()
           
 int getCoordinatesSize()
           
 float[] getCoordRefFloat()
           
 int getFaceSize()
           
 int getInitialVertexIndex()
           
 GeomNioFloatData getInterleavedData()
           
 void getNormal(int vertexIndex, float[] floatArray)
           
 void getNormal(int index, org.openmali.vecmath2.Vector3f normal)
           
 float[] getNormalRefFloat()
           
 void getNormals(int vertexIndex, float[] floatArray)
           
 void getNormals(int index0, org.openmali.vecmath2.Vector3f[] vector3fArray)
           
 GeomNioFloatData getNormalsData()
           
 long getNormalsOffset()
           
 int getNormalsSize()
           
 SceneGraphOpenGLReferences getOpenGLReference_DL_GeomData()
           
 SceneGraphOpenGLReferences getOpenGLReference_DL_TexCoords()
           
 SceneGraphOpenGLReferences getOpenGLReference_DL()
           
 float[] getTexCoordRefFloat(int unit)
           
 GeomNioFloatData getTexCoordsData(int unit)
           
 int getTexCoordSetCount()
           
 int[] getTexCoordSetMap()
           
 void getTexCoordSetMap(int[] intArray)
           
 int getTexCoordSize(int unit)
          
 long getTexCoordsOffset(int unit)
           
 void getTextureCoordinate(int unit, int vertexIndex, float[] floatArray)
          Gets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void getTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord1f texCoord1f)
          Gets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void getTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord2f texCoord2f)
          Gets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void getTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord3f texCoord3f)
          Gets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void getTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord4f texCoord4f)
          Gets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void getTextureCoordinates(int unit, int vertexIndex, float[] floatArray)
           
 GeomContainer.Type getType()
           
 int getValidVertexCount()
           
 boolean getVertex(int i, org.openmali.vecmath2.Tuple3f pos)
           
 GeomNioFloatData getVertexAttribData(int index)
           
 int getVertexAttribSize(int index)
           
 long getVertexAttribsOffset(int index)
           
 float getVertexAttribute(int attribIndex, int vertexIndex)
          Gets the vertex attribute of the vertex at the specified index for the specified attribute.
 void getVertexAttribute(int attribIndex, int vertexIndex, float[] floatArray)
           
 void getVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple2f value)
          Gets the vertex attribute of the vertex at the specified index for the specified attribute.
 void getVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple3f value)
          Gets the vertex attribute of the vertex at the specified index for the specified attribute.
 void getVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Vector4f value)
          Gets the vertex attribute of the vertex at the specified index for the specified attribute.
 void getVertexAttributes(int attribIndex, int vertexIndex, float[] floatArray)
           
 int getVertexAttributesCount()
           
 int getVertexCount()
           
 int getVertexFormat()
          
 boolean hasColorAlpha()
          
 boolean hasColors()
          
 boolean hasFeature(int flag)
          
 boolean hasIndex()
          
 boolean hasNormals()
          
 boolean hasTextureCoordinates()
          
 boolean hasTextureCoordinates(int unit)
           
 boolean hasVertexAttributes()
          
 boolean hasVertexAttributes(int attribIndex)
           
 void invertNormals()
          Inverts all the normals in place.
 boolean isInterleaved()
           
 boolean isStrip()
          
 void makeInterleaved()
          Sets up the Geometry to be stored in a single NIO buffer for interleaved geometry.
 void makeInterleaved(int features, boolean colorAlpha, int[] tuSizes, int[] vaSizes)
          Sets up the Geometry to be stored in a single NIO buffer for interleaved geometry.
 void setColor(int vertexIndex, org.openmali.vecmath2.Colorf colorf)
          Sets the color of the vertex at the specified index.
 void setColor(int vertexIndex, float[] floatArray)
          Sets the color of the vertex at the specified index.
 void setColor(int vertexIndex, float r, float g, float b)
          Sets the color of the vertex at the specified index.
 void setColor(int vertexIndex, float r, float g, float b, float a)
          Sets the color of the vertex at the specified index.
 void setColorData(GeomNioFloatData data)
           
 void setColors(int vertexIndex, org.openmali.vecmath2.Colorf[] colorfArray)
          Sets the colors of the vertices starting at the specified index.
 void setColors(int vertexIndex, org.openmali.vecmath2.Colorf[] colorfArray, int startIndex, int length)
          Sets the colors of the vertices starting at the given index.
 void setColors(int vertexIndex, int colorSize, float[] floatArray)
          Sets the colors of the vertices starting at the specified index.
 void setColors(int vertexIndex, int colorSize, float[] floatArray, int startIndex, int length)
          Sets the colors of the vertices starting at the specified index.
 void setCoordinate(int vertexIndex, float[] floatArray)
          Sets the coordinates of the specified vertex.
 void setCoordinate(int vertexIndex, float x, float y, float z)
          Sets the coordinates of the vertex at the given index
 void setCoordinate(int vertexIndex, org.openmali.vecmath2.Tuple3f point3f)
          Sets the coordinates of the vertex at the given index
 void setCoordinateData(GeomNioFloatData data)
           
 void setCoordinates(int vertexIndex, float[] floatArray)
          Sets the coordinates of the vertices starting at the specified index.
 void setCoordinates(int vertexIndex, float[] floatArray, int startIndex, int length)
          Sets the coordinates of the vertices starting at the specified index.
 void setCoordinates(int vertexIndex, org.openmali.vecmath2.Tuple3f[] point3fArray)
          Sets the coordinates of the vertices starting at the specified index.
 void setCoordinates(int vertexIndex, org.openmali.vecmath2.Tuple3f[] point3fArray, int startIndex, int length)
          Sets the coordinates of the vertices starting at the specified index
protected  void setDataBuffers()
          Sets up the data buffers.
 void setInitialVertexIndex(int initialVertex)
          Sets the index of the first vertex which will be rendered from this geometry array.
protected  void setNioBuffers()
          Sets up an NIO buffer for each type of data needed for the geometry.
 void setNormal(int vertexIndex, float[] floatArray)
          Sets the normal of the vertex at the given index.
 void setNormal(int vertexIndex, float x, float y, float z)
          Sets the normal of the vertex at the given index.
 void setNormal(int vertexIndex, org.openmali.vecmath2.Vector3f vector3f)
          Sets the normal of the vertex at the given index.
 void setNormalData(GeomNioFloatData data)
           
 void setNormals(int vertexIndex, float[] floatArray)
          Sets the normals of the vertices starting at the specified index.
 void setNormals(int vertexIndex, float[] floatArray, int startIndex, int length)
          Sets the normals of the vertices starting at the specified index.
 void setNormals(int vertexIndex, org.openmali.vecmath2.Vector3f[] vector3fArray)
          Sets the normals of the vertices at the specified index.
 void setNormals(int vertexIndex, org.openmali.vecmath2.Vector3f[] vector3fArray, int startIndex, int length)
          Sets the normals of the vertices starting at the specified index.
 void setTexCoordData(int unit, GeomNioFloatData data)
           
 void setTextureCoordinate(int unit, int vertexIndex, float s)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, float[] floatArray)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, float s, float t)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, float s, float t, float r)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, float s, float t, float r, float q)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord2f texCoord2f)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord3f texCoord3f)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinate(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord4f texCoord4f)
          Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, int texCoordSize, float[] floatArray)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, int texCoordSize, float[] floatArray, int startIndex, int length)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord2f[] texCoord2fArray)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord2f[] texCoord2fArray, int startIndex, int length)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord3f[] texCoord3fArray)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord3f[] texCoord3fArray, int startIndex, int length)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord4f[] texCoord4fArray)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setTextureCoordinates(int unit, int vertexIndex, org.openmali.vecmath2.TexCoord4f[] texCoord4fArray, int startIndex, int length)
          Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.
 void setValidVertexCount(int count)
          Sets the number of vertices which will be rendered from this geometry array.
 void setVertexAttribute(int attribIndex, int vertexIndex, float value)
          Sets the vertex attribute of the vertex at the specified index for the specified attribute.
 void setVertexAttribute(int attribIndex, int vertexIndex, float[] floatArray)
          Sets the vertex attribute of the vertex at the specified index for the specified attribute.
 void setVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple2f value)
          Sets the vertex attribute of the vertex at the specified index for the specified attribute.
 void setVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple3f value)
          Sets the vertex attribute of the vertex at the specified index for the specified attribute.
 void setVertexAttribute(int attribIndex, int vertexIndex, org.openmali.vecmath2.Vector4f value)
          Sets the vertex attribute of the vertex at the specified index for the specified attribute.
 void setVertexAttributes(int attribIndex, int vertexIndex, float[] values, int attribSize)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, float[] values, int attribsSize, int startIndex, int length)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple2f[] values)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple2f[] values, int startIndex, int length)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple3f[] values)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Tuple3f[] values, int startIndex, int length)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Vector4f[] values)
          Sets the vertex attributes.
 void setVertexAttributes(int attribIndex, int vertexIndex, org.openmali.vecmath2.Vector4f[] values, int startIndex, int length)
          Sets the vertex attributes.
 void update()
          Invokes the geometry updater for this geometry buffer.
 void updateData(GeometryUpdater geometryUpdater)
           
 
Methods inherited from class org.xith3d.scenegraph.Geometry
cloneNodeComponent, getCachedBounds, getOptimization, isBoundsDirty, isTriangulatable, isTriangulated, setBoundsDirty, setCachedBounds, setOptimization
 
Methods inherited from class org.xith3d.scenegraph.NodeComponent
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COORDINATES

public static final int COORDINATES
See Also:
Constant Field Values

NORMALS

public static final int NORMALS
See Also:
Constant Field Values

COLORS

public static final int COLORS
See Also:
Constant Field Values

TEXTURE_COORDINATES

public static final int TEXTURE_COORDINATES
See Also:
Constant Field Values

VERTEX_ATTRIBUTES

public static final int VERTEX_ATTRIBUTES
See Also:
Constant Field Values

BY_REFERENCE

public static final int BY_REFERENCE
See Also:
Constant Field Values

INTERLEAVED

public static final int INTERLEAVED
See Also:
Constant Field Values

coords

protected GeomNioFloatData coords

normals

protected GeomNioFloatData normals

colors

protected GeomNioFloatData colors

texCoords

protected GeomNioFloatData[] texCoords

vertexAttribs

protected GeomNioFloatData[] vertexAttribs

interleavedData

protected GeomNioFloatData interleavedData

faceSize

protected final int faceSize

numVertices

protected int numVertices
Constructor Detail

GeomContainer

public GeomContainer(GeomContainer.Type type,
                     int coordsSize,
                     int vertexCount,
                     int[] stripVertexCounts)
Method Detail

getType

public final GeomContainer.Type getType()

isStrip

public final boolean isStrip()

Specified by:
isStrip in class Geometry
Returns:
true, if this Geometry is a Strip

isInterleaved

public final boolean isInterleaved()

hasIndex

public final boolean hasIndex()

Specified by:
hasIndex in class Geometry
Returns:
true, if this Geometry has an Index

getFaceSize

public final int getFaceSize()

getVertexCount

public int getVertexCount()

getVertex

public boolean getVertex(int i,
                         org.openmali.vecmath2.Tuple3f pos)

getVertexFormat

public final int getVertexFormat()

Specified by:
getVertexFormat in class Geometry
Returns:
the format of the vertices in this object.

hasColorAlpha

public final boolean hasColorAlpha()

Specified by:
hasColorAlpha in class Geometry

hasFeature

public final boolean hasFeature(int flag)

Specified by:
hasFeature in class Geometry

calculateFaceNormals

public void calculateFaceNormals(boolean apply,
                                 org.openmali.vecmath2.Vector3f[] faceNormals,
                                 org.openmali.vecmath2.Vector3f[] vertexNormals)
This method calculates smooth face normals.

Parameters:
apply - if true, the normals are applied back to the Geometry
faceNormals - must be of size getTrianglesCount(), or null. It is filled with the face normals, if not null.
vertexNormals - must be of size getVertexCount(), or null. It is filled with the new vertex normals, if not null.

calculateFaceNormals

public void calculateFaceNormals()
This method calculates smooth face normals and applies them to the Geometry.


invertNormals

public void invertNormals()
Inverts all the normals in place.


addData

public void addData(float[] coordData,
                    float[] texCoordData,
                    float[] normalData,
                    float[] colorData)
Super fast method add a bunch of data right into the data elements.


addData

public void addData(org.openmali.vecmath2.Tuple3f translate,
                    int numVertices,
                    float[] coordData,
                    float[] texCoordData,
                    float[] normalData,
                    float[] colorData)
Super fast method for moving a bunch of data into the data elements. The Positions are all translated according to the tuple passed in.


addData

public void addData(org.openmali.vecmath2.Tuple3f translate,
                    int numVertices,
                    float[] coordData,
                    float[] texCoordData,
                    float[] normalData,
                    float alpha)
Super fast method for moving a bunch of data into the data elements. The Positions are all translated according to the tuple passed in. The color for all the vertices are set the specified value


setCoordinateData

public void setCoordinateData(GeomNioFloatData data)

getCoordinatesData

public final GeomNioFloatData getCoordinatesData()

getCoordinatesSize

public final int getCoordinatesSize()

getCoordinatesOffset

public final long getCoordinatesOffset()

setNormalData

public void setNormalData(GeomNioFloatData data)

getNormalsData

public final GeomNioFloatData getNormalsData()

getNormalsSize

public final int getNormalsSize()

getNormalsOffset

public final long getNormalsOffset()

setColorData

public void setColorData(GeomNioFloatData data)

getColorData

public final GeomNioFloatData getColorData()

getColorsSize

public final int getColorsSize()

getColorsOffset

public final long getColorsOffset()

setTexCoordData

public void setTexCoordData(int unit,
                            GeomNioFloatData data)

getTexCoordsData

public final GeomNioFloatData getTexCoordsData(int unit)

getTexCoordSize

public final int getTexCoordSize(int unit)

Specified by:
getTexCoordSize in class Geometry

getTexCoordSetCount

public final int getTexCoordSetCount()

getTexCoordSetMap

public final int[] getTexCoordSetMap()

getTexCoordSetMap

public final void getTexCoordSetMap(int[] intArray)

getTexCoordsOffset

public final long getTexCoordsOffset(int unit)

getVertexAttribData

public final GeomNioFloatData getVertexAttribData(int index)

getVertexAttribSize

public final int getVertexAttribSize(int index)

getVertexAttribsOffset

public final long getVertexAttribsOffset(int index)

getInterleavedData

public final GeomNioFloatData getInterleavedData()

updateData

public void updateData(GeometryUpdater geometryUpdater)

setInitialVertexIndex

public void setInitialVertexIndex(int initialVertex)
Sets the index of the first vertex which will be rendered from this geometry array. The extact vertices which will be rendered is from InitialVertexIndex to InitialVertexIndex + ValidVertexCount-1.

Parameters:
initialVertex -

getInitialVertexIndex

public final int getInitialVertexIndex()
Returns:
the index of the first vertex which will be rendered from this geometry array. The extact vertices which will be rendered is from InitialVertexIndex to InitialVertexIndex + ValidVertexCount-1.

setValidVertexCount

public void setValidVertexCount(int count)
Sets the number of vertices which will be rendered from this geometry array. The extact vertices which will be rendered is from InitialVertexIndex to InitialVertexIndex + ValidVertexCount-1.

Parameters:
count -

getValidVertexCount

public final int getValidVertexCount()
Returns:
the number of vertices which will be rendered from this geometry array. The extact vertices which will be rendered is from InitialVertexIndex to InitialVertexIndex + ValidVertexCount-1.

setCoordinate

public void setCoordinate(int vertexIndex,
                          float[] floatArray)
Sets the coordinates of the specified vertex. The coordinates should occupy the first three indices of the given array.


setCoordinates

public void setCoordinates(int vertexIndex,
                           float[] floatArray,
                           int startIndex,
                           int length)
Sets the coordinates of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to be modified.
floatArray - The new coordinates. The size of the array must be a multiple of 3.
startIndex - The index of the first coordinate in the given array. The first read item of the array will be startIndex*3.
length - The number of vertices to copy

setCoordinates

public void setCoordinates(int vertexIndex,
                           float[] floatArray)
Sets the coordinates of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
floatArray - The new coordinates. The size of the array must be a multiple of 3.

setCoordinate

public void setCoordinate(int vertexIndex,
                          org.openmali.vecmath2.Tuple3f point3f)
Sets the coordinates of the vertex at the given index

Parameters:
vertexIndex - The index of the vertex to modify
point3f - The new coordinates

setCoordinate

public void setCoordinate(int vertexIndex,
                          float x,
                          float y,
                          float z)
Sets the coordinates of the vertex at the given index

Parameters:
vertexIndex - The index of the vertex to modify
x - The new coordinates
y - The new coordinates
z - The new coordinates

setCoordinates

public void setCoordinates(int vertexIndex,
                           org.openmali.vecmath2.Tuple3f[] point3fArray)
Sets the coordinates of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
point3fArray - The new coordinates.

setCoordinates

public void setCoordinates(int vertexIndex,
                           org.openmali.vecmath2.Tuple3f[] point3fArray,
                           int startIndex,
                           int length)
Sets the coordinates of the vertices starting at the specified index

Parameters:
vertexIndex - The index of the first vertex to be modified.
point3fArray - The new coordinates
startIndex - The index of the first coordinate in the given array
length - The number of coordinates to copy

getCoordinate

public void getCoordinate(int index,
                          org.openmali.vecmath2.Tuple3f point)

getCoordinate

public void getCoordinate(int vertexIndex,
                          float[] floatArray)

getCoordinates

public void getCoordinates(int vertexIndex,
                           org.openmali.vecmath2.Tuple3f[] point3fArray)

getCoordinates

public void getCoordinates(int vertexIndex,
                           float[] floatArray)

hasNormals

public final boolean hasNormals()

Specified by:
hasNormals in class Geometry

setNormal

public void setNormal(int vertexIndex,
                      float[] floatArray)
Sets the normal of the vertex at the given index.

Parameters:
vertexIndex - The index of the vertex to modify
floatArray - The new normal data. Its size must be a multiple of 3.

setNormals

public void setNormals(int vertexIndex,
                       float[] floatArray)
Sets the normals of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
floatArray - The new normals. Its size must be a multiple of 3.

setNormals

public void setNormals(int vertexIndex,
                       float[] floatArray,
                       int startIndex,
                       int length)
Sets the normals of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
floatArray - The new normal data. Its size must be a multiple of 3.
startIndex - The first coordinate to use in the given array. The first element of the array to be used will be startIndex*3.
length - The number of vertices to modify

setNormal

public void setNormal(int vertexIndex,
                      org.openmali.vecmath2.Vector3f vector3f)
Sets the normal of the vertex at the given index.

Parameters:
vertexIndex - THe index of the vertex to modify
vector3f - The new normal

setNormal

public void setNormal(int vertexIndex,
                      float x,
                      float y,
                      float z)
Sets the normal of the vertex at the given index.

Parameters:
vertexIndex - THe index of the vertex to modify
x - The new normal
y - The new normal
z - The new normal

setNormals

public void setNormals(int vertexIndex,
                       org.openmali.vecmath2.Vector3f[] vector3fArray)
Sets the normals of the vertices at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
vector3fArray - The new normals

setNormals

public void setNormals(int vertexIndex,
                       org.openmali.vecmath2.Vector3f[] vector3fArray,
                       int startIndex,
                       int length)
Sets the normals of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
vector3fArray - The new normals
startIndex - The index of the first coordinate to use in the given array.
length - The number of vertices to modify

getNormal

public void getNormal(int index,
                      org.openmali.vecmath2.Vector3f normal)

getNormal

public void getNormal(int vertexIndex,
                      float[] floatArray)

getNormals

public void getNormals(int vertexIndex,
                       float[] floatArray)

getNormals

public void getNormals(int index0,
                       org.openmali.vecmath2.Vector3f[] vector3fArray)

flipNormals

public void flipNormals()
Flips (inverts, negates) all the normals of this Geometry.

Throws:
Error, - if this Geometry doesn't currently have normals.

hasColors

public final boolean hasColors()

Specified by:
hasColors in class Geometry

setColor

public void setColor(int vertexIndex,
                     float[] floatArray)
Sets the color of the vertex at the specified index.

Parameters:
vertexIndex - The index of the vertex to modify
floatArray - The new color data. The first colorSize elements will be used.

setColors

public void setColors(int vertexIndex,
                      int colorSize,
                      float[] floatArray)
Sets the colors of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify
colorSize -
floatArray - The new color value. Its size must be a multiple of colorSize.

setColors

public void setColors(int vertexIndex,
                      int colorSize,
                      float[] floatArray,
                      int startIndex,
                      int length)
Sets the colors of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to be modified.
floatArray - The new color data. The size of the array must be a multiple of colorSize.
colorSize -
startIndex - The index of the first color in the given array. The first read item of the array will be startIndex*colorSize.
length - The number of colors to copy

setColor

public void setColor(int vertexIndex,
                     org.openmali.vecmath2.Colorf colorf)
Sets the color of the vertex at the specified index.

Parameters:
vertexIndex - The index of the vertex to modify
colorf - The new color.

setColor

public void setColor(int vertexIndex,
                     float r,
                     float g,
                     float b)
Sets the color of the vertex at the specified index.

Parameters:
vertexIndex - The index of the vertex to modify
r -
g -
b -

setColor

public void setColor(int vertexIndex,
                     float r,
                     float g,
                     float b,
                     float a)
Sets the color of the vertex at the specified index.

Parameters:
vertexIndex - The index of the vertex to modify
r -
g -
b -
a -

setColors

public void setColors(int vertexIndex,
                      org.openmali.vecmath2.Colorf[] colorfArray)
Sets the colors of the vertices starting at the specified index.

Parameters:
vertexIndex - The index of the first vertex to modify.
colorfArray - The new color values.

setColors

public void setColors(int vertexIndex,
                      org.openmali.vecmath2.Colorf[] colorfArray,
                      int startIndex,
                      int length)
Sets the colors of the vertices starting at the given index.

Parameters:
vertexIndex - The index of the first vertex to modify
colorfArray - The new color data.
startIndex - The index of the first color in the given array
length - The number of vertices to modify.

getColor

public void getColor(int vertexIndex,
                     org.openmali.vecmath2.Colorf colorf)
Gets the color of the vertex at the specified index.

Parameters:
vertexIndex - The index of the vertex to modify
colorf - The new color.

getColor

public void getColor(int vertexIndex,
                     float[] floatArray)

getColors

public void getColors(int vertexIndex,
                      float[] floatArray)

hasTextureCoordinates

public final boolean hasTextureCoordinates()

Specified by:
hasTextureCoordinates in class Geometry

hasTextureCoordinates

public final boolean hasTextureCoordinates(int unit)

setTextureCoordinate

public void setTextureCoordinate(int unit,
                                 int vertexIndex,
                                 float[] floatArray)
Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.

Parameters:
unit - The coordinates set.
vertexIndex - The index of the vertex to modify
floatArray - The new texture coordinate data. Its size must be 2, 3 or 4.

setTextureCoordinates

public void setTextureCoordinates(int unit,
                                  int vertexIndex,
                                  int texCoordSize,
                                  float[] floatArray)
Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.

Parameters:
unit - The coordinates set.
vertexIndex - The index of the first vertex to modify
texCoordSize - 1, 2, 3 or 4
floatArray - The new coordinate data. Its size must be a multiple of 2, 3 or 4 depending on texCoordSet format.

setTextureCoordinates

public void setTextureCoordinates(int unit,
                                  int vertexIndex,
                                  int texCoordSize,
                                  float[] floatArray,
                                  int startIndex,
                                  int length)
Sets the texture coordinate of the vertex starting at the specified index for the specified coordinates set.

Parameters:
unit - The coordinates set.
vertexIndex - The index of the first vertex to modify
texCoordSize -
floatArray - The new coordinate data. Its size must be a multiple of 2.
startIndex -
length -

setTextureCoordinate

public void setTextureCoordinate(int unit,
                                 int vertexIndex,
                                 float s)
Sets the texture coordinate of the vertex at the specified index for the specified coordinates set.

Parameters:<