crystalspace.jbind.impl.video.vbufmgr
Class csPolygonBuffer

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.video.vbufmgr.csPolygonBuffer
All Implemented Interfaces:
iBase, iPointer, iPolygonBuffer

public class csPolygonBuffer
extends csBase
implements iPolygonBuffer

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csPolygonBuffer(iPointer nPointer)
           
 
Method Summary
 void addMaterial(iMaterialHandle mat_handle)
          Add a material.
 void addPolygon(int[] verts, csPolyTextureMapping texmap, csPlane3 poly_normal, int mat_index, iRendererLightmap lm)
          Add a polygon to this buffer.
 void clear()
          Clear all polygons, materials, and vertex array.
 csBox3 getBoundingBox()
          Get a bounding box for all the vertices.
 iMaterialHandle getMaterial(int idx)
          Get a material.
 int getMaterialCount()
          Get the number of materials.
 java.lang.String getName()
          Return the name of the interface
 int getVersion()
          Return the version of the interface
 int getVertexCount()
          Gets the number of vertices.
 csVector3[] getVertices()
          Gets the array of vertices.
protected  boolean isNativePointerValidSafe(long pointer)
           
 void markLightmapsDirty()
          Sets the polygon buffer as dirty.
 void prepare()
          After adding everything and before using this polygon buffer you should call Prepare();.
 void setMaterial(int idx, iMaterialHandle mat_handle)
          Set a previously added material (this can be used to change a material handle);.
 void setVertexArray(csVector3[] verts)
          Set vertices to use for the polygons.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csPolygonBuffer

public csPolygonBuffer(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase
See Also:
iBase.getVersion()

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase
See Also:
iBase.getName()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
csNativeObject.isNativePointerValidSafe(long)

addMaterial

public void addMaterial(iMaterialHandle mat_handle)
Description copied from interface: iPolygonBuffer
Add a material.

Specified by:
addMaterial in interface iPolygonBuffer
Parameters:
mat_handle -
See Also:
iPolygonBuffer.addMaterial(crystalspace.jbind.interfaces.ivideo.material.iMaterialHandle)

addPolygon

public void addPolygon(int[] verts,
                       csPolyTextureMapping texmap,
                       csPlane3 poly_normal,
                       int mat_index,
                       iRendererLightmap lm)
Description copied from interface: iPolygonBuffer
Add a polygon to this buffer. The data pointed to by 'verts' is copied so it can be discarded after calling AddPolygon. 'mat_index' is an index in the material table (initialized with AddMaterial(););. It is best to add the polygons sorted by material as that will generate the most efficient representation on hardware.

Specified by:
addPolygon in interface iPolygonBuffer
Parameters:
verts -
texmap -
poly_normal -
mat_index -
lm -
See Also:
iPolygonBuffer.addPolygon(int[], crystalspace.jbind.impl.mesh.thing.polygon.csPolyTextureMapping, crystalspace.jbind.impl.csgeom.plane3.csPlane3, int, crystalspace.jbind.interfaces.ivideo.txtmgr.iRendererLightmap)

clear

public void clear()
Description copied from interface: iPolygonBuffer
Clear all polygons, materials, and vertex array.

Specified by:
clear in interface iPolygonBuffer
See Also:
iPolygonBuffer.clear()

getBoundingBox

public csBox3 getBoundingBox()
Description copied from interface: iPolygonBuffer
Get a bounding box for all the vertices.

Specified by:
getBoundingBox in interface iPolygonBuffer
Returns:
See Also:
iPolygonBuffer.getBoundingBox()

getMaterial

public iMaterialHandle getMaterial(int idx)
Description copied from interface: iPolygonBuffer
Get a material.

Specified by:
getMaterial in interface iPolygonBuffer
Parameters:
idx -
Returns:
See Also:
iPolygonBuffer.getMaterial(int)

getMaterialCount

public int getMaterialCount()
Description copied from interface: iPolygonBuffer
Get the number of materials.

Specified by:
getMaterialCount in interface iPolygonBuffer
Returns:
See Also:
iPolygonBuffer.getMaterialCount()

getVertexCount

public int getVertexCount()
Description copied from interface: iPolygonBuffer
Gets the number of vertices.

Specified by:
getVertexCount in interface iPolygonBuffer
Returns:
See Also:
iPolygonBuffer.getVertexCount()

getVertices

public csVector3[] getVertices()
Description copied from interface: iPolygonBuffer
Gets the array of vertices.

Specified by:
getVertices in interface iPolygonBuffer
Returns:
See Also:
iPolygonBuffer.getVertices()

markLightmapsDirty

public void markLightmapsDirty()
Description copied from interface: iPolygonBuffer
Sets the polygon buffer as dirty. This means that the mesh is affected by some light.

Specified by:
markLightmapsDirty in interface iPolygonBuffer
See Also:
iPolygonBuffer.markLightmapsDirty()

prepare

public void prepare()
Description copied from interface: iPolygonBuffer
After adding everything and before using this polygon buffer you should call Prepare();.

Specified by:
prepare in interface iPolygonBuffer
See Also:
iPolygonBuffer.prepare()

setMaterial

public void setMaterial(int idx,
                        iMaterialHandle mat_handle)
Description copied from interface: iPolygonBuffer
Set a previously added material (this can be used to change a material handle);.

Specified by:
setMaterial in interface iPolygonBuffer
Parameters:
idx -
mat_handle -
See Also:
iPolygonBuffer.setMaterial(int, crystalspace.jbind.interfaces.ivideo.material.iMaterialHandle)

setVertexArray

public void setVertexArray(csVector3[] verts)
Description copied from interface: iPolygonBuffer
Set vertices to use for the polygons. The given array is copied.

Specified by:
setVertexArray in interface iPolygonBuffer
Parameters:
verts -
See Also:
iPolygonBuffer.setVertexArray(crystalspace.jbind.impl.csgeom.vector3.csVector3[])