AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
rigidbody.h
1#pragma once
2#include <glm/glm.hpp>
3//#include "../res-management/terrain.h"
4
5namespace Aire {
8 class Rigidbody {
9 public:
15 Rigidbody(int rbIndex, glm::vec3 pos = glm::vec3(0,0,0), glm::mat3 rot = glm::mat3(1.0));
16
19 void update(float aTerrainHeight);
20
21 // Unique ID of the rigidbody so it can be tracked in the handler
22 int rbIndex;
23
24 //World position of the rigidbody
25 glm::vec3 position;
26
27 //Orientation of the rigidbody
28 glm::mat3 orientation;
29
30 //Vertical speed of rigidbody
31 float verticalSpeed;
32
33 //Velocity of the rigidbody
34 glm::vec3 velocity = glm::vec3(0, 0, 0);
35
36 /* Gravity variables */
37 //Does gravity apply
38 bool hasGravity;
39
40 //Value of gravity
41 float gravityValue;
42
43 //Touching the ground
44 bool grounded = true;
45
46 /* Collision variables */
47 //Is collidable
48 bool collidable = true;
49 bool isStatic = false;
50 bool willCollide = false;
51 bool canFall = true;
52
53 // True if is sphere
54 bool isSphere = false;
55
56 // If spherical width, height, depth will be 0
57 // Else radius will be 0
58 float width = 0;
59 float height = 0;
60 float depth = 0;
61 float radius = 0;
62
63 private:
64
65 };
66}
Definition hashSet.h:18
Definition rigidbody.h:8
Rigidbody(int rbIndex, glm::vec3 pos=glm::vec3(0, 0, 0), glm::mat3 rot=glm::mat3(1.0))
Definition rigidbody.cpp:7
void update(float aTerrainHeight)
Definition rigidbody.cpp:25