CrystalSpace

Public API Reference

iObjectModel Struct Reference
[Geometry utilities]

This interface represents data related to some geometry in object space. More...

#include <imesh/objmodel.h>

Inheritance diagram for iObjectModel:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void AddListener (iObjectModelListener *listener)=0
 Add a listener to this object model.
virtual csPtr
< iPolygonMesh
CreateLowerDetailPolygonMesh (float detail)=0
 Create a polygon mesh representing a lower detail version of the object but without the restrictions of GetPolygonMeshViscull().
virtual const csBox3GetObjectBoundingBox ()=0
 Get the bounding box in object space for this mesh object.
virtual void GetObjectBoundingBox (csBox3 &bbox)=0
 Get the bounding box in object space for this mesh object.
virtual iPolygonMeshGetPolygonMeshBase ()=0
 Get a polygon mesh representing the basic geometry of the object.
virtual iPolygonMeshGetPolygonMeshColldet ()=0
 Get a polygon mesh representing the geometry of the object.
virtual iPolygonMeshGetPolygonMeshShadows ()=0
 Get a polygon mesh specifically for shadow casting (to be used by the shadow manager).
virtual iPolygonMeshGetPolygonMeshViscull ()=0
 Get a polygon mesh specifically for visibility culling (to be used as an occluder).
virtual void GetRadius (float &radius, csVector3 &center)=0
 Get the radius and center of this object in object space.
virtual long GetShapeNumber () const =0
 Returns a number that will change whenever the shape of this object changes.
virtual iTerraFormerGetTerraFormerColldet ()=0
 Get a terra former representing the geometry of the object.
virtual iTerrainSystemGetTerrainColldet ()=0
 Get a terrain representing the geometry of the object.
virtual iTriangleMeshGetTriangleData (csStringID id)=0
 Get a triangle mesh representing the geometry of the object.
virtual csPtr
< iTriangleMeshIterator
GetTriangleDataIterator ()=0
 Get an iterator to iterate over all triangle meshes in this object model.
virtual bool IsTriangleDataSet (csStringID id)=0
 Return true if the triangle data was set for this id.
virtual void RemoveListener (iObjectModelListener *listener)=0
 Remove a listener from this object model.
virtual void ResetTriangleData (csStringID id)=0
 Reset triangle data.
virtual void SetObjectBoundingBox (const csBox3 &bbox)=0
 Override the bounding box of this mesh object in object space.
virtual void SetPolygonMeshColldet (iPolygonMesh *polymesh)=0
 Set a polygon mesh representing the geometry of the object.
virtual void SetPolygonMeshShadows (iPolygonMesh *polymesh)=0
 Set a polygon mesh representing the geometry of the object.
virtual void SetPolygonMeshViscull (iPolygonMesh *polymesh)=0
 Set a polygon mesh representing the geometry of the object.
virtual void SetTriangleData (csStringID id, iTriangleMesh *trimesh)=0
 Set a triangle mesh representing the geometry of the object.


Detailed Description

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.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Definition at line 93 of file objmodel.h.


Member Function Documentation

virtual void iObjectModel::AddListener ( iObjectModelListener listener  )  [pure virtual]

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.

virtual csPtr<iPolygonMesh> iObjectModel::CreateLowerDetailPolygonMesh ( float  detail  )  [pure virtual]

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.

Deprecated:
This method was never implemented and is misplaced.

Implemented in csObjectModel.

virtual const csBox3& iObjectModel::GetObjectBoundingBox (  )  [pure virtual]

Get the bounding box in object space for this mesh object.

Implemented in csParticleSystem, and csMeshObject.

virtual void iObjectModel::GetObjectBoundingBox ( csBox3 bbox  )  [pure virtual]

Get the bounding box in object space for this mesh object.

Deprecated:
Use GetObjectBoundingBox() (without parameters) instead.

Implemented in csParticleSystem, and csMeshObject.

virtual iPolygonMesh* iObjectModel::GetPolygonMeshBase (  )  [pure virtual]

Get a polygon mesh representing the basic geometry of the object.

Can return 0 if this object model doesn't support that.

Deprecated:
Use GetTriangleData(id) with id the interned string 'base'.

Implemented in csObjectModel.

virtual iPolygonMesh* iObjectModel::GetPolygonMeshColldet (  )  [pure virtual]

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.

Deprecated:
Use GetTriangleData(id) with id the interned string 'colldet'.

Implemented in csObjectModel.

virtual iPolygonMesh* iObjectModel::GetPolygonMeshShadows (  )  [pure virtual]

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.

Deprecated:
Use GetTriangleData(id) with id the interned string 'shadows'.

Implemented in csObjectModel.

virtual iPolygonMesh* iObjectModel::GetPolygonMeshViscull (  )  [pure virtual]

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.

Deprecated:
Use GetTriangleData(id) with id the interned string 'viscull'.

Implemented in csObjectModel.

virtual void iObjectModel::GetRadius ( float &  radius,
csVector3 center 
) [pure virtual]

Get the radius and center of this object in object space.

Implemented in csParticleSystem, and csMeshObject.

virtual long iObjectModel::GetShapeNumber (  )  const [pure virtual]

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.

virtual iTerraFormer* iObjectModel::GetTerraFormerColldet (  )  [pure virtual]

Get a terra former representing the geometry of the object.

This class is useful for collision detection. Can return 0 if this object model doesn't support that.

Implemented in csParticleSystem, csMeshObject, and csObjectModel.

virtual iTerrainSystem* iObjectModel::GetTerrainColldet (  )  [pure virtual]

Get a terrain representing the geometry of the object.

This class is useful for collision detection. Can return 0 if this object model doesn't support that.

Implemented in csParticleSystem, csMeshObject, and csObjectModel.

virtual iTriangleMesh* iObjectModel::GetTriangleData ( csStringID  id  )  [pure virtual]

Get a triangle mesh representing the geometry of the object.

The ID indicates the type of mesh that is desired. Use the string registry (iStringSet from object registry with tag 'crystalspace.shared.stringset') to convert the ID string to a csStringID identification. Some common possibilities are:

  • 'base'
  • 'colldet'
  • 'viscull'
  • 'shadows'
    Returns:
    the triangle mesh for that id. If this is 0 then there are two possibilities: either the mesh was never set and in this case the subsystem can pick the base mesh as a fallback. Another possibility is that the triangle data was explicitelly cleared with SetTriangleData(id,0). In that case the mesh is assumed to be empty and usually that means that the specific subsystem will ignore it. To distinguish between these two cases use IsTriangleDataSet(id).

Implemented in csObjectModel.

virtual csPtr<iTriangleMeshIterator> iObjectModel::GetTriangleDataIterator (  )  [pure virtual]

Get an iterator to iterate over all triangle meshes in this object model.

This includes triangle meshes that are 0.

Implemented in csObjectModel.

virtual bool iObjectModel::IsTriangleDataSet ( csStringID  id  )  [pure virtual]

Return true if the triangle data was set for this id.

This can be used to distinguish between an empty mesh as set with SetTriangleData() or SetTriangleData() not being called at all. Calling ResetTriangleData() will clear this.

Implemented in csObjectModel.

virtual void iObjectModel::RemoveListener ( iObjectModelListener listener  )  [pure virtual]

Remove a listener from this object model.

Implemented in csObjectModel.

virtual void iObjectModel::ResetTriangleData ( csStringID  id  )  [pure virtual]

Reset triangle data.

After calling this it is as if the triangle data was never set.

Implemented in csObjectModel.

virtual void iObjectModel::SetObjectBoundingBox ( const csBox3 bbox  )  [pure virtual]

Override the bounding box of this mesh object in object space.

Note that some mesh objects don't have a bounding box on their own and may delegate this call to their factory (like genmesh).

Implemented in csParticleSystem, and csMeshObject.

virtual void iObjectModel::SetPolygonMeshColldet ( iPolygonMesh polymesh  )  [pure virtual]

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.

Deprecated:
Use SetTriangleData(id) with id the interned string 'colldet'.

Implemented in csObjectModel.

virtual void iObjectModel::SetPolygonMeshShadows ( iPolygonMesh polymesh  )  [pure virtual]

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.

Deprecated:
Use SetTriangleData(id) with id the interned string 'shadows'.

Implemented in csObjectModel.

virtual void iObjectModel::SetPolygonMeshViscull ( iPolygonMesh polymesh  )  [pure virtual]

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.

Deprecated:
Use SetTriangleData(id) with id the interned string 'viscull'.

Implemented in csObjectModel.

virtual void iObjectModel::SetTriangleData ( csStringID  id,
iTriangleMesh trimesh 
) [pure virtual]

Set a triangle mesh representing the geometry of the object.

The ID indicates the type of mesh that you want to change. Note that the base mesh (ID equal to 'base') cannot be modified.

Parameters:
id is a numer id you can fetch from the string registry (iStringSet from object registry with tag\ 'crystalspace.shared.stringset').
trimesh is the new mesh. The reference count will be increased. If you pass in 0 here then this means that the mesh for this specific ID is disabled. If you want to reset this then call ResetTriangleData(id). When no mesh is set or ResetTriangleData() is called many subsystems will use the base mesh instead. However if you set 0 here then this means that this mesh is disabled.

Implemented in csObjectModel.


The documentation for this struct was generated from the following file:
Generated for Crystal Space 1.2.1 by doxygen 1.5.3