Antkeeper  0.0.1
Public Member Functions | List of all members
rest_pose Class Reference

Skeleton rest pose. More...

#include <rest-pose.hpp>

Inheritance diagram for rest_pose:
pose

Public Member Functions

 rest_pose (const skeleton &skeleton)
 Constructs a rest pose. More...
 
 rest_pose () noexcept=default
 Constructs an empty rest pose. More...
 
void update (bone_index_type first_index, std::size_t bone_count) override
 Updates a subset of the pose after one or more relative transforms have been changed. More...
 
void resize ()
 Updates the number of bones in the rest pose if the skeleton has been modified. More...
 
const bone_transform_typeget_inverse_absolute_transform (bone_index_type index) const
 Returns the inverse of the absolute transform describing a bone pose. More...
 
void update ()
 Updates the pose after one or more relative transforms have been changed. More...
 
virtual void update (bone_index_type first_index, std::size_t bone_count)
 Updates a subset of the pose after one or more relative transforms have been changed. More...
 
- Public Member Functions inherited from pose
 pose (const skeleton &skeleton)
 Constructs a pose. More...
 
constexpr pose () noexcept=default
 Constructs an empty pose. More...
 
void update ()
 Updates the pose after one or more relative transforms have been changed. More...
 
void set_relative_transform (bone_index_type index, const bone_transform_type &transform)
 Sets the relative transform describing a bone pose. More...
 
void set_relative_translation (bone_index_type index, const bone_transform_type::vector_type &translation)
 Sets the relative translation of a bone pose. More...
 
void set_relative_rotation (bone_index_type index, const bone_transform_type::quaternion_type &rotation)
 Sets the relative rotation of a bone pose. More...
 
void set_relative_scale (bone_index_type index, const bone_transform_type::vector_type &scale)
 Sets the relative scale of a bone pose. More...
 
const skeletonget_skeleton () const noexcept
 Returns the skeleton with which the pose is associated. More...
 
const bone_transform_typeget_relative_transform (bone_index_type index) const
 Returns the relative transform describing a bone pose. More...
 
const bone_transform_typeget_absolute_transform (bone_index_type index) const
 Returns the absolute transform describing a bone pose. More...
 

Additional Inherited Members

- Protected Attributes inherited from pose
const skeletonm_skeleton {nullptr}
 Skeleton with which the pose is associated. More...
 
std::vector< bone_transform_typem_relative_transforms
 Relative ransforms for each bone in a skeleton. More...
 
std::vector< bone_transform_typem_absolute_transforms
 Absolute transforms for each bone in a skeleton. More...
 

Detailed Description

Skeleton rest pose.

Definition at line 28 of file rest-pose.hpp.

Constructor & Destructor Documentation

◆ rest_pose() [1/2]

rest_pose::rest_pose ( const skeleton skeleton)
explicit

Constructs a rest pose.

Parameters
skeletonSkeleton with which to associate the rest pose.

Definition at line 25 of file rest-pose.cpp.

◆ rest_pose() [2/2]

rest_pose::rest_pose ( )
defaultnoexcept

Constructs an empty rest pose.

Member Function Documentation

◆ get_inverse_absolute_transform()

const bone_transform_type& rest_pose::get_inverse_absolute_transform ( bone_index_type  index) const
inline

Returns the inverse of the absolute transform describing a bone pose.

Parameters
indexIndex of a bone.
Returns
Inverse of the absolute transform describing the bone pose.

Definition at line 56 of file rest-pose.hpp.

◆ resize()

void rest_pose::resize ( )

Updates the number of bones in the rest pose if the skeleton has been modified.

Definition at line 50 of file rest-pose.cpp.

◆ update() [1/3]

void pose::update

Updates the pose after one or more relative transforms have been changed.

Definition at line 47 of file pose.cpp.

◆ update() [2/3]

void pose::update

Updates a subset of the pose after one or more relative transforms have been changed.

Parameters
first_indexIndex of the first bone in the chain to update.
bone_countNumber of bones in the chain to update.
Warning
It's the caller's responsibility to ensure that any ancestors of the bone chain are up to date before the call, and any descendants are updated after the call.

Definition at line 57 of file pose.cpp.

◆ update() [3/3]

void rest_pose::update ( bone_index_type  first_index,
std::size_t  bone_count 
)
overridevirtual

Updates a subset of the pose after one or more relative transforms have been changed.

Parameters
first_indexIndex of the first bone in the chain to update.
bone_countNumber of bones in the chain to update.
Warning
It's the caller's responsibility to ensure that any ancestors of the bone chain are up to date before the call, and any descendants are updated after the call.

Reimplemented from pose.

Definition at line 30 of file rest-pose.cpp.


The documentation for this class was generated from the following files: