Toast Engine
Loading...
Searching...
No Matches
assets::Animation Class Reference

A set of clips plus the skins they pose. More...

#include <animation.hpp>

Inheritance diagram for assets::Animation:
Collaboration diagram for assets::Animation:

Public Member Functions

 Animation (std::span< const uint8_t > data)
 Parses the binary .tanim representation.
auto type () const -> std::string_view override
auto clips () const noexcept -> const std::vector< AnimationClip > &
auto skins () const noexcept -> const std::vector< Skin > &
auto findClip (std::string_view name) const -> const AnimationClip *
Public Member Functions inherited from assets::Asset
 Asset (const Asset &)=delete
auto operator= (const Asset &) -> Asset &=delete
auto refCount () const noexcept -> uint32_t

Static Public Member Functions

static auto toBinary (const std::vector< AnimationClip > &clips, const std::vector< Skin > &skins) -> std::vector< uint8_t >
 Serialises clips + skins into the binary .tanim layout the constructor reads back.

Additional Inherited Members

Protected Member Functions inherited from assets::Asset
void addRef () noexcept
void release () noexcept

Detailed Description

A set of clips plus the skins they pose.

The format holds many clips, but the importer writes one per file so each is its own asset in the browser. Every file carries the skins too, so any one can pose the skeleton alone - and a glTF with skins but no animations still produces a clip-less file for MeshNode::skin_animation to point at

Member Function Documentation

◆ findClip()

auto assets::Animation::findClip ( std::string_view name) const -> const AnimationClip *
nodiscard
Returns
the clip with this name, or nullptr

◆ type()

auto assets::Animation::type ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Implements assets::Asset.


The documentation for this class was generated from the following files:
  • engine/src/toast/assets/animation.hpp
  • engine/src/toast/assets/animation.cpp