Planeshift
psCharAppearance Class Reference

A manager class that handles all the details of a characters appearance. More...

#include <charapp.h>

Public Member Functions

void ApplyEquipment (const csString &equipment)
 Apply a set of equipment based on a XML string. More...
 
void ApplyRider (iMeshWrapper *mesh)
 Handle the visual aspect of mounting, by attaching the rider's mesh on the back of the mount. More...
 
void ApplyTraits (const csString &traits)
 Apply a set of traits based on a XML string. More...
 
void BeardMesh (csString &submesh)
 Attach a beard sub mesh to the model. More...
 
bool ChangeMaterial (const char *part, const char *materialName)
 Change the material on a part of the model. More...
 
bool CheckLoadStatus ()
 
void ClearEquipment (const char *slot=NULL)
 Clears the equipment on a mesh. More...
 
void Clone (psCharAppearance *clone)
 Copy a current appearance class. More...
 
bool Dequip (csString &slotname, csString &mesh, csString &part, csString &subMesh, csString &texture, csString &removedMesh)
 Remove an item from the model. More...
 
void Equip (csString &slotname, csString &mesh, csString &part, csString &subMesh, csString &texture, csString &removedMesh)
 Equip an item onto the model. More...
 
void EyeColor (csVector3 &shader)
 Set the colour of the eyes. More...
 
void FaceTexture (csString &faceMaterial)
 Set the material we want to use for the face. More...
 
void HairColor (csVector3 &shader)
 Set the colour of the hair. More...
 
void HairMesh (csString &submesh)
 Attach a hair sub mesh to the model. More...
 
 psCharAppearance (iObjectRegistry *objectReg)
 Setup the class. More...
 
void SetMesh (iMeshWrapper *mesh)
 Set the mesh that is the base model character. More...
 
void SetSkinTone (csString &part, csString &material)
 Set the skin tone. More...
 
void SetSneak (bool sneaking)
 
void ShowHair (bool flag=true)
 Toggle the hair mesh on and off. More...
 
void ShowMeshes (csString &slot, csString &meshList, bool show=true)
 Toggle the meshes on and off. More...
 
void UpdateMeshShowStatus (csString &meshName)
 Checks if the mesh is hidden and in that case removes it. More...
 
 ~psCharAppearance ()
 
- Public Member Functions inherited from DelayedLoader
virtual ~DelayedLoader ()
 

Detailed Description

A manager class that handles all the details of a characters appearance.

Definition at line 65 of file charapp.h.

Constructor & Destructor Documentation

psCharAppearance::psCharAppearance ( iObjectRegistry *  objectReg)

Setup the class.

Parameters
objectRegThe Crystal Space registry so we can aquire some needed objects.
psCharAppearance::~psCharAppearance ( )

Member Function Documentation

void psCharAppearance::ApplyEquipment ( const csString &  equipment)

Apply a set of equipment based on a XML string.

Parameters
equipmentThe XML formated string that has a list of the equipment to apply.
void psCharAppearance::ApplyRider ( iMeshWrapper *  mesh)

Handle the visual aspect of mounting, by attaching the rider's mesh on the back of the mount.

Parameters
meshThe mount's mesh
void psCharAppearance::ApplyTraits ( const csString &  traits)

Apply a set of traits based on a XML string.

Parameters
traitsThe XML formated string that has a list of the traits to apply.
void psCharAppearance::BeardMesh ( csString &  submesh)

Attach a beard sub mesh to the model.

Parameters
submeshThe name of the beard sub mesh to attach.
bool psCharAppearance::ChangeMaterial ( const char *  part,
const char *  materialName 
)

Change the material on a part of the model.

Parameters
partThe part of the model we want to change the materail on ( ex Torso )
materialNameThe name of the material to use.
Returns
true if the material was changed.
bool psCharAppearance::CheckLoadStatus ( )
virtual

Implements DelayedLoader.

void psCharAppearance::ClearEquipment ( const char *  slot = NULL)

Clears the equipment on a mesh.

void psCharAppearance::Clone ( psCharAppearance clone)

Copy a current appearance class.

Parameters
cloneThe class to copy.
bool psCharAppearance::Dequip ( csString &  slotname,
csString &  mesh,
csString &  part,
csString &  subMesh,
csString &  texture,
csString &  removedMesh 
)

Remove an item from the model.

Parameters
slotnameThe socket we want to remove the item.
meshThe name of the 3D mesh in above socket.
partThe part of the model we want to change ( ie Torso )
subMeshThe submesh we want to remove ( ie $P_Plate )
textureThe texture to apply to that part.
removedMeshThe mesh to remove when this item is equipped
void psCharAppearance::Equip ( csString &  slotname,
csString &  mesh,
csString &  part,
csString &  subMesh,
csString &  texture,
csString &  removedMesh 
)

Equip an item onto the model.

Parameters
slotnameThe socket we want to place the item.
meshThe name of the 3D mesh to attach in above socket.
partThe part of the model we want to change ( ie Torso )
subMeshThe submesh we want to use ( ie $P_Plate )
textureThe texture to apply to that part.
removedMeshThe mesh to remove when this item is equipped
void psCharAppearance::EyeColor ( csVector3 &  shader)

Set the colour of the eyes.

Parameters
shaderthe R,G,B value of the shader to use on the eyes.
void psCharAppearance::FaceTexture ( csString &  faceMaterial)

Set the material we want to use for the face.

Parameters
faceMaterialThe material to use.
void psCharAppearance::HairColor ( csVector3 &  shader)

Set the colour of the hair.

Parameters
shaderthe R,G,B value of the shader to use on the hair.
void psCharAppearance::HairMesh ( csString &  submesh)

Attach a hair sub mesh to the model.

Parameters
submeshThe name of the hair sub mesh to attach.
void psCharAppearance::SetMesh ( iMeshWrapper *  mesh)

Set the mesh that is the base model character.

Parameters
meshThe mesh that will be the core model that we want to manage the appearance for.
void psCharAppearance::SetSkinTone ( csString &  part,
csString &  material 
)

Set the skin tone.

Parameters
partThe part of the model to change.
materialThe material to use on that part.
void psCharAppearance::SetSneak ( bool  sneaking)
void psCharAppearance::ShowHair ( bool  flag = true)

Toggle the hair mesh on and off.

Parameters
flagTrue if we want to show the hair. False if we want to hide it.
void psCharAppearance::ShowMeshes ( csString &  slot,
csString &  meshList,
bool  show = true 
)

Toggle the meshes on and off.

Parameters
slotThe slot which which will apply/remove this restrain.
meshListThe list of meshes which will be applied/removed this restrain.
showTrue if the slot is a restrain to showing the mesh. False if it's not anymore.
void psCharAppearance::UpdateMeshShowStatus ( csString &  meshName)

Checks if the mesh is hidden and in that case removes it.

Useful when we are adding a new mesh to check if it should really show.

Parameters
meshNameThe name of the mesh to check for restrains.

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