Camera增加一堆默认向量
This commit is contained in:
parent
0516bef44c
commit
9bab8a97f1
@ -49,13 +49,8 @@ private:
|
||||
void InitCamera()
|
||||
{
|
||||
camera.type=CameraType::Perspective;
|
||||
camera.center.Set(0,0,0);
|
||||
camera.eye.Set(100,100,100);
|
||||
camera.up_vector.Set(0,0,1);
|
||||
camera.forward_vector.Set(0,1,0);
|
||||
camera.znear=4;
|
||||
camera.zfar=1000;
|
||||
camera.fov=90;
|
||||
camera.center.Set(0,0,0,1);
|
||||
camera.eye.Set(100,100,100,1);
|
||||
camera.width=SCREEN_WIDTH;
|
||||
camera.height=SCREEN_HEIGHT;
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
using namespace hgl;
|
||||
using namespace hgl::graph;
|
||||
|
||||
constexpr uint32_t SCREEN_WIDTH=1280;
|
||||
constexpr uint32_t SCREEN_HEIGHT=960;
|
||||
constexpr uint32_t SCREEN_WIDTH=128;
|
||||
constexpr uint32_t SCREEN_HEIGHT=128;
|
||||
|
||||
vulkan::Renderable *CreateMeshRenderable(SceneDB *db,vulkan::Material *mtl,const MeshData *mesh)
|
||||
{
|
||||
@ -119,18 +119,13 @@ private:
|
||||
math::vec center_point=model_data->bounding_box.CenterPoint();
|
||||
math::vec max_point=model_data->bounding_box.maxPoint;
|
||||
|
||||
max_point.x*=3.0f;
|
||||
max_point.x*=2.0f;
|
||||
max_point.y=center_point.y;
|
||||
max_point.z=center_point.z;
|
||||
|
||||
camera.type=CameraType::Perspective;
|
||||
camera.center=center_point.xyz();
|
||||
camera.eye=max_point.xyz();
|
||||
camera.up_vector.Set(0,0,1);
|
||||
camera.forward_vector.Set(0,1,0);
|
||||
camera.znear=4;
|
||||
camera.zfar=1000;
|
||||
camera.fov=90;
|
||||
camera.center=center_point;
|
||||
camera.eye=max_point;
|
||||
camera.width=SCREEN_WIDTH;
|
||||
camera.height=SCREEN_HEIGHT;
|
||||
|
||||
|
@ -21,7 +21,7 @@ using namespace hgl::graph;
|
||||
|
||||
class VulkanApplicationFramework
|
||||
{
|
||||
private:
|
||||
private:
|
||||
|
||||
Window * win =nullptr;
|
||||
vulkan::Instance * inst =nullptr;
|
||||
|
@ -22,14 +22,14 @@ namespace hgl
|
||||
float width; ///<视图宽
|
||||
float height; ///<视图高
|
||||
|
||||
float fov; ///<水平FOV
|
||||
float znear,zfar; ///<Z轴上离眼睛的距离
|
||||
float fov=90; ///<水平FOV
|
||||
float znear=0,zfar=1000; ///<Z轴上离眼睛的距离
|
||||
|
||||
Vector4f eye; ///<眼睛坐标
|
||||
Vector4f center; ///<视点坐标
|
||||
Vector4f up_vector; ///<向上量(默认0,0,1)
|
||||
Vector4f forward_vector; ///<向前量(默认1,0,0)
|
||||
Vector4f right_vector; ///<向右量(默认0,1,0)
|
||||
Vector4f up_vector =Vector4f(0,0,1,0); ///<向上量(默认0,0,1)
|
||||
Vector4f forward_vector =Vector4f(0,1,0,0); ///<向前量(默认0,1,0)
|
||||
Vector4f right_vector =Vector4f(1,0,0,0); ///<向右量(默认0,0,1)
|
||||
|
||||
public:
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#${ROOT_INCLUDE_PATH}/hgl/graph/Mesh.h
|
||||
#${ROOT_INCLUDE_PATH}/hgl/graph/Material.h
|
||||
${ROOT_INCLUDE_PATH}/hgl/graph/TextureType.h
|
||||
#${ROOT_INCLUDE_PATH}/hgl/graph/Spline.h
|
||||
#${ROOT_INCLUDE_PATH}/hgl/graph/Spline.h
|
||||
)
|
||||
|
||||
SET(SCENE_GRAPH_SOURCE AABox.cpp
|
||||
@ -25,7 +25,7 @@ SET(SCENE_GRAPH_SOURCE AABox.cpp
|
||||
#Material.cpp
|
||||
#Mesh.cpp
|
||||
#SceneFile.cpp
|
||||
)
|
||||
)
|
||||
|
||||
SOURCE_GROUP("Header Files" FILES ${SCENE_GRAPH_HEADER})
|
||||
SOURCE_GROUP("Source Files" FILES ${SCENE_GRAPH_SOURCE})
|
||||
|
Loading…
x
Reference in New Issue
Block a user