Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/ModelDef.h
Show All 25 Lines | |||||
#include "maths/Vector2D.h" | #include "maths/Vector2D.h" | ||||
#include "maths/Vector3D.h" | #include "maths/Vector3D.h" | ||||
#include "maths/Quaternion.h" | #include "maths/Quaternion.h" | ||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | ||||
#include "renderer/VertexArray.h" | #include "renderer/VertexArray.h" | ||||
#include <map> | #include <map> | ||||
#include <cstring> | #include <cstring> | ||||
class CBoundingBoxAligned; | |||||
class CBoneState; | class CBoneState; | ||||
/** | /** | ||||
* Describes the position of a prop point within its parent model. A prop point is the location within a parent model | * Describes the position of a prop point within its parent model. A prop point is the location within a parent model | ||||
* where the prop's origin will be attached. | * where the prop's origin will be attached. | ||||
* | * | ||||
* A prop point is specified by its transformation matrix (or separately by its position and rotation), which | * A prop point is specified by its transformation matrix (or separately by its position and rotation), which | ||||
* can be relative to either the parent model's origin, or one of the parent's bones. If the parent model is boned, | * can be relative to either the parent model's origin, or one of the parent's bones. If the parent model is boned, | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | public: | ||||
size_t* GetBlendIndices() const { return m_pBlendIndices; } | size_t* GetBlendIndices() const { return m_pBlendIndices; } | ||||
// find and return pointer to prop point matching given name; return | // find and return pointer to prop point matching given name; return | ||||
// null if no match (case insensitive search) | // null if no match (case insensitive search) | ||||
const SPropPoint* FindPropPoint(const char* name) const; | const SPropPoint* FindPropPoint(const char* name) const; | ||||
/** | /** | ||||
* Transform the given vertex's position from the bind pose into the new pose. | * Transform the given vertex's position from the bind pose into the new pose. | ||||
* | |||||
* @return new world-space vertex coordinates | |||||
*/ | */ | ||||
static CVector3D SkinPoint(const SModelVertex& vtx, | static void SkinPoint(const SModelVertex& vtx, const CMatrix3D newPoseMatrices[], CVector3D& result); | ||||
const CMatrix3D newPoseMatrices[]); | |||||
/** | |||||
* Transform the given vertex's position from the bind pose into the new pose. Extend the bounds accordingly. | |||||
*/ | |||||
static void SkinPoint(const SModelVertex& vtx, const CMatrix3D newPoseMatrices[], CBoundingBoxAligned& result); | |||||
/** | /** | ||||
* Transform the given vertex's normal from the bind pose into the new pose. | * Transform the given vertex's normal from the bind pose into the new pose. | ||||
* | * | ||||
* @return new world-space vertex normal | * @return new world-space vertex normal | ||||
*/ | */ | ||||
static CVector3D SkinNormal(const SModelVertex& vtx, | static void SkinNormal(const SModelVertex& vtx, const CMatrix3D newPoseMatrices[], CVector3D &result); | ||||
const CMatrix3D newPoseMatrices[]); | |||||
/** | /** | ||||
* Transform vertices' positions and normals. | * Transform vertices' positions and normals. | ||||
* (This is equivalent to looping over SkinPoint and SkinNormal, | * (This is equivalent to looping over SkinPoint and SkinNormal, | ||||
* but slightly more efficient.) | * but slightly more efficient.) | ||||
*/ | */ | ||||
static void SkinPointsAndNormals( | static void SkinPointsAndNormals( | ||||
size_t numVertices, | size_t numVertices, | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator