From 8ce7bceee05d340240484d80cbb7b6b97faa2ca9 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 27 May 2019 22:47:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BSceneNode/RenderList=E7=9A=84?= =?UTF-8?q?Camera=E7=9B=B8=E5=85=B3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/graph/SceneNode.h | 1 - src/SceneGraph/RenderList.cpp | 9 +++------ src/SceneGraph/SceneNode.cpp | 13 ------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/inc/hgl/graph/SceneNode.h b/inc/hgl/graph/SceneNode.h index 97d559d4..0ab39a36 100644 --- a/inc/hgl/graph/SceneNode.h +++ b/inc/hgl/graph/SceneNode.h @@ -78,7 +78,6 @@ namespace hgl bool ExpendToList(RenderList *rl,Frustum *f) ///<展开到渲染列表(使用平截头裁剪) {return ExpendToList(rl,FrustumClipFilter,f);} -// bool ExpendToList(RenderList *,const Matrix4f &,const Matrix4f &,RenderListCompFunc=nullptr); ///<展开到渲染列表(使用平截头裁剪并排序) bool ExpendToList(RenderList *,Camera *,RenderListCompFunc=nullptr); ///<展开到渲染列表(使用摄像机平截头裁剪并排序) };//class SceneNode }//namespace graph diff --git a/src/SceneGraph/RenderList.cpp b/src/SceneGraph/RenderList.cpp index acc4aec7..55124dd2 100644 --- a/src/SceneGraph/RenderList.cpp +++ b/src/SceneGraph/RenderList.cpp @@ -30,15 +30,12 @@ namespace hgl { camera=cam; - MakeCameraMatrix( &ubo_matrix.projection, - &ubo_matrix.modelview, - &camera); - + ubo_matrix.projection=camera.projection; + ubo_matrix.modelview=camera.modelview; ubo_matrix.mvp =ubo_matrix.projection*ubo_matrix.modelview; ubo_matrix.normal =ubo_matrix.modelview.Float3x3Part(); //法线矩阵为3x3 - CameraToFrustum(&frustum, - &camera); + frustum=camera.frustum; } void RenderList::SetMVP(const Matrix4f &proj,const Matrix4f &mv) diff --git a/src/SceneGraph/SceneNode.cpp b/src/SceneGraph/SceneNode.cpp index 39b0cbd4..700cbda7 100644 --- a/src/SceneGraph/SceneNode.cpp +++ b/src/SceneGraph/SceneNode.cpp @@ -1,6 +1,5 @@ #include #include -//#include namespace hgl { namespace graph @@ -92,13 +91,6 @@ namespace hgl return(true); } - //bool SceneNode::ExpendToList(RenderList *rl,const Matrix4f &proj,const Matrix4f &mv,RenderListCompFunc comp_func)const - //{ - // if(!rl)return(false); - - - //} - /** * 从当前节点展开输出到一个渲染列表 * @param rl 渲染列表 @@ -109,11 +101,6 @@ namespace hgl { if(!rl||!cam)return(false); -// Frustum f; - -// MakeCameraFrustum(&f,cam); - -// if(!ExpendToList(rl,&f)) if(!ExpendToList(rl)) return(false);