few
This commit is contained in:
parent
b77ede95e5
commit
a4cc34d03b
@ -19,6 +19,7 @@ constexpr float position_data[VERTEX_COUNT*2]=
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr uint DRAW_OBJECT_COUNT=12;
|
constexpr uint DRAW_OBJECT_COUNT=12;
|
||||||
|
constexpr double TRI_ROTATE_ANGLE=360.0f/DRAW_OBJECT_COUNT;
|
||||||
|
|
||||||
#define USE_MATERIAL_FILE true //是否使用材质文件
|
#define USE_MATERIAL_FILE true //是否使用材质文件
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ private:
|
|||||||
if(!render_obj[i].r)
|
if(!render_obj[i].r)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
mat=rotate(deg2rad<double>(double(360/DRAW_OBJECT_COUNT*i)),AxisVector::Z);
|
mat=rotate(deg2rad<double>(TRI_ROTATE_ANGLE*i),AxisVector::Z);
|
||||||
|
|
||||||
render_root.Add(new SceneNode(mat,render_obj[i].r));
|
render_root.Add(new SceneNode(mat,render_obj[i].r));
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include<hgl/graph/VKRenderTarget.h>
|
#include<hgl/graph/VKRenderTarget.h>
|
||||||
#include<hgl/graph/VKMaterialInstance.h>
|
#include<hgl/graph/VKMaterialInstance.h>
|
||||||
#include<hgl/graph/PrimitiveCreater.h>
|
#include<hgl/graph/PrimitiveCreater.h>
|
||||||
#include<hgl/graph/VKRenderResource.h>
|
|
||||||
#include<hgl/graph/PrimitiveCreater.h>
|
|
||||||
#include<hgl/Time.h>
|
#include<hgl/Time.h>
|
||||||
//#include<iostream>
|
//#include<iostream>
|
||||||
|
|
||||||
@ -92,7 +90,12 @@ namespace hgl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pc->Create();
|
auto *prim=pc->Create();
|
||||||
|
|
||||||
|
if(prim)
|
||||||
|
db->Add(prim);
|
||||||
|
|
||||||
|
return prim;
|
||||||
}
|
}
|
||||||
|
|
||||||
graph::Renderable *WorkObject::CreateRenderable( const AnsiString &name,
|
graph::Renderable *WorkObject::CreateRenderable( const AnsiString &name,
|
||||||
@ -101,22 +104,11 @@ namespace hgl
|
|||||||
graph::Pipeline *pipeline,
|
graph::Pipeline *pipeline,
|
||||||
const std::initializer_list<graph::VertexAttribDataPtr> &vad_list)
|
const std::initializer_list<graph::VertexAttribDataPtr> &vad_list)
|
||||||
{
|
{
|
||||||
auto *pc=new graph::PrimitiveCreater(GetDevice(),mi->GetVIL());
|
auto *prim=this->CreatePrimitive(name,vertices_count,mi->GetVIL(),vad_list);
|
||||||
|
|
||||||
pc->Init(name,vertices_count);
|
if(!prim)
|
||||||
|
return(nullptr);
|
||||||
|
|
||||||
for(const auto &vad:vad_list)
|
return db->CreateRenderable(prim,mi,pipeline);
|
||||||
{
|
|
||||||
if(!pc->WriteVAB(vad.name,vad.format,vad.data))
|
|
||||||
{
|
|
||||||
delete pc;
|
|
||||||
return(nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto *result=db->CreateRenderable(pc,mi,pipeline);
|
|
||||||
|
|
||||||
delete pc;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}//namespcae hgl
|
}//namespcae hgl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user