-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScene.h
More file actions
40 lines (27 loc) · 1.25 KB
/
Scene.h
File metadata and controls
40 lines (27 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef SCENE_H
#define SCENE_H
#include "btBulletDynamicsCommon.h"
class Scene {
public:
Scene (btDynamicsWorld* ownerWorld); // Constructor
virtual ~Scene(); // Destructor
void update(int elapsedTime, const btVector3& creatureCOM); // Update the scene (platform and ball)
void switchPlatform() {m_PlatformActive = !m_PlatformActive;} // Activate / Deactivate platform
void switchBall(){m_BallActive = !m_BallActive;} // Activate / Deactivate ball
protected:
btDynamicsWorld * m_ownerWorld; // The physics world of the simulation
btCollisionShape * m_platform_shape; // The primitive shape of the platform
btCollisionShape * m_ball_shape; // The primitive shape of the ball
btRigidBody * m_platform; // The platform body
btRigidBody * m_ball; // The ball body
//Platform movements
int m_axisToRotatePlatform; // current axis of rotation of the platform
int m_signToRotatePlatform; // current direction of rotation of the platform
btScalar m_magnitudeToRotatePlatform; // current magnitude of the rotation
//Timer
int lastChangeRotation; // Time of last change of rotation
int lastShoot; // Time of last ball shooting
bool m_PlatformActive; // Platform is active
bool m_BallActive; // Ball is active
};
#endif