[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.2 Mesh

The mesh property class can be used to assign a 3D model to an entity. This property class defines a visual representation for an entity.

Property Class Details

General Information

Using this property class one can assign a 3D mesh from Crystal Space to an entity.

Setting the Mesh Data

There are a few ways to set the mesh in `pcmesh':

Note that the file can be either a `meshfact' XML file or else a `library' XML file.

From Mesh to Entity and Back

It is easy to get from the entity to the mesh by using the following code:

 
csRef<iPcMesh> pcmesh = CEL_QUERY_PROPCLASS_ENT (entity, iPcMesh);
iMeshWrapper* mesh = pcmesh->GetMesh ();

But you can also get from the mesh back to the entity very easily because the physical layer maintains a link:

 
iMeshWrapper* mesh = ...;
iCelEntity* entity = pl->FindAttachedEntity (mesh->QueryObject ());

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated using texi2html 1.76.