CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iMeshObject Struct Reference

This is a general mesh object that the engine can interact with. More...

#include <object.h>

Inheritance diagram for iMeshObject:

iBase csMeshObject List of all members.

Public Methods

virtual iMeshObjectFactoryGetFactory () const=0
 Get the reference to the factory that created this mesh object. More...

virtual bool DrawTest (iRenderView *rview, iMovable *movable)=0
 First part of Draw. More...

virtual void UpdateLighting (iLight **lights, int num_lights, iMovable *movable)=0
 Update lighting for the object on the given position. More...

virtual bool Draw (iRenderView *rview, iMovable *movable, csZBufMode zbufMode)=0
 Draw this mesh object. More...

virtual void SetVisibleCallback (iMeshObjectDrawCallback *cb)=0
 Register a callback to the mesh object which will be called from within Draw() if the mesh object thinks that the object is really visible. More...

virtual iMeshObjectDrawCallbackGetVisibleCallback () const=0
 Get the current visible callback. More...

virtual void NextFrame (csTicks current_time, const csVector3 &pos)=0
 Control animation of this object. More...

virtual void HardTransform (const csReversibleTransform &t)=0
 Do a hard transform of this object. More...

virtual bool SupportsHardTransform () const=0
 Return true if HardTransform is supported for this mesh object type. More...

virtual bool HitBeamOutline (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr)=0
 Check if this mesh is hit by this object space vector. More...

virtual bool HitBeamObject (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr)=0
 Check if this mesh is hit by this object space vector. More...

virtual void SetLogicalParent (iBase *logparent)=0
 Set a reference to some logical parent in the context that holds the mesh objects. More...

virtual iBaseGetLogicalParent () const=0
 Get the logical parent for this mesh object. More...

virtual iObjectModelGetObjectModel ()=0
 Get the generic interface describing the geometry of this mesh. More...

virtual bool SetColor (const csColor &color)=0
 Set the base color of the mesh. More...

virtual bool GetColor (csColor &color) const=0
 Get the base color of the mesh. More...

virtual bool SetMaterialWrapper (iMaterialWrapper *material)=0
 Set the material of the mesh. More...

virtual iMaterialWrapperGetMaterialWrapper () const=0
 Get the material of the mesh. More...


Detailed Description

This is a general mesh object that the engine can interact with.

The mesh object only manages its shape, texture etc. but *not* its position, sector or similar information. For this reason, a mesh object can only be used in the engine if a hook object is created for it in the engine that does the required management. The hook object is called mesh wrapper.

Definition at line 58 of file imesh/object.h.


Member Function Documentation

virtual bool iMeshObject::Draw iRenderView   rview,
iMovable   movable,
csZBufMode    zbufMode
[pure virtual]
 

Draw this mesh object.

Returns false if not visible. If this function returns true it does not mean that the object is invisible. It just means that this MeshObject thinks that the object was probably visible. DrawTest() will be called before this function (possibly with an UpdateLighting() in between.

Implemented in csMeshObject.

virtual bool iMeshObject::DrawTest iRenderView   rview,
iMovable   movable
[pure virtual]
 

First part of Draw.

The engine will call this DrawTest() before calling Draw() so DrawTest() can (if needed) remember computationally expensive data. If DrawTest() returns false the engine will not call Draw(). Possibly UpdateLighting() will be called in between DrawTest() and Draw().

Implemented in csMeshObject.

virtual bool iMeshObject::GetColor csColor   color const [pure virtual]
 

Get the base color of the mesh.

Will return false if not supported.

Implemented in csMeshObject.

virtual iMeshObjectFactory* iMeshObject::GetFactory   const [pure virtual]
 

Get the reference to the factory that created this mesh object.

Implemented in csMeshObject.

virtual iBase* iMeshObject::GetLogicalParent   const [pure virtual]
 

Get the logical parent for this mesh object.

See SetLogicalParent() for more information.

Implemented in csMeshObject.

virtual iMaterialWrapper* iMeshObject::GetMaterialWrapper   const [pure virtual]
 

Get the material of the mesh.

If not supported this will return NULL.

Implemented in csMeshObject.

virtual iObjectModel* iMeshObject::GetObjectModel   [pure virtual]
 

Get the generic interface describing the geometry of this mesh.

If the factory supports this you should preferably use the object model from the factory instead.

Implemented in csMeshObject.

virtual iMeshObjectDrawCallback* iMeshObject::GetVisibleCallback   const [pure virtual]
 

Get the current visible callback.

Implemented in csMeshObject.

virtual void iMeshObject::HardTransform const csReversibleTransform   t [pure virtual]
 

Do a hard transform of this object.

This transformation and the original coordinates are not remembered but the object space coordinates are directly computed (world space coordinates are set to the object space coordinates by this routine). Note that some implementations of mesh objects will not change the orientation of the object but only the position.

Implemented in csMeshObject.

virtual bool iMeshObject::HitBeamObject const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr
[pure virtual]
 

Check if this mesh is hit by this object space vector.

Return the collision point in object space coordinates. This is the most detailed version (and also the slowest). The returned hit will be guaranteed to be the point closest to the 'start' of the beam.

Implemented in csMeshObject.

virtual bool iMeshObject::HitBeamOutline const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr
[pure virtual]
 

Check if this mesh is hit by this object space vector.

This will do a test based on the outline of the object. This means that it is more accurate than HitBeamBBox(). Note that this routine will typically be faster than HitBeamObject(). The hit may be on the front or the back of the object, but will indicate that it iterrupts the beam.

Implemented in csMeshObject.

virtual void iMeshObject::NextFrame csTicks    current_time,
const csVector3   pos
[pure virtual]
 

Control animation of this object.

Implemented in csMeshObject.

virtual bool iMeshObject::SetColor const csColor   color [pure virtual]
 

Set the base color of the mesh.

This color will be added to whatever color is set for lighting. Not all meshes need to support this. This function will return true if it worked.

Implemented in csMeshObject.

virtual void iMeshObject::SetLogicalParent iBase   logparent [pure virtual]
 

Set a reference to some logical parent in the context that holds the mesh objects.

When a mesh object is used in the context of the 3D engine then this will be an iMeshWrapper. In case it is used in the context of the isometric engine this will be an iIsoMeshSprite. Note that this function should NOT increase the ref-count of the given logical parent because this would cause a circular reference (since the logical parent already holds a reference to this mesh object).

Implemented in csMeshObject.

virtual bool iMeshObject::SetMaterialWrapper iMaterialWrapper   material [pure virtual]
 

Set the material of the mesh.

This only works for single-material meshes. If not supported this function will return false.

Implemented in csMeshObject.

virtual void iMeshObject::SetVisibleCallback iMeshObjectDrawCallback   cb [pure virtual]
 

Register a callback to the mesh object which will be called from within Draw() if the mesh object thinks that the object is really visible.

Depending on the type of mesh object this can be very accurate or not accurate at all. But in all cases it will certainly be called if the object is visible.

Implemented in csMeshObject.

virtual bool iMeshObject::SupportsHardTransform   const [pure virtual]
 

Return true if HardTransform is supported for this mesh object type.

Implemented in csMeshObject.

virtual void iMeshObject::UpdateLighting iLight **    lights,
int    num_lights,
iMovable   movable
[pure virtual]
 

Update lighting for the object on the given position.

Implemented in csMeshObject.


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