Planeshift
|
A manager class that handles all the details of a characters appearance. More...
#include <charapp.h>
Classes | |
struct | Attachment |
Delayed loading. | |
Public Member Functions | |
void | ApplyEquipment (const csString &equipment) |
Apply a set of equipment based on a XML string. | |
void | ApplyRider (iMeshWrapper *mesh) |
Handle the visual aspect of mounting, by attaching the rider's mesh on the back of the mount. | |
void | ApplyTraits (const csString &traits) |
Apply a set of traits based on a XML string. | |
void | BeardMesh (csString &submesh) |
Attach a beard sub mesh to the model. | |
bool | ChangeMaterial (const char *part, const char *materialName) |
Change the material on a part of the model. | |
bool | CheckLoadStatus () |
void | ClearEquipment (const char *slot=NULL) |
Clears the equipment on a mesh. | |
void | Clone (psCharAppearance *clone) |
Copy a current appearance class. | |
bool | Dequip (csString &slotname, csString &mesh, csString &part, csString &subMesh, csString &texture, csString &removedMesh) |
Remove an item from the model. | |
void | Equip (csString &slotname, csString &mesh, csString &part, csString &subMesh, csString &texture, csString &removedMesh) |
Equip an item onto the model. | |
void | EyeColor (csVector3 &shader) |
Set the colour of the eyes. | |
void | FaceTexture (csString &faceMaterial) |
Set the material we want to use for the face. | |
void | HairColor (csVector3 &shader) |
Set the colour of the hair. | |
void | HairMesh (csString &submesh) |
Attach a hair sub mesh to the model. | |
psCharAppearance (iObjectRegistry *objectReg) | |
Setup the class. | |
void | SetMesh (iMeshWrapper *mesh) |
Set the mesh that is the base model character. | |
void | SetSkinTone (csString &part, csString &material) |
Set the skin tone. | |
void | SetSneak (bool sneaking) |
void | ShowHair (bool flag=true) |
Toggle the hair mesh on and off. | |
void | ShowMeshes (csString &slot, csString &meshList, bool show=true) |
Toggle the meshes on and off. | |
void | UpdateMeshShowStatus (csString &meshName) |
Checks if the mesh is hidden and in that case removes it. | |
~psCharAppearance () |
A manager class that handles all the details of a characters appearance.
psCharAppearance::psCharAppearance | ( | iObjectRegistry * | objectReg | ) |
Setup the class.
objectReg | The Crystal Space registry so we can aquire some needed objects. |
psCharAppearance::~psCharAppearance | ( | ) |
void psCharAppearance::ApplyEquipment | ( | const csString & | equipment | ) |
Apply a set of equipment based on a XML string.
equipment | The 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.
mesh | The mount's mesh |
void psCharAppearance::ApplyTraits | ( | const csString & | traits | ) |
Apply a set of traits based on a XML string.
traits | The 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.
submesh | The 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.
part | The part of the model we want to change the materail on ( ex Torso ) |
materialName | The name of the material to use. |
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.
clone | The class to copy. |
bool psCharAppearance::Dequip | ( | csString & | slotname, |
csString & | mesh, | ||
csString & | part, | ||
csString & | subMesh, | ||
csString & | texture, | ||
csString & | removedMesh | ||
) |
Remove an item from the model.
slotname | The socket we want to remove the item. |
mesh | The name of the 3D mesh in above socket. |
part | The part of the model we want to change ( ie Torso ) |
subMesh | The submesh we want to remove ( ie $P_Plate ) |
texture | The texture to apply to that part. |
removedMesh | The 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.
slotname | The socket we want to place the item. |
mesh | The name of the 3D mesh to attach in above socket. |
part | The part of the model we want to change ( ie Torso ) |
subMesh | The submesh we want to use ( ie $P_Plate ) |
texture | The texture to apply to that part. |
removedMesh | The mesh to remove when this item is equipped |
void psCharAppearance::EyeColor | ( | csVector3 & | shader | ) |
Set the colour of the eyes.
shader | the 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.
faceMaterial | The material to use. |
void psCharAppearance::HairColor | ( | csVector3 & | shader | ) |
Set the colour of the hair.
shader | the 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.
submesh | The name of the hair sub mesh to attach. |
void psCharAppearance::SetMesh | ( | iMeshWrapper * | mesh | ) |
Set the mesh that is the base model character.
mesh | The 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.
part | The part of the model to change. |
material | The material to use on that part. |
void psCharAppearance::SetSneak | ( | bool | sneaking | ) |
void psCharAppearance::ShowHair | ( | bool | flag = true | ) |
Toggle the hair mesh on and off.
flag | True 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.
slot | The slot which which will apply/remove this restrain. |
meshList | The list of meshes which will be applied/removed this restrain. |
show | True 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.
meshName | The name of the mesh to check for restrains. |