|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { DirectionalLight as TDirectionalLight, Group, MathUtils, Matrix3, Matrix4, Object3D, Vector2, Vector3 } from "three";
|
|
|
|
|
import { UpdateDraw } from "../../Common/Status";
|
|
|
|
|
import { equalv3 } from "../../Geometry/GeUtils";
|
|
|
|
|
import { equaln, equalv3 } from "../../Geometry/GeUtils";
|
|
|
|
|
import { RenderType } from "../../GraphicsSystem/RenderType";
|
|
|
|
|
import { AutoRecord } from "../AutoRecord";
|
|
|
|
|
import { Factory } from "../CADFactory";
|
|
|
|
@ -65,6 +65,32 @@ export class DirectionalLight extends Light
|
|
|
|
|
this.Update();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get SunPosition() { return super.Position; }
|
|
|
|
|
set SunPosition(p: Vector3)
|
|
|
|
|
{
|
|
|
|
|
if (
|
|
|
|
|
equaln(p.x, this._Matrix.elements[12])
|
|
|
|
|
&& equaln(p.y, this._Matrix.elements[13])
|
|
|
|
|
&& equaln(p.z, this._Matrix.elements[14])
|
|
|
|
|
)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
|
this._Matrix.setPosition(p);
|
|
|
|
|
this.Update(UpdateDraw.Geometry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get Position() { return super.Position; }
|
|
|
|
|
set Position(p: Vector3)
|
|
|
|
|
{
|
|
|
|
|
console.error("不支持的用法! 错误的设计");
|
|
|
|
|
let bak = this._Target.toArray();
|
|
|
|
|
super.Position = p;
|
|
|
|
|
this._Target.fromArray(bak);
|
|
|
|
|
this.Update(UpdateDraw.Geometry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get WebIntensity()
|
|
|
|
|
{
|
|
|
|
|
let x = this._Intensity / 150;
|
|
|
|
@ -92,7 +118,7 @@ export class DirectionalLight extends Light
|
|
|
|
|
if (indexList[0] === 0)
|
|
|
|
|
this.Position = this.Position.add(vec);
|
|
|
|
|
else
|
|
|
|
|
this.Target = this.Target.add(vec);
|
|
|
|
|
this._Target.add((vec));
|
|
|
|
|
}
|
|
|
|
|
protected InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D
|
|
|
|
|
{
|
|
|
|
|