From 6bf37023b011791ee0e59462b7604344e19c35ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Wed, 12 Jun 2024 02:00:22 +0000 Subject: [PATCH] =?UTF-8?q?!2812=20=E4=BC=98=E5=8C=96:=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=A0=8F=E5=85=89=E6=BA=90=E8=A7=92=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/Lights/DirectionalLight.ts | 4 ++-- src/UI/Components/RightPanel/RightPanel.less | 6 +++++- src/UI/Components/RightPanel/SunLightGui.tsx | 11 ++++++++--- src/UI/Components/RightPanel/SunLightStore.ts | 1 + 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/DatabaseServices/Lights/DirectionalLight.ts b/src/DatabaseServices/Lights/DirectionalLight.ts index fc119f624..237ba87cd 100644 --- a/src/DatabaseServices/Lights/DirectionalLight.ts +++ b/src/DatabaseServices/Lights/DirectionalLight.ts @@ -1,4 +1,4 @@ -import { DirectionalLight as TDirectionalLight, Group, MathUtils, Matrix3, Matrix4, Object3D, Vector2, Vector3 } from "three"; +import { Group, MathUtils, Matrix3, Matrix4, Object3D, DirectionalLight as TDirectionalLight, Vector2, Vector3 } from "three"; import { UpdateDraw } from "../../Common/Status"; import { equaln, equalv3 } from "../../Geometry/GeUtils"; import { RenderType } from "../../GraphicsSystem/RenderType"; @@ -16,7 +16,7 @@ export class DirectionalLight extends Light { protected _Intensity: number = 50; //强度 //光源源角度 0-50 - @AutoRecord LightSourceAngle = 0.5357; + @AutoRecord LightSourceAngle = 0.5; //源软角度角度 @AutoRecord LightSourceSoftAngle = 0; diff --git a/src/UI/Components/RightPanel/RightPanel.less b/src/UI/Components/RightPanel/RightPanel.less index 968565ca2..cb63b24a5 100644 --- a/src/UI/Components/RightPanel/RightPanel.less +++ b/src/UI/Components/RightPanel/RightPanel.less @@ -208,7 +208,11 @@ margin-left: auto; } - :nth-child(2) { + > :nth-child(1) { + margin: 0; + } + + > :nth-child(2) { margin: 0; } } diff --git a/src/UI/Components/RightPanel/SunLightGui.tsx b/src/UI/Components/RightPanel/SunLightGui.tsx index 4a6191eb0..cff12f78b 100644 --- a/src/UI/Components/RightPanel/SunLightGui.tsx +++ b/src/UI/Components/RightPanel/SunLightGui.tsx @@ -416,7 +416,12 @@ export default class SunLightGui extends Component
- + + + { - let v = parseFloat(FixedNotZero(val, 4)); + let v = parseFloat(FixedNotZero(val, 1)); await this.SetSunLightSourceAngle(v); app.Viewer.UpdateRender(); }} @@ -465,7 +470,7 @@ export default class SunLightGui extends Component icon='redo' onClick={async () => { - await this.SetSunLightSourceAngle(0.5357); + await this.SetSunLightSourceAngle(0.5); app.Viewer.UpdateRender(); const KEY = '修改太阳光源角度'; if (CommandState.CommandIng && app.Database.hm.UndoData.CommandName === KEY) diff --git a/src/UI/Components/RightPanel/SunLightStore.ts b/src/UI/Components/RightPanel/SunLightStore.ts index 83de5605b..0e781e674 100644 --- a/src/UI/Components/RightPanel/SunLightStore.ts +++ b/src/UI/Components/RightPanel/SunLightStore.ts @@ -71,6 +71,7 @@ export class SunLightStore this.sunLightIndirectLightingIntensity = light.IndirectLightingIntensity; this.sunLightColorTemperature = light.Temperature; this.sunLightColor = `#${light.Color.getHexString()}`; + this.sunLightSourceAngle = light.LightSourceAngle; let rotateV = light.Position.sub(light.Target).normalize(); let theta = Math.atan2(rotateV.y, rotateV.x) * MathUtils.RAD2DEG;//旋转