示例#1
0
Camera::Camera()
	: m_position(0.0f, 0.0f, 0.0f), 
	  m_right(1.0f, 0.0f, 0.0f),
	  m_up(0.0f, 1.0f, 0.0f),
	  m_look(0.0f, 0.0f, 1.0f)
{
	setLens(0.25f*MathHelper::Pi, 1.0f, 1.0f, 1000.0f);
}
示例#2
0
Camera::Camera(int width,int height) {		
	m_View = matrix::m4identity();
	m_Proj = matrix::m4identity();
	mViewProj = matrix::m4identity();

	m_Speed = 10.0f;
	m_LastMousePosition = Vector2f(0,0);
	m_ViewPos = Vector3f(0,0,-5);
	m_UpVec = Vector3f(0,1,0);
	m_LookAt = Vector3f(0,0,1);
	m_RightVec = Vector3f(1,0,0);
	

	float w = static_cast<float>(width);
	float h = static_cast<float>(height);
	float aspect = w / h;
	setLens(0.25f*PI, aspect, 1.0f, 1000.0f);
	m_OrthoProj = matrix::mat4OrthoLH(w,h,0.0f,1.0f);	// checked
	m_OrthoView = matrix::m4identity();//matrix::mat4LookAtLH(m_ViewPos,m_LookAt,m_UpVec); // checked
	m_Ortho = false;
	buildView();
}