#include <SkeletalAnimatable.hpp>
Represents a skeleton used for skeletal rigging. A collection of connected bones which allow for transforming vertices in unique ways
Definition at line 35 of file SkeletalAnimatable.hpp.
◆ Skeleton() [1/3]
◆ Skeleton() [2/3]
Skeleton::Skeleton |
( |
const std::vector< std::tuple< int, float, float > > & | bones, |
|
|
AngleUnit | unit ) |
Creates a skeleton given a vector of tuples containing the index of the previous bone, the bone length, and the bone rotation
- Parameters
-
bones | The vector of bones |
unit | The unit of the rotation given |
Definition at line 33 of file SkeletalAnimatable.cpp.
◆ Skeleton() [3/3]
Skeleton::Skeleton |
( |
const std::vector< Bone > & | bones | ) |
|
◆ calculateBone()
static Bone Kale::Skeleton::calculateBone |
( |
const std::vector< Bone > & | bones, |
|
|
int | previousBone, |
|
|
float | length, |
|
|
float | rotation, |
|
|
AngleUnit | unit ) |
|
inlinestatic |
Calculates a single bone
- Parameters
-
bones | A vector of the existing bones, this must containt he parent of this bone if previousBone is not -1 |
previousBone | The previous bone index, -1 if this is the base |
length | The length of the bone |
rotation | The rotation of the bone |
unit | The unit the bone's rotation is given in |
- Returns
- The calculated bone
Definition at line 105 of file SkeletalAnimatable.hpp.
◆ transform()
static Vector2f Kale::Skeleton::transform |
( |
const std::vector< Transform > & | offsets, |
|
|
Vector2f | vert, |
|
|
const std::array< std::pair< int, float >, 4 > & | weights ) |
|
inlinestatic |
Transforms a single vertex given its weights
- Parameters
-
offsets | The offset matrices of the skeleton to transform with |
vert | The vertex to transform |
weights | The weights of the vertex, 4 pairs of the index of the bone along with the significance. Must add up to 1, set the index of the bone to -1 if it is unassigned. |
- Returns
- The transformed vertex
Definition at line 127 of file SkeletalAnimatable.hpp.
◆ bones
std::vector<Bone> Kale::Skeleton::bones |
The documentation for this struct was generated from the following files: