Struct blender_armature::BlenderArmature[][src]

pub struct BlenderArmature {
    pub joint_index: HashMap<String, u8>,
    pub inverse_bind_poses: Vec<Bone>,
    pub actions: HashMap<String, Vec<Keyframe>>,
}

All of the data about a Blender armature that we've exported from Blender. A BlenderArmature should have all of the data that you need to implement skeletal animation.

If you have other needs, such as a way to know the model space position of any bone at any time so that you can, say, render a baseball in on top of your hand bone.. Open an issue. (I plan to support this specific example in the future)

Fields

Methods

impl BlenderArmature
[src]

Interpolate in between the keyframes of your BlenderArmature. This is useful for skeletal animation.

We return a hashmap so that you can easily merge the results of interpolating different sets of bone groups.

Panics

We don't yet support interpolating matrix bones, so we panic if your bones aren't dual quaternions.

Panics if you pass in previous actions that do not have the exact same joint indices as your current action.

impl BlenderArmature
[src]

Given a string of JSON we deserialize a BlenderArmature. This is here as a convenience since we already depend on serde anyway. In a real application you might want to serialize and deserialize to a smaller file format.. such as bincode.

Convert a matrix into a dual quaternion https://github.com/chinedufn/mat4-to-dual-quat/blob/master/src/mat4-to-dual-quat.js Note that we use w, x, y, z and not x, y, z, w for our quaternion representation

https://github.com/chinedufn/dual-quat-to-mat4/blob/master/src/dual-quat-to-mat4.js

impl BlenderArmature
[src]

Iterate over all of the action bones and apply and multiply in the inverse bind pose.

TODO: another function to apply bind shape matrix? Most armatures seem to export an identity bind shape matrix but that might not be the same for every armature.

Tranpose all of the bone matrices in our armature's action keyframes. Blender uses row major matrices, but OpenGL uses column major matrices so you'll usually want to transpose your matrices before using them.

impl BlenderArmature
[src]

Convert your action matrices into dual quaternions so that you can implement dual quaternion linear blending.

Trait Implementations

impl Debug for BlenderArmature
[src]

Formats the value using the given formatter. Read more

impl PartialEq for BlenderArmature
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations