浏览代码

Added some convenient functions in camera.

legacy
Benjamin ‘Touky’ Huet touky 12 年前
父节点
当前提交
a031bad19c
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. +10
    -0
      src/camera.cpp
  2. +2
    -0
      src/camera.h

+ 10
- 0
src/camera.cpp 查看文件

@@ -61,6 +61,16 @@ void Camera::SetPerspective(float fov, float width, float height,
m_proj_matrix = mat4::perspective(fov, width, height, near, far);
}

void Camera::SetTarget(vec3 const &pos)
{
m_target = pos;
}

vec3 Camera::GetTarget()
{
return m_target;
}

mat4 const &Camera::GetViewMatrix()
{
return m_view_matrix;


+ 2
- 0
src/camera.h 查看文件

@@ -34,6 +34,8 @@ public:
void SetOrtho(float width, float height, float near, float far);
void SetPerspective(float fov, float width, float height,
float near, float far);
void SetTarget(vec3 const &pos);
vec3 GetTarget();

mat4 const &GetViewMatrix();
mat4 const &GetProjMatrix();


正在加载...
取消
保存