-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.cpp
48 lines (38 loc) · 1.06 KB
/
Camera.cpp
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
//
// Created by rcabido on 7/11/19.
//
#include "Camera.h"
#include "GameObject.h"
#include <GL/glut.h>
//// MÉTODOS CLASE CAMERA ////
//* Constructores *//
Camera::Camera() : GameObject() {
this->id = 0;
}
Camera::Camera(int id, const Vector3D &pos, const Vector3D &orientation)
: GameObject(pos, Color(), Vector3D(), orientation, Vector3D(), true) {
this->id = id;
}
Camera::Camera(int id, float x, float y, float z)
: GameObject(Vector3D(x, y, z), Color(), Vector3D(), Vector3D(), Vector3D(), true) {
this->id = id;
}
//* Getters *//
int Camera::getId() const {
return this->id;
}
//* Setters *//
void Camera::setId(const int id) {
this->id = id;
}
//* Otros *//
//Renderizado
void Camera::render() const {
glTranslatef(-this->getPosition().getX(), -this->getPosition().getY(), -this->getPosition().getZ());
glRotatef(getOrientation().getX(), 1.0, 0.0, 0.0);
glRotatef(getOrientation().getY(), 0.0, 1.0, 0.0);
glRotatef(getOrientation().getZ(), 0.0, 0.0, 1.0);
}
//Actualización
void Camera::update(const float &deltaTime, const Vector3D& gravity){
}