-
Notifications
You must be signed in to change notification settings - Fork 0
/
WhiteBall.h
55 lines (34 loc) · 1.05 KB
/
WhiteBall.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <Urho3D/Input/Controls.h>
#include "Ball.h"
namespace Urho3D {
class RigidBody;
class Node;
}
using namespace Urho3D;
const int CTRL_PUSH = 1;
const float PUSH_FORCE_PER_SECOND = 1500.0f;
const unsigned MAX_PUSH_BUTTON_HOLD_TIME = 2.0f; // 2 seconds???
const float WHITE_BALL_INITIAL_PITH = 17.0f;
const float WHITE_BALL_INITIAL_YAW = 90.0f;
URHO3D_EVENT(E_WHITEBALLINPOCKET, WhiteBallInPocket) {
}
class WhiteBall : public Ball {
URHO3D_OBJECT(WhiteBall, Ball);
public:
/// Construct.
WhiteBall(Context *context);
/// Register object factory and attributes.
static void RegisterObject(Context *context);
/// Handle physics world update. Called by LogicComponent base class.
virtual void FixedUpdate(float timeStep);
// Gets camera node pointer
void Init(WeakPtr<Node>);
/// Movement controls.
Controls controls_;
float pushButtonHoldingTime_ = 0.f;
private:
void HandleCollisionWithPocket(VariantMap &eventData);
WeakPtr<Node> cameraNode_;
Vector3 initialPosition_;
};