]> git.tdb.fi Git - libs/game.git/blobdiff - examples/bassteroids/source/physics.h
Allow external forces and torques to be added on rigid bodies
[libs/game.git] / examples / bassteroids / source / physics.h
index a611789ebd1cfa9b16d2c15f1d841ec7b181de27..078d2e60aa31ac0c07f5b44ec11c7969a772a03e 100644 (file)
@@ -17,10 +17,14 @@ private:
        {
                Msp::Game::Handle<PhysicalEntity> entity;
                float inverse_mass = 1.0f;
+               float moment_of_inertia = 1.0f;
                Msp::LinAl::Vector<float, 2> external_force;
+               float external_torque = 0.0f;
 
                Msp::LinAl::Vector<float, 2> position;
+               Msp::Geometry::Angle<float> rotation;
                Msp::LinAl::Vector<float, 2> velocity;
+               Msp::Geometry::Angle<float> angular_velocity;
 
                unsigned collision_count;
                Msp::LinAl::Vector<float, 2> position_adjust;
@@ -63,6 +67,7 @@ private:
 
        Collision &get_collision(unsigned, unsigned);
        void collide_circle_circle(unsigned, unsigned);
+       void collide_circle_box(unsigned, unsigned);
 };
 
 #endif