mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Refactor: Merge [IC]SkinnedMesh
into SkinnedMesh
(#15511)
This commit is contained in:
parent
810f39767c
commit
3e10d9ccf5
18 changed files with 326 additions and 646 deletions
|
@ -12,7 +12,7 @@
|
|||
#include "IFileSystem.h"
|
||||
#include "IReadFile.h"
|
||||
#include "ISceneManager.h"
|
||||
#include "ISkinnedMesh.h"
|
||||
#include "SkinnedMesh.h"
|
||||
#include "irrlicht.h"
|
||||
|
||||
#include "catch.h"
|
||||
|
@ -379,14 +379,14 @@ SECTION("simple sparse accessor")
|
|||
// https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/SimpleSkin
|
||||
SECTION("simple skin")
|
||||
{
|
||||
using ISkinnedMesh = irr::scene::ISkinnedMesh;
|
||||
using SkinnedMesh = irr::scene::SkinnedMesh;
|
||||
const auto mesh = loadMesh(model_stem + "simple_skin.gltf");
|
||||
REQUIRE(mesh != nullptr);
|
||||
auto csm = dynamic_cast<const ISkinnedMesh*>(mesh);
|
||||
auto csm = dynamic_cast<const SkinnedMesh*>(mesh);
|
||||
const auto joints = csm->getAllJoints();
|
||||
REQUIRE(joints.size() == 3);
|
||||
|
||||
const auto findJoint = [&](const std::function<bool(ISkinnedMesh::SJoint*)> &predicate) {
|
||||
const auto findJoint = [&](const std::function<bool(SkinnedMesh::SJoint*)> &predicate) {
|
||||
for (std::size_t i = 0; i < joints.size(); ++i) {
|
||||
if (predicate(joints[i])) {
|
||||
return joints[i];
|
||||
|
@ -420,7 +420,7 @@ SECTION("simple skin")
|
|||
|
||||
SECTION("weights are correct")
|
||||
{
|
||||
const auto weights = [&](const ISkinnedMesh::SJoint *joint) {
|
||||
const auto weights = [&](const SkinnedMesh::SJoint *joint) {
|
||||
std::unordered_map<irr::u32, irr::f32> weights;
|
||||
for (std::size_t i = 0; i < joint->Weights.size(); ++i) {
|
||||
const auto weight = joint->Weights[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue