|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.Geometry org.j3d.aviatrix3d.VertexGeometry
public abstract class VertexGeometry
Common representation of all vertex-based geometry.
This class represents the raw values of the geometry. How these are turned
into a rendered primitive by OpenGL is dependent on the derived class.
Internally all the geometry is stored by reference to the user provided
array of data, but a copy is made and placed in an instance of a
FloatBuffer
. The buffer is used as it is an optimisation
step used at the OpenGL level for faster rendering. If the user changes
the values in their array, we won't know about it unless the user calls the
appropriate setter method, at which point we'll update our array.
Currently the class does not take any sort of optimisation hints. This is a design task in the future. For example, we would like to hint that the class should use interleaved geometry instead of a single array for each data type.
For the alpha flag setting, the current approach is pretty dumb. If you
have hasAlpha as true in the setColor()
method call then
we blindly assume that you really do have some values that have non-one
transparency, and thus it will get put into the list of transparent objects
during transparency sorting. If you really want to avoid this, then only
set 3-component colour values.
Geometry may have one of two forms of color. The traditional per-vertex colours are available. In this mode there must be one colour value for each vertex value provided. We do not allow short arrays to be provided, and arrays of values longer than the current number of vertices ignore the extras. In the second mode, a single colour value can be supplied that is applied to all the geometry in this instance. This is useful if you want to have coloured geometry rendering without the lighting effects that would require the use of material properties. An advantage is that far less data is pushed to the video card and less state changing too. It is particularly useful for CAD-style data that only uses per-part colours with no texturing and no lighting.
Reading Values
The data stored here is kept by reference as well as the copy to the internal buffers. The getter methods provided here copy the referenced array into the user provided array. This can be a significant performance hit. If you need to access the data and the user application is keeping references to the provided arrays, there is no need to use the getter methods here - just read the array directly. We make no changes, so what you put in is what you would get out too.
A number of flags are defined for the picking that allow the user to define what they would like returned in the data array. If more than one flag is specified, the order needs to be known so that sense can be made from the array. The order is defined as follows:
Internationalisation Resource Names
Field Summary | |
---|---|
protected static int |
ATTRIB_CLEAR
Mask to clear the shader vertex attributes setting |
protected static int |
ATTRIB_MASK
Mask to work out if shader vertex attributes are used |
protected int[] |
attribIds
Listing of the valid attribute IDs for rendering |
protected static int |
ATTRIBS
Edge values are shader vertex attributes in the data |
protected org.j3d.util.IntHashMap |
attributes
Map of the attribute Ids to their data (ref to user array). |
protected static int |
COLOR_3
RGB colour values are supplied in the data |
protected static int |
COLOR_4
RGBA colour values are supplied in the data |
protected static int |
COLOR_CLEAR
Mask to clear the per-vertex colour setting |
protected static int |
COLOR_MASK
Mask to work out if colours are used |
protected static int |
COLOR_SINGLE
A single colour value is supplied in the data. |
protected static int |
COLOR2
Secondary color values are supplied in the data |
protected static int |
COLOR2_CLEAR
Mask to clear the per-vertex secondary colour setting |
protected static int |
COLOR2_MASK
Mask to work out if secondary colours are used |
protected java.nio.FloatBuffer |
color2Buffer
Buffer for holding secondary color data |
protected float[] |
color2s
Reference to the user array of secondary colors used |
protected java.nio.FloatBuffer |
colorBuffer
Buffer for holding colour data |
protected float[] |
colors
Reference to the user array of colors used |
static int |
COORDINATE_2
2D Coordinate information is included in the vertex values |
static int |
COORDINATE_3
3D Coordinate information is included in the vertex values |
static int |
COORDINATE_4
4D Coordinate information is included in the vertex values |
protected static int |
COORDINATE_CLEAR
Mask to clear the coordinate setting |
protected static int |
COORDINATE_MASK
Mask to work out what coordinates are used |
protected float[] |
coordinates
Reference to the user array of coordinates used |
protected GLStateMap |
dataChanged
State map indicating sources have changed |
protected static int |
EDGE_CLEAR
Mask to clear the edge flag setting |
protected static int |
EDGE_MASK
Mask to work out if edge flags are used |
protected static int |
EDGES
Edge values are supplied in the data |
protected static int |
FOG
Fog coordinate values are supplied in the data |
protected static int |
FOG_CLEAR
Mask to clear the fog coordinate setting |
protected static int |
FOG_MASK
Mask to work out if fog coordinates are used |
protected java.nio.FloatBuffer |
fogBuffer
Buffer for holding fog coordinate data |
protected float[] |
fogCoords
Reference to the user array of fog coordinates used |
protected static boolean |
hasMultiTextureAPI
Global flag to know if we are capable of rendering multitextures. |
static int |
INTERSECT_ALL
Bit mask combining everything to return all information available |
static int |
INTERSECT_COLOR
Bit mask to select colour information to be returned. |
static int |
INTERSECT_COORDS
Bit mask to select vertex information to be returned. |
static int |
INTERSECT_NORMAL
Bit mask to select normal information to be returned. |
static int |
INTERSECT_TEXCOORDS_MULTI
Bit mask to select all texture coordinates of all units. |
static int |
INTERSECT_TEXCOORDS_SINGLE
Bit mask to select the texture coordinates of just the first unit. |
protected static int |
maxTextureUnits
Global flag indicating the maximum number of texture units the current hardware supports. |
protected static int |
NORMAL_CLEAR
Mask to clear the normal setting |
protected java.nio.FloatBuffer |
normalBuffer
Buffer for holding normal data |
protected float[] |
normals
Reference to the user array of normals used |
protected static int |
NORMALS
Normal information is included in the vertex values |
protected int |
numCoords
Number of valid entries in the coordinate array |
protected int |
numRenderedTextureSets
Maximum number of renderable sets. |
protected int |
numRequiredCoords
The number of coordinates actually required as defined by the geometry type. |
protected int |
numTextureArrays
The number of valid texture arrays in the textures variable |
protected int |
numTextureSets
The number of texture sets to use from the textureSet array |
protected static int |
TEXTURE_CLEAR
Mask to clear the texture coordinate setting |
static int |
TEXTURE_COORDINATE_1
1D texture coordinates are included in the vertex values |
static int |
TEXTURE_COORDINATE_2
2D texture coordinates are included in the vertex values |
static int |
TEXTURE_COORDINATE_3
3D texture coordinates are included in the vertex values |
static int |
TEXTURE_COORDINATE_4
4D texture coordinates are included in the vertex values |
protected static int |
TEXTURE_COORDINATE_MULTI
Multiple sets of texture coordinates are included in the vertex values |
protected static int |
TEXTURE_COORDINATE_SINGLE
Single set of texture coordinates are included in the vertex values |
protected static int |
TEXTURE_MASK
Mask to work out if texture coordinates are used |
protected static int |
TEXTURE_SET_AVAILABLE
Has a valid texture set provided |
protected static int |
TEXTURE_SET_CLEAR
Has a valid texture set provided |
protected java.nio.FloatBuffer[] |
textureBuffer
Buffer for holding texture coordinate data |
protected float[][] |
textures
Reference to the user array of textures used, indexed by set |
protected int[] |
textureSets
The texture set map array that describes how to map the arrays |
protected int[] |
textureTypes
Flags for the texture type for each array. |
protected boolean |
useVbo
Should we use VBO's to store data |
static int |
VBO_HINT_DYNAMIC
VBO Hint for Dynamic geometry |
static int |
VBO_HINT_STATIC
VBO Hint for Static geometry |
static int |
VBO_HINT_STREAM
VBO Hint for Streamed geometry |
protected static boolean |
vboAvailable
Are VBO's available |
protected int |
vboHint
How are VBO's going to be used |
protected java.util.HashMap<javax.media.opengl.GL,java.lang.Integer> |
vboIdMap
Map of VBO IDs. |
protected static boolean |
vboQueryComplete
Is the gl query for VBOs done? |
protected java.nio.FloatBuffer |
vertexBuffer
Buffer for holding vertex data |
protected int |
vertexFormat
The format of the geometry used |
protected float[] |
wkPolygon
Working places for a single quad/triangle |
Fields inherited from class org.j3d.aviatrix3d.Geometry |
---|
bounds, implicitBounds, internalUpdater, INVALID_BOUNDS, lastParentList, parentList, pickFlags, validAlpha |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject |
---|
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget |
---|
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE |
Constructor Summary | |
---|---|
protected |
VertexGeometry()
Constructs an instance with pre-defined values with default values. |
protected |
VertexGeometry(boolean useVbo,
int vboHint)
Constructs an instance. |
Method Summary | |
---|---|
void |
cleanup(javax.media.opengl.GL gl)
Cleanup the object now for the given GL context. |
protected void |
clearVertexState(javax.media.opengl.GL gl)
Convenience method to clear the previously set state in the rendering pipeline. |
protected int |
computeBufferSize()
Compute the total size of vertex buffer data, used for allocating VBOs. |
protected int |
fillBufferData(javax.media.opengl.GL gl)
Fill VBOs with vertex buffer data. |
void |
getColor(int index,
float[] color)
Get the color values at the given index. |
void |
getColors(float[] col)
Retrieve the colours that are currently set. |
void |
getFogCoordinates(float[] fogs)
Retrieve the fog coordinates that are currently set. |
void |
getFogCoordinates(int index,
float[] fogs)
Retrieve the fog coordinates at the given index. |
void |
getNormal(int index,
float[] n)
Get the color values at the given index. |
void |
getNormals(float[] n)
Retrieve the normals that are currently set. |
void |
getSecondaryColors(float[] cols)
Retrieve the secondary colors that are currently set. |
void |
getSecondaryColors(int index,
float[] cols)
Retrieve the fog coordinates at the given index. |
void |
getTextureCoordinate(int index,
int set,
float[] coords)
Retrieve the texture coordinates that are currently set. |
void |
getTextureCoordinates(float[][] coords)
Retrieve the texture coordinates that are currently set. |
int |
getValidVertexCount()
Get the number of vertices that are valid in the geometry arrays. |
boolean |
getVBOEnabled()
Get whether Vertex Buffer Objects are used. |
int |
getVBOHint()
Get how VBO's are optimized on the graphics card. |
void |
getVertex(int index,
float[] coord)
Get the vertex values at the given index. |
int |
getVertexType()
Get the current vertex format type - 2D, 3D, or 4D. |
void |
getVertices(float[] vertices)
Retrieve the vertices that are currently set. |
protected void |
initPolygonDetails(int numCoords)
Initialize the internal arrays to a given size for the picking. |
boolean |
is2D()
Check to see whether this shape is something that represents 2D or 3D geometry. |
boolean |
isMultiTextureAllowed()
Convenience method to check if this code has detected the prescense of multitexture extensions. |
protected boolean |
isVisible()
Check to see if this geometry is making the geometry visible or not. |
int |
numTextureUnits()
Request the maximum number of texture units available on this hardware. |
protected boolean |
ray3DQuadChecked(float[] origin,
float[] direction,
float length,
float[] dataOut)
Private version of the ray - Polygon intersection test that does not do any bounds checking on arrays and assumes everything is correct. |
protected boolean |
ray3DTriangleChecked(float[] origin,
float[] direction,
float length,
float[] dataOut)
Private version of the ray - Polygon intersection test that does not do any bounds checking on arrays and assumes everything is correct. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
setAttributes(int index,
int size,
byte[] attribs,
boolean normalise,
boolean signed)
Set the attribute values at the given index to a new value. |
void |
setAttributes(int index,
int size,
double[] attribs,
boolean normalise)
Set the attribute values at the given index to a new value. |
void |
setAttributes(int index,
int size,
float[] attribs,
boolean normalise)
Set the attribute values at the given index to a new value. |
void |
setAttributes(int index,
int size,
int[] attribs,
boolean normalise,
boolean signed)
Set the attribute values at the given index to a new value. |
void |
setAttributes(int index,
int size,
short[] attribs,
boolean normalise,
boolean signed)
Set the attribute values at the given index to a new value. |
void |
setColors(boolean hasAlpha,
float[] colors)
Set the color array reference to the new array. |
void |
setFogCoordinates(float[] coords)
Set the fog coordinate reference to the new array. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setNormals(float[] normals)
Set the normal array reference to the new array. |
void |
setSecondaryColors(float[] colors)
Set the secondary color reference to the new array. |
void |
setSingleColor(boolean hasAlpha,
float[] color)
Set a single color value to be used by all the vertices. |
void |
setTextureCoordinates(int[] types,
float[][] texCoords)
Replace all the texture array reference with the new array. |
void |
setTextureCoordinates(int[] types,
float[][] texCoords,
int numSets)
Replace all the texture array reference to the new array. |
void |
setTextureCoordinates(int type,
int textureSet,
float[] texCoords)
Set a single texture array reference to the new array. |
void |
setTextureSetMap(int[] set)
Set the texture set map to the new mapping. |
void |
setTextureSetMap(int[] set,
int numValid)
Set the texture set map to the new mapping. |
void |
setValidVertexCount(int count)
Set the number of vertices to the new number. |
void |
setVBOEnabled(boolean enabled)
Set whether Vertex Buffer Objects are used. |
void |
setVBOHint(int hint)
Set how VBO's are optimized on the graphics card. |
protected void |
setVertexState(javax.media.opengl.GL gl)
Convenience method to pass everything to the rendering pipeline. |
protected void |
setVertexStateVBO(javax.media.opengl.GL gl)
Handles state setting when VBOs are used. |
void |
setVertices(int type,
float[] vertices)
Set the vertex array reference to the new array. |
void |
setVertices(int type,
float[] vertices,
int numValid)
Set the vertex array reference to the new array. |
protected void |
updateBounds()
Update this node's bounds and then call the parent to update it's bounds. |
Methods inherited from class org.j3d.aviatrix3d.Geometry |
---|
addParent, boundsChanged, checkPickMask, getBounds, getPickableBounds, getPickMask, getPickTargetType, hasTransparency, markBoundsDirty, pickBatch, pickLineRay, pickLineSegment, pickSingle, removeParent, setBounds, setPickMask |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.GeometryRenderable |
---|
hasTransparency, render |
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable |
---|
equals |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final int VBO_HINT_STREAM
public static final int VBO_HINT_STATIC
public static final int VBO_HINT_DYNAMIC
public static final int COORDINATE_2
public static final int COORDINATE_3
public static final int COORDINATE_4
protected static final int COORDINATE_MASK
protected static final int COORDINATE_CLEAR
protected static final int NORMALS
protected static final int NORMAL_CLEAR
protected static final int TEXTURE_MASK
protected static final int TEXTURE_CLEAR
protected static final int TEXTURE_COORDINATE_SINGLE
protected static final int TEXTURE_COORDINATE_MULTI
protected static final int TEXTURE_SET_AVAILABLE
protected static final int TEXTURE_SET_CLEAR
protected static final int COLOR_MASK
protected static final int COLOR_CLEAR
protected static final int COLOR_3
protected static final int COLOR_4
protected static final int COLOR_SINGLE
protected static final int EDGE_MASK
protected static final int EDGE_CLEAR
protected static final int EDGES
protected static final int COLOR2_MASK
protected static final int COLOR2_CLEAR
protected static final int COLOR2
protected static final int FOG_MASK
protected static final int FOG_CLEAR
protected static final int FOG
protected static final int ATTRIB_MASK
protected static final int ATTRIB_CLEAR
protected static final int ATTRIBS
public static final int TEXTURE_COORDINATE_1
public static final int TEXTURE_COORDINATE_2
public static final int TEXTURE_COORDINATE_3
public static final int TEXTURE_COORDINATE_4
public static final int INTERSECT_COORDS
public static final int INTERSECT_COLOR
public static final int INTERSECT_NORMAL
public static final int INTERSECT_TEXCOORDS_SINGLE
public static final int INTERSECT_TEXCOORDS_MULTI
public static final int INTERSECT_ALL
protected static boolean hasMultiTextureAPI
protected static int maxTextureUnits
protected float[] wkPolygon
protected java.nio.FloatBuffer vertexBuffer
protected java.nio.FloatBuffer colorBuffer
protected java.nio.FloatBuffer normalBuffer
protected java.nio.FloatBuffer fogBuffer
protected java.nio.FloatBuffer color2Buffer
protected java.nio.FloatBuffer[] textureBuffer
protected float[] coordinates
protected int numCoords
protected int numRequiredCoords
protected float[] normals
protected float[][] textures
protected int numTextureArrays
protected int[] textureSets
protected int[] textureTypes
protected int numTextureSets
protected int numRenderedTextureSets
protected float[] colors
protected float[] color2s
protected float[] fogCoords
protected int[] attribIds
protected org.j3d.util.IntHashMap attributes
protected int vertexFormat
protected static boolean vboQueryComplete
protected static boolean vboAvailable
protected boolean useVbo
protected int vboHint
protected java.util.HashMap<javax.media.opengl.GL,java.lang.Integer> vboIdMap
protected GLStateMap dataChanged
Constructor Detail |
---|
protected VertexGeometry()
protected VertexGeometry(boolean useVbo, int vboHint)
useVbo
- Should we use vertex buffer objectsvboHint
- Hints for how to setup VBO. Valid values are VBO_HINT_*.Method Detail |
---|
protected boolean isVisible()
isVisible
in class Geometry
public boolean is2D()
EffectRenderable
, while 3D is.
Note that this can be changed depending on the type of geometry itself.
A Shape3D node with an IndexedLineArray that only has 2D coordinates is
as much a 2D geometry as a raster object.
is2D
in class Geometry
protected void updateBounds()
updateBounds
in class Geometry
protected void recomputeBounds()
recomputeBounds
in class Geometry
protected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic void cleanup(javax.media.opengl.GL gl)
cleanup
in interface DeletableRenderable
gl
- The gl context to draw withpublic int getVertexType()
public int getValidVertexCount()
public void setValidVertexCount(int count) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the bounds changed callback.
count
- The new number, must be >= 0
java.lang.IllegalArgumentException
- The number is negative
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void setVertices(int type, float[] vertices) throws InvalidWriteTimingException
In a live scene graph, can only be called during the bounds changed callback.
type
- The number of dimensions to the coordinates - 2D, 3D or 4Dvertices
- The new array reference to use for vertex information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void getVertices(float[] vertices)
vertices
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getVertex(int index, float[] coord)
index
- The index of the coordinate to getcoord
- The array to copy the coordinate value in to
java.lang.ArrayIndexOutOfBoundsException
- If the coord array is not big
enough for the coordinate dimensionspublic void setVertices(int type, float[] vertices, int numValid) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the bounds changed callback.
type
- The number of dimensions to the coordinates - 2D, 3D or 4Dvertices
- The new array reference to use for vertex informationnumValid
- The number of valid values to use in the array
java.lang.IllegalArgumentException
- The number is negative
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void setSingleColor(boolean hasAlpha, float[] color) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
hasAlpha
- true if this is 4 component colour, false for 3 componentcolor
- The new colour array
java.lang.IllegalArgumentException
- The length of the colors array is less
than the number of declared vertices
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setColors(boolean hasAlpha, float[] colors) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
hasAlpha
- true if this is 4 component colour, false for 3 componentcolors
- The new array reference to use for color information
java.lang.IllegalArgumentException
- The length of the colors array is less
than the number of declared vertices
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getColors(float[] col)
col
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getColor(int index, float[] color)
index
- The index of the coordinate to getcolor
- The array to copy the color value in to
java.lang.ArrayIndexOutOfBoundsException
- If the coord array is not big
enough for the coordinate dimensionspublic void setNormals(float[] normals) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
normals
- The new array reference to use for normal information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void getNormals(float[] n)
n
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getNormal(int index, float[] n)
index
- The index of the coordinate to getn
- The array to copy the normal value in to
java.lang.ArrayIndexOutOfBoundsException
- If the normal array is not big
enoughpublic void setTextureSetMap(int[] set) throws InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
set
- The new set to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setTextureSetMap(int[] set, int numValid) throws InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
set
- The new set to usenumValid
- The length of the set to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setTextureCoordinates(int type, int textureSet, float[] texCoords) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
type
- The texture type - 1D, 2D, 3D, 4D.textureSet
- The set to update with these arraystexCoords
- The new array reference to use for vertex information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback method
java.lang.IllegalArgumentException
public void setTextureCoordinates(int[] types, float[][] texCoords) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
types
- The sets of texture coordinate types that match each arraytexCoords
- The new array reference to use for vertex information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void setTextureCoordinates(int[] types, float[][] texCoords, int numSets) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
types
- The sets of texture coordinate types that match each arraytexCoords
- The new array reference to use for vertex informationnumSets
- The number of texture sets that are valid
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void getTextureCoordinates(float[][] coords)
coords
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getTextureCoordinate(int index, int set, float[] coords)
coords
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void setFogCoordinates(float[] coords) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE)
before
setting these values and then clear it afterwards.
In a live scene graph, can only be called during the data changed callback.
coords
- The new array reference to use for z depth values
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void getFogCoordinates(float[] fogs)
fogs
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getFogCoordinates(int index, float[] fogs)
index
- The index of the coordinate to getfogs
- The array to copy the fog coordinate value in to
java.lang.ArrayIndexOutOfBoundsException
- If the normal array is not big
enoughpublic void setSecondaryColors(float[] colors) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
colors
- The new array reference to use for secondary color
information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void getSecondaryColors(float[] cols)
cols
- The array to copy the values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void getSecondaryColors(int index, float[] cols)
index
- The index of the coordinate to getcols
- The array to copy the color value in to
java.lang.ArrayIndexOutOfBoundsException
- If the normal array is not big
enoughpublic void setAttributes(int index, int size, float[] attribs, boolean normalise) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
No checks are made on the index value and it is assumed the user
provides valid values for this after binding the index in the
ShaderProgram
class.
Note: If the index provided is zero, then this attribute will replace the vertex values (eg a glVertex() call) with the attribute value, as per the OpenGL specification.
In a live scene graph, can only be called during the data changed callback.
index
- The attribute index to set these values forsize
- The number of components: -1, 1, 2, 3 or 4attribs
- The new array reference to use for attribute informationnormalise
- true if the values should be normalised [-1.0, 1.0]
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void setAttributes(int index, int size, double[] attribs, boolean normalise) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
No checks are made on the index value and it is assumed the user
provides valid values for this after binding the index in the
ShaderProgram
class.
Note: If the index provided is zero, then this attribute will replace the vertex values (eg a glVertex() call) with the attribute value, as per the OpenGL specification.
In a live scene graph, can only be called during the data changed callback.
index
- The attribute index to set these values forsize
- The number of components: -1, 1, 2, 3 or 4attribs
- The new array reference to use for attribute informationnormalise
- true if the values should be normalised [-1.0, 1.0]
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void setAttributes(int index, int size, int[] attribs, boolean normalise, boolean signed) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
No checks are made on the index value and it is assumed the user
provides valid values for this after binding the index in the
ShaderProgram
class.
Note: If the index provided is zero, then this attribute will replace the vertex values (eg a glVertex() call) with the attribute value, as per the OpenGL specification.
In a live scene graph, can only be called during the data changed callback.
index
- The attribute index to set these values forsize
- The number of components: -1, 1, 2, 3 or 4attribs
- The new array reference to use for attribute informationnormalise
- true if the values should be normalised [-1.0, 1.0]signed
- false if this is unsigned ints, true for signed values
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void setAttributes(int index, int size, short[] attribs, boolean normalise, boolean signed) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
No checks are made on the index value and it is assumed the user
provides valid values for this after binding the index in the
ShaderProgram
class.
Note: If the index provided is zero, then this attribute will replace the vertex values (eg a glVertex() call) with the attribute value, as per the OpenGL specification.
In a live scene graph, can only be called during the data changed callback.
index
- The attribute index to set these values forsize
- The number of components: -1, 1, 2, 3 or 4attribs
- The new array reference to use for attribute informationnormalise
- true if the values should be normalised [-1.0, 1.0]signed
- false if this is unsigned shorts, true for signed values
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
public void setAttributes(int index, int size, byte[] attribs, boolean normalise, boolean signed) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
No checks are made on the index value and it is assumed the user
provides valid values for this after binding the index in the
ShaderProgram
class.
Note: If the index provided is zero, then this attribute will replace the vertex values (eg a glVertex() call) with the attribute value, as per the OpenGL specification.
In a live scene graph, can only be called during the data changed callback.
index
- The attribute index to set these values forsize
- The number of components: -1, 1, 2, 3 or 4attribs
- The new array reference to use for attribute informationnormalise
- true if the values should be normalised [-1.0, 1.0]signed
- false if this is unsigned shorts, true for signed values
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
protected int computeBufferSize()
setVertexStateVBO
, and should not be called
other places.
Must be overridden in subclasses that has vertex data in addition to what
is in VertexGeometry
. See TriangleArray
for
examples.
protected int fillBufferData(javax.media.opengl.GL gl)
setVertexStateVBO
, and should not be called
other places.
Must be overridden in subclasses that has vertex data in addition to what
is in VertexGeometry
. See TriangleArray
for
examples.
protected void setVertexStateVBO(javax.media.opengl.GL gl)
setVertexState(GL gl)
only!
protected final void setVertexState(javax.media.opengl.GL gl)
glDrawArrays()
or equivalent.
gl
- The gl context to draw withprotected final void clearVertexState(javax.media.opengl.GL gl)
glDrawArrays()
or equivalent.
gl
- The gl context to draw withprotected void initPolygonDetails(int numCoords)
numCoords
- The number of coordinates in the polygonprotected boolean ray3DTriangleChecked(float[] origin, float[] direction, float length, float[] dataOut)
This method does not use wkPoint.
origin
- The origin of the raydirection
- The direction of the raylength
- An optional length for to make the ray a segment. If
the value is zero, it is ignoreddataOut
- The intersection coordinates and more
protected boolean ray3DQuadChecked(float[] origin, float[] direction, float length, float[] dataOut)
This method does not use wkPoint.
origin
- The origin of the raydirection
- The direction of the raylength
- An optional length for to make the ray a segment. If
the value is zero, it is ignoreddataOut
- The intersection coordinates and more
public boolean isMultiTextureAllowed()
public int numTextureUnits()
public void setVBOEnabled(boolean enabled) throws InvalidWriteTimingException
enabled
- Should VBO's be used.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean getVBOEnabled()
public void setVBOHint(int hint) throws InvalidWriteTimingException
hint
- The hint
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getVBOHint()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |