Updated ozz-animation to version 0.14.1 @35b2efd4

This commit is contained in:
Martin Felis
2023-03-26 13:28:12 +02:00
parent bf3189ff49
commit 15871f349c
194 changed files with 3495 additions and 1957 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ add_executable(sample_attach
target_link_libraries(sample_attach
sample_framework)
target_copy_shared_libraries(sample_attach)
set_target_properties(sample_attach
PROPERTIES FOLDER "samples")
+19 -24
View File
@@ -25,24 +25,21 @@
// //
//----------------------------------------------------------------------------//
#include "ozz/animation/runtime/animation.h"
#include "ozz/animation/runtime/local_to_model_job.h"
#include "ozz/animation/runtime/sampling_job.h"
#include "ozz/animation/runtime/skeleton.h"
#include "ozz/base/log.h"
#include "ozz/base/maths/box.h"
#include "ozz/base/maths/simd_math.h"
#include "ozz/base/maths/soa_transform.h"
#include "ozz/base/maths/vec_float.h"
#include "ozz/options/options.h"
#include "framework/application.h"
#include "framework/imgui.h"
#include "framework/renderer.h"
#include "framework/utils.h"
#include "ozz/animation/runtime/animation.h"
#include "ozz/animation/runtime/local_to_model_job.h"
#include "ozz/animation/runtime/sampling_job.h"
#include "ozz/animation/runtime/skeleton.h"
#include "ozz/animation/runtime/skeleton_utils.h"
#include "ozz/base/log.h"
#include "ozz/base/maths/box.h"
#include "ozz/base/maths/simd_math.h"
#include "ozz/base/maths/soa_transform.h"
#include "ozz/base/maths/vec_float.h"
#include "ozz/options/options.h"
// Skeleton archive can be specified as an option.
OZZ_OPTIONS_DECLARE_STRING(skeleton,
@@ -67,7 +64,7 @@ class AttachSampleApplication : public ozz::sample::Application {
// Samples optimized animation at t = animation_time_.
ozz::animation::SamplingJob sampling_job;
sampling_job.animation = &animation_;
sampling_job.cache = &cache_;
sampling_job.context = &context_;
sampling_job.ratio = controller_.time_ratio();
sampling_job.output = make_span(locals_);
if (!sampling_job.Run()) {
@@ -133,15 +130,13 @@ class AttachSampleApplication : public ozz::sample::Application {
locals_.resize(num_soa_joints);
models_.resize(num_joints);
// Allocates a cache that matches animation requirements.
cache_.Resize(num_joints);
// Allocates a context that matches animation requirements.
context_.Resize(num_joints);
// Finds the joint where the object should be attached.
for (int i = 0; i < num_joints; i++) {
if (std::strstr(skeleton_.joint_names()[i], "LeftHandMiddle")) {
attachment_ = i;
break;
}
attachment_ = FindJoint(skeleton_, "LeftHandMiddle1");
if (attachment_ < 0) {
return false;
}
return true;
@@ -198,8 +193,8 @@ class AttachSampleApplication : public ozz::sample::Application {
// Runtime animation.
ozz::animation::Animation animation_;
// Sampling cache.
ozz::animation::SamplingCache cache_;
// Sampling context.
ozz::animation::SamplingJob::Context context_;
// Buffer of local transforms as sampled from animation_.
ozz::vector<ozz::math::SoaTransform> locals_;