CrystalSpace

Public API Reference

iMeshObject Struct Reference
[Mesh plugins]

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

#include <imesh/object.h>

Inheritance diagram for iMeshObject:

List of all members.

Public Member Functions

virtual void BuildDecal (const csVector3 *pos, float decalRadius, iDecalBuilder *decalBuilder)=0
 This mesh is being asked to build a decal for its own geometry.
virtual csPtr< iMeshObjectClone ()=0
 Creates a copy of this object and returns the clone.
virtual bool GetColor (csColor &color) const =0
 Get the base color of the mesh.
virtual iMeshObjectFactoryGetFactory () const =0
 Get the reference to the factory that created this mesh object.
virtual csFlagsGetFlags ()=0
 Get flags for this object.
virtual iMaterialWrapperGetMaterialWrapper () const =0
 Get the material of the mesh.
virtual iMeshWrapperGetMeshWrapper () const =0
 Get the logical parent for this mesh object.
virtual uint GetMixMode () const =0
 Get mix mode.
virtual iObjectModelGetObjectModel ()=0
 Get the generic interface describing the geometry of this mesh.
virtual CS::Graphics::RenderMesh ** GetRenderMeshes (int &num, iRenderView *rview, iMovable *movable, uint32 frustum_mask)=0
 Returns the set of render meshes.
virtual iMeshObjectDrawCallbackGetVisibleCallback () const =0
 Get the current visible callback.
virtual void HardTransform (const csReversibleTransform &t)=0
 Do a hard transform of this object.
virtual bool HitBeamObject (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr, int *polygon_idx=0, iMaterialWrapper **material=0, bool bf=false)=0
 Check if this mesh is hit by this object space vector.
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.
virtual void NextFrame (csTicks current_time, const csVector3 &pos, uint currentFrame)=0
 Control animation of this object.
virtual void PositionChild (iMeshObject *child, csTicks current_time)=0
 The engine asks this mesh object to place one of his hierarchical children.
virtual bool SetColor (const csColor &color)=0
 Set the base color of the mesh.
virtual bool SetMaterialWrapper (iMaterialWrapper *material)=0
 Set the material of the mesh.
virtual void SetMeshWrapper (iMeshWrapper *logparent)=0
 Set a reference to the mesh wrapper holding the mesh objects.
virtual void SetMixMode (uint mode)=0
 Set mix mode. Note that not all meshes may support this.
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.
virtual bool SupportsHardTransform () const =0
 Return true if HardTransform is supported for this mesh object type.

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.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Main users of this interface:

Definition at line 125 of file object.h.


Member Function Documentation

virtual void iMeshObject::BuildDecal ( const csVector3 pos,
float  decalRadius,
iDecalBuilder decalBuilder 
) [pure virtual]

This mesh is being asked to build a decal for its own geometry.

The mesh is given a position and radius of the decal and must create geometry through the provided iDecalBuilder.

Implemented in csMeshObject.

virtual csPtr<iMeshObject> iMeshObject::Clone (  )  [pure virtual]

Creates a copy of this object and returns the clone.

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 csFlags& iMeshObject::GetFlags (  )  [pure virtual]

Get flags for this object.

The following flags are at least supported:

Mesh objects may implement additional flags. These mesh object specific flags must be equal to at least 0x00010000.

Implemented in csMeshObject.

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

Get the material of the mesh.

If not supported this will return 0.

Implemented in csMeshObject.

virtual iMeshWrapper* iMeshObject::GetMeshWrapper (  )  const [pure virtual]

Get the logical parent for this mesh object.

See SetMeshWrapper() for more information.

Implemented in csMeshObject.

virtual uint iMeshObject::GetMixMode (  )  const [pure virtual]

Get mix mode.

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 CS::Graphics::RenderMesh** iMeshObject::GetRenderMeshes ( int &  num,
iRenderView rview,
iMovable movable,
uint32  frustum_mask 
) [pure virtual]

Returns the set of render meshes.

The frustum_mask is given by the culler and contains a mask with all relevant planes for the given object. These planes correspond with the clip planes kept by iRenderView.

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,
int *  polygon_idx = 0,
iMaterialWrapper **  material = 0,
bool  bf = false 
) [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. If the object supports this then an index of the hit polygon will be returned (or -1 if not supported or no hit).

Parameters:
start Start of the beam to trace in object coordinate.
end End of the beam to trace in object coordinate.
isect Will be set to the point of the hit in object coordinate.
pr Will be set to the position of the hit as a value between 0 and 1, where 0 means start and 1 means end.
polygon_idx Index of the polygon hit on the mesh (or -1 if not supported).
bf if this is true then backface culling is used on the triangles.
material If not 0 then the hit material will be put here. Or 0 in case this mesh object doesn't support material selection.

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 interrupts the beam.

Parameters:
start Start of the beam to trace in object coordinate.
end End of the beam to trace in object coordinate.
isect Will be set to the point of the hit in object coordinate.
pr Will be set to the position of the hit as a value between 0 and 1, where 0 means start and 1 means end.

Implemented in csMeshObject.

virtual void iMeshObject::NextFrame ( csTicks  current_time,
const csVector3 pos,
uint  currentFrame 
) [pure virtual]

Control animation of this object.

Implemented in csMeshObject.

virtual void iMeshObject::PositionChild ( iMeshObject child,
csTicks  current_time 
) [pure virtual]

The engine asks this mesh object to place one of his hierarchical children.

It must be placed where it should be at the given time. This object might or might not have been drawn, so you can't use it's current state.

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 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::SetMeshWrapper ( iMeshWrapper logparent  )  [pure virtual]

Set a reference to the mesh wrapper holding the mesh objects.

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 void iMeshObject::SetMixMode ( uint  mode  )  [pure virtual]

Set mix mode. Note that not all meshes may support this.

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.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1