#pragma once

#include "metrics/HistoryBuffer.hpp"
#include <glm/glm.hpp>

#include <Jolt/Jolt.h>
#include <Jolt/Physics/Character/CharacterVirtual.h>

namespace tw {

class CharacterBody {
public:
    JPH::CharacterVirtual* m_character;

    JPH::Vec3 m_desired_velocity;

    // JPH::Vec3's default constructor leaves the value uninitialised, and the
    // desired velocity is accumulated across steps, so it has to start at zero
    // or the first step feeds garbage into the character's velocity.
    CharacterBody(JPH::CharacterVirtual* character) :
        m_character(character),
        m_desired_velocity(JPH::Vec3::sZero())
    { }
};

}
