Пример #1
0
void Camera::move(Movement direction, float speed) {
	glm::vec3 translation;
	if (direction == LEFT) {
		translation = -getSideVector();
	}
	else if (direction == RIGHT) {
		translation = getSideVector();
	}
	else if (direction == UP) {
		translation = getOrthoUpVector();
	}
	else if (direction == DOWN) {
		translation = -getOrthoUpVector();
	}
	else if (direction == BACKWARD) {
		translation = -getLookVector();
	}
	else if (direction == FORWARD) { 
		translation = getLookVector();
	}
	
	translation = translation * m_Orientation * speed;
	m_Eye += translation;
	m_Center += translation;
}
Пример #2
0
	vec3 getSideVector() { return glm::cross(getLookVector(), vec3(0,-1,0));}