Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/PropPoint.h
- This file was added.
/* Copyright (C) 2022 Wildfire Games. | |||||
* This file is part of 0 A.D. | |||||
* | |||||
* 0 A.D. is free software: you can redistribute it and/or modify | |||||
* it under the terms of the GNU General Public License as published by | |||||
* the Free Software Foundation, either version 2 of the License, or | |||||
* (at your option) any later version. | |||||
* | |||||
* 0 A.D. is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
* GNU General Public License for more details. | |||||
* | |||||
* You should have received a copy of the GNU General Public License | |||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | |||||
*/ | |||||
#ifndef INCLUDED_PROPPOINT | |||||
#define INCLUDED_PROPPOINT | |||||
#include "maths/Matrix3D.h" | |||||
#include "maths/Quaternion.h" | |||||
#include "maths/Vector3D.h" | |||||
#include "ps/CStr.h" | |||||
/** | |||||
* Describes the position of a prop point within its parent. | |||||
* A prop point is the location within a parent 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 | |||||
* can be relative to either the parent's origin, or one of the parent's bones. If the parent is boned, | |||||
* then the @ref m_BoneIndex field may specify a bone to which the transformation matrix is relative | |||||
* (see @ref CModel::m_BoneMatrices). | |||||
* Otherwise, the transformation matrix is assumed to be relative to the parent's origin. | |||||
* | |||||
* @see CModel::m_BoneMatrices | |||||
*/ | |||||
struct SPropPoint | |||||
{ | |||||
CStr m_Name; | |||||
/** | |||||
* Position of the point within the parent model, relative to either the parent's origin, | |||||
* or one of the parent's bones if applicable. | |||||
* Also specified as part of @ref m_Transform. | |||||
* @see m_Transform | |||||
*/ | |||||
CVector3D m_Position; | |||||
/** | |||||
* Rotation of the prop that will be attached at this point. Also specified as part of @ref m_Transform. | |||||
* @see m_Transform | |||||
*/ | |||||
CQuaternion m_Rotation; | |||||
/** | |||||
* Object to parent space transformation. Combines both @ref m_Position and @ref m_Rotation in a single | |||||
* transformation matrix. This transformation is relative to either the parent's origin, or one of its | |||||
* bones, depending on whether it is skeletal. If relative to a bone, then the bone in the parent model to | |||||
* which this transformation is relative may be found by m_BoneIndex. | |||||
* @see m_Position, m_Rotation | |||||
*/ | |||||
CMatrix3D m_Transform; | |||||
/** | |||||
* Index of parent bone to which this prop point is relative, if any. The value 0xFF specifies that either the parent | |||||
* model is unboned, or that this prop point is relative to the parent model's origin rather than one if its bones. | |||||
*/ | |||||
u8 m_BoneIndex; | |||||
}; | |||||
#endif // INCLUDED_PROPPOINT |
Wildfire Games · Phabricator