port from perforce
This commit is contained in:
43
aiwaz/Aiwaz/Resources/Camera/BaseCamera.cpp
Normal file
43
aiwaz/Aiwaz/Resources/Camera/BaseCamera.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "stdafx.h"
|
||||
#include "BaseCamera.h"
|
||||
|
||||
|
||||
BaseCamera::BaseCamera(IEngine& argEngine)
|
||||
: Transformation(argEngine)
|
||||
, m_NearClip(1.0f)
|
||||
, m_FarClip(100.0f)
|
||||
, m_AspectRatio(1.0f)
|
||||
{
|
||||
this->set_IsPreconditionForFollowingShaders(true);
|
||||
this->RecreateAllShaderParameters();
|
||||
}
|
||||
|
||||
|
||||
void BaseCamera::set_AspectRatio(float argValue)
|
||||
{
|
||||
m_AspectRatio = argValue;
|
||||
m_IsDirty = true;
|
||||
}
|
||||
|
||||
|
||||
void BaseCamera::set_FarClip(float argValue)
|
||||
{
|
||||
m_FarClip = argValue;
|
||||
m_IsDirty = true;
|
||||
}
|
||||
|
||||
|
||||
void BaseCamera::set_NearClip(float argValue)
|
||||
{
|
||||
m_NearClip = argValue;
|
||||
m_IsDirty = true;
|
||||
}
|
||||
|
||||
|
||||
void BaseCamera::RecreateAllShaderParameters()
|
||||
{
|
||||
this->SetParameter("ViewMatrix", &m_ViewMatrix, ParameterBindType::BindBySemantic);
|
||||
this->SetParameter("ProjectionMatrix", &m_ProjectionMatrix, ParameterBindType::BindBySemantic);
|
||||
|
||||
Transformation::RecreateAllShaderParameters();
|
||||
}
|
||||
Reference in New Issue
Block a user