1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
This commit is contained in:
Lars Mueller 2025-04-03 02:13:03 +02:00
parent b8799e9f84
commit e0bde0ca59

View file

@ -13,6 +13,7 @@
#include "matrix4.h"
#include "os.h"
#include "vector3d.h"
#include <cassert>
#include <cstddef>
#include <variant>
#include <vector>
@ -61,7 +62,7 @@ void SkinnedMesh::setAnimationSpeed(f32 fps)
using VariantTransform = SkinnedMesh::SJoint::VariantTransform;
std::vector<VariantTransform> SkinnedMesh::animateMesh(f32 frame)
{
_IRR_DEBUG_BREAK_IF(!HasAnimation);
assert(HasAnimation);
std::vector<VariantTransform> result;
result.reserve(AllJoints.size());
for (auto *joint : AllJoints)
@ -72,7 +73,7 @@ std::vector<VariantTransform> SkinnedMesh::animateMesh(f32 frame)
core::aabbox3df SkinnedMesh::calculateBoundingBox(
const std::vector<core::matrix4> &global_transforms)
{
_IRR_DEBUG_BREAK_IF(global_transforms.size() != AllJoints.size());
assert(global_transforms.size() == AllJoints.size());
core::aabbox3df result = StaticPartsBox;
// skeletal animation
for (u16 i = 0; i < AllJoints.size(); ++i) {
@ -443,7 +444,7 @@ void SkinnedMesh::topoSortJoints()
for (u16 i = 0; i < n; ++i) {
if (auto pjid = AllJoints[i]->ParentJointID)
_IRR_DEBUG_BREAK_IF(*pjid >= i);
assert(*pjid < i);
}
}
@ -517,19 +518,19 @@ SkinnedMesh::SJoint *SkinnedMeshBuilder::addJoint(SJoint *parent)
void SkinnedMeshBuilder::addPositionKey(SJoint *joint, f32 frame, core::vector3df pos)
{
_IRR_DEBUG_BREAK_IF(!joint);
assert(joint);
joint->keys.position.pushBack(frame, pos);
}
void SkinnedMeshBuilder::addScaleKey(SJoint *joint, f32 frame, core::vector3df scale)
{
_IRR_DEBUG_BREAK_IF(!joint);
assert(joint);
joint->keys.scale.pushBack(frame, scale);
}
void SkinnedMeshBuilder::addRotationKey(SJoint *joint, f32 frame, core::quaternion rot)
{
_IRR_DEBUG_BREAK_IF(!joint);
assert(joint);
joint->keys.rotation.pushBack(frame, rot);
}