crystalspace.jbind.interfaces.igeom.polymesh
Interface iPolygonMesh

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

public interface iPolygonMesh
extends iBase

This interface reprents a mesh of polygons. It is useful to communicate geometry information outside of the engine. One place where this will be useful is for communicating geometry information to the collision detection plugin. All Crystal Space mesh objects (things, sprites, ...) should implement and/or embed an implementation of this interface. A polygon mesh has the concept of a vertex buffer and an array of polygons. A triangle mesh is also supported. A mesh object typically only implements either a polygon mesh or a triangle mesh. In that case requesting the other type of mesh will automatically generate the new format. iPolygonMesh can use csPolygonMeshTools::Triangulate() and csPolygonMeshTools::Polygonize() to help with that.

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

Method Summary
 int getChangeNumber()
          When this number changes you know the polygon mesh has changed (deformation has occured); since the last time you got another number from this function.
 csFlags getFlags()
          Get flags for this polygon mesh.
 int getPolygonCount()
          Get the number of polygons for this mesh.
 csMeshedPolygonArray getPolygons()
          Get the pointer to the array of polygons.
 int getTriangleCount()
          Get the number of triangles for this mesh.
 csTriangleArray getTriangles()
          Get the triangle table for this mesh.
 int getVertexCount()
          Get the number of vertices for this mesh.
 csVector3Array getVertices()
          Get the pointer to the array of vertices.
 void lock()
          Lock the polygon mesh.
 void unlock()
          Unlock the polygon mesh.
 
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

getChangeNumber

public int getChangeNumber()
When this number changes you know the polygon mesh has changed (deformation has occured); since the last time you got another number from this function. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getFlags

public csFlags getFlags()
Get flags for this polygon mesh. This is zero or a combination of the following flags: CS_POLYMESH_CLOSED: mesh is closed. CS_POLYMESH_NOTCLOSED: mesh is not closed. CS_POLYMESH_CONVEX: mesh is convex. CS_POLYMESH_NOTCONVEX: mesh is not convex. CS_POLYMESH_DEFORMABLE: mesh is deformable. CS_POLYMESH_TRIANGLEMESH: mesh prefers triangle mesh. Note that if neither CS_POLYMESH_CLOSED nor CS_POLYMESH_NOTCLOSED are set then the closed state is not known. Setting both is illegal. Note that if neither CS_POLYMESH_CONVEX nor CS_POLYMESH_NOTCONVEX are set then the convex state is not known. Setting both is illegal. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getPolygonCount

public int getPolygonCount()
Get the number of polygons for this mesh. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getPolygons

public csMeshedPolygonArray getPolygons()
Get the pointer to the array of polygons. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getTriangleCount

public int getTriangleCount()
Get the number of triangles for this mesh. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getTriangles

public csTriangleArray getTriangles()
Get the triangle table for this mesh. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getVertexCount

public int getVertexCount()
Get the number of vertices for this mesh. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

getVertices

public csVector3Array getVertices()
Get the pointer to the array of vertices. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.

Returns:

lock

public void lock()
Lock the polygon mesh. This prevents the polygon and triangle data from being cleaned up. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.


unlock

public void unlock()
Unlock the polygon mesh. This allows clean up again. Implemented in csPortalContainerPolyMeshHelper, csPolygonMesh, csPolygonMeshBox, BezierPolyMeshHelper, and PolyMeshHelper.