!2812 优化:右侧栏光源角功能提示

pull/2797/MERGE
林三 4 months ago committed by ChenX
parent e6982eb69c
commit 6bf37023b0

@ -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;

@ -208,7 +208,11 @@
margin-left: auto;
}
:nth-child(2) {
> :nth-child(1) {
margin: 0;
}
> :nth-child(2) {
margin: 0;
}
}

@ -416,7 +416,12 @@ export default class SunLightGui extends Component
</FormGroup>
<FormGroup>
<div className='sun-light-angle'>
<Label>:</Label>
<Tooltip
content="定向光源的自发光表面相对于接收物而延展的角度,影响半影尺寸"
position='top-left'
>
<Label>:</Label>
</Tooltip>
<INumericInput
min={0}
max={5}
@ -443,7 +448,7 @@ export default class SunLightGui extends Component
value={this.store.sunLightSourceAngle}
onChange={async (val) =>
{
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)

@ -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;//旋转

Loading…
Cancel
Save