|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.NodeComponent
org.xith3d.scenegraph.Geometry
org.xith3d.scenegraph.GeometryTranslocator
public class GeometryTranslocator
A geometry translocator provides an optimized method for drawing many copies of a geometry array at different locations. This wraps any standard geometry array.
Each translocator node specifies the start vertex index, the vertex count, the color and a transformation matrix. You can specify as many translocator nodes as desired.
This allows for high speed rendering of these transloctor nodes because the geometry is setup and bound once before looping through and rendering each object. This makes it ideal for displaying grass, weeds and other types of vegetation which represents nothing more than variations on a theme.
It is up to the programmer to optimize the translocator nodes for Frustum culling. Generally the nodes are adjusted one a per frame basis by the application.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.xith3d.scenegraph.Geometry |
|---|
Geometry.Optimization |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
XITH3D_USERDATAKEY_OLDUSERDATA |
| Constructor Summary | |
|---|---|
GeometryTranslocator(GeometryArray geom)
|
|
| Method Summary | |
|---|---|
void |
addNode(TranslocatorNode node)
|
void |
clearNodes()
|
GeometryTranslocator |
cloneNodeComponent(boolean forceDuplicate)
|
protected void |
duplicateNodeComponent(NodeComponent original,
boolean forceDuplicate)
|
void |
freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components. |
GeometryArray |
getGeometry()
|
java.util.ArrayList<TranslocatorNode> |
getNodes()
|
int |
getTexCoordSize(int unit)
|
boolean |
getVertex(int i,
org.openmali.vecmath2.Tuple3f pos)
|
int |
getVertexCount()
|
int |
getVertexFormat()
|
boolean |
hasColorAlpha()
|
boolean |
hasColors()
|
boolean |
hasFeature(int flag)
|
boolean |
hasIndex()
|
boolean |
hasNormals()
|
boolean |
hasTextureCoordinates()
|
boolean |
hasVertexAttributes()
|
boolean |
isStrip()
|
boolean |
isTriangulatable()
|
boolean |
isTriangulated()
|
void |
setGeometry(GeometryArray g)
|
| Methods inherited from class org.xith3d.scenegraph.Geometry |
|---|
getCachedBounds, getOptimization, isBoundsDirty, setBoundsDirty, setCachedBounds, setOptimization |
| Methods inherited from class org.xith3d.scenegraph.NodeComponent |
|---|
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener |
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GeometryTranslocator(GeometryArray geom)
| Method Detail |
|---|
public void setGeometry(GeometryArray g)
public final GeometryArray getGeometry()
public void clearNodes()
public void addNode(TranslocatorNode node)
public final java.util.ArrayList<TranslocatorNode> getNodes()
public final int getVertexFormat()
getVertexFormat in class Geometrypublic final boolean hasFeature(int flag)
hasFeature in class Geometrypublic final int getVertexCount()
public final boolean getVertex(int i,
org.openmali.vecmath2.Tuple3f pos)
public final boolean hasNormals()
hasNormals in class Geometrypublic final boolean hasColors()
hasColors in class Geometrypublic final boolean hasColorAlpha()
hasColorAlpha in class Geometrypublic final boolean hasTextureCoordinates()
hasTextureCoordinates in class Geometrypublic final int getTexCoordSize(int unit)
getTexCoordSize in class Geometrypublic final boolean hasVertexAttributes()
hasVertexAttributes in class Geometrypublic final boolean hasIndex()
hasIndex in class Geometrytrue, if this Geometry has an Indexpublic final boolean isStrip()
isStrip in class Geometrytrue, if this Geometry is a Strippublic final boolean isTriangulatable()
isTriangulatable in class Geometrytrue, if this Geometry is built of triangles or can at least be interpreted as triangles.public final boolean isTriangulated()
isTriangulated in class Geometrytrue, if this Geometry is built of triangles.
protected void duplicateNodeComponent(NodeComponent original,
boolean forceDuplicate)
duplicateNodeComponent in class NodeComponentpublic void freeOpenGLResources(CanvasPeer canvasPeer)
freeOpenGLResources in class NodeComponentpublic GeometryTranslocator cloneNodeComponent(boolean forceDuplicate)
cloneNodeComponent in class Geometry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||