Th3NiKo

Rigidbody.h

May 12th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. #ifndef RIGIDBODY_H
  2. #define RIGIDBODY_H
  3. #include <GL/glew.h>
  4. #include <GL/glut.h>
  5. #include <glm/glm.hpp>
  6. #include <glm/ext.hpp>
  7. #include <iostream>
  8.  
  9. class RigidBody
  10. {
  11.  
  12.     public:
  13.         RigidBody (float m, glm::mat3 inertia);
  14.         virtual ~RigidBody();
  15.  
  16.         void Update ( float t, float dt);
  17.  
  18.         void ClearEverything();
  19.  
  20.         void AddForce(glm::vec3 force);
  21.         void AddForce(glm::vec3 force, glm::vec3 position);
  22.         void AddTorque(glm::vec3 _torque);
  23.  
  24.         void Convert ( glm::quat Q, glm::vec3 P, glm::vec3 L, glm::mat3 & R, glm::vec3 & V, glm::vec3 & W) const ;
  25.         // constant quantities
  26.         float m_mass , m_invMass ;
  27.         glm::mat3 m_inertia , m_invInertia ;
  28.         // state variables
  29.         glm::vec3 m_X; // position
  30.         glm::quat m_Q; // orientation
  31.         glm::vec3 m_P; // linear momentum
  32.         glm::vec3 m_L; // angular momentum
  33.         // derived state variables
  34.  
  35.         glm::mat3 m_R; // orientation matrix
  36.         glm::vec3 m_V; // linear velocity vector
  37.         glm::vec3 m_W; // angular velocity
  38.  
  39.         // force and torque functions
  40.         glm::vec3 m_force;
  41.         glm::vec3 m_torque;
  42.  
  43.     private:
  44. };
  45.  
  46. #endif // RIGIDBODY_H
Advertisement
Add Comment
Please, Sign In to add comment