Package jahuwaldt.j3d.geom
Class GeometryData
- java.lang.Object
-
- jahuwaldt.j3d.geom.GeometryData
-
- All Implemented Interfaces:
java.lang.Cloneable
public class GeometryData extends java.lang.Object implements java.lang.Cloneable
Data representation of geometry information that is created through the various generator classes in this package.This data representation is used to hold information needed to generate geometry from one of the generator classes in this package. In general, data does not get filled in for items that are not requested.
The type of data to be produced can be changed with each call. While it is possible to ask for both 2D and 3D texture coordinates, the code will only generate 2D values if asked.
- Version:
- $Revision: 1.10 $
- Author:
- Justin Couch
-
-
Field Summary
Fields Modifier and Type Field Description int[]colorIndexesStorage for color index information if the shape type requires it.float[]colorsColour values if using per-vertex coloring.float[]coordinatesStorage for coordinate information.intgeometryComponentsThe attributes of the geometry you want created.intgeometrySubTypeA generator specific field that describes the type of output algorithm you would like to use for the geometry.intgeometryTypeThis is the type of geometry that you want to have madestatic intINDEXED_LINE_STRIPSGenerate the geometry as an indexed line strip arraystatic intINDEXED_LINESGenerate the geometry as an indexed line arraystatic intINDEXED_QUADSGenerate the geometry as indexed quadsstatic intINDEXED_TRIANGLE_FANSGenerate the geometry as an indexed triangle fan arraystatic intINDEXED_TRIANGLE_STRIPSGenerate the geometry as an indexed triangle strip arraystatic intINDEXED_TRIANGLESGenerate the geometry as an indexed triangle arrayint[]indexesStorage for coordinate index information if the shape type requires it.intindexesCountThe number of items stored in the indexes arraystatic intLINE_STRIPSGenerate the geometry as an line strip arraystatic intLINESGenerate the geometry as a line arraystatic intNORMAL_DATARequest for lighting normal data to be producedint[]normalIndexesStorage for normal index information if the shape type requires it.float[]normalsStorage for lighting normal information.intnumStripsThe number of items stored in the strip countsstatic intQUADSGenerate the geometry as individual unindexed quadsint[]stripCountsStorage for strip counts if the shape type uses itint[]texCoordIndexesStorage for texture coordinate index information if the shape type requires it.static intTEXTURE_2D_DATARequest for 2D Texture coordinate data to be producedstatic intTEXTURE_3D_DATARequest for 3D Texture coordinate data to be producedfloat[]textureCoordinatesTexture coordinate information if requested.static intTRIANGLE_FANSGenerate the geometry as a triangle fan array(s)static intTRIANGLE_STRIPSGenerate the geometry as a triangle strip array(s)static intTRIANGLESGenerate the geometry as individual unindexed trianglesintvertexCountThe number of vertices stored in the coordinates array
-
Constructor Summary
Constructors Constructor Description GeometryData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Make a copy of this object with identical data.voidprettyPrint()Convenience method to print out all the data associated with this geometry array.
-
-
-
Field Detail
-
TRIANGLES
public static final int TRIANGLES
Generate the geometry as individual unindexed triangles- See Also:
- Constant Field Values
-
QUADS
public static final int QUADS
Generate the geometry as individual unindexed quads- See Also:
- Constant Field Values
-
TRIANGLE_STRIPS
public static final int TRIANGLE_STRIPS
Generate the geometry as a triangle strip array(s)- See Also:
- Constant Field Values
-
TRIANGLE_FANS
public static final int TRIANGLE_FANS
Generate the geometry as a triangle fan array(s)- See Also:
- Constant Field Values
-
INDEXED_QUADS
public static final int INDEXED_QUADS
Generate the geometry as indexed quads- See Also:
- Constant Field Values
-
INDEXED_TRIANGLES
public static final int INDEXED_TRIANGLES
Generate the geometry as an indexed triangle array- See Also:
- Constant Field Values
-
INDEXED_TRIANGLE_STRIPS
public static final int INDEXED_TRIANGLE_STRIPS
Generate the geometry as an indexed triangle strip array- See Also:
- Constant Field Values
-
INDEXED_TRIANGLE_FANS
public static final int INDEXED_TRIANGLE_FANS
Generate the geometry as an indexed triangle fan array- See Also:
- Constant Field Values
-
LINES
public static final int LINES
Generate the geometry as a line array- See Also:
- Constant Field Values
-
LINE_STRIPS
public static final int LINE_STRIPS
Generate the geometry as an line strip array- See Also:
- Constant Field Values
-
INDEXED_LINES
public static final int INDEXED_LINES
Generate the geometry as an indexed line array- See Also:
- Constant Field Values
-
INDEXED_LINE_STRIPS
public static final int INDEXED_LINE_STRIPS
Generate the geometry as an indexed line strip array- See Also:
- Constant Field Values
-
NORMAL_DATA
public static final int NORMAL_DATA
Request for lighting normal data to be produced- See Also:
- Constant Field Values
-
TEXTURE_2D_DATA
public static final int TEXTURE_2D_DATA
Request for 2D Texture coordinate data to be produced- See Also:
- Constant Field Values
-
TEXTURE_3D_DATA
public static final int TEXTURE_3D_DATA
Request for 3D Texture coordinate data to be produced- See Also:
- Constant Field Values
-
geometryType
public int geometryType
This is the type of geometry that you want to have made
-
geometrySubType
public int geometrySubType
A generator specific field that describes the type of output algorithm you would like to use for the geometry. May be ignored.
-
geometryComponents
public int geometryComponents
The attributes of the geometry you want created. This is an OR'd list of the above variables. It is not possible to generate anything without the raw geometry being computed.
-
vertexCount
public int vertexCount
The number of vertices stored in the coordinates array
-
coordinates
public float[] coordinates
Storage for coordinate information. These are stored in flat [x1, y1, z1, x2, y2, z2, ...] configuration
-
normals
public float[] normals
Storage for lighting normal information. This should be at least the length of the coordinates array. Data is stored in the same fashion. If normals are requested, the count is the same as vertexCount.
-
indexesCount
public int indexesCount
The number of items stored in the indexes array
-
indexes
public int[] indexes
Storage for coordinate index information if the shape type requires it.
-
numStrips
public int numStrips
The number of items stored in the strip counts
-
stripCounts
public int[] stripCounts
Storage for strip counts if the shape type uses it
-
textureCoordinates
public float[] textureCoordinates
Texture coordinate information if requested. May be 2D or 3D depending on the requested type. If 2D the values are stored [s1, t1, s2, t2...] For 3D coordinates it is stores as [r1, s1, t1, r2, s2, t2,...]
-
colors
public float[] colors
Colour values if using per-vertex coloring. This array will be identical in length to the coordinate array and index values match etc.
-
normalIndexes
public int[] normalIndexes
Storage for normal index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
-
texCoordIndexes
public int[] texCoordIndexes
Storage for texture coordinate index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
-
colorIndexes
public int[] colorIndexes
Storage for color index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
-
-
Constructor Detail
-
GeometryData
public GeometryData()
-
-
Method Detail
-
prettyPrint
public void prettyPrint()
Convenience method to print out all the data associated with this geometry array. Prints one vertex per line. Ignores index information.
-
clone
public java.lang.Object clone()
Make a copy of this object with identical data. Does a deep copy of all data associated.- Returns:
- The copy of the data
-
-