|
|
|
@ -9,6 +9,7 @@ import { Entitys2Data } from "../../../Add-on/ExportData";
|
|
|
|
|
import { app } from "../../../ApplicationServices/Application";
|
|
|
|
|
import { ResourcesCDN_HOST } from "../../../Common/HostUrl";
|
|
|
|
|
import { KeyBoard } from "../../../Common/KeyEnum";
|
|
|
|
|
import { UpdateDraw } from "../../../Common/Status";
|
|
|
|
|
import { FixedNotZero } from "../../../Common/Utils";
|
|
|
|
|
import { DirectionalLight } from "../../../DatabaseServices/Lights/DirectionalLight";
|
|
|
|
|
import { Light } from "../../../DatabaseServices/Lights/Light";
|
|
|
|
@ -80,10 +81,17 @@ export class SpotLightModel extends React.Component<{ store: LightStore; configS
|
|
|
|
|
}
|
|
|
|
|
if (isDirection)
|
|
|
|
|
{
|
|
|
|
|
(light as SpotLight | DirectionalLight).Target = ptRes.Point;
|
|
|
|
|
app.Editor.UpdateScreen();
|
|
|
|
|
this._Target = ptRes.Point.clone().sub(this.props.store.currentSelectEnt.Position).normalize().ceil().toArray().toString();
|
|
|
|
|
|
|
|
|
|
if (light instanceof SpotLight || light instanceof DirectionalLight)
|
|
|
|
|
{
|
|
|
|
|
light.Target = ptRes.Point;
|
|
|
|
|
this._Target = ptRes.Point.clone().sub(this.props.store.currentSelectEnt.Position).normalize().ceil().toArray().toString();
|
|
|
|
|
light.Update(UpdateDraw.Matrix);
|
|
|
|
|
}
|
|
|
|
|
else if (light instanceof RectAreaLight)
|
|
|
|
|
{
|
|
|
|
|
light.Target = ptRes.Point;
|
|
|
|
|
light.lookAtTarget();
|
|
|
|
|
}
|
|
|
|
|
if (userConfig.synchronousEnable)
|
|
|
|
|
app.WebSocket.Send(JSON.stringify(Entitys2Data([light])));
|
|
|
|
|
}
|
|
|
|
|