Google

Main Page   Class Hierarchy   Compound List   File List   Compound 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 List of all members.

Public Methods

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

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.

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.

virtual void GetObjectBoundingBox (csBox3 &bbox, int type=CS_BBOX_NORMAL)=0
 Get the bounding box in object space for this mesh object. More...

virtual void GetRadius (csVector3 &radius, csVector3 &center)=0
 Get the radius and center of this object in object space.

virtual void NextFrame (csTicks current_time)=0
 Control animation of this object.

virtual bool WantToDie () const=0
 If this method returns true this object wants to die. 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.

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 long GetShapeNumber () const=0
 Return a number which will change as soon as the object undergoes a fundamental change that affects the maximum bounding box. 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...


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.


Member Function Documentation

bool iMeshObject::Draw ( iRenderView * rview,
iMovable * movable,
csZBufMode zMode ) [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.

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

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

Get the logical parent for this mesh object.

See SetLogicalParent() for more information.

void iMeshObject::GetObjectBoundingBox ( csBox3 & bbox,
int type = CS_BBOX_NORMAL ) [pure virtual]
 

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.

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

Return a number which will change as soon as the object undergoes a fundamental change that affects the maximum bounding box.

Using this number you can test if you need to get the bounding box again and perform calculations on that.

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.

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.

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.

void iMeshObject::SetLogicalParent ( iBase * lp ) [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).

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.

bool iMeshObject::WantToDie ( ) const [pure virtual]
 

If this method returns true this object wants to die.

The user of this object should take care to make it die at the soonest possible time. This is usally used for things like particle systems that only have a limited time to live.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000