Files
dl_old/dl/render/dl_camera.h
T

45 lines
745 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* @file dl_camera.h
* @brief 摄像机(3d)
*
*
* @version 1.0
* @author lveyou
* @date 21-03-30
*
* @note 返回视图矩阵和投影矩阵给VK使用
* @note 起始在(1, 1, 1),看向原点,y轴向上
*/
#pragma once
#include "dl_type.h"
#include "math/dl_matrix.h"
namespace dl
{
class Camera
{
friend class VK;
public:
Camera() :
_position{1.0f, 1.0f, 1.0f},
_lookDirection{ -1.0f, -1.0f, -1.0f},
_upDirection{ 0, 1.0f, 0 }
{}
void RunControllerFPS();
Position3 GetPosition() { return _position; }
//! 返回视图矩阵
Matrix4 GetMatrixView()
{
return Mat::CreateLookTo(_position, _lookDirection, _upDirection);
}
private:
Position3 _position;
Position3 _lookDirection;
Position3 _upDirection;
};
}