mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
minor cleanup
This commit is contained in:
parent
66e779b87f
commit
07963f1af5
3 changed files with 7 additions and 6 deletions
|
@ -349,8 +349,11 @@ public:
|
||||||
// The .x and .gltf formats pre-calculate this
|
// The .x and .gltf formats pre-calculate this
|
||||||
std::optional<core::matrix4> GlobalInversedMatrix;
|
std::optional<core::matrix4> GlobalInversedMatrix;
|
||||||
|
|
||||||
// TODO friends?
|
void setParent(SJoint *parent) {
|
||||||
u16 JointID; // TODO refactor away: pointers -> IDs
|
ParentJointID = parent ? parent->JointID : std::optional<u16>{};
|
||||||
|
}
|
||||||
|
|
||||||
|
u16 JointID; // TODO refactor away: pointers -> IDs (problem: .x loader abuses SJoint)
|
||||||
std::optional<u16> ParentJointID;
|
std::optional<u16> ParentJointID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -514,8 +514,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(SkinnedMesh::SJoint *Parent)
|
||||||
if (n.has_value()) {
|
if (n.has_value()) {
|
||||||
JointID = *n;
|
JointID = *n;
|
||||||
joint = AnimatedMesh->getAllJoints()[JointID];
|
joint = AnimatedMesh->getAllJoints()[JointID];
|
||||||
if (Parent)
|
joint->setParent(Parent);
|
||||||
joint->ParentJointID = Parent->JointID;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -509,8 +509,7 @@ void SkinnedMeshBuilder::addMeshBuffer(SSkinMeshBuffer *meshbuf)
|
||||||
SkinnedMesh::SJoint *SkinnedMeshBuilder::addJoint(SJoint *parent)
|
SkinnedMesh::SJoint *SkinnedMeshBuilder::addJoint(SJoint *parent)
|
||||||
{
|
{
|
||||||
SJoint *joint = new SJoint;
|
SJoint *joint = new SJoint;
|
||||||
if (parent)
|
joint->setParent(parent);
|
||||||
joint->ParentJointID = parent->JointID;
|
|
||||||
|
|
||||||
joint->JointID = AllJoints.size();
|
joint->JointID = AllJoints.size();
|
||||||
AllJoints.push_back(joint);
|
AllJoints.push_back(joint);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue