-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModelElement.cs
66 lines (53 loc) · 2.16 KB
/
ModelElement.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
using System;
using Mogre;
using Mogre.TutorialFramework;
namespace RaceGame
{
/// <summary>
/// This class describes and initialize an element of the character model
/// </summary>
class ModelElement : MovableElement
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="mSceneMgr">A reference to the scene manager</param>
/// <param name="modelName">The name of the .mesh file which contains the geometry of the model</param>
///
public ModelElement(SceneManager mSceneMgr, string modelName = "")
{
// YOUR CODE FOR INITIALIZE THE GAMENODE GOES HERE
if (modelName != "")
{
//YOUR CODE FOR INITIALIZE AND ATTACH THE GAMEENTITY TO THE NODE GOES HERE
}
}
/// <summary>
/// This method moves the model element in the specified direction
/// </summary>
/// <param name="direction">A direction in which to move the model element</param>
public override void Move(Vector3 direction)
{
// YOUR CODE FOR MOVING THE GAMENODE GOES HERE
}
/// <summary>
/// This modeto rotate the model element as described by the quaternion given as parameter in the
/// specified transformation space
/// </summary>
/// <param name="quaternion">The quaternion which describes the rotation axis and angle</param>
/// <param name="transformSpace">The space in which to perfrom the rotation, local by default</param>
public override void Rotate(Quaternion quaternion,
Node.TransformSpace transformSpace = Node.TransformSpace.TS_LOCAL)
{
// YOUR CODE FOR ROTATING THE GAMENODE GOES HERE
}
/// <summary>
/// This method adds a child to the node of this model element
/// </summary>
/// <param name="childNode"></param>
public void AddChild(SceneNode childNode)
{
//YOUR NODE FOR ATTACHING A CHILDNODE TO THE GAMENODE GOES HERE
}
}
}