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);