Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct AABB
- {
- glm::vec2 min;
- glm::vec2 max;
- AABB::AABB(float minX, float minY, float maxX, float maxY)
- {
- min = glm::vec2(minX, minY);
- max = glm::vec2(maxX, maxY);
- }
- int AABB::getHeight()
- {
- return max.y - min.y;
- }
- int AABB::getWidth()
- {
- return max.x - min.x;
- }
- };
- //__________________________________
- PhysObj::PhysObj(float pos_x, float pos_y, float m, int width, int height, float step)
- {
- position = glm::vec2(pos_x, pos_y);
- mass.mass = m;
- if (m == 0)
- mass.inv_mass = 0;
- else
- mass.inv_mass = 1 / mass.mass;
- square_coll = AABB(pos_x, pos_y, pos_x + width, pos_y + height);
- time_step = step;
- original_time = step;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement