22#ifndef INCLUDED_MODELDEF
23#define INCLUDED_MODELDEF
36#include <unordered_map>
227 const size_t* blendIndices,
void ModelDefActivateFastImpl()
Detects CPU caps and activates the best possible codepath.
Definition: ModelDef.cpp:525
Definition: SkeletonAnimDef.h:35
Definition: BoundingBoxAligned.h:34
Definition: Matrix3D.h:34
Definition: ModelDef.h:130
CModelDefRPrivate()
Definition: ModelDef.h:132
virtual ~CModelDefRPrivate()
Definition: ModelDef.h:133
Definition: ModelDef.h:141
const VfsPath & GetName() const
Definition: ModelDef.h:255
CMatrix3D * m_InverseBindBoneMatrices
Definition: ModelDef.h:269
SModelVertex * m_pVertices
Definition: ModelDef.h:260
const std::vector< CVector2D > & GetUVCoordinates() const
Definition: ModelDef.h:176
void BlendBoneMatrices(CMatrix3D boneMatrices[])
Blend bone matrices together to fill bone palette.
Definition: ModelDef.cpp:256
std::map< const void *, CModelDefRPrivate * > RenderDataMap
Definition: ModelDef.h:285
size_t m_NumBlends
Definition: ModelDef.h:271
void SetRenderData(const void *key, CModelDefRPrivate *data)
Register renderer private data.
Definition: ModelDef.cpp:506
size_t m_NumUVsPerVertex
Definition: ModelDef.h:262
static void(* SkinPointsAndNormals)(size_t numVertices, const VertexArrayIterator< CVector3D > &Position, const VertexArrayIterator< CVector3D > &Normal, const SModelVertex *vertices, const size_t *blendIndices, const CMatrix3D newPoseMatrices[])
Transform vertices' positions and normals.
Definition: ModelDef.h:222
CMatrix3D * GetInverseBindBoneMatrices()
Definition: ModelDef.h:185
const SPropPoint * FindPropPoint(const char *name) const
Definition: ModelDef.cpp:301
SModelFace * GetFaces() const
Definition: ModelDef.h:180
VfsPath m_Name
Definition: ModelDef.h:278
CBoneState * GetBones() const
Definition: ModelDef.h:184
size_t m_NumBones
Definition: ModelDef.h:267
SVertexBlend * m_pBlends
Definition: ModelDef.h:272
RenderDataMap m_RenderData
Definition: ModelDef.h:286
@ FILE_VERSION
Definition: ModelDef.h:146
static void Save(const VfsPath &filename, const CModelDef *mdef)
Definition: ModelDef.cpp:473
size_t GetNumVertices() const
Definition: ModelDef.h:170
~CModelDef()
Definition: ModelDef.cpp:287
CModelDef()
Definition: ModelDef.cpp:278
std::vector< CVector2D > m_UVCoordinates
Definition: ModelDef.h:261
size_t GetNumFaces() const
Definition: ModelDef.h:179
static CVector3D SkinNormal(const SModelVertex &vtx, const CMatrix3D newPoseMatrices[])
Transform the given vertex's normal from the bind pose into the new pose.
Definition: ModelDef.cpp:86
size_t m_NumVertices
Definition: ModelDef.h:259
SModelFace * m_pFaces
Definition: ModelDef.h:265
size_t GetNumBlends() const
Definition: ModelDef.h:188
size_t * m_pBlendIndices
Definition: ModelDef.h:273
std::vector< SPropPoint > m_PropPoints
Definition: ModelDef.h:275
size_t GetNumBones() const
Definition: ModelDef.h:183
size_t GetNumUVsPerVertex() const
Definition: ModelDef.h:174
void GetMaxBounds(CSkeletonAnimDef *anim, bool loop, CBoundingBoxAligned &result)
Definition: ModelDef.cpp:31
static CModelDef * Load(const VfsPath &filename, const VfsPath &name)
Loads a PMD file.
Definition: ModelDef.cpp:311
static CVector3D SkinPoint(const SModelVertex &vtx, const CMatrix3D newPoseMatrices[])
Transform the given vertex's position from the bind pose into the new pose.
Definition: ModelDef.cpp:73
size_t * GetBlendIndices() const
Definition: ModelDef.h:190
SModelVertex * GetVertices() const
Definition: ModelDef.h:171
SVertexBlend * GetBlends() const
Definition: ModelDef.h:189
CBoneState * m_Bones
Definition: ModelDef.h:268
std::unordered_map< u32, CBoundingBoxAligned > m_MaxBoundsPerAnimDef
Definition: ModelDef.h:281
@ FILE_READ_VERSION
Definition: ModelDef.h:148
CModelDefRPrivate * GetRenderData(const void *key) const
Definition: ModelDef.cpp:515
size_t m_NumFaces
Definition: ModelDef.h:264
Definition: Quaternion.h:26
Definition: SkeletonAnimDef.h:48
Definition: Vector3D.h:31
Definition: VertexArray.h:31
@ Normal
Definition: CCmpRangeManager.cpp:211
Definition: ModelDef.h:121
u16 m_Verts[3]
Definition: ModelDef.h:123
Definition: ModelDef.h:108
CVector3D m_Norm
Definition: ModelDef.h:112
CVector3D m_Coords
Definition: ModelDef.h:110
SVertexBlend m_Blend
Definition: ModelDef.h:114
Describes the position of a prop point within its parent model.
Definition: ModelDef.h:55
u8 m_BoneIndex
Index of parent bone to which this prop point is relative, if any.
Definition: ModelDef.h:85
CStr m_Name
Name of the prop point.
Definition: ModelDef.h:57
CVector3D m_Position
Position of the point within the parent model, relative to either the parent model's origin or one of...
Definition: ModelDef.h:64
CQuaternion m_Rotation
Rotation of the prop model that will be attached at this point.
Definition: ModelDef.h:70
CMatrix3D m_Transform
Object to parent space transformation.
Definition: ModelDef.h:79
Definition: ModelDef.h:92
bool operator==(const SVertexBlend &o) const
Definition: ModelDef.h:99
u8 m_Bone[SIZE]
Definition: ModelDef.h:95
float m_Weight[SIZE]
Definition: ModelDef.h:97
@ SIZE
Definition: ModelDef.h:93
uint8_t u8
Definition: types.h:37
uint16_t u16
Definition: types.h:38
pthread_key_t key
Definition: wpthread.cpp:140