Updated ozz-animation to version 0.14.1 @35b2efd4
This commit is contained in:
+1
-1
@@ -7,10 +7,10 @@ add_custom_command(
|
||||
add_executable(sample_millipede
|
||||
sample_millipede.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/README.md)
|
||||
|
||||
target_link_libraries(sample_millipede
|
||||
ozz_animation_offline
|
||||
sample_framework)
|
||||
target_copy_shared_libraries(sample_millipede)
|
||||
|
||||
set_target_properties(sample_millipede
|
||||
PROPERTIES FOLDER "samples")
|
||||
|
||||
+1
-1
@@ -24,5 +24,5 @@ Some other playback parameters can be tuned:
|
||||
2. Convert the RawSkeleton (aka offline) object to a runtime ozz::animation::offline::Skeleton, using ozz::animation::offline::SkeletonBuilder. This offline utility does the conversion to the runtime format, which can then be serialized or used by the runtime API.
|
||||
2. Create the animation object:
|
||||
1. Instantiates a ozz::animation::offline::RawAnimation object and fills it with keyframes for every joint of the skeleton, simulating walk cycles. The RawAnimation is an offline suitable format, meaning it is easily programmatically modified: Add/remove keys, add/remove tracks, change duration...
|
||||
2. Convert the offline animation to a runtime format, using ozz::animation::offline::AnimationBuilder. This utility takes as input a RawAnimation and outputs a runtime ozz::animation::Animation. The runtime format is the one used for sampling. In opposition with the offline one, it cannot be edited/modified. It is optimized for runtime usage in term of memory layout (cache coherence for sampling) and footprint (compression scheme).
|
||||
2. Convert the offline animation to a runtime format, using ozz::animation::offline::AnimationBuilder. This utility takes as input a RawAnimation and outputs a runtime ozz::animation::Animation. The runtime format is the one used for sampling. In opposition with the offline one, it cannot be edited/modified. It is optimized for runtime usage in term of memory layout (context coherence for sampling) and footprint (compression scheme).
|
||||
3. The remaining code of the sample is to allocate runtime buffers and samples animation every frame. See playback sample for more details.
|
||||
|
||||
+17
-20
@@ -30,25 +30,22 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#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/offline/animation_builder.h"
|
||||
#include "ozz/animation/offline/raw_animation.h"
|
||||
#include "ozz/animation/offline/raw_skeleton.h"
|
||||
#include "ozz/animation/offline/skeleton_builder.h"
|
||||
|
||||
#include "ozz/base/maths/quaternion.h"
|
||||
#include "ozz/base/maths/simd_math.h"
|
||||
#include "ozz/base/maths/soa_transform.h"
|
||||
#include "ozz/base/maths/vec_float.h"
|
||||
|
||||
#include "framework/application.h"
|
||||
#include "framework/imgui.h"
|
||||
#include "framework/renderer.h"
|
||||
#include "framework/utils.h"
|
||||
#include "ozz/animation/offline/animation_builder.h"
|
||||
#include "ozz/animation/offline/raw_animation.h"
|
||||
#include "ozz/animation/offline/raw_skeleton.h"
|
||||
#include "ozz/animation/offline/skeleton_builder.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/base/maths/quaternion.h"
|
||||
#include "ozz/base/maths/simd_math.h"
|
||||
#include "ozz/base/maths/soa_transform.h"
|
||||
#include "ozz/base/maths/vec_float.h"
|
||||
|
||||
using ozz::animation::offline::RawAnimation;
|
||||
using ozz::animation::offline::RawSkeleton;
|
||||
@@ -126,7 +123,7 @@ class MillipedeSampleApplication : public ozz::sample::Application {
|
||||
// Samples animation at t = animation_time_.
|
||||
ozz::animation::SamplingJob sampling_job;
|
||||
sampling_job.animation = animation_.get();
|
||||
sampling_job.cache = &cache_;
|
||||
sampling_job.context = &context_;
|
||||
sampling_job.ratio = controller_.time_ratio();
|
||||
sampling_job.output = make_span(locals_);
|
||||
if (!sampling_job.Run()) {
|
||||
@@ -208,8 +205,8 @@ class MillipedeSampleApplication : public ozz::sample::Application {
|
||||
locals_.resize(num_soa_joints);
|
||||
models_.resize(num_joints);
|
||||
|
||||
// Allocates a cache that matches new animation requirements.
|
||||
cache_.Resize(num_joints);
|
||||
// Allocates a context that matches new animation requirements.
|
||||
context_.Resize(num_joints);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -423,8 +420,8 @@ class MillipedeSampleApplication : public ozz::sample::Application {
|
||||
// The millipede procedural walk animation.
|
||||
ozz::unique_ptr<ozz::animation::Animation> animation_;
|
||||
|
||||
// Sampling cache, as used by SamplingJob.
|
||||
ozz::animation::SamplingCache cache_;
|
||||
// Sampling context, as used by SamplingJob.
|
||||
ozz::animation::SamplingJob::Context context_;
|
||||
|
||||
// Buffer of local transforms as sampled from animation_.
|
||||
// These are shared between sampling output and local-to-model input.
|
||||
|
||||
Reference in New Issue
Block a user