View playback sample source code.
Loads a skeleton and an animation from ozz binary archives. This animation is then played-back and applied to the skeleton. Animation time and playback speed can be tweaked.
Initializing WebGL
This sample loads ozz binary archive file, a skeleton and an animation. Ozz binary files can be produced with ozz command line tool fbx2ozz, or with ozz serializer (ozz::io::OArchive) from your own application/converter.
At every frame the animation is sampled with ozz::animation::SamplingJob
. Sampling local-space output is then converted to model-space matrices for rendering using ozz::animation::LocalToModelJob
.
Some parameters can be tuned from sample UI:
ozz::io::OArchive
object with a valid ozz::io::Stream
as argument. The stream can be a ozz::io::File
, or your custom io read capable object that inherits from ozz::io::Stream
.ozz::io::OArchive::TestTag()
function. Object type is specified as a template argument.>> operator
.ozz::math::SoaTransform
, model-space matrices of type ozz::math::Float4x4
) with the number of elements required for your skeleton. Note that local-space transform are Soa objects, meaning that 1 ozz::math::SoaTransform
can store multiple (4) joints.ozz::animation::SamplingJob::Context
) with the number of joints required for your animation. This cache is used to store sampling local data as well as optimizing key-frame lookup while reading animation forward.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.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.