@archvisioninc/canvas 3.2.3 → 3.2.5

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.
@@ -1225,6 +1225,7 @@ export const updateLighting = inboundData => {
1225
1225
  y,
1226
1226
  z
1227
1227
  } = position;
1228
+ const angleRad = rotation * Math.PI / 180;
1228
1229
  const distance = light?.distance || Math.sqrt(Math.pow(Math.abs(x), 2) + Math.pow(Math.abs(y), 2) + Math.pow(Math.abs(z), 2));
1229
1230
  light.position = newVector(distance * Math.cos(angleRad), 5, distance * Math.sin(angleRad));
1230
1231
  light.setDirectionToTarget(newVector(0, 0, 0));
@@ -611,6 +611,14 @@ export const buildMaterialsArray = () => {
611
611
  export const buildLightsArray = () => {
612
612
  const lights = scene.lights;
613
613
  return lights.map(light => {
614
+ const {
615
+ position
616
+ } = light;
617
+ const {
618
+ x,
619
+ y,
620
+ z
621
+ } = position;
614
622
  return {
615
623
  ...light.serialize(),
616
624
  rotation: light?.rotation ?? 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archvisioninc/canvas",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "private": false,
5
5
  "main": "dist/Canvas.js",
6
6
  "module": "dist/Canvas.js",
@@ -1218,6 +1218,7 @@ export const updateLighting = inboundData => {
1218
1218
  if (rotation !== undefined) {
1219
1219
  const { position } = light;
1220
1220
  const { x, y, z } = position;
1221
+ const angleRad = (rotation * Math.PI) / 180
1221
1222
  const distance = light?.distance || Math.sqrt(Math.pow(Math.abs(x), 2) + Math.pow(Math.abs(y), 2) + Math.pow(Math.abs(z), 2));
1222
1223
  light.position = newVector(distance * Math.cos(angleRad), 5, distance * Math.sin(angleRad));
1223
1224
  light.setDirectionToTarget(newVector(0, 0, 0));
@@ -669,6 +669,8 @@ export const buildMaterialsArray = () => {
669
669
  export const buildLightsArray = () => {
670
670
  const lights = scene.lights;
671
671
  return lights.map(light => {
672
+ const { position } = light;
673
+ const { x, y, z} = position;
672
674
  return {
673
675
  ...light.serialize(),
674
676
  rotation: light?.rotation ?? 0,