optimized SceneNode class.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
#include"VulkanAppFramework.h"
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/filesystem/FileSystem.h>
|
||||
#include<hgl/graph/PrimitiveCreater.h>
|
||||
#include<hgl/graph/VKVertexInputConfig.h>
|
||||
#include<hgl/graph/mtl/Material2DCreateConfig.h>
|
||||
@@ -94,7 +93,7 @@ private:
|
||||
rad=deg2rad<double>((360/TRIANGLE_NUMBER)*i); //这里一定要加<float>或<float>,否则结果用int保存会出现问题
|
||||
mat=rotate(rad,Vector3f(0,0,1));
|
||||
|
||||
render_root.CreateSubNode(mat,render_obj);
|
||||
render_root.Add(new SceneNode(mat,render_obj));
|
||||
}
|
||||
|
||||
render_root.RefreshMatrix();
|
||||
@@ -110,10 +109,10 @@ public:
|
||||
{
|
||||
SAFE_CLEAR(render_list);
|
||||
}
|
||||
|
||||
bool Init()
|
||||
|
||||
bool Init(uint w,uint h)
|
||||
{
|
||||
if(!VulkanApplicationFramework::Init(SCREEN_WIDTH,SCREEN_HEIGHT))
|
||||
if(!VulkanApplicationFramework::Init(w,h))
|
||||
return(false);
|
||||
|
||||
render_list=new RenderList(device);
|
||||
@@ -139,12 +138,5 @@ public:
|
||||
|
||||
int main(int,char **)
|
||||
{
|
||||
TestApp app;
|
||||
|
||||
if(!app.Init())
|
||||
return(-1);
|
||||
|
||||
while(app.Run());
|
||||
|
||||
return 0;
|
||||
return RunApp<TestApp>(SCREEN_WIDTH,SCREEN_HEIGHT);
|
||||
}
|
||||
|
@@ -1,10 +1,7 @@
|
||||
// 该范例主要演示使用NDC坐标系直接绘制一个渐变色的三角形
|
||||
|
||||
#include"VulkanAppFramework.h"
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/math/HalfFloat.h>
|
||||
#include<hgl/filesystem/FileSystem.h>
|
||||
#include<hgl/graph/SceneInfo.h>
|
||||
#include<hgl/graph/VKVertexInputConfig.h>
|
||||
#include<hgl/graph/PrimitiveCreater.h>
|
||||
#include<hgl/graph/mtl/Material2DCreateConfig.h>
|
||||
@@ -125,9 +122,9 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
bool Init()
|
||||
bool Init(uint w,uint h)
|
||||
{
|
||||
if(!VulkanApplicationFramework::Init(SCREEN_WIDTH,SCREEN_HEIGHT))
|
||||
if(!VulkanApplicationFramework::Init(w,h))
|
||||
return(false);
|
||||
|
||||
InitVIL();
|
||||
@@ -157,12 +154,5 @@ public:
|
||||
|
||||
int main(int,char **)
|
||||
{
|
||||
TestApp app;
|
||||
|
||||
if(!app.Init())
|
||||
return(-1);
|
||||
|
||||
while(app.Run());
|
||||
|
||||
return 0;
|
||||
return RunApp<TestApp>(SCREEN_WIDTH,SCREEN_HEIGHT);
|
||||
}
|
||||
|
@@ -1,9 +1,6 @@
|
||||
// 该范例主要演示使用2D坐系统直接绘制一个渐变色的三角形,使用UBO传递Viewport信息
|
||||
|
||||
#include"VulkanAppFramework.h"
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/filesystem/FileSystem.h>
|
||||
#include<hgl/graph/SceneInfo.h>
|
||||
#include<hgl/graph/VKVertexInputConfig.h>
|
||||
#include<hgl/graph/PrimitiveCreater.h>
|
||||
#include<hgl/graph/mtl/Material2DCreateConfig.h>
|
||||
@@ -132,5 +129,5 @@ public:
|
||||
|
||||
int main(int,char **)
|
||||
{
|
||||
RunApp<TestApp>(1280,720);
|
||||
return RunApp<TestApp>(1280,720);
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ bool InitGizmoRotateStaticMesh()
|
||||
|
||||
white_torus->GetTransform().AddTransform(rotate_white_torus_tfc);
|
||||
|
||||
root_node->AddSubNode(white_torus);
|
||||
root_node->Add(white_torus);
|
||||
}
|
||||
|
||||
sm_gizmo_rotate=CreateGizmoStaticMesh(root_node);
|
||||
|
Reference in New Issue
Block a user