Commit 8a984baf authored by Lázár Bence Kis's avatar Lázár Bence Kis
Browse files

Bone matrices cleaned up

parent 42e3360a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -468,13 +468,11 @@ void Renderer::quad_pass(const std::vector<const com::Folder *> &lights, ShaderG
void calculate_bone_matrices(std::vector<mat4x4> &bones, com::Folder *instance_folder, com::Folder *skeleton_folder, com::Frame *root_frame) {
    if (auto bone_frame = instance_folder->locate<com::Frame>({"frame"})) {
        if (auto joint_index = skeleton_folder->locate<com::FileUInt>({"joint_index"})) {
            auto bone = bone_frame->out();
            auto mat = bone_frame->out();
            auto index = joint_index->get();
            if (index >= bones.size()) {
                bones.resize(index + 1);
            }
            bones[index] = mat;
            bones[index] = bone_frame->out();
        }
    }

@@ -547,6 +545,7 @@ void Renderer::present_object(com::Folder *const object, CommonVisitData const &
    }

    std::vector<mat4x4> bone_uniforms{};
    bone_uniforms.reserve(100);
    for (com::Link *const frame_link : object_system()->get_frames(object)->links()) {
        frame = frame_link->target<com::Frame>();
        INVARIANT(frame != nullptr);