|
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 org.j3d.aviatrix3d.IndexedVertexGeometry org.j3d.aviatrix3d.IndexedQuadArray
public class IndexedQuadArray
An OpenGL QuadArray.
Part of the optimisation we make is to only copy into the underlying structures the exact number of coordinates, normals etc that are needed. To know this number, we need to know how many coordinates exist before attempting to set anything else. When constructing, or updating, geometry, you should always make sure that you first set the vertex list, then the sizing information for the strip or fan counts, and then set normals as needed.
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.IndexedVertexGeometry |
---|
indexBuffer, indices, numIndices, numIndicesUsed, vboElementIdMap |
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 | |
---|---|
IndexedQuadArray()
Constructs a QuadArray with default values. |
|
IndexedQuadArray(boolean useVbo,
int vboHint)
Constructs an instance. |
Method Summary | |
---|---|
int |
compareTo(IndexedQuadArray ta)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
protected int |
computeBufferSize()
Compute the total size of vertex buffer data, used for allocating VBOs. |
boolean |
equals(IndexedQuadArray ta)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
protected int |
fillBufferData(javax.media.opengl.GL gl)
Fill VBOs with vertex buffer data. |
boolean |
pickLineRay(float[] origin,
float[] direction,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line ray and return the exact distance away of the closest picking point. |
boolean |
pickLineSegment(float[] start,
float[] end,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line segment and return the exact distance away of the closest picking point. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
render(javax.media.opengl.GL gl)
Issue ogl commands needed for this renderable object. |
void |
setEdgeFlags(boolean[] flags)
Set the edge flag reference to the new array. |
Methods inherited from class org.j3d.aviatrix3d.IndexedVertexGeometry |
---|
cleanup, createBuffer, getIndices, getValidIndexCount, isVisible, setIndices, setVBOEnabled, setVertexStateVBO |
Methods inherited from class org.j3d.aviatrix3d.Geometry |
---|
addParent, boundsChanged, checkPickMask, getBounds, getPickableBounds, getPickMask, getPickTargetType, hasTransparency, markBoundsDirty, pickBatch, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.GeometryRenderable |
---|
hasTransparency |
Constructor Detail |
---|
public IndexedQuadArray()
public IndexedQuadArray(boolean useVbo, int vboHint)
useVbo
- Should we use vertex buffer objectsvboHint
- Hints for how to setup VBO. Valid values are VBO_HINT_*Method Detail |
---|
public void render(javax.media.opengl.GL gl)
gl
- The gl context to draw withprotected 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.
computeBufferSize
in class VertexGeometry
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.
fillBufferData
in class IndexedVertexGeometry
public boolean pickLineSegment(float[] start, float[] end, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineSegment
in interface LeafPickTarget
pickLineSegment
in class Geometry
start
- The start point of the segmentend
- The end point of the segmentfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywaypublic boolean pickLineRay(float[] origin, float[] direction, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineRay
in interface LeafPickTarget
pickLineRay
in class Geometry
origin
- The start point of the raydirection
- The direction vector of the rayfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywayprotected void recomputeBounds()
recomputeBounds
in class IndexedVertexGeometry
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setEdgeFlags(boolean[] flags) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the data changed callback.
flags
- The new array reference to use for edge flag information
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback method
java.lang.IllegalArgumentException
public int compareTo(IndexedQuadArray ta)
ta
- The argument instance to be compared
public boolean equals(IndexedQuadArray ta)
ta
- The geometry instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |