Add capybara
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
@@ -493,7 +494,20 @@ static double GetMaxAnimationKeyTick(const aiAnimation* aiAnim) {
|
||||
static std::vector<SkeletalAnimation> LoadAnimations(const aiScene* scene,
|
||||
const Skeleton& skeleton) {
|
||||
std::vector<SkeletalAnimation> result;
|
||||
if (!scene->HasAnimations() || skeleton.joints.empty()) return result;
|
||||
|
||||
if (!scene->HasAnimations()) {
|
||||
std::cout << "[ModelLoader] No animations found in scene.\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (skeleton.joints.empty()) {
|
||||
std::cout << "[ModelLoader] Scene has " << scene->mNumAnimations
|
||||
<< " animation(s), but no skeleton joints were loaded.\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
std::cout << "[ModelLoader] Found " << scene->mNumAnimations
|
||||
<< " animation(s). Loading...\n";
|
||||
|
||||
const auto jointIndexByName = BuildJointIndexMap(skeleton);
|
||||
|
||||
@@ -584,9 +598,19 @@ static std::vector<SkeletalAnimation> LoadAnimations(const aiScene* scene,
|
||||
anim.tracks.push_back(std::move(track));
|
||||
}
|
||||
|
||||
std::cout << "[ModelLoader] Loaded animation [" << a << "]: "
|
||||
<< anim.name << ""
|
||||
<< " | duration: " << anim.duration << "s"
|
||||
<< " | tracks: " << anim.tracks.size()
|
||||
<< " | source channels: " << aiAnim->mNumChannels
|
||||
<< "\n";
|
||||
|
||||
result.push_back(std::move(anim));
|
||||
}
|
||||
|
||||
std::cout << "[ModelLoader] Finished loading " << result.size()
|
||||
<< " skeletal animation(s).\n";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -702,6 +726,9 @@ static SkinnedModel LoadSkinnedModel(const std::string& path) {
|
||||
|
||||
SkinnedModel model;
|
||||
model.skeleton = LoadSkeleton(scene);
|
||||
std::cout << "[ModelLoader] Loaded skeleton with " << model.skeleton.joints.size()
|
||||
<< " joint(s).\n";
|
||||
|
||||
model.animations = LoadAnimations(scene, model.skeleton);
|
||||
|
||||
struct StackItem { const aiNode* node; glm::mat4 parentWorld; };
|
||||
|
||||
Reference in New Issue
Block a user