From 13f4332af12590cfeb299205612b61b95ef31629 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 7 Jul 2025 01:28:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRenderBoundBox=E8=8C=83?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMCore | 2 +- example/Basic/RenderBoundBox.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMCore b/CMCore index 25060b07..8e733a24 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit 25060b07d03d088b940f78ac1223f4888377f608 +Subproject commit 8e733a241536efcaff8cbff66c8a3a4f1255ed86 diff --git a/example/Basic/RenderBoundBox.cpp b/example/Basic/RenderBoundBox.cpp index eaf3665c..65af266e 100644 --- a/example/Basic/RenderBoundBox.cpp +++ b/example/Basic/RenderBoundBox.cpp @@ -33,8 +33,6 @@ class TestApp:public WorkObject { private: - - struct MaterialData { Material * material = nullptr; @@ -56,6 +54,8 @@ private: MeshComponentData *data; ComponentDataPtr cdp; + MeshComponent *component; + public: ~RenderMesh() @@ -201,8 +201,8 @@ private: { struct TorusCreateInfo tci; - tci.innerRadius=0.975; - tci.outerRadius=1.0; + tci.innerRadius=0.9; + tci.outerRadius=1.1; tci.numberSlices=64; tci.numberStacks=8; @@ -233,14 +233,14 @@ private: { cci.mat=scale(10,10,1); - CreateComponent(&cci,rm_plane->cdp); + rm_plane->component=CreateComponent(&cci,rm_plane->cdp); } { - //cci.mat=rotate(90,AxisVector::Y); - cci.mat=Identity4f; - auto *mc=CreateComponent(&cci,rm_torus->cdp); - mc->SetOverrideMaterial(solid.mi[1]); + cci.mat=AxisYRotate(deg2rad(90)); + + rm_torus->component=CreateComponent(&cci,rm_torus->cdp); + rm_torus->component->SetOverrideMaterial(solid.mi[1]); } return(true); @@ -250,6 +250,8 @@ private: { CreateComponentInfo cci(GetSceneRoot()); + cci.mat=rm_torus->component->GetLocalMatrix(); + CreateComponent(&cci,rm_box->cdp); CameraControl *camera_control=GetCameraControl();