-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharacterController.cs
112 lines (100 loc) · 3.88 KB
/
CharacterController.cs
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
using System;
using Mogre;
namespace RaceGame
{
/// <summary>
/// This abstract class allows to implement a character controller.
/// This allows to controll the camera either by keyboard and mouse or by AI
/// </summary>
abstract class CharacterController
{
protected Character character; // A reference to the character to controll
protected Vector3 angles; // Rotation angles
/// <summary>
/// Write only. This property allows to set the rotation angle
/// </summary>
public Vector3 Angles
{
set { angles = value; }
}
protected bool shoot; // This method determines when the charatcer is to shoot
/// <summary>
/// Write only. This property allows to set whether the character is to shoot
/// </summary>
public bool Shoot
{
set { shoot = value; }
}
protected bool forward; // This method determines when the charatcer is to move forward
/// <summary>
/// Write only. This property allows to set whether the character is to move forward
/// </summary>
public bool Forward
{
set { forward = value; }
}
protected bool backward; // This method determines when the charatcer is to move backward
/// <summary>
/// Write only. This property allows to set whether the character is to move backward
/// </summary>
public bool Backward
{
set { backward = value; }
}
protected bool left; // This method determines when the charatcer is to move left
/// <summary>
/// Write only. This property allows to set whether the character is to move left
/// </summary>
public bool Left
{
set { left = value; }
}
protected bool right; // This method determines when the charatcer is to move right
/// <summary>
/// Write only. This property allows to set whether the character is to move right
/// </summary>
public bool Right
{
set { right = value; }
}
protected bool up; // This method determines when the charatcer is to move up
/// <summary>
/// Write only. This property allows to set whether the character is to move up
/// </summary>
public bool Up
{
set { up = value; }
}
protected bool down; // This method determines when the charatcer is to move down
/// <summary>
/// Write only. This property allows to set whether the character is to move down
/// </summary>
public bool Down
{
set { down = value; }
}
protected bool accellerate; // This method determines when the charatcer is to move accellerate
/// <summary>
/// Write only. This property allows to set whether the character is to accellerate
/// </summary>
public bool Accellerate
{
set { accellerate = value; }
}
protected float speed; // This method determines the speed of the character movement
/// <summary>
/// Write only. This property allows to set the speed of the character movement
/// </summary>
public float Speed
{
set { speed = value; }
}
/// <summary>
/// This virtual method updates the state of the character
/// </summary>
/// <param name="evt">A frame event that can be used for the update of the character</param>
virtual public void Update(FrameEvent evt)
{
}
}
}