-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscene.h
47 lines (40 loc) · 1.2 KB
/
scene.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
#ifndef SCENE_H
#define SCENE_H
#include <SDL.h>
#include <list>
#include "player.h"
#include "graphics.h"
class Scene {
public:
Player * player;
Screen * screen;
std::list<Object*> objectList;
//Rendering Time Variables
float renderTime;
int collectAverageRenderTime;
float * frameTimes;
int frameIndex;
//Render margin error used to only render things within view
int renderMargin;
float drawDistance;
//Constructor that takes a pointer to the player instance as paramter
Scene(Player * inputPlayer, Screen * inputScreen);
//Function that renders the scene
void renderScene();
//Returns a list with 2d vertex's to render
std::list<Triangle> renderQueue();
//Add a object that consists of vertices to the scene
void addObject(Object * object);
//Rotate an object
void rotateScene(float thetaAdd, float phiAdd);
//Returns render time
float getRenderTime();
//Returns average render time for x latest frames
float getAverageRenderTime(int numOfFrames);
//Returns distance between object and player
float getDistToPlayer(Object * inputObject);
//Return true if object is visible
int objectVisible(Object * inputObject);
//Returns 2D screen coordinates from 3D coordinates
};
#endif