Updated ozz-animation to version 0.14.1 @35b2efd4
This commit is contained in:
@@ -20,6 +20,7 @@ add_executable(sample_playback
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/media/animation.ozz")
|
||||
target_link_libraries(sample_playback
|
||||
sample_framework)
|
||||
target_copy_shared_libraries(sample_playback)
|
||||
|
||||
set_target_properties(sample_playback
|
||||
PROPERTIES FOLDER "samples")
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ Some parameters can be tuned from sample UI:
|
||||
2. Check that the stream stores the expected object using ozz::io::OArchive::TestTag() function. Object type is specified as a template argument.
|
||||
3. De-serialize the object with >> operator.
|
||||
2. Allocates runtime buffers (local-space transforms of type ozz::math::SoaTransform, model-space matrices of type ozz::math::Float4x4) with the number of elements required for the skeleton. Note that local-space transform are Soa objects, meaning that 1 ozz::math::SoaTransform can store multiple (4) joints.
|
||||
3. Allocates sampling cache (ozz::animation::SamplingCache) with the number of joints required for the animation. This cache is used to store sampling local data as well as optimizing key-frame lookup while reading animation forward.
|
||||
4. Sample animation to get local-space transformations using ozz::animation::SamplingJob. This job takes as input the animation, the cache and a time at which the animation should be sampled. Output is the local-space transformation array.
|
||||
3. Allocates sampling context (ozz::animation::SamplingJob::Context) with the number of joints required for the animation. This context is used to store sampling local data as well as optimizing key-frame lookup while reading animation forward.
|
||||
4. Sample animation to get local-space transformations using ozz::animation::SamplingJob. This job takes as input the animation, the context and a time at which the animation should be sampled. Output is the local-space transformation array.
|
||||
5. Convert local-space transformations to model-space matrices using ozz::animation::LocalToModelJob. It takes as input the skeleton (to know about joint's hierarchy) and local-space transforms. Output is model-space matrices array.
|
||||
6. Model-space matrices array can then be used for rendering (to skin a mesh) or updating the scene graph.
|
||||
@@ -62,7 +62,7 @@ class PlaybackSampleApplication : 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()) {
|
||||
@@ -109,8 +109,8 @@ class PlaybackSampleApplication : public ozz::sample::Application {
|
||||
const int num_joints = skeleton_.num_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);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -144,8 +144,8 @@ class PlaybackSampleApplication : 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_;
|
||||
|
||||
Reference in New Issue
Block a user