@archvisioninc/canvas 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1226,7 +1226,8 @@ export const updateLighting = inboundData => {
|
|
|
1226
1226
|
z
|
|
1227
1227
|
} = position;
|
|
1228
1228
|
const angleRad = rotation * Math.PI / 180;
|
|
1229
|
-
|
|
1229
|
+
let distance = light?.distance || Math.sqrt(Math.pow(Math.abs(x), 2) + Math.pow(Math.abs(y), 2) + Math.pow(Math.abs(z), 2));
|
|
1230
|
+
distance = distance > 200 ? 200 : distance;
|
|
1230
1231
|
light.position = newVector(distance * Math.cos(angleRad), distance * Math.tanh(angleRad), distance * Math.sin(angleRad));
|
|
1231
1232
|
light.setDirectionToTarget(newVector(0, 0, 0));
|
|
1232
1233
|
light.rotation = rotation;
|
package/package.json
CHANGED
|
@@ -1219,7 +1219,8 @@ export const updateLighting = inboundData => {
|
|
|
1219
1219
|
const { position } = light;
|
|
1220
1220
|
const { x, y, z } = position;
|
|
1221
1221
|
const angleRad = (rotation * Math.PI) / 180
|
|
1222
|
-
|
|
1222
|
+
let distance = light?.distance || Math.sqrt(Math.pow(Math.abs(x), 2) + Math.pow(Math.abs(y), 2) + Math.pow(Math.abs(z), 2));
|
|
1223
|
+
distance = distance > 200 ? 200 : distance;
|
|
1223
1224
|
light.position = newVector(distance * Math.cos(angleRad), distance * Math.tanh(angleRad), distance * Math.sin(angleRad));
|
|
1224
1225
|
light.setDirectionToTarget(newVector(0, 0, 0));
|
|
1225
1226
|
light.rotation = rotation;
|