准备开始实现StaticMeshComponent

This commit is contained in:
2025-06-12 03:01:50 +08:00
parent 3fd6f98ef7
commit 87c150d1bd
6 changed files with 43 additions and 28 deletions

View File

@@ -36,7 +36,7 @@ class TestApp:public WorkObject
private:
MaterialInstance * material_instance =nullptr;
Mesh * render_obj =nullptr;
Mesh * mesh_triangle =nullptr;
Pipeline * pipeline =nullptr;
@@ -79,7 +79,7 @@ private:
position_data[i][1]=position_data_float[i][1]*ext.height;
}
render_obj=CreateMesh("Triangle",VERTEX_COUNT,material_instance,pipeline,
mesh_triangle=CreateMesh("Triangle",VERTEX_COUNT,material_instance,pipeline,
{
{VAN::Position,POSITION_DATA_FORMAT,position_data},
{VAN::Color, COLOR_DATA_FORMAT, color_data}
@@ -87,9 +87,11 @@ private:
SceneNode *scene_root=GetSceneRoot(); ///<取得场景根节点
scene_root->Add(new SceneNode(render_obj));
return(render_obj);
scene_root->Add(new SceneNode(mesh_triangle));
return(mesh_triangle);
}
public:

View File

@@ -1,4 +1,5 @@
#pragma once
#include"Gizmo.h"
#include<hgl/color/Color.h>
@@ -6,7 +7,7 @@ VK_NAMESPACE_BEGIN
class SceneNode;
class PrimitiveCreater;
class StaticMesh;
class StaticMeshComponent;
constexpr const COLOR gizmo_color[size_t(GizmoColor::RANGE_SIZE)]=
{
@@ -37,6 +38,6 @@ constexpr const float GIZMO_TWO_AXIS_OFFSET =5.0F;
Mesh *GetGizmoRenderable(const GizmoShape &gs,const GizmoColor &);
StaticMesh *CreateGizmoStaticMesh(SceneNode *);
StaticMeshComponent *CreateGizmoStaticMeshComponent(SceneNode *);
VK_NAMESPACE_END