114 virtual void SetFrames(
float fFrom,
float fTo,
float fBlend);
224 const std::vector<std::unique_ptr<RndTransAnim>> &
GetAnims()
const {
264 if (pPrev !=
nullptr) {
306 Interp(from, to, fBlend, out);
330 identity.
mBasisX = {1.0f, 0.0f, 0.0f};
331 identity.
mBasisY = {0.0f, 1.0f, 0.0f};
332 identity.
mBasisZ = {0.0f, 0.0f, 1.0f};
357 std::vector<std::unique_ptr<RndTransAnim>>
mAnims;
The callback of the loads of the files of a part.
Definition avatarpart.h:37
Callback(AvatarPart *pOwner)
Construct the callback of a part.
Definition avatarpart.h:46
int ShouldLoad(RndObject *pExisting, const char *pszName, const char *pszClass) override
Create an object only when no object of the name exists.
static void ResetLocalXfm(RndMesh *pMesh)
Set the local transform of a mesh to the identity and mark it out of date.
Definition avatarpart.h:328
static RndMesh * FindMesh(const char *pszName)
Find a mesh by name.
Definition avatarpart.h:317
const char * GetType() const
Definition avatarpart.h:191
void SetPendingType(const char *pszType)
Set the choice SetType() last requested.
Definition avatarpart.h:205
RndMesh * mTransRoot
Definition avatarpart.h:350
static void BlendRotation(const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Quat &out)
Blend the rotations of an animation at two frames.
Definition avatarpart.h:281
virtual void Update()
Hang the model from the joint of its parent.
void SetColor(const Color *pColor)
Colour the model.
void SetBlend(float fBlend)
Set the alpha of the material of the model, when it has one.
void SetMatTree(RndMesh *pMesh)
Give a mesh and every mesh drawn under it the material of the model.
const char * mPendingType
Definition avatarpart.h:344
RndMesh * mJoint
Definition avatarpart.h:352
void SetMat(RndMat *pMat)
Set the material of the model.
Definition avatarpart.h:214
DataArray * mData
Definition avatarpart.h:340
Callback mCallback
Definition avatarpart.h:338
RndMesh * mMesh
Definition avatarpart.h:348
std::unique_ptr< RndLoader > mPendingExtraLoader
The load of the second file of mPendingType, or null.
Definition avatarpart.h:369
virtual void SetFrames(float fFrom, float fTo, float fBlend)
Pose the model between two frames of its animations.
const std::vector< std::unique_ptr< RndTransAnim > > & GetAnims() const
Definition avatarpart.h:224
std::vector< std::unique_ptr< RndTransAnim > > mAnims
The animations of the bones the anims array lists, in its order, deleted with the part.
Definition avatarpart.h:357
RndMesh * GetTransRoot()
Definition avatarpart.h:219
virtual ~AvatarPart()
Delete the animations and the loaders of the model.
virtual void ReleaseType()
Abandon the loads SetType() started and return to the choice the meshes show.
virtual void SetType(const char *pszType)
Start loading the files of a choice of the part.
Color mColor
Definition avatarpart.h:346
const char * mType
Definition avatarpart.h:342
AvatarPart * mParent
Definition avatarpart.h:359
virtual void SetFrame(float fFrame)
Pose the model at one frame of its animations.
static void BlendTranslation(const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Vector3 &out)
Blend the translations of an animation at two frames.
Definition avatarpart.h:300
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" secti...
void FindJoint()
Find the joint mesh the model hangs from, avatar<n>_<trans_root>_joint.mesh.
Avatar * mAvatar
Definition avatarpart.h:361
std::unique_ptr< RndLoader > mPendingLoader
The load of the first file of mPendingType, or null.
Definition avatarpart.h:366
RndMat * mMat
Definition avatarpart.h:354
void Draw()
Draw the model, when it has a mesh.
static void RotationAt(const RndTransAnim *pAnim, float fFrame, Quat &out)
Interpolate the rotation keys of an animation at a frame.
Definition avatarpart.h:259
virtual bool Rebuild()
Build the meshes of the model once the files SetType() started loading have loaded.
std::unique_ptr< RndLoader > mLoader
Definition avatarpart.h:363
const char * GetPendingType() const
Definition avatarpart.h:196
One of the avatars the game can draw at a time, lent to the AvatarPartSet that shows.
Definition avatar.h:24
Reference-counted array of script data nodes.
Definition dataarray.h:20
Rotation quaternion, stored as the vector part followed by the scalar part.
Definition quaternion.h:19
Interface a loader consults before it creates each object of its file.
Definition rndloader.h:35
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Triangle mesh with a material.
Definition rndmesh.h:31
Base of every object the renderer can load, resolve by name, and serialise.
Definition rndobject.h:20
Animation of a transformable's local transform by rotation, translation, and scale keys.
Definition rndtransanim.h:20
const std::vector< Key< Quat > > & GetRotKeys() const
Definition rndtransanim.h:231
RndTransAnim * GetFramesOwner() const
Definition rndtransanim.h:226
const std::vector< Key< Vector3 > > & GetTransKeys() const
Definition rndtransanim.h:276
void InterpKeys(const std::vector< Key< T > > &keys, float fFrame, T &out)
Interpolate keys at a frame.
Definition key.h:193
int AtFrame(const std::vector< Key< T > > &keys, float fFrame, const Key< T > *&pPrev, const Key< T > *&pNext, float &fRatio)
Find the keys around a frame.
Definition key.h:46
void Interp(const Vector3 &a, const Vector3 &b, float fRatio, Vector3 &out)
Blend two vectors, taking either end exactly at a position of 0 or 1.
Definition key.h:103
void QuatSlerp(const Quat &from, const Quat &to, Quat &out, float flT)
Interpolate between two rotation quaternions along the shorter arc.
RndManager TheManager
The renderer's registry.
Linear colour with four float components.
Definition color.h:12
One keyframe of an animation channel, a value at a frame.
Definition key.h:21
T value
Definition key.h:22
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14