FreeFlyCamera::FreeFlyCamera(glm::vec3 position, float nearDistance, float farDistance, float verticalFieldOfView, double leafSize){
		m_Position = position;
		m_fPhi = PI;
		m_fTheta = 0;
		
		m_leafSize = leafSize;
		
		m_nearDistance = nearDistance;
		m_farDistance = farDistance;
		m_verticalFieldOfView = verticalFieldOfView;
		
		m_frustumNearPlanePoint = glm::vec3(0.f, 0.f, 0.f);
		m_frustumFarPlanePoint = glm::vec3(0.f, 0.f, 0.f);
		m_frustumTopPlanePoint = glm::vec3(0.f, 0.f, 0.f);
		m_frustumRightPlanePoint = glm::vec3(0.f, 0.f, 0.f);
		m_frustumBottomPlanePoint = glm::vec3(0.f, 0.f, 0.f);
		m_frustumLeftPlanePoint = glm::vec3(0.f, 0.f, 0.f);

		m_frustumNearPlaneNormal = glm::vec3(0.f, 0.f, 0.f);
		m_frustumFarPlaneNormal = glm::vec3(0.f, 0.f, 0.f);
		m_frustumTopPlaneNormal = glm::vec3(0.f, 0.f, 0.f);
		m_frustumRightPlaneNormal = glm::vec3(0.f, 0.f, 0.f);
		m_frustumBottomPlaneNormal = glm::vec3(0.f, 0.f, 0.f);
		m_frustumLeftPlaneNormal = glm::vec3(0.f, 0.f, 0.f);

		computeDirectionVectors();
		computeFrustumPlanes();
	}
Beispiel #2
0
Camera::Camera(const Camera &source){
	position = source.position;
	m_fPhi = source.m_fPhi;
	m_fTheta = source.m_fTheta;
	cameraSpeed = source.cameraSpeed;

	computeDirectionVectors();
}
	FreeFlyCamera()
	{
		m_Position = glm::vec3(5,8,5);
		m_Inertia = glm::vec3(0,0,0);
		m_fPhi = 0;
		m_fTheta = 0.f;
		computeDirectionVectors();
	}
Beispiel #4
0
Camera::Camera(){
	position = glm::vec3(0, defaultYPosition, 0);
	m_fPhi = M_PI;
	m_fTheta = 0;
	cameraSpeed = 2.2f;

	computeDirectionVectors();
}
Beispiel #5
0
	void rotateUp(float degrees) {
		m_fTheta += glm::radians(degrees);
		computeDirectionVectors();
	}
Beispiel #6
0
	void rotateLeft(float degrees) {
		m_fPhi += glm::radians(degrees);
		computeDirectionVectors();
	}
Beispiel #7
0
	FreeflyCamera(): m_Position(0.f), m_fPhi(M_PI), m_fTheta(0.f) {
		computeDirectionVectors();
	}
Beispiel #8
0
		void rotateUp(float degrees){
			m_fTheta+=M_PI*degrees/180;
			computeDirectionVectors();
		}
Beispiel #9
0
		void rotateLeft(float degrees){
			m_fPhi+=M_PI*degrees/180;
			computeDirectionVectors();
		}
Beispiel #10
0
void Camera::moveFront(float t){
	m_Position += t * m_FrontVector;
	computeDirectionVectors();
}
Beispiel #11
0
			inline void setAngles(float phi, float theta){ m_fPhi = phi; m_fTheta = theta; computeDirectionVectors(); };
	void FreeFlyCamera::rotateUp(float degree){
		m_fTheta = glm::radians(degree);
		computeDirectionVectors();
		computeFrustumPlanes();
	}
	void FreeFlyCamera::resetView(float theta, float phi){
		m_fTheta = theta;
		m_fPhi = phi;
		computeDirectionVectors();
		computeFrustumPlanes();
	}
Beispiel #14
0
void Camera::changePosition( glm::vec3 position){
	m_Position = position;
	computeDirectionVectors();
}
Beispiel #15
0
Camera::Camera(){
	m_Position = glm::vec3(0.0f);;
	m_fPhi = glm::radians(M_PI);
	m_fTheta = glm::radians(0.0);
	computeDirectionVectors();
}
Beispiel #16
0
void Camera::rotateLeft(float degrees){
	//if(m_fPhi + glm::radians(degrees)> M_PI + 1 || m_fPhi + glm::radians(degrees)< M_PI -1) return;
	m_fPhi += glm::radians(degrees);
	computeDirectionVectors();
}
Beispiel #17
0
void Camera::rotateUp(float degrees){
	if(m_fTeta + glm::radians(degrees) > 1.7 || m_fTeta + glm::radians(degrees) < -1.7) return;
	m_fTeta += glm::radians(degrees);
	computeDirectionVectors();								    
}
void FreeflyCamera::rotateUp(float degrees){
	m_fTeta += glm::radians(degrees);
	computeDirectionVectors();
}
Beispiel #19
0
		FreeflyCamera(){
			m_Position=glm::vec3(0,5,-5);
			m_fPhi=M_PI;
			m_fTheta=0;
			computeDirectionVectors();
		}
Beispiel #20
0
void Camera::moveLeft(float t){
	m_Position += t * m_LeftVector;
	computeDirectionVectors();
}