org.xith3d.scenegraph
Interface GeomInterface

All Superinterfaces:
GeometryUpdater

public interface GeomInterface
extends GeometryUpdater

This interface defines a standard set of methods for interacting with dynamic geometry while hiding the underlying implementation.


Method Summary
 void addData(float[] coordData, float[] texCoordData, float[] normalData, float[] colorData)
          Super fast method add a bunch of data right into the data elements
 void addData(org.openmali.vecmath2.Tuple3f translate, int numCoords, float[] coordData, float[] texCoordData, float[] normalData, float alpha)
          Super fast method for moving a bunch of data into the data elements.
 void addData(org.openmali.vecmath2.Tuple3f translate, int numCoords, float[] coordData, float[] texCoordData, float[] normalData, float[] colorData)
          Super fast method for moving a bunch of data into the data elements.
 void drawEnd()
          Ends the drawing cycle and commits the geometry changes to the 3d card.
 void drawStart()
          Resets the vertices back to zero and sets the types of changes that will be made during the drawing cycle.
 void drawStart(int mask)
          Resets the vertices back to zero and sets the types of changes that will be made during the drawing cycle.
 GeometryArray getGeometry()
           
 int getNumVertices()
           
 int getValidVertexCount()
           
 int newVertex()
          Starts a new vertex to be updated.
 void setColor(byte x, byte y, byte z)
           
 void setColor(byte x, byte y, byte z, byte a)
           
 void setColor(org.openmali.vecmath2.Colorf color)
           
 void setColor(float x, float y, float z)
           
 void setCoordinate(float x, float y, float z)
           
 void setCoordinate(org.openmali.vecmath2.Tuple3f p)
           
 void setNormal(float x, float y, float z)
           
 void setNormal(org.openmali.vecmath2.Vector3f normal)
           
 void setTexCoord(int unit, float u, float v)
           
 void setTexCoord(int unit, org.openmali.vecmath2.TexCoord2f t)
           
 void update()
          This method must be provided by users to draw the geometry.
 
Methods inherited from interface org.xith3d.scenegraph.GeometryUpdater
updateData
 

Method Detail

drawStart

void drawStart(int mask)
Resets the vertices back to zero and sets the types of changes that will be made during the drawing cycle. In some implementations the data will be destroyed in any buffer referenced in the mask.

Parameters:
mask - The bitmask of things which can change.

drawStart

void drawStart()
Resets the vertices back to zero and sets the types of changes that will be made during the drawing cycle. This assumes all the data is going to change. Use the drawStart(mask) version if you will only be changing some of the data.


newVertex

int newVertex()
Starts a new vertex to be updated. This must be called before setting the vertex information.

Returns:
The index of the new vertex.

drawEnd

void drawEnd()
Ends the drawing cycle and commits the geometry changes to the 3d card. The number of vertices will be set.


setCoordinate

void setCoordinate(org.openmali.vecmath2.Tuple3f p)

setCoordinate

void setCoordinate(float x,
                   float y,
                   float z)

setTexCoord

void setTexCoord(int unit,
                 org.openmali.vecmath2.TexCoord2f t)

setTexCoord

void setTexCoord(int unit,
                 float u,
                 float v)

setColor

void setColor(org.openmali.vecmath2.Colorf color)

setColor

void setColor(float x,
              float y,
              float z)

setColor

void setColor(byte x,
              byte y,
              byte z)

setColor

void setColor(byte x,
              byte y,
              byte z,
              byte a)

setNormal

void setNormal(org.openmali.vecmath2.Vector3f normal)

setNormal

void setNormal(float x,
               float y,
               float z)

addData

void addData(float[] coordData,
             float[] texCoordData,
             float[] normalData,
             float[] colorData)
Super fast method add a bunch of data right into the data elements


addData

void addData(org.openmali.vecmath2.Tuple3f translate,
             int numCoords,
             float[] coordData,
             float[] texCoordData,
             float[] normalData,
             float[] colorData)
Super fast method for moving a bunch of data into the data elements. The Positions are all translated according to the tuple passed in.


addData

void addData(org.openmali.vecmath2.Tuple3f translate,
             int numCoords,
             float[] coordData,
             float[] texCoordData,
             float[] normalData,
             float alpha)
Super fast method for moving a bunch of data into the data elements. The Positions are all translated according to the tuple passed in. The color for all the vertices are set the specified value


getGeometry

GeometryArray getGeometry()

update

void update()
This method must be provided by users to draw the geometry. Users can then call drawStart(), the various setXXX functions and then a drawEnd();


getValidVertexCount

int getValidVertexCount()

getNumVertices

int getNumVertices()