mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
reassert
This commit is contained in:
parent
b8799e9f84
commit
e0bde0ca59
1 changed files with 7 additions and 6 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include "matrix4.h"
|
#include "matrix4.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "vector3d.h"
|
#include "vector3d.h"
|
||||||
|
#include <cassert>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -61,7 +62,7 @@ void SkinnedMesh::setAnimationSpeed(f32 fps)
|
||||||
using VariantTransform = SkinnedMesh::SJoint::VariantTransform;
|
using VariantTransform = SkinnedMesh::SJoint::VariantTransform;
|
||||||
std::vector<VariantTransform> SkinnedMesh::animateMesh(f32 frame)
|
std::vector<VariantTransform> SkinnedMesh::animateMesh(f32 frame)
|
||||||
{
|
{
|
||||||
_IRR_DEBUG_BREAK_IF(!HasAnimation);
|
assert(HasAnimation);
|
||||||
std::vector<VariantTransform> result;
|
std::vector<VariantTransform> result;
|
||||||
result.reserve(AllJoints.size());
|
result.reserve(AllJoints.size());
|
||||||
for (auto *joint : AllJoints)
|
for (auto *joint : AllJoints)
|
||||||
|
@ -72,7 +73,7 @@ std::vector<VariantTransform> SkinnedMesh::animateMesh(f32 frame)
|
||||||
core::aabbox3df SkinnedMesh::calculateBoundingBox(
|
core::aabbox3df SkinnedMesh::calculateBoundingBox(
|
||||||
const std::vector<core::matrix4> &global_transforms)
|
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;
|
core::aabbox3df result = StaticPartsBox;
|
||||||
// skeletal animation
|
// skeletal animation
|
||||||
for (u16 i = 0; i < AllJoints.size(); ++i) {
|
for (u16 i = 0; i < AllJoints.size(); ++i) {
|
||||||
|
@ -443,7 +444,7 @@ void SkinnedMesh::topoSortJoints()
|
||||||
|
|
||||||
for (u16 i = 0; i < n; ++i) {
|
for (u16 i = 0; i < n; ++i) {
|
||||||
if (auto pjid = AllJoints[i]->ParentJointID)
|
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)
|
void SkinnedMeshBuilder::addPositionKey(SJoint *joint, f32 frame, core::vector3df pos)
|
||||||
{
|
{
|
||||||
_IRR_DEBUG_BREAK_IF(!joint);
|
assert(joint);
|
||||||
joint->keys.position.pushBack(frame, pos);
|
joint->keys.position.pushBack(frame, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkinnedMeshBuilder::addScaleKey(SJoint *joint, f32 frame, core::vector3df scale)
|
void SkinnedMeshBuilder::addScaleKey(SJoint *joint, f32 frame, core::vector3df scale)
|
||||||
{
|
{
|
||||||
_IRR_DEBUG_BREAK_IF(!joint);
|
assert(joint);
|
||||||
joint->keys.scale.pushBack(frame, scale);
|
joint->keys.scale.pushBack(frame, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkinnedMeshBuilder::addRotationKey(SJoint *joint, f32 frame, core::quaternion rot)
|
void SkinnedMeshBuilder::addRotationKey(SJoint *joint, f32 frame, core::quaternion rot)
|
||||||
{
|
{
|
||||||
_IRR_DEBUG_BREAK_IF(!joint);
|
assert(joint);
|
||||||
joint->keys.rotation.pushBack(frame, rot);
|
joint->keys.rotation.pushBack(frame, rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue