crystalspace.jbind.impl.csgeom.objmodel
Class csObjectModel

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.csgeom.objmodel.csObjectModel
All Implemented Interfaces:
iBase, iObjectModel, iPointer

public class csObjectModel
extends csBase
implements iObjectModel

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csObjectModel(iPointer nPointer)
           
 
Method Summary
 void addListener(iObjectModelListener listener)
          Add a listener to this object model.
 iPolygonMesh createLowerDetailPolygonMesh(float detail)
          Create a polygon mesh representing a lower detail version of the object but without the restrictions of GetPolygonMeshViscull();.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 java.lang.String getName()
          Return the name of the interface
 void getObjectBoundingBox(csBox3 bbox)
          Get the bounding box in object space for this mesh object.
 void getObjectBoundingBox(csBox3 bbox, int type)
          Get the bounding box in object space for this mesh object.
 iPolygonMesh getPolygonMeshBase()
          Get a polygon mesh representing the basic geometry of the object.
 iPolygonMesh getPolygonMeshColldet()
          Get a polygon mesh representing the geometry of the object.
 iPolygonMesh getPolygonMeshShadows()
          Get a polygon mesh specifically for shadow casting (to be used by the shadow manager);.
 iPolygonMesh getPolygonMeshViscull()
          Get a polygon mesh specifically for visibility culling (to be used as an occluder);.
 void getRadius(csVector3 radius, csVector3 center)
          Get the radius and center of this object in object space.
 long getShapeNumber()
          Returns a number that will change whenever the shape of this object changes.
 int getVersion()
          Return the version of the interface
static void initSCF()
           
protected  boolean isNativePointerValidSafe(long pointer)
           
 void removeListener(iObjectModelListener listener)
          Remove a listener from this object model.
 void setPolygonMeshColldet(iPolygonMesh polymesh)
          Set a polygon mesh representing the geometry of the object.
 void setPolygonMeshShadows(iPolygonMesh polymesh)
          Set a polygon mesh representing the geometry of the object.
 void setPolygonMeshViscull(iPolygonMesh polymesh)
          Set a polygon mesh representing the geometry of the object.
 
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

csObjectModel

public csObjectModel(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

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

initSCF

public static void initSCF()

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

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

addListener

public void addListener(iObjectModelListener listener)
Description copied from interface: iObjectModel
Add a listener to this object model. This listener will be called whenever the object model changes or right before it is destroyed. Implemented in csObjectModel.

Specified by:
addListener in interface iObjectModel
Parameters:
listener -
See Also:
crystalspace.jbind.interfaces.igeom.objmodel.iObjectModel#AddListener(crystalspace.jbind.interfaces.igeom.objmodel.iObjectModelListener)

createLowerDetailPolygonMesh

public iPolygonMesh createLowerDetailPolygonMesh(float detail)
Description copied from interface: iObjectModel
Create a polygon mesh representing a lower detail version of the object but without the restrictions of GetPolygonMeshViscull();. The floating point input number is 0 for minimum detail and 1 for highest detail. This function may return the same polygon mesh as GetPolygonMeshColldet(); (but with ref count incremented by one);. Can return 0 if this object model doesn't support that. Implemented in csObjectModel.

Specified by:
createLowerDetailPolygonMesh in interface iObjectModel
Parameters:
detail -
Returns:
See Also:
iObjectModel.createLowerDetailPolygonMesh(float)

getObjectBoundingBox

public void getObjectBoundingBox(csBox3 bbox)
Description copied from interface: iObjectModel
Get the bounding box in object space for this mesh object. Type has three possibilities: CS_BBOX_NORMAL: get a normal bounding box which may or may not be recalculated depending on the changing geometry of the object. CS_BBOX_ACCURATE: get a totally accurate bounding box. Not all plugins support this. Some will just return a normal bounding box. CS_BBOX_MAX: get the maximum bounding box that this object will ever use. For objects that don't have a preset maximum bounding box this just has to be a reasonable estimate of a realistic maximum bounding box.

Specified by:
getObjectBoundingBox in interface iObjectModel
Parameters:
bbox -
See Also:
iObjectModel.getObjectBoundingBox(crystalspace.jbind.impl.csgeom.box.csBox3)

getObjectBoundingBox

public void getObjectBoundingBox(csBox3 bbox,
                                 int type)
Description copied from interface: iObjectModel
Get the bounding box in object space for this mesh object. Type has three possibilities: CS_BBOX_NORMAL: get a normal bounding box which may or may not be recalculated depending on the changing geometry of the object. CS_BBOX_ACCURATE: get a totally accurate bounding box. Not all plugins support this. Some will just return a normal bounding box. CS_BBOX_MAX: get the maximum bounding box that this object will ever use. For objects that don't have a preset maximum bounding box this just has to be a reasonable estimate of a realistic maximum bounding box.

Specified by:
getObjectBoundingBox in interface iObjectModel
Parameters:
bbox -
type -
See Also:
iObjectModel.getObjectBoundingBox(crystalspace.jbind.impl.csgeom.box.csBox3, int)

getPolygonMeshBase

public iPolygonMesh getPolygonMeshBase()
Description copied from interface: iObjectModel
Get a polygon mesh representing the basic geometry of the object. Can return 0 if this object model doesn't support that. Implemented in csObjectModel.

Specified by:
getPolygonMeshBase in interface iObjectModel
Returns:
See Also:
iObjectModel.getPolygonMeshBase()

getPolygonMeshColldet

public iPolygonMesh getPolygonMeshColldet()
Description copied from interface: iObjectModel
Get a polygon mesh representing the geometry of the object. This mesh is useful for collision detection. Can return 0 if this object model doesn't support that. Implemented in csObjectModel.

Specified by:
getPolygonMeshColldet in interface iObjectModel
Returns:
See Also:
iObjectModel.getPolygonMeshColldet()

getPolygonMeshShadows

public iPolygonMesh getPolygonMeshShadows()
Description copied from interface: iObjectModel
Get a polygon mesh specifically for shadow casting (to be used by the shadow manager);. This polygon mesh is guaranteed to be smaller or equal to the real object. In other words: if you would render the original mesh in red and this one in blue you should not see any blue anywhere. Can return 0 if this object model doesn't support that. In that case the object will not be used for shadow casting. Implemented in csObjectModel.

Specified by:
getPolygonMeshShadows in interface iObjectModel
Returns:
See Also:
iObjectModel.getPolygonMeshShadows()

getPolygonMeshViscull

public iPolygonMesh getPolygonMeshViscull()
Description copied from interface: iObjectModel
Get a polygon mesh specifically for visibility culling (to be used as an occluder);. This polygon mesh is guaranteed to be smaller or equal to the real object. In other words: if you would render the original mesh in red and this one in blue you should not see any blue anywhere. This kind of lower detail version can be used for occlusion writing in a visibility culling system. Can return 0 if this object model doesn't support that. In that case the object will not be used for visibility culling. Implemented in csObjectModel.

Specified by:
getPolygonMeshViscull in interface iObjectModel
Returns:
See Also:
iObjectModel.getPolygonMeshViscull()

getRadius

public void getRadius(csVector3 radius,
                      csVector3 center)
Description copied from interface: iObjectModel
Get the radius and center of this object in object space.

Specified by:
getRadius in interface iObjectModel
Parameters:
radius -
center -
See Also:
crystalspace.jbind.interfaces.igeom.objmodel.iObjectModel#GetRadius(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3)

getShapeNumber

public long getShapeNumber()
Description copied from interface: iObjectModel
Returns a number that will change whenever the shape of this object changes. If that happens then the data in all the returned polygon meshes and bounding volumes will be invalid. Implemented in csObjectModel.

Specified by:
getShapeNumber in interface iObjectModel
Returns:
See Also:
iObjectModel.getShapeNumber()

removeListener

public void removeListener(iObjectModelListener listener)
Description copied from interface: iObjectModel
Remove a listener from this object model. Implemented in csObjectModel.

Specified by:
removeListener in interface iObjectModel
Parameters:
listener -
See Also:
iObjectModel.removeListener(crystalspace.jbind.interfaces.igeom.objmodel.iObjectModelListener)

setPolygonMeshColldet

public void setPolygonMeshColldet(iPolygonMesh polymesh)
Description copied from interface: iObjectModel
Set a polygon mesh representing the geometry of the object. This mesh is useful for collision detection. This can be used to replace the default polygon mesh returned by GetPolygonMeshColldet(); with one that has less detail or even to support polygon mesh for mesh objects that otherwise don't support it. The object model will keep a reference to the given polymesh. Implemented in csObjectModel.

Specified by:
setPolygonMeshColldet in interface iObjectModel
Parameters:
polymesh -
See Also:
iObjectModel.setPolygonMeshColldet(crystalspace.jbind.interfaces.igeom.polymesh.iPolygonMesh)

setPolygonMeshShadows

public void setPolygonMeshShadows(iPolygonMesh polymesh)
Description copied from interface: iObjectModel
Set a polygon mesh representing the geometry of the object. This mesh is useful for shadow casting. This can be used to replace the default polygon mesh returned by GetPolygonMeshShadows(); with one that has less detail or even to support polygon mesh for mesh objects that otherwise don't support it. The object model will keep a reference to the given polymesh. Implemented in csObjectModel.

Specified by:
setPolygonMeshShadows in interface iObjectModel
Parameters:
polymesh -
See Also:
iObjectModel.setPolygonMeshShadows(crystalspace.jbind.interfaces.igeom.polymesh.iPolygonMesh)

setPolygonMeshViscull

public void setPolygonMeshViscull(iPolygonMesh polymesh)
Description copied from interface: iObjectModel
Set a polygon mesh representing the geometry of the object. This mesh is useful for visibility culling. This can be used to replace the default polygon mesh returned by GetPolygonMeshViscull(); with one that has less detail or even to support polygon mesh for mesh objects that otherwise don't support it. The object model will keep a reference to the given polymesh. Implemented in csObjectModel.

Specified by:
setPolygonMeshViscull in interface iObjectModel
Parameters:
polymesh -
See Also:
iObjectModel.setPolygonMeshViscull(crystalspace.jbind.interfaces.igeom.polymesh.iPolygonMesh)