2 #include <msp/game/entity.h>
3 #include <msp/game/transform.h>
7 RigidBody::RigidBody(Game::Handle<Game::Entity> e, const Setup &s):
12 void RigidBody::set_velocity(const LinAl::Vector<float, 2> &v)
17 void RigidBody::set_angular_velocity(Geometry::Angle<float> as)
19 angular_velocity = as;
22 void RigidBody::add_force(const LinAl::Vector<float, 2> &f)
27 void RigidBody::add_force(const LinAl::Vector<float, 2> &f, const LinAl::Vector<float, 2> &p)
30 LinAl::Vector<float, 2> r = p-entity->get_transform()->get_position().slice<2>(0);
31 torque += r.x*f.y-r.y*f.x;
34 void RigidBody::add_torque(float t)
39 void RigidBody::clear_forces()
41 force = LinAl::Vector<float, 2>();