|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.geometry.SimpleGeometryDataContainer
public class SimpleGeometryDataContainer
This is a simple geometry data container, that contains only coordinates and indices. This can be useful for physical data, that doesn't need or know normals, colors, texture-coordinates or vertex-attributes.
| Field Summary | |
|---|---|
static int |
BY_REFERENCE
|
static int |
COORDINATES
|
protected GeomNioFloatData |
coords
|
protected long |
coordsOffset
|
protected GeomNioIntData |
indexData
|
static int |
INTERLEAVED
|
protected GeomNioFloatData |
interleavedData
|
protected boolean |
isInterleaved
|
protected int |
maxVertices
|
protected int |
numIndices
|
protected int |
numVertices
|
protected static boolean |
reversed
|
| Constructor Summary | |
|---|---|
protected |
SimpleGeometryDataContainer(GeometryArrayType type,
boolean hasIndex,
int coordsSize,
int vertexCount,
int[] stripCounts,
int indexCount)
|
|
SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount)
|
|
SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int indexCount)
|
|
SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int[] stripCounts)
|
|
SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int[] stripCounts,
int indexCount)
|
| Method Summary | ||
|---|---|---|
protected void |
checkCoordsExistence(int coordsSize)
|
|
protected void |
copyFrom(SimpleGeometryDataContainer o,
boolean forceDuplicate)
Copies details from the given container. |
|
protected void |
createCoordinates()
|
|
void |
getCoordinate(int vertexIndex,
float[] floatArray)
|
|
|
getCoordinate(int index,
T 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 |
getIndex(int i)
|
|
void |
getIndex(int[] index)
Gets all index values. |
|
int |
getIndexCount()
|
|
GeomNioIntData |
getIndexData()
|
|
int |
getInitialIndex()
|
|
GeomNioFloatData |
getInterleavedData()
|
|
int |
getMaxVertexCount()
|
|
int |
getNumStrips()
|
|
int[] |
getStripCounts()
Gets the counts for each strip. |
|
void |
getStripCounts(int[] sCounts)
Gets the strip counts. |
|
boolean |
getTriangle(int i0,
int i1,
int i2,
org.openmali.spatial.polygons.Triangle triangle)
Retrieves the the n-th Triangle from the GeometryArray. |
|
GeometryArrayType |
getType()
|
|
int |
getValidVertexCount()
|
|
boolean |
getVertex(int i,
org.openmali.vecmath2.Tuple3f pos)
|
|
int |
getVertexCount()
|
|
boolean |
hasIndex()
|
|
boolean |
isInterleaved()
|
|
boolean |
isStrip()
|
|
protected GeomNioFloatData |
newNioFloatData(int maxElements,
int elemSize,
int stride,
boolean reversed)
|
|
protected GeomNioIntData |
newNioIntData(int maxElems,
int elemSize,
boolean reversed)
|
|
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)
Directly sets the coordinates data buffer. |
|
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,
java.util.List<org.openmali.vecmath2.Tuple3f> point3fList)
|
|
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 |
|
void |
setIndex(int[] indices)
Sets all index values. |
|
void |
setIndex(int i,
int idx)
Sets the i-th index value. |
|
void |
setInitialIndex(int initialIndex)
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 |
setStripCounts(int[] stripCounts)
Sets the counts for each strip. |
|
boolean |
setTriangle(int i0,
int i1,
int i2,
org.openmali.spatial.polygons.Triangle triangle)
Applies the the n-th Triangle to the GeometryArray. |
|
boolean |
setTriangle(org.openmali.spatial.polygons.Triangle triangle)
Applies the the n-th Triangle to the GeometryArray. |
|
void |
setValidVertexCount(int count)
Sets the number of vertices which will be rendered from this geometry array. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COORDINATES
public static final int BY_REFERENCE
public static final int INTERLEAVED
protected GeomNioFloatData coords
protected GeomNioIntData indexData
protected GeomNioFloatData interleavedData
protected boolean isInterleaved
protected final int maxVertices
protected int numVertices
protected int numIndices
protected long coordsOffset
protected static final boolean reversed
| Constructor Detail |
|---|
protected SimpleGeometryDataContainer(GeometryArrayType type,
boolean hasIndex,
int coordsSize,
int vertexCount,
int[] stripCounts,
int indexCount)
public SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount)
public SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int indexCount)
public SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int[] stripCounts)
public SimpleGeometryDataContainer(GeometryArrayType type,
int coordsSize,
int vertexCount,
int[] stripCounts,
int indexCount)
| Method Detail |
|---|
public final GeometryArrayType getType()
public final boolean isStrip()
true, if this Geometry is a Strippublic final int getFaceSize()
public final int getVertexCount()
getVertexCount in interface org.openmali.spatial.VertexContainerpublic final boolean isInterleaved()
true, if this Geometry is constructed by interleaved data
(one ByteBuffer for all data except index).public final boolean hasIndex()
true, if this Geometry has an Index.public void setCoordinateData(GeomNioFloatData data)
data - public final GeomNioFloatData getCoordinatesData()
public final int getCoordinatesSize()
public final long getCoordinatesOffset()
public final GeomNioFloatData getInterleavedData()
public void setInitialIndex(int initialIndex)
initialIndex - public final int getInitialIndex()
public void setValidVertexCount(int count)
count - public final int getValidVertexCount()
public final int getMaxVertexCount()
protected GeomNioFloatData newNioFloatData(int maxElements,
int elemSize,
int stride,
boolean reversed)
maxElements - elemSize - stride - reversed -
protected void createCoordinates()
protected final void checkCoordsExistence(int coordsSize)
public void setCoordinate(int vertexIndex,
float[] floatArray)
public void setCoordinate(int vertexIndex,
org.openmali.vecmath2.Tuple3f point3f)
vertexIndex - The index of the vertex to modifypoint3f - The new coordinates
public void setCoordinates(int vertexIndex,
float[] floatArray,
int startIndex,
int length)
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
public void setCoordinates(int vertexIndex,
org.openmali.vecmath2.Tuple3f[] point3fArray,
int startIndex,
int length)
vertexIndex - The index of the first vertex to be modified.point3fArray - The new coordinatesstartIndex - The index of the first coordinate in the given arraylength - The number of coordinates to copy
public void setCoordinates(int vertexIndex,
float[] floatArray)
vertexIndex - The index of the first vertex to modifyfloatArray - The new coordinates. The size of the array must be a
multiple of 3.
public void setCoordinates(int vertexIndex,
org.openmali.vecmath2.Tuple3f[] point3fArray)
vertexIndex - The index of the first vertex to modifypoint3fArray - The new coordinates.
public void setCoordinates(int vertexIndex,
java.util.List<org.openmali.vecmath2.Tuple3f> point3fList)
public void setCoordinate(int vertexIndex,
float x,
float y,
float z)
vertexIndex - The index of the vertex to modifyx - The new coordinatesy - The new coordinatesz - The new coordinates
public void getCoordinate(int vertexIndex,
float[] floatArray)
public <T extends org.openmali.vecmath2.Tuple3f> T getCoordinate(int index,
T point)
public boolean getVertex(int i,
org.openmali.vecmath2.Tuple3f pos)
getVertex in interface org.openmali.spatial.VertexContainer
public void getCoordinates(int vertexIndex,
float[] floatArray)
public void getCoordinates(int vertexIndex,
org.openmali.vecmath2.Tuple3f[] point3fArray)
public boolean setTriangle(int i0,
int i1,
int i2,
org.openmali.spatial.polygons.Triangle triangle)
i0 - the first triangle's vertex-indexi1 - the second triangle's vertex-indexi2 - the third triangle's vertex-indextriangle -
public final boolean setTriangle(org.openmali.spatial.polygons.Triangle triangle)
triangle -
public boolean getTriangle(int i0,
int i1,
int i2,
org.openmali.spatial.polygons.Triangle triangle)
i0 - the first triangle's vertex-indexi1 - the second triangle's vertex-indexi2 - the third triangle's vertex-indextriangle -
public final int getIndexCount()
public void setIndex(int[] indices)
indices -
public void setIndex(int i,
int idx)
i - idx - public final void getIndex(int[] index)
public final int getIndex(int i)
public final GeomNioIntData getIndexData()
public final int getNumStrips()
public void setStripCounts(int[] stripCounts)
stripCounts - public final int[] getStripCounts()
public void getStripCounts(int[] sCounts)
sCounts - public float[] getCoordRefFloat()
protected void setNioBuffers()
protected void copyFrom(SimpleGeometryDataContainer o,
boolean forceDuplicate)
o - forceDuplicate -
protected GeomNioIntData newNioIntData(int maxElems,
int elemSize,
boolean reversed)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||