crystalspace.jbind.interfaces.ivideo.vbufmgr
Interface iPolygonBuffer

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csPolygonBuffer

public interface iPolygonBuffer
extends iBase

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/pubapi/structiPolygonBuffer.php

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.
 int getVertexCount()
          Gets the number of vertices.
 csVector3[] getVertices()
          Gets the array of vertices.
 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 interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

addMaterial

public void addMaterial(iMaterialHandle mat_handle)
Add a material.

Parameters:
mat_handle -

addPolygon

public void addPolygon(int[] verts,
                       csPolyTextureMapping texmap,
                       csPlane3 poly_normal,
                       int mat_index,
                       iRendererLightmap lm)
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.

Parameters:
verts -
texmap -
poly_normal -
mat_index -
lm -

clear

public void clear()
Clear all polygons, materials, and vertex array.


getBoundingBox

public csBox3 getBoundingBox()
Get a bounding box for all the vertices.

Returns:

getMaterial

public iMaterialHandle getMaterial(int idx)
Get a material.

Parameters:
idx -
Returns:

getMaterialCount

public int getMaterialCount()
Get the number of materials.

Returns:

getVertexCount

public int getVertexCount()
Gets the number of vertices.

Returns:

getVertices

public csVector3[] getVertices()
Gets the array of vertices.

Returns:

markLightmapsDirty

public void markLightmapsDirty()
Sets the polygon buffer as dirty. This means that the mesh is affected by some light.


prepare

public void prepare()
After adding everything and before using this polygon buffer you should call Prepare();.


setMaterial

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

Parameters:
idx -
mat_handle -

setVertexArray

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

Parameters:
verts -