Skip to content

Accept separate translation/rot/scale for an animation #42

@bmatthieu3

Description

@bmatthieu3

Hello,

I would like to know if it can be possible to obtain for each animation the translation & scaling vectors + the quaternion instead of the final matrix4x4. Maybe we could create an enum

enum Transform {
    // Either the final transform
    Matrix(Matrix4<f32>),
    // Or its decomposed form
    LocRotScale {
        t: Vector3<f32>,
        r: Quaternion<f32>,
        s: Vector3<f32>,
    }
}

#[derive(Debug)]
pub struct Animation {
    ///
    /// The node (joint) this animation is targeting
    ///
    pub target: String,

    ///
    /// Times for each sample (in seconds)
    ///
    pub sample_times: Vec<f32>,

    ///
    /// Node pose transforms for each sample.
    /// Column-major.
    ///
    pub sample_poses: Vec<Transform>,
}

I propose this because I think it is more easy to interpolate between keyframes if we have 2 LocRotScale than 2 Matrix4. I suppose there may be some problems when directly interpolating the coeffs of a Matrix4 or maybe I am wrong ?

best,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions