CrystalSpace

Public API Reference

iMeshFactoryWrapper Struct Reference
[Mesh support]

A mesh factory wrapper is an engine-level object that wraps around a mesh object factory (iMeshObjectFactory). More...

#include <iengine/mesh.h>

Inheritance diagram for iMeshFactoryWrapper:

List of all members.

Public Member Functions

virtual size_t AddExtraRenderMesh (CS::Graphics::RenderMesh *renderMesh)=0
 Adds a render mesh to the list of extra render meshes.
virtual void AddFactoryToStaticLOD (int lod, iMeshFactoryWrapper *fact)=0
 Set a given child factory at a specific lod level.
virtual void AddInstance (csVector3 &position, csMatrix3 &rotation)=0
 Adds a (pseudo-)instance of the instance factory at the given position.
virtual csPtr< iMeshWrapperCreateMeshWrapper ()=0
 Create mesh objects from this factory.
virtual iLODControlCreateStaticLOD ()=0
 Create a LOD control template for this factory.
virtual void DestroyStaticLOD ()=0
 Destroy the LOD control for this factory.
virtual iMeshFactoryListGetChildren ()=0
 Get all the children of this mesh factory.
virtual CS::Graphics::RenderMeshGetExtraRenderMesh (size_t idx) const =0
 Get a specific extra render mesh.
virtual size_t GetExtraRenderMeshCount () const =0
 Get the number of extra render meshes.
virtual csFlagsGetFlags ()=0
 Get default flags for all meshes created from this factory.
virtual iMeshFactoryWrapperGetInstanceFactory () const =0
 Returns the instance factory.
virtual csShaderVariableGetInstances () const =0
 Returns the instancing transforms array shadervar.
virtual iMeshObjectFactoryGetMeshObjectFactory () const =0
 Get the iMeshObjectFactory.
virtual iMeshFactoryWrapperGetParentContainer () const =0
 Get the parent of this factory.
virtual
CS::Graphics::RenderPriority 
GetRenderPriority () const =0
 Get the render priority.
virtual void GetStaticLOD (float &m, float &a) const =0
 Get the LOD function parameters for this factory.
virtual iLODControlGetStaticLOD ()=0
 Get the LOD control for this factory.
virtual iShaderVariableContextGetSVContext ()=0
 Get the shader variable context of the mesh factory.
virtual csReversibleTransformGetTransform ()=0
 Get optional relative transform (relative to parent).
virtual csZBufMode GetZBufMode () const =0
 Get the Z-buf drawing mode.
virtual void HardTransform (const csReversibleTransform &t)=0
 Do a hard transform of this factory.
virtual iObjectQueryObject ()=0
 Get the iObject for this mesh factory.
virtual void RemoveFactoryFromStaticLOD (iMeshFactoryWrapper *fact)=0
 Remove a child factory from all lod levels.
virtual void SetInstanceFactory (iMeshFactoryWrapper *meshfact)=0
 Sets the instance factory.
virtual void SetMeshObjectFactory (iMeshObjectFactory *fact)=0
 Set the mesh object factory.
virtual void SetParentContainer (iMeshFactoryWrapper *p)=0
 Set the parent of this factory.
virtual void SetRenderPriority (CS::Graphics::RenderPriority rp)=0
 The renderer will render all objects in a sector based on this number.
virtual void SetRenderPriorityRecursive (CS::Graphics::RenderPriority rp)=0
 Same as SetRenderPriority() but this version will recursively set render priority for the children too.
virtual void SetStaticLOD (float m, float a)=0
 Set the LOD function parameters for this factory.
virtual void SetTransform (const csReversibleTransform &tr)=0
 Set optional relative transform (relative to parent).
virtual void SetZBufMode (csZBufMode mode)=0
 Set the Z-buf drawing mode to use for this factory.
virtual void SetZBufModeRecursive (csZBufMode mode)=0
 Same as SetZBufMode() but this will also set the z-buf mode for the children too.



virtual void RemoveExtraRenderMesh (size_t idx)=0
 Deletes a specific extra rendermesh.
virtual void RemoveExtraRenderMesh (CS::Graphics::RenderMesh *renderMesh)=0
 Deletes a specific extra rendermesh.

Detailed Description

A mesh factory wrapper is an engine-level object that wraps around a mesh object factory (iMeshObjectFactory).

Every mesh object factory in the engine is represented by a mesh factory wrapper, which keeps the pointer to the mesh factory, its name, etc.

Think of the mesh factory wrapper as the hook that holds the mesh factory in the engine. An effect of this is that the i???FactoryState interfaces (e.g. iSprite3DFactoryState) must be queried from the mesh *factories*, not the wrappers!

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Main users of this interface:

Definition at line 697 of file mesh.h.


Member Function Documentation

virtual size_t iMeshFactoryWrapper::AddExtraRenderMesh ( CS::Graphics::RenderMesh renderMesh  )  [pure virtual]

Adds a render mesh to the list of extra render meshes.

This list is used for special cases (like decals or lines) where additional things need to be renderered for the mesh in an abstract way.

Warning:
: the factory will take the memory ownership of the render mesh, ie you cannot call delete anymore on the object.
virtual void iMeshFactoryWrapper::AddFactoryToStaticLOD ( int  lod,
iMeshFactoryWrapper fact 
) [pure virtual]

Set a given child factory at a specific lod level.

Note that a factory can be at several lod levels at once.

virtual void iMeshFactoryWrapper::AddInstance ( csVector3 position,
csMatrix3 rotation 
) [pure virtual]

Adds a (pseudo-)instance of the instance factory at the given position.

virtual csPtr<iMeshWrapper> iMeshFactoryWrapper::CreateMeshWrapper (  )  [pure virtual]

Create mesh objects from this factory.

If the factory has a hierarchy then a hierarchical mesh object will be created.

virtual iLODControl* iMeshFactoryWrapper::CreateStaticLOD (  )  [pure virtual]

Create a LOD control template for this factory.

This is relevant only if the factory is hierarchical. The LOD control will be used to select which children are visible and which are not. Use this to create static lod.

virtual void iMeshFactoryWrapper::DestroyStaticLOD (  )  [pure virtual]

Destroy the LOD control for this factory.

virtual iMeshFactoryList* iMeshFactoryWrapper::GetChildren (  )  [pure virtual]

Get all the children of this mesh factory.

virtual CS::Graphics::RenderMesh* iMeshFactoryWrapper::GetExtraRenderMesh ( size_t  idx  )  const [pure virtual]

Get a specific extra render mesh.

virtual size_t iMeshFactoryWrapper::GetExtraRenderMeshCount (  )  const [pure virtual]

Get the number of extra render meshes.

virtual csFlags& iMeshFactoryWrapper::GetFlags (  )  [pure virtual]

Get default flags for all meshes created from this factory.

The following flags are supported:

Remarks:
Despite the name, this method does not only provide read access to the mesh flags, as the returned reference to a csFlags object also provides write access.
virtual iMeshFactoryWrapper* iMeshFactoryWrapper::GetInstanceFactory (  )  const [pure virtual]

Returns the instance factory.

virtual csShaderVariable* iMeshFactoryWrapper::GetInstances (  )  const [pure virtual]

Returns the instancing transforms array shadervar.

virtual iMeshObjectFactory* iMeshFactoryWrapper::GetMeshObjectFactory (  )  const [pure virtual]
virtual iMeshFactoryWrapper* iMeshFactoryWrapper::GetParentContainer (  )  const [pure virtual]

Get the parent of this factory.

This will be 0 if this factory has no parent.

virtual CS::Graphics::RenderPriority iMeshFactoryWrapper::GetRenderPriority (  )  const [pure virtual]

Get the render priority.

virtual void iMeshFactoryWrapper::GetStaticLOD ( float &  m,
float &  a 
) const [pure virtual]

Get the LOD function parameters for this factory.

virtual iLODControl* iMeshFactoryWrapper::GetStaticLOD (  )  [pure virtual]

Get the LOD control for this factory.

This will return 0 if this is a normal (hierarchical) factory. Otherwise it will return an object with which you can control the static LOD of this factory.

virtual iShaderVariableContext* iMeshFactoryWrapper::GetSVContext (  )  [pure virtual]

Get the shader variable context of the mesh factory.

virtual csReversibleTransform& iMeshFactoryWrapper::GetTransform (  )  [pure virtual]

Get optional relative transform (relative to parent).

virtual csZBufMode iMeshFactoryWrapper::GetZBufMode (  )  const [pure virtual]

Get the Z-buf drawing mode.

virtual void iMeshFactoryWrapper::HardTransform ( const csReversibleTransform t  )  [pure virtual]

Do a hard transform of this factory.

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.

virtual iObject* iMeshFactoryWrapper::QueryObject (  )  [pure virtual]

Get the iObject for this mesh factory.

virtual void iMeshFactoryWrapper::RemoveExtraRenderMesh ( size_t  idx  )  [pure virtual]

Deletes a specific extra rendermesh.

virtual void iMeshFactoryWrapper::RemoveExtraRenderMesh ( CS::Graphics::RenderMesh renderMesh  )  [pure virtual]

Deletes a specific extra rendermesh.

virtual void iMeshFactoryWrapper::RemoveFactoryFromStaticLOD ( iMeshFactoryWrapper fact  )  [pure virtual]

Remove a child factory from all lod levels.

The factory is not removed from the list of factories however.

virtual void iMeshFactoryWrapper::SetInstanceFactory ( iMeshFactoryWrapper meshfact  )  [pure virtual]

Sets the instance factory.

virtual void iMeshFactoryWrapper::SetMeshObjectFactory ( iMeshObjectFactory fact  )  [pure virtual]

Set the mesh object factory.

virtual void iMeshFactoryWrapper::SetParentContainer ( iMeshFactoryWrapper p  )  [pure virtual]

Set the parent of this factory.

This will only change the 'parent' pointer but not add the factory as a child! Internal use only.

virtual void iMeshFactoryWrapper::SetRenderPriority ( CS::Graphics::RenderPriority  rp  )  [pure virtual]

The renderer will render all objects in a sector based on this number.

Low numbers get rendered first. High numbers get rendered later. The value for the factory is used as a default for objects created from that factory. There are a few often used slots:

  • 1. Sky objects are rendered before everything else. Usually they are rendered using ZFILL (or ZNONE).
  • 2. Walls are rendered after that. They usually use ZFILL.
  • 3. After that normal objects are rendered using the Z-buffer (ZUSE).
  • 4. Alpha transparent objects or objects using some other transparency system are rendered after that. They are usually rendered using ZTEST.
virtual void iMeshFactoryWrapper::SetRenderPriorityRecursive ( CS::Graphics::RenderPriority  rp  )  [pure virtual]

Same as SetRenderPriority() but this version will recursively set render priority for the children too.

virtual void iMeshFactoryWrapper::SetStaticLOD ( float  m,
float  a 
) [pure virtual]

Set the LOD function parameters for this factory.

These control the function:

    float lod = m * distance + a;
 
virtual void iMeshFactoryWrapper::SetTransform ( const csReversibleTransform tr  )  [pure virtual]

Set optional relative transform (relative to parent).

virtual void iMeshFactoryWrapper::SetZBufMode ( csZBufMode  mode  )  [pure virtual]

Set the Z-buf drawing mode to use for this factory.

All objects created from this factory will have this mode as default. Possible values are:

virtual void iMeshFactoryWrapper::SetZBufModeRecursive ( csZBufMode  mode  )  [pure virtual]

Same as SetZBufMode() but this will also set the z-buf mode for the children too.


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

Generated for Crystal Space 2.0 by doxygen 1.6.1