From 9b40225df04ef6c2b64bfc5ce225bc223b3e839f Mon Sep 17 00:00:00 2001 From: Guillaume Blanc Date: Tue, 28 May 2024 22:42:01 +0200 Subject: [PATCH] Improves documentation --- samples/motion_blend/sample_motion_blend.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/motion_blend/sample_motion_blend.cc b/samples/motion_blend/sample_motion_blend.cc index e6a8edf6..b7e666bb 100644 --- a/samples/motion_blend/sample_motion_blend.cc +++ b/samples/motion_blend/sample_motion_blend.cc @@ -131,23 +131,28 @@ class MotionBlendSampleApplication : public ozz::sample::Application { // Blends motion. //------------------------------------------------------------------------- { + // Fills job layers with delta transforms and weights. ozz::animation::MotionBlendingJob::Layer layers[kNumLayers]; for (size_t i = 0; i < kNumLayers; ++i) { const auto& sampler = samplers_[i]; - layers[i].delta = &sampler.motion_sampler.delta; - layers[i].weight = sampler.weight; + layers[i].delta = + &sampler.motion_sampler.delta; // Uses delta transform from motion + // sampler accumulator. + layers[i].weight = sampler.weight; // Reuses animation weight. } + // Setup blending job. ozz::math::Transform delta; ozz::animation::MotionBlendingJob motion_blend_job; motion_blend_job.layers = layers; motion_blend_job.output = δ - // Blends. + // Executes blending job. if (!motion_blend_job.Run()) { return false; } + // Applies blended delta to the character accumulator. const auto rotation = FrameRotation(_dt); accumulator_.Update(delta, rotation); }