forked from abertay-cmp404/virtual_vita
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel1.h
More file actions
132 lines (102 loc) · 2.62 KB
/
Level1.h
File metadata and controls
132 lines (102 loc) · 2.62 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#pragma once
#include "StateBase.h"
#include <graphics/renderer_3d.h>
#include <maths/math_utils.h>
#include <graphics/mesh_instance.h>
#include <system/debug_log.h>
//#include "Camera.h"
#include <graphics/font.h>
#include "load_texture.h"
#include <graphics/sprite_renderer.h>
#include <graphics/sprite.h>
#include <system/application.h>
#include <maths/vector2.h>
#include <vector>
#include <platform/vita/graphics/texture_vita.h>
#include "primitive_builder.h"
#include "GameObjectMy.h"
#include "Enemy.h"
#include "Tower01.h"
// Vita AR includes
//#include <camera.h>
//#include <gxm.h>
//#include <motion.h>
//#include <libdbg.h>
//#include <libsmart.h>
namespace gef
{
class Platform;
class SpriteRenderer;
class Font;
class Renderer3D;
class Mesh;
class RenderTarget;
//class TextureVita;
class InputManager;
class Scene;
}
class VirtualSystem;
class Level1 :
public StateBase
{
public:
Level1();
~Level1();
virtual StateBase::EStates Update(float frame_time);
virtual void CleanUp();
virtual void Render();
virtual void Init();
void SetUpLights();
private:
bool IsCollidingAABB(const gef::MeshInstance& meshInstance1_, const gef::MeshInstance& meshInstance2_);
void RenderOverlay();
void SetUpMapWalls(gef::Matrix44 markerTranform, float frameTime);
void ReadSceneAndAssignFistMesh(const char* filename_, gef::Scene** scene_, gef::Mesh** mesh_);
gef::Mesh* GetFirstMesh(gef::Scene* scene);
bool sampleIsMarkerFound(int idx);
void sampleGetTransform(int idx, gef::Matrix44* mat);
void DrawHUD();
void SetupCamera();
void UpdateTheCamera();
gef::Vector4 camera_eye_;
gef::Vector4 camera_lookat_;
gef::Vector4 camera_up_;
float camera_fov_;
float near_plane_;
float far_plane_;
gef::Matrix44 OrthoMatrix;
gef::Matrix44 ProjectionMatrix;
float ImageScaleFactor;
gef::Sprite CameraFeedSprite;
//gef::TextureVita TextureCameraMap;
GameObjectMy Cube_GameObject;
GameObjectMy SecondCube_GameObject;
GameObjectMy ThirdCube_GameObject;
#ifndef _NUMWAYPOINTS
#define _NUMWAYPOINTS 10
#endif // _NUMWAYPOINTS
Enemy enemy;
///////////////////
// ----- MAP WALLS ---------
GameObjectMy cubes[20];
bool hasPosBeenSet;
float wallCubeHalfSize;
//////////////////
Tower01* tower;
bool isTowerSphereColliding;
// mesh instance
gef::MeshInstance cube;
float fps_;
gef::Scene* model_scene_;
bool isMarkerFound;
bool areBoxesColliding;
float lerpAmount;
bool isLocalTransformInit;
bool isMarker1Found;
//Virtual Vita
VirtualSystem* virtualSystem_;
///////////////////// Variables for storing map model
//Mesh instance
GameObjectMy importedModelInstance_;
class gef::Mesh* importedModelMesh_;
};