#ifndef SDL3CPP_SCRIPT_PHYSICS_BRIDGE_HPP #define SDL3CPP_SCRIPT_PHYSICS_BRIDGE_HPP #include #include #include class btVector3; class btTransform; class btCollisionShape; class btMotionState; class btRigidBody; class btDefaultCollisionConfiguration; class btCollisionDispatcher; class btBroadphaseInterface; class btSequentialImpulseConstraintSolver; class btDiscreteDynamicsWorld; namespace sdl3cpp::script { class PhysicsBridge { public: PhysicsBridge(); ~PhysicsBridge(); PhysicsBridge(const PhysicsBridge&) = delete; PhysicsBridge& operator=(const PhysicsBridge&) = delete; bool addBoxRigidBody(const std::string& name, const btVector3& halfExtents, float mass, const btTransform& transform, std::string& error); int stepSimulation(float deltaTime); bool getRigidBodyTransform(const std::string& name, btTransform& outTransform, std::string& error) const; private: struct BodyRecord { std::unique_ptr shape; std::unique_ptr motionState; std::unique_ptr body; }; std::unique_ptr collisionConfig_; std::unique_ptr dispatcher_; std::unique_ptr broadphase_; std::unique_ptr solver_; std::unique_ptr world_; std::unordered_map bodies_; }; } // namespace sdl3cpp::script #endif // SDL3CPP_SCRIPT_PHYSICS_BRIDGE_HPP