|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.Geometry
org.j3d.aviatrix3d.VertexGeometry
org.j3d.aviatrix3d.TriangleArray
An OpenGL TriangleArray representation.
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.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_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG |
Fields inherited from interface org.j3d.aviatrix3d.PickableObject |
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Constructor Summary | |
TriangleArray()
Constructs a TriangleArray with default values. |
Method Summary | |
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. |
void |
postRender(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state. |
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this renderable object. |
void |
setEdgeFlags(boolean[] flags)
Set the edge flag reference to the new array. |
void |
setValidVertexCount(int count)
Set the number of vertices to the new number. |
void |
setVertices(int type,
float[] vertices,
int numValid)
Set the vertex array reference to the new array. |
Methods inherited from class org.j3d.aviatrix3d.Geometry |
addParent, boundsChanged, getBounds, getPickMask, hasTransparency, markBoundsDirty, pickBatch, pickSingle, removeParent, setBounds, setPickMask |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
addParent, getParents, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TriangleArray()
Method Detail |
public void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
gl
- The gl context to draw withglu
- The utility context to draw withpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
gl
- The gl context to draw withglu
- The utility context to draw withpublic void setValidVertexCount(int count) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the bounds changed callback.
setValidVertexCount
in class VertexGeometry
count
- The new number, must be >= 0
java.lang.IllegalStateException
- This call was not made during the update
callback if the node is live
java.lang.IllegalArgumentException
- The number is negative
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setVertices(int type, float[] vertices, int numValid) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, InvalidWriteTimingException
In a live scene graph, can only be called during the bounds changed callback.
setVertices
in class VertexGeometry
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.IllegalStateException
- This call was not made during the update
callback if the node is live
java.lang.IllegalArgumentException
- The number is negative
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic boolean pickLineSegment(float[] start, float[] end, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
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 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 anywaypublic void setEdgeFlags(boolean[] flags) throws java.lang.IllegalStateException, 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
java.lang.IllegalStateException
- This call was not made during the update
callback if the node is live
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback method
java.lang.IllegalArgumentException
|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |