[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
iPcMesh
Using this property class one can assign a 3D mesh from Crystal Space to an entity.
There are a few ways to set the mesh in ‘pcobject.mesh’:
iPcMesh->SetMesh()
with the mesh wrapper as
a parameter.
iPcMesh->SetMesh()
with ‘factname’ given and ‘filename’
equal to ‘0’.
SetMesh()
will first check to see if the factory is already loaded. If not then it
will load it from the given filename. If you call iPcMesh->SetPath()
then you can also control the VFS path from which the factory file
will be loaded.
Note that the file can be either a ‘meshfact’ XML file or else a ‘library’ XML file.
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 ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated using texi2html 1.76.