|
wavelength 1.0.0
|
The model of one part of an avatar that an Avatar draws. More...
#include <avatarpart.h>
Classes | |
| class | Callback |
| The callback of the loads of the files of a part. More... | |
Public Member Functions | |
| AvatarPart (int nPart, int nParent, Avatar *pAvatar) | |
| Construct the model of a part from its entry of the parts array of the avatar entry of the "db" section. | |
| virtual | ~AvatarPart () |
| Delete the animations and the loaders of the model. | |
| virtual void | SetFrame (float fFrame) |
| Pose the model at one frame of its animations. | |
| virtual void | SetFrames (float fFrom, float fTo, float fBlend) |
| Pose the model between two frames of its animations. | |
| virtual void | Update () |
| Hang the model from the joint of its parent. | |
| virtual void | SetType (const char *pszType) |
| Start loading the files of a choice of the part. | |
| virtual bool | Rebuild () |
| Build the meshes of the model once the files SetType() started loading have loaded. | |
| virtual void | ReleaseType () |
| Abandon the loads SetType() started and return to the choice the meshes show. | |
| void | Draw () |
| Draw the model, when it has a mesh. | |
| void | SetBlend (float fBlend) |
| Set the alpha of the material of the model, when it has one. | |
| void | SetColor (const Color *pColor) |
| Colour the model. | |
| const char * | GetType () const |
| const char * | GetPendingType () const |
| void | SetPendingType (const char *pszType) |
| Set the choice SetType() last requested. | |
| void | SetMat (RndMat *pMat) |
| Set the material of the model. | |
| RndMesh * | GetTransRoot () |
| const std::vector< std::unique_ptr< RndTransAnim > > & | GetAnims () const |
Protected Member Functions | |
| void | SetMatTree (RndMesh *pMesh) |
| Give a mesh and every mesh drawn under it the material of the model. | |
| void | FindJoint () |
| Find the joint mesh the model hangs from, avatar<n>_<trans_root>_joint.mesh. | |
Static Protected Member Functions | |
| static void | RotationAt (const RndTransAnim *pAnim, float fFrame, Quat &out) |
| Interpolate the rotation keys of an animation at a frame. | |
| static void | BlendRotation (const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Quat &out) |
| Blend the rotations of an animation at two frames. | |
| static void | BlendTranslation (const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Vector3 &out) |
| Blend the translations of an animation at two frames. | |
| static RndMesh * | FindMesh (const char *pszName) |
| Find a mesh by name. | |
| static void | ResetLocalXfm (RndMesh *pMesh) |
| Set the local transform of a mesh to the identity and mark it out of date. | |
Protected Attributes | |
| Callback | mCallback |
| DataArray * | mData |
| const char * | mType |
| const char * | mPendingType |
| Color | mColor |
| RndMesh * | mMesh |
| RndMesh * | mTransRoot |
| RndMesh * | mJoint |
| RndMat * | mMat |
| std::vector< std::unique_ptr< RndTransAnim > > | mAnims |
| The animations of the bones the anims array lists, in its order, deleted with the part. | |
| AvatarPart * | mParent |
| Avatar * | mAvatar |
| std::unique_ptr< RndLoader > | mLoader |
| std::unique_ptr< RndLoader > | mPendingLoader |
| The load of the first file of mPendingType, or null. | |
| std::unique_ptr< RndLoader > | mPendingExtraLoader |
| The load of the second file of mPendingType, or null. | |
The model of one part of an avatar that an Avatar draws.
The RTTI includes the name. The object is 0x70 bytes, and the vptr follows the data members at +0x64. TorsoPart, InstrPart, and ArmPart derive from it. The part comes from its entry of the parts array of the avatar entry of the "db" section. Each choice of the types array of that entry names one or two .rnd files under rnd_dir, and the anims array names the meshes the shared fbase_*.tnm animations drive.
| AvatarPart::AvatarPart | ( | int | nPart, |
| int | nParent, | ||
| Avatar * | pAvatar ) |
Construct the model of a part from its entry of the parts array of the avatar entry of the "db" section.
Each name of the anims array of the entry gets an animation avatar<n>_<name>.tnm that shares the keys of fbase_<name>.tnm. Only the pelvis and the arm bones retain the translation keys.
| nPart | The part, one of AvatarPartSet::Part. |
| nParent | The part the model hangs from, or AvatarPartSet::kNumParts for none. |
| pAvatar | The avatar the part belongs to. |
|
virtual |
Delete the animations and the loaders of the model.
|
virtual |
Pose the model at one frame of its animations.
The name is inferred.
| fFrame | The frame. |
Reimplemented in ArmPart.
|
virtual |
Pose the model between two frames of its animations.
The translation of a bone without translation keys is not changed. The name is inferred.
| fFrom | The frame blended from. |
| fTo | The frame blended to. |
| fBlend | The weight of fTo, 0 to 1. |
Reimplemented in ArmPart.
|
virtual |
Hang the model from the joint of its parent.
The name is inferred.
Reimplemented in ArmPart.
|
virtual |
|
virtual |
|
virtual |
| void AvatarPart::Draw | ( | ) |
Draw the model, when it has a mesh.
The name is inferred.
| void AvatarPart::SetBlend | ( | float | fBlend | ) |
Set the alpha of the material of the model, when it has one.
The name is inferred.
| fBlend | The alpha, 0 to 1. |
| void AvatarPart::SetColor | ( | const Color * | pColor | ) |
Colour the model.
The colour becomes the light colour of the material.
| pColor | The colour. Its alpha is ignored. |
|
inline |
|
inline |
|
inline |
Set the choice SetType() last requested.
| pszType | The choice, or null. |
|
inline |
Set the material of the model.
| pMat | The material, or null. Borrowed. |
|
inline |
|
inline |
|
protected |
Give a mesh and every mesh drawn under it the material of the model.
The name is inferred.
| pMesh | The mesh. |
|
protected |
Find the joint mesh the model hangs from, avatar<n>_<trans_root>_joint.mesh.
The parent calls it once its meshes are built. The name is inferred.
|
inlinestaticprotected |
Interpolate the rotation keys of an animation at a frame.
The binary expands the routine inline. Nothing is written for no keys.
| pAnim | The animation. Its frames owner has the keys. |
| fFrame | The frame. |
| out | Receives the rotation. |
|
inlinestaticprotected |
Blend the rotations of an animation at two frames.
The binary expands the routine inline.
| pAnim | The animation. |
| fFrom | The frame blended from. |
| fTo | The frame blended to. |
| fBlend | The weight of fTo. |
| out | Receives the rotation. |
|
inlinestaticprotected |
Blend the translations of an animation at two frames.
The binary expands the routine inline.
| pAnim | The animation. |
| fFrom | The frame blended from. |
| fTo | The frame blended to. |
| fBlend | The weight of fTo. |
| out | Receives the translation. |
|
inlinestaticprotected |
Find a mesh by name.
The binary expands the routine inline.
| pszName | The name. |
|
inlinestaticprotected |
Set the local transform of a mesh to the identity and mark it out of date.
The binary expands the routine inline.
| pMesh | The mesh. |
|
protected |
The callback of the loads of the part.
|
protected |
The entry of the part in the parts array. Borrowed.
|
protected |
The choice the meshes show, or null before the first.
|
protected |
The choice SetType() last requested, or null.
|
protected |
The colour, opaque white until SetColor(). +0x20
|
protected |
The draw_root mesh drawn, or null. Borrowed.
|
protected |
The trans_root mesh the model hangs from, or null. Borrowed.
|
protected |
The joint mesh of the parent the model hangs from, or null. Borrowed.
|
protected |
The material of the model, or null. Borrowed.
|
protected |
The animations of the bones the anims array lists, in its order, deleted with the part.
|
protected |
The part the model hangs from, or null. Borrowed.
|
protected |
The avatar the part belongs to. Borrowed.
|
protected |
The load of the files the meshes come from, or null.
|
protected |
The load of the first file of mPendingType, or null.
|
protected |
The load of the second file of mPendingType, or null.