crystalspace.jbind.interfaces.igeom.objmodel
Interface iObjectModel

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

public interface iObjectModel
extends iBase

This interface represents data related to some geometry in object space. It is a generic way to describe meshes in the engine. By using this interface you can make sure your code works on all engine geometry. The data returned by this class is in local object space.

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

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();.
 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.
 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 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

addListener

public void addListener(iObjectModelListener listener)
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.

Parameters:
listener -

createLowerDetailPolygonMesh

public iPolygonMesh createLowerDetailPolygonMesh(float detail)
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.

Parameters:
detail -
Returns:

getObjectBoundingBox

public void getObjectBoundingBox(csBox3 bbox)
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.

Parameters:
bbox -

getObjectBoundingBox

public void getObjectBoundingBox(csBox3 bbox,
                                 int type)
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.

Parameters:
bbox -
type -

getPolygonMeshBase

public iPolygonMesh getPolygonMeshBase()
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.

Returns:

getPolygonMeshColldet

public iPolygonMesh getPolygonMeshColldet()
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.

Returns:

getPolygonMeshShadows

public iPolygonMesh getPolygonMeshShadows()
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.

Returns:

getPolygonMeshViscull

public iPolygonMesh getPolygonMeshViscull()
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.

Returns:

getRadius

public void getRadius(csVector3 radius,
                      csVector3 center)
Get the radius and center of this object in object space.

Parameters:
radius -
center -

getShapeNumber

public long getShapeNumber()
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.

Returns:

removeListener

public void removeListener(iObjectModelListener listener)
Remove a listener from this object model. Implemented in csObjectModel.

Parameters:
listener -

setPolygonMeshColldet

public void setPolygonMeshColldet(iPolygonMesh polymesh)
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.

Parameters:
polymesh -

setPolygonMeshShadows

public void setPolygonMeshShadows(iPolygonMesh polymesh)
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.

Parameters:
polymesh -

setPolygonMeshViscull

public void setPolygonMeshViscull(iPolygonMesh polymesh)
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.

Parameters:
polymesh -