const Setup &setup;
Msp::LinAl::Vector<float, 2> velocity;
Msp::Geometry::Angle<float> angular_velocity;
+ Msp::LinAl::Vector<float, 2> force;
+ float torque = 0.0f;
public:
RigidBody(Msp::Game::Handle<Msp::Game::Entity>, const Setup &);
float get_moment_of_inertia() const { return setup.moment_of_inertia; }
void set_velocity(const Msp::LinAl::Vector<float, 2> &);
void set_angular_velocity(Msp::Geometry::Angle<float>);
+ void add_force(const Msp::LinAl::Vector<float, 2> &);
+ void add_force(const Msp::LinAl::Vector<float, 2> &, const Msp::LinAl::Vector<float, 2> &);
+ void add_torque(float);
+ void clear_forces();
const Msp::LinAl::Vector<float, 2> &get_velocity() const { return velocity; }
Msp::Geometry::Angle<float> get_angular_velocity() const { return angular_velocity; }
+ const Msp::LinAl::Vector<float, 2> &get_force() const { return force; }
+ float get_torque() const { return torque; }
};
#endif