#pragma once #include "../../gfx/model.h" #include "simpleengine/vector.h" #include #include #include #include #include #include #include namespace simpleengine::physics { class PhysicsSystem; } namespace simpleengine::ecs { /** * @brief A component that contains a Model that will be rendered. * */ class RigidBodyComponent { friend simpleengine::physics::PhysicsSystem; private: float mass; bool is_dynamic; // TODO: Free btDefaultMotionState* motion_state; btCollisionShape* col_shape; public: bool initialized = false; btRigidBody* rigid_body; RigidBodyComponent(float mass, simpleengine::Vectorf start_origin, btCollisionShape* col_shape) : mass(mass), is_dynamic(mass != 0.f), col_shape(col_shape) { } }; }