@configura/babylon-view 2.1.0-alpha.2 → 2.1.0

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.
Files changed (134) hide show
  1. package/.eslintrc.json +5 -5
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/animation/AnimatableObject.d.ts +8 -8
  5. package/dist/animation/AnimatableObject.js +3 -3
  6. package/dist/animation/animator/Animator.d.ts +33 -33
  7. package/dist/animation/animator/Animator.js +58 -58
  8. package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
  9. package/dist/animation/animator/AnimatorEasing.js +31 -31
  10. package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
  11. package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
  12. package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
  13. package/dist/animation/animator/AnimatorHighlight.js +32 -32
  14. package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
  15. package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
  16. package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
  17. package/dist/animation/animator/AnimatorQueue.js +57 -57
  18. package/dist/animation/animator/AnimatorScale.d.ts +8 -8
  19. package/dist/animation/animator/AnimatorScale.js +13 -13
  20. package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
  21. package/dist/animation/animator/AnimatorSpin.js +13 -13
  22. package/dist/animation/animator/EasingFunctions.d.ts +35 -35
  23. package/dist/animation/animator/EasingFunctions.js +137 -137
  24. package/dist/animation/coordinator/Coordinator.d.ts +28 -28
  25. package/dist/animation/coordinator/Coordinator.js +53 -53
  26. package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
  27. package/dist/animation/coordinator/CoordinatorDropAndSpin.js +138 -138
  28. package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
  29. package/dist/animation/coordinator/CoordinatorIdentity.js +14 -14
  30. package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
  31. package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
  32. package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
  33. package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
  34. package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
  35. package/dist/animation/coordinator/CoordinatorPulseBounce.js +35 -35
  36. package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
  37. package/dist/animation/coordinator/CoordinatorPulseHighlight.js +29 -29
  38. package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
  39. package/dist/animation/coordinator/CoordinatorPulseInflate.js +23 -23
  40. package/dist/camera/CameraCreator.d.ts +5 -5
  41. package/dist/camera/CameraCreator.js +4 -4
  42. package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -26
  43. package/dist/camera/CfgArcRotateCameraPointersInput.js +266 -266
  44. package/dist/camera/CfgOrbitalCamera.d.ts +76 -76
  45. package/dist/camera/CfgOrbitalCamera.js +281 -281
  46. package/dist/camera/CfgOrbitalCameraControlProps.d.ts +14 -14
  47. package/dist/camera/CfgOrbitalCameraControlProps.js +7 -7
  48. package/dist/camera/GradingApplier.d.ts +3 -3
  49. package/dist/camera/GradingApplier.js +48 -48
  50. package/dist/engine/EngineCreator.d.ts +3 -3
  51. package/dist/engine/EngineCreator.js +10 -10
  52. package/dist/geometry/CfgGeometry.d.ts +29 -29
  53. package/dist/geometry/CfgGeometry.js +146 -146
  54. package/dist/geometry/CfgMesh.d.ts +10 -10
  55. package/dist/geometry/CfgMesh.js +38 -38
  56. package/dist/geometry/geoSplitter.d.ts +8 -8
  57. package/dist/geometry/geoSplitter.js +192 -192
  58. package/dist/geometry/stretch/CfgMorphTarget.d.ts +15 -15
  59. package/dist/geometry/stretch/CfgMorphTarget.js +65 -65
  60. package/dist/geometry/stretch/CfgStretchData.d.ts +116 -116
  61. package/dist/geometry/stretch/CfgStretchData.js +347 -350
  62. package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +16 -16
  63. package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -95
  64. package/dist/index.d.ts +16 -16
  65. package/dist/index.js +16 -16
  66. package/dist/io/CfgHistoryToCameraConfConnector.d.ts +31 -31
  67. package/dist/io/CfgHistoryToCameraConfConnector.js +90 -90
  68. package/dist/io/CfgIOCameraConfConnector.d.ts +35 -35
  69. package/dist/io/CfgIOCameraConfConnector.js +81 -81
  70. package/dist/io/CfgObservableStateToCameraConfConnector.d.ts +10 -10
  71. package/dist/io/CfgObservableStateToCameraConfConnector.js +11 -11
  72. package/dist/io/CfgWindowMessageToCameraConfConnector.d.ts +10 -10
  73. package/dist/io/CfgWindowMessageToCameraConfConnector.js +11 -11
  74. package/dist/light/CfgDirectionalLight.d.ts +8 -8
  75. package/dist/light/CfgDirectionalLight.js +18 -18
  76. package/dist/light/CfgHemisphericLight.d.ts +7 -7
  77. package/dist/light/CfgHemisphericLight.js +17 -17
  78. package/dist/light/CfgPointLight.d.ts +8 -8
  79. package/dist/light/CfgPointLight.js +18 -18
  80. package/dist/light/DefaultLightRig.d.ts +19 -19
  81. package/dist/light/DefaultLightRig.js +77 -77
  82. package/dist/light/LightRigCreator.d.ts +9 -9
  83. package/dist/light/LightRigCreator.js +3 -3
  84. package/dist/material/CfgMaterial.d.ts +68 -68
  85. package/dist/material/CfgMaterial.js +482 -482
  86. package/dist/material/DummyMaterialCreator.d.ts +4 -4
  87. package/dist/material/DummyMaterialCreator.js +15 -15
  88. package/dist/material/material.d.ts +18 -18
  89. package/dist/material/material.js +128 -128
  90. package/dist/material/texture.d.ts +14 -14
  91. package/dist/material/texture.js +306 -306
  92. package/dist/nodes/CfgContentRootNode.d.ts +19 -19
  93. package/dist/nodes/CfgContentRootNode.js +75 -75
  94. package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -55
  95. package/dist/nodes/CfgDeferredMeshNode.js +378 -378
  96. package/dist/nodes/CfgProductNode.d.ts +127 -127
  97. package/dist/nodes/CfgProductNode.js +598 -598
  98. package/dist/nodes/CfgSymNode.d.ts +50 -50
  99. package/dist/nodes/CfgSymNode.js +249 -249
  100. package/dist/nodes/CfgSymRootNode.d.ts +45 -45
  101. package/dist/nodes/CfgSymRootNode.js +239 -229
  102. package/dist/nodes/CfgTransformNode.d.ts +33 -33
  103. package/dist/nodes/CfgTransformNode.js +83 -83
  104. package/dist/scene/SceneCreator.d.ts +6 -6
  105. package/dist/scene/SceneCreator.js +22 -22
  106. package/dist/utilities/CfgBoundingBox.d.ts +21 -21
  107. package/dist/utilities/CfgBoundingBox.js +81 -81
  108. package/dist/utilities/anchor/anchor.d.ts +50 -50
  109. package/dist/utilities/anchor/anchor.js +133 -133
  110. package/dist/utilities/anchor/anchorMap.d.ts +20 -20
  111. package/dist/utilities/anchor/anchorMap.js +111 -111
  112. package/dist/utilities/utilities3D.d.ts +70 -70
  113. package/dist/utilities/utilities3D.js +265 -265
  114. package/dist/utilities/utilitiesColor.d.ts +18 -18
  115. package/dist/utilities/utilitiesColor.js +50 -50
  116. package/dist/utilities/utilitiesImage.d.ts +6 -6
  117. package/dist/utilities/utilitiesImage.js +107 -107
  118. package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -7
  119. package/dist/utilities/utilitiesSymRootIdentifier.js +26 -26
  120. package/dist/view/BaseView.d.ts +78 -78
  121. package/dist/view/BaseView.js +303 -303
  122. package/dist/view/BaseViewConfiguration.d.ts +32 -32
  123. package/dist/view/BaseViewConfiguration.js +10 -10
  124. package/dist/view/RenderEnv.d.ts +43 -43
  125. package/dist/view/RenderEnv.js +7 -7
  126. package/dist/view/SingleProductDefaultCameraView.d.ts +38 -38
  127. package/dist/view/SingleProductDefaultCameraView.js +149 -149
  128. package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +44 -44
  129. package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
  130. package/dist/view/SingleProductView.d.ts +44 -44
  131. package/dist/view/SingleProductView.js +212 -212
  132. package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
  133. package/dist/view/SingleProductViewConfiguration.js +19 -19
  134. package/package.json +5 -5
@@ -1,17 +1,17 @@
1
- import { UVMapper } from "@configura/web-core/dist/cm/core3D/uvmapper/UVMapper";
2
- import { Logger } from "@configura/web-utilities";
3
- import { CfgStretchData } from "./CfgStretchData.js";
4
- /**
5
- * Contains positions which are where stretching to twice the referenceLength would place them.
6
- * This is raw data for CfgMorphTarget.
7
- */
8
- export declare class CfgMorphTwiceStretchedGeometry {
9
- readonly id: string;
10
- readonly stretchData: CfgStretchData;
11
- readonly pos: Float32Array;
12
- readonly uvs: Float32Array | undefined;
13
- static make(logger: Logger, uvMapper: UVMapper | undefined, stretchData: CfgStretchData, pos: Float32Array, normals: Float32Array | undefined, uvs: Float32Array | undefined): CfgMorphTwiceStretchedGeometry;
14
- private constructor();
15
- cloneWithSubset(indices: Uint32Array | number[]): CfgMorphTwiceStretchedGeometry;
16
- }
1
+ import { UVMapper } from "@configura/web-core/dist/cm/core3D/uvmapper/UVMapper";
2
+ import { Logger } from "@configura/web-utilities";
3
+ import { CfgStretchData } from "./CfgStretchData.js";
4
+ /**
5
+ * Contains positions which are where stretching to twice the referenceLength would place them.
6
+ * This is raw data for CfgMorphTarget.
7
+ */
8
+ export declare class CfgMorphTwiceStretchedGeometry {
9
+ readonly id: string;
10
+ readonly stretchData: CfgStretchData;
11
+ readonly pos: Float32Array;
12
+ readonly uvs: Float32Array | undefined;
13
+ static make(logger: Logger, uvMapper: UVMapper | undefined, stretchData: CfgStretchData, pos: Float32Array, normals: Float32Array | undefined, uvs: Float32Array | undefined): CfgMorphTwiceStretchedGeometry;
14
+ private constructor();
15
+ cloneWithSubset(indices: Uint32Array | number[]): CfgMorphTwiceStretchedGeometry;
16
+ }
17
17
  //# sourceMappingURL=CfgStretchMorphGeometry.d.ts.map
@@ -1,95 +1,95 @@
1
- import { Vector3 } from "@babylonjs/core";
2
- import { makeIndexMap } from "../CfgGeometry.js";
3
- /**
4
- * CET has a built in error in how bounds are calculated. I will add 1mm to each side of the
5
- * bounding box. This gives pronounced errors on small objects, less so on larger objects. To be
6
- * consistent with CET we also add 1 mm. Remove this when this is corrected in CET.
7
- */
8
- const CET_COMPENSATION = 0.001;
9
- /**
10
- * Contains positions which are where stretching to twice the referenceLength would place them.
11
- * This is raw data for CfgMorphTarget.
12
- */
13
- export class CfgMorphTwiceStretchedGeometry {
14
- constructor(id, stretchData, pos, uvs) {
15
- this.id = id;
16
- this.stretchData = stretchData;
17
- this.pos = pos;
18
- this.uvs = uvs;
19
- }
20
- static make(logger, uvMapper, stretchData, pos, normals, uvs) {
21
- const posLength = pos.length;
22
- const stretchedPos = new Float32Array(posLength);
23
- const min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
24
- const max = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
25
- const stretchedMin = [
26
- Number.POSITIVE_INFINITY,
27
- Number.POSITIVE_INFINITY,
28
- Number.POSITIVE_INFINITY,
29
- ];
30
- const stretchedMax = [
31
- Number.NEGATIVE_INFINITY,
32
- Number.NEGATIVE_INFINITY,
33
- Number.NEGATIVE_INFINITY,
34
- ];
35
- const c = new Vector3();
36
- let p = 0;
37
- for (let i = 0; i < posLength; i += 3) {
38
- for (let axis = 0; axis < 3; axis++) {
39
- p = pos[i + axis];
40
- min[axis] = Math.min(min[axis], p);
41
- max[axis] = Math.max(max[axis], p);
42
- }
43
- c.fromArray(pos, i);
44
- c.addInPlace(stretchData.stretchPointToTwice(c));
45
- c.toArray(stretchedPos, i);
46
- for (let axis = 0; axis < 3; axis++) {
47
- p = stretchedPos[i + axis];
48
- stretchedMin[axis] = Math.min(stretchedMin[axis], p);
49
- stretchedMax[axis] = Math.max(stretchedMax[axis], p);
50
- }
51
- }
52
- for (let axis = 0; axis < 3; axis++) {
53
- min[axis] = min[axis] - CET_COMPENSATION;
54
- max[axis] = max[axis] + CET_COMPENSATION;
55
- stretchedMin[axis] = stretchedMin[axis] - CET_COMPENSATION;
56
- stretchedMax[axis] = stretchedMax[axis] + CET_COMPENSATION;
57
- }
58
- const size = max.map((m, axis) => m - min[axis]);
59
- const stretchedSize = stretchedMax.map((m, axis) => m - stretchedMin[axis]);
60
- let stretchedUvs = uvs;
61
- if (uvMapper !== undefined && normals !== undefined && uvs !== undefined) {
62
- stretchedUvs = uvMapper.createUVCoordinatesForStretched(logger, stretchedPos, {
63
- min: stretchedMin,
64
- max: stretchedMax,
65
- size: stretchedSize,
66
- }, normals, pos, {
67
- min,
68
- max,
69
- size,
70
- }, uvs);
71
- }
72
- return new this(stretchData.measureParam, stretchData, stretchedPos, stretchedUvs);
73
- }
74
- cloneWithSubset(indices) {
75
- const { indexMap } = makeIndexMap(indices);
76
- const count = indexMap.size;
77
- const thisPos = this.pos;
78
- const newPos = new Float32Array(count * 3);
79
- for (const [oldIndex, newIndex] of indexMap) {
80
- newPos[newIndex * 3] = thisPos[oldIndex * 3];
81
- newPos[newIndex * 3 + 1] = thisPos[oldIndex * 3 + 1];
82
- newPos[newIndex * 3 + 2] = thisPos[oldIndex * 3 + 2];
83
- }
84
- const thisUvs = this.uvs;
85
- let newUvs = undefined;
86
- if (thisUvs !== undefined) {
87
- newUvs = new Float32Array(count * 2);
88
- for (const [oldIndex, newIndex] of indexMap) {
89
- newUvs[newIndex * 2] = thisUvs[oldIndex * 2];
90
- newUvs[newIndex * 2 + 1] = thisUvs[oldIndex * 2 + 1];
91
- }
92
- }
93
- return new CfgMorphTwiceStretchedGeometry(this.id + ` (subset ${indices.length})`, this.stretchData, newPos, newUvs);
94
- }
95
- }
1
+ import { Vector3 } from "@babylonjs/core";
2
+ import { makeIndexMap } from "../CfgGeometry.js";
3
+ /**
4
+ * CET has a built in error in how bounds are calculated. I will add 1mm to each side of the
5
+ * bounding box. This gives pronounced errors on small objects, less so on larger objects. To be
6
+ * consistent with CET we also add 1 mm. Remove this when this is corrected in CET.
7
+ */
8
+ const CET_COMPENSATION = 0.001;
9
+ /**
10
+ * Contains positions which are where stretching to twice the referenceLength would place them.
11
+ * This is raw data for CfgMorphTarget.
12
+ */
13
+ export class CfgMorphTwiceStretchedGeometry {
14
+ constructor(id, stretchData, pos, uvs) {
15
+ this.id = id;
16
+ this.stretchData = stretchData;
17
+ this.pos = pos;
18
+ this.uvs = uvs;
19
+ }
20
+ static make(logger, uvMapper, stretchData, pos, normals, uvs) {
21
+ const posLength = pos.length;
22
+ const stretchedPos = new Float32Array(posLength);
23
+ const min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
24
+ const max = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
25
+ const stretchedMin = [
26
+ Number.POSITIVE_INFINITY,
27
+ Number.POSITIVE_INFINITY,
28
+ Number.POSITIVE_INFINITY,
29
+ ];
30
+ const stretchedMax = [
31
+ Number.NEGATIVE_INFINITY,
32
+ Number.NEGATIVE_INFINITY,
33
+ Number.NEGATIVE_INFINITY,
34
+ ];
35
+ const c = new Vector3();
36
+ let p = 0;
37
+ for (let i = 0; i < posLength; i += 3) {
38
+ for (let axis = 0; axis < 3; axis++) {
39
+ p = pos[i + axis];
40
+ min[axis] = Math.min(min[axis], p);
41
+ max[axis] = Math.max(max[axis], p);
42
+ }
43
+ c.fromArray(pos, i);
44
+ c.addInPlace(stretchData.stretchPointToTwice(c));
45
+ c.toArray(stretchedPos, i);
46
+ for (let axis = 0; axis < 3; axis++) {
47
+ p = stretchedPos[i + axis];
48
+ stretchedMin[axis] = Math.min(stretchedMin[axis], p);
49
+ stretchedMax[axis] = Math.max(stretchedMax[axis], p);
50
+ }
51
+ }
52
+ for (let axis = 0; axis < 3; axis++) {
53
+ min[axis] = min[axis] - CET_COMPENSATION;
54
+ max[axis] = max[axis] + CET_COMPENSATION;
55
+ stretchedMin[axis] = stretchedMin[axis] - CET_COMPENSATION;
56
+ stretchedMax[axis] = stretchedMax[axis] + CET_COMPENSATION;
57
+ }
58
+ const size = max.map((m, axis) => m - min[axis]);
59
+ const stretchedSize = stretchedMax.map((m, axis) => m - stretchedMin[axis]);
60
+ let stretchedUvs = uvs;
61
+ if (uvMapper !== undefined && normals !== undefined && uvs !== undefined) {
62
+ stretchedUvs = uvMapper.createUVCoordinatesForStretched(logger, stretchedPos, {
63
+ min: stretchedMin,
64
+ max: stretchedMax,
65
+ size: stretchedSize,
66
+ }, normals, pos, {
67
+ min,
68
+ max,
69
+ size,
70
+ }, uvs);
71
+ }
72
+ return new this(stretchData.measureParam, stretchData, stretchedPos, stretchedUvs);
73
+ }
74
+ cloneWithSubset(indices) {
75
+ const { indexMap } = makeIndexMap(indices);
76
+ const count = indexMap.size;
77
+ const thisPos = this.pos;
78
+ const newPos = new Float32Array(count * 3);
79
+ for (const [oldIndex, newIndex] of indexMap) {
80
+ newPos[newIndex * 3] = thisPos[oldIndex * 3];
81
+ newPos[newIndex * 3 + 1] = thisPos[oldIndex * 3 + 1];
82
+ newPos[newIndex * 3 + 2] = thisPos[oldIndex * 3 + 2];
83
+ }
84
+ const thisUvs = this.uvs;
85
+ let newUvs = undefined;
86
+ if (thisUvs !== undefined) {
87
+ newUvs = new Float32Array(count * 2);
88
+ for (const [oldIndex, newIndex] of indexMap) {
89
+ newUvs[newIndex * 2] = thisUvs[oldIndex * 2];
90
+ newUvs[newIndex * 2 + 1] = thisUvs[oldIndex * 2 + 1];
91
+ }
92
+ }
93
+ return new CfgMorphTwiceStretchedGeometry(this.id + ` (subset ${indices.length})`, this.stretchData, newPos, newUvs);
94
+ }
95
+ }
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export * from "./animation/coordinator/CoordinatorDropAndSpin.js";
2
- export * from "./animation/coordinator/CoordinatorPulseBounce.js";
3
- export * from "./animation/coordinator/CoordinatorPulseHighlight.js";
4
- export * from "./animation/coordinator/CoordinatorPulseInflate.js";
5
- export * from "./camera/CfgOrbitalCameraControlProps.js";
6
- export * from "./io/CfgHistoryToCameraConfConnector.js";
7
- export * from "./io/CfgObservableStateToCameraConfConnector.js";
8
- export * from "./io/CfgWindowMessageToCameraConfConnector.js";
9
- export * from "./utilities/utilities3D.js";
10
- export * from "./view/BaseView.js";
11
- export * from "./view/BaseViewConfiguration.js";
12
- export * from "./view/RenderEnv.js";
13
- export * from "./view/SingleProductDefaultCameraView.js";
14
- export * from "./view/SingleProductDefaultCameraViewConfiguration.js";
15
- export * from "./view/SingleProductView.js";
16
- export * from "./view/SingleProductViewConfiguration.js";
1
+ export * from "./animation/coordinator/CoordinatorDropAndSpin.js";
2
+ export * from "./animation/coordinator/CoordinatorPulseBounce.js";
3
+ export * from "./animation/coordinator/CoordinatorPulseHighlight.js";
4
+ export * from "./animation/coordinator/CoordinatorPulseInflate.js";
5
+ export * from "./camera/CfgOrbitalCameraControlProps.js";
6
+ export * from "./io/CfgHistoryToCameraConfConnector.js";
7
+ export * from "./io/CfgObservableStateToCameraConfConnector.js";
8
+ export * from "./io/CfgWindowMessageToCameraConfConnector.js";
9
+ export * from "./utilities/utilities3D.js";
10
+ export * from "./view/BaseView.js";
11
+ export * from "./view/BaseViewConfiguration.js";
12
+ export * from "./view/RenderEnv.js";
13
+ export * from "./view/SingleProductDefaultCameraView.js";
14
+ export * from "./view/SingleProductDefaultCameraViewConfiguration.js";
15
+ export * from "./view/SingleProductView.js";
16
+ export * from "./view/SingleProductViewConfiguration.js";
17
17
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- export * from "./animation/coordinator/CoordinatorDropAndSpin.js";
2
- export * from "./animation/coordinator/CoordinatorPulseBounce.js";
3
- export * from "./animation/coordinator/CoordinatorPulseHighlight.js";
4
- export * from "./animation/coordinator/CoordinatorPulseInflate.js";
5
- export * from "./camera/CfgOrbitalCameraControlProps.js";
6
- export * from "./io/CfgHistoryToCameraConfConnector.js";
7
- export * from "./io/CfgObservableStateToCameraConfConnector.js";
8
- export * from "./io/CfgWindowMessageToCameraConfConnector.js";
9
- export * from "./utilities/utilities3D.js";
10
- export * from "./view/BaseView.js";
11
- export * from "./view/BaseViewConfiguration.js";
12
- export * from "./view/RenderEnv.js";
13
- export * from "./view/SingleProductDefaultCameraView.js";
14
- export * from "./view/SingleProductDefaultCameraViewConfiguration.js";
15
- export * from "./view/SingleProductView.js";
16
- export * from "./view/SingleProductViewConfiguration.js";
1
+ export * from "./animation/coordinator/CoordinatorDropAndSpin.js";
2
+ export * from "./animation/coordinator/CoordinatorPulseBounce.js";
3
+ export * from "./animation/coordinator/CoordinatorPulseHighlight.js";
4
+ export * from "./animation/coordinator/CoordinatorPulseInflate.js";
5
+ export * from "./camera/CfgOrbitalCameraControlProps.js";
6
+ export * from "./io/CfgHistoryToCameraConfConnector.js";
7
+ export * from "./io/CfgObservableStateToCameraConfConnector.js";
8
+ export * from "./io/CfgWindowMessageToCameraConfConnector.js";
9
+ export * from "./utilities/utilities3D.js";
10
+ export * from "./view/BaseView.js";
11
+ export * from "./view/BaseViewConfiguration.js";
12
+ export * from "./view/RenderEnv.js";
13
+ export * from "./view/SingleProductDefaultCameraView.js";
14
+ export * from "./view/SingleProductDefaultCameraViewConfiguration.js";
15
+ export * from "./view/SingleProductView.js";
16
+ export * from "./view/SingleProductViewConfiguration.js";
@@ -1,32 +1,32 @@
1
- import { CfgHistoryManager, CfgHistoryManagerSendData, HistoryMode } from "@configura/web-api";
2
- import { Observable } from "@configura/web-utilities";
3
- import { CfgOrbitalCameraControlProps } from "../camera/CfgOrbitalCameraControlProps.js";
4
- import { CfgCameraConfMessage, CfgIOCameraConfConnector } from "./CfgIOCameraConfConnector.js";
5
- /**
6
- * Instantiating this will make the browser history (and URL) update with the orientation
7
- * of the Camera. It always use replace in the history API, so it will never add frames
8
- * to the history stack.
9
- */
10
- export declare class CfgHistoryToCameraConfConnector extends CfgIOCameraConfConnector<CfgHistoryManagerSendData<CfgCameraConfMessage>> {
11
- private readonly defaults;
12
- private readonly _mode;
13
- private readonly _qsKeyYaw;
14
- private readonly _qsKeyPitch;
15
- private readonly _qsKeyDistance;
16
- /**
17
- * @param defaults The default camera settings.
18
- * @param cameraControl Connects with the Camera.
19
- * @param mode
20
- * @param qsKeyYaw The Query String key for Yaw.
21
- * @param qsKeyPitch The Query String key for Pitch.
22
- * @param qsKeyDistance The Query String key for Distance.
23
- * @returns The instance and the initial camera orientation.
24
- */
25
- static make(manager: CfgHistoryManager, defaults: CfgOrbitalCameraControlProps, cameraControl: Observable<CfgOrbitalCameraControlProps>, mode: HistoryMode, qsKeyYaw?: string, qsKeyPitch?: string, qsKeyDistance?: string): {
26
- instance: CfgHistoryToCameraConfConnector;
27
- initial: CfgOrbitalCameraControlProps;
28
- };
29
- private constructor();
30
- protected makeSendData(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgHistoryManagerSendData<CfgCameraConfMessage>;
31
- }
1
+ import { CfgHistoryManager, CfgHistoryManagerSendData, HistoryMode } from "@configura/web-api";
2
+ import { Observable } from "@configura/web-utilities";
3
+ import { CfgOrbitalCameraControlProps } from "../camera/CfgOrbitalCameraControlProps.js";
4
+ import { CfgCameraConfMessage, CfgIOCameraConfConnector } from "./CfgIOCameraConfConnector.js";
5
+ /**
6
+ * Instantiating this will make the browser history (and URL) update with the orientation
7
+ * of the Camera. It always use replace in the history API, so it will never add frames
8
+ * to the history stack.
9
+ */
10
+ export declare class CfgHistoryToCameraConfConnector extends CfgIOCameraConfConnector<CfgHistoryManagerSendData<CfgCameraConfMessage>> {
11
+ private readonly defaults;
12
+ private readonly _mode;
13
+ private readonly _qsKeyYaw;
14
+ private readonly _qsKeyPitch;
15
+ private readonly _qsKeyDistance;
16
+ /**
17
+ * @param defaults The default camera settings.
18
+ * @param cameraControl Connects with the Camera.
19
+ * @param mode
20
+ * @param qsKeyYaw The Query String key for Yaw.
21
+ * @param qsKeyPitch The Query String key for Pitch.
22
+ * @param qsKeyDistance The Query String key for Distance.
23
+ * @returns The instance and the initial camera orientation.
24
+ */
25
+ static make(manager: CfgHistoryManager, defaults: CfgOrbitalCameraControlProps, cameraControl: Observable<CfgOrbitalCameraControlProps>, mode: HistoryMode, qsKeyYaw?: string, qsKeyPitch?: string, qsKeyDistance?: string): {
26
+ instance: CfgHistoryToCameraConfConnector;
27
+ initial: CfgOrbitalCameraControlProps;
28
+ };
29
+ private constructor();
30
+ protected makeSendData(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgHistoryManagerSendData<CfgCameraConfMessage>;
31
+ }
32
32
  //# sourceMappingURL=CfgHistoryToCameraConfConnector.d.ts.map
@@ -1,90 +1,90 @@
1
- import { CfgHistoryManager } from "@configura/web-api";
2
- import { degToRad, radToDeg } from "@configura/web-utilities";
3
- import { CfgIOCameraConfConnector, STAGE_CAMERA_CONF_MESSAGE_KEY, } from "./CfgIOCameraConfConnector.js";
4
- const YAW_QS_KEY = "stageyaw";
5
- const PITCH_QS_KEY = "stagepitch";
6
- const DISTANCE_QS_KEY = "stagedistance";
7
- /**
8
- * @returns if the key is set in qsMap return the value as a number, or else undefined
9
- */
10
- const qsAsNumber = (qsMap, key) => {
11
- const asString = qsMap.get(key);
12
- if (asString === undefined) {
13
- return undefined;
14
- }
15
- const asNumber = parseFloat(asString);
16
- if (!isFinite(asNumber)) {
17
- return undefined;
18
- }
19
- return asNumber;
20
- };
21
- /**
22
- * If the number is set, round it and add to the map
23
- */
24
- const addToMapAndRound = (map, key, value, def) => {
25
- if (value === undefined || value === def) {
26
- map.set(key, undefined);
27
- return;
28
- }
29
- const timesHundredString = `${Math.round(100 * value)}`;
30
- const decimalPlace = timesHundredString.length - 2;
31
- map.set(key, `${timesHundredString.substring(0, decimalPlace)}.${timesHundredString.substring(decimalPlace)}`);
32
- };
33
- const degToRadOrUndefined = (v) => v && degToRad(v);
34
- const radToDegOrUndefined = (v) => v && radToDeg(v);
35
- /**
36
- * Instantiating this will make the browser history (and URL) update with the orientation
37
- * of the Camera. It always use replace in the history API, so it will never add frames
38
- * to the history stack.
39
- */
40
- export class CfgHistoryToCameraConfConnector extends CfgIOCameraConfConnector {
41
- constructor(manager, defaults, initial, cameraControl, _mode, _qsKeyYaw, _qsKeyPitch, _qsKeyDistance) {
42
- super(manager, initial, cameraControl);
43
- this.defaults = defaults;
44
- this._mode = _mode;
45
- this._qsKeyYaw = _qsKeyYaw;
46
- this._qsKeyPitch = _qsKeyPitch;
47
- this._qsKeyDistance = _qsKeyDistance;
48
- }
49
- /**
50
- * @param defaults The default camera settings.
51
- * @param cameraControl Connects with the Camera.
52
- * @param mode
53
- * @param qsKeyYaw The Query String key for Yaw.
54
- * @param qsKeyPitch The Query String key for Pitch.
55
- * @param qsKeyDistance The Query String key for Distance.
56
- * @returns The instance and the initial camera orientation.
57
- */
58
- static make(manager, defaults, cameraControl, mode, qsKeyYaw = YAW_QS_KEY, qsKeyPitch = PITCH_QS_KEY, qsKeyDistance = DISTANCE_QS_KEY) {
59
- var _a, _b;
60
- const qsKeyValues = CfgHistoryManager.currentQsKeyValues();
61
- // First try to use the state, if that doesn't work use the query string
62
- let initial;
63
- const initialMessage = CfgHistoryManager.getMessageFromCurrentHistoryState(STAGE_CAMERA_CONF_MESSAGE_KEY);
64
- if (initialMessage !== undefined) {
65
- initial = initialMessage.cameraConf;
66
- }
67
- else {
68
- initial = {
69
- yaw: (_a = degToRadOrUndefined(qsAsNumber(qsKeyValues, qsKeyYaw))) !== null && _a !== void 0 ? _a : defaults.yaw,
70
- pitch: (_b = degToRadOrUndefined(qsAsNumber(qsKeyValues, qsKeyPitch))) !== null && _b !== void 0 ? _b : defaults.pitch,
71
- distance: qsAsNumber(qsKeyValues, qsKeyDistance !== null && qsKeyDistance !== void 0 ? qsKeyDistance : defaults.distance),
72
- };
73
- }
74
- const instance = new CfgHistoryToCameraConfConnector(manager, defaults, initial, cameraControl, mode, qsKeyYaw, qsKeyPitch, qsKeyDistance);
75
- return { instance, initial };
76
- }
77
- makeSendData(cameraConf, initial) {
78
- const qsKeyValues = new Map();
79
- if (!initial) {
80
- addToMapAndRound(qsKeyValues, this._qsKeyYaw, radToDegOrUndefined(cameraConf.yaw), radToDegOrUndefined(this.defaults.yaw));
81
- addToMapAndRound(qsKeyValues, this._qsKeyPitch, radToDegOrUndefined(cameraConf.pitch), radToDegOrUndefined(this.defaults.pitch));
82
- addToMapAndRound(qsKeyValues, this._qsKeyDistance, cameraConf.distanceWasAutoSet ? undefined : cameraConf.distance, this.defaults.distance);
83
- }
84
- return {
85
- message: CfgIOCameraConfConnector.makeMessage(cameraConf, initial),
86
- qsKeyValues,
87
- mode: this._mode,
88
- };
89
- }
90
- }
1
+ import { CfgHistoryManager } from "@configura/web-api";
2
+ import { degToRad, radToDeg } from "@configura/web-utilities";
3
+ import { CfgIOCameraConfConnector, STAGE_CAMERA_CONF_MESSAGE_KEY, } from "./CfgIOCameraConfConnector.js";
4
+ const YAW_QS_KEY = "stageyaw";
5
+ const PITCH_QS_KEY = "stagepitch";
6
+ const DISTANCE_QS_KEY = "stagedistance";
7
+ /**
8
+ * @returns if the key is set in qsMap return the value as a number, or else undefined
9
+ */
10
+ const qsAsNumber = (qsMap, key) => {
11
+ const asString = qsMap.get(key);
12
+ if (asString === undefined) {
13
+ return undefined;
14
+ }
15
+ const asNumber = parseFloat(asString);
16
+ if (!isFinite(asNumber)) {
17
+ return undefined;
18
+ }
19
+ return asNumber;
20
+ };
21
+ /**
22
+ * If the number is set, round it and add to the map
23
+ */
24
+ const addToMapAndRound = (map, key, value, def) => {
25
+ if (value === undefined || value === def) {
26
+ map.set(key, undefined);
27
+ return;
28
+ }
29
+ const timesHundredString = `${Math.round(100 * value)}`;
30
+ const decimalPlace = timesHundredString.length - 2;
31
+ map.set(key, `${timesHundredString.substring(0, decimalPlace)}.${timesHundredString.substring(decimalPlace)}`);
32
+ };
33
+ const degToRadOrUndefined = (v) => v && degToRad(v);
34
+ const radToDegOrUndefined = (v) => v && radToDeg(v);
35
+ /**
36
+ * Instantiating this will make the browser history (and URL) update with the orientation
37
+ * of the Camera. It always use replace in the history API, so it will never add frames
38
+ * to the history stack.
39
+ */
40
+ export class CfgHistoryToCameraConfConnector extends CfgIOCameraConfConnector {
41
+ constructor(manager, defaults, initial, cameraControl, _mode, _qsKeyYaw, _qsKeyPitch, _qsKeyDistance) {
42
+ super(manager, initial, cameraControl);
43
+ this.defaults = defaults;
44
+ this._mode = _mode;
45
+ this._qsKeyYaw = _qsKeyYaw;
46
+ this._qsKeyPitch = _qsKeyPitch;
47
+ this._qsKeyDistance = _qsKeyDistance;
48
+ }
49
+ /**
50
+ * @param defaults The default camera settings.
51
+ * @param cameraControl Connects with the Camera.
52
+ * @param mode
53
+ * @param qsKeyYaw The Query String key for Yaw.
54
+ * @param qsKeyPitch The Query String key for Pitch.
55
+ * @param qsKeyDistance The Query String key for Distance.
56
+ * @returns The instance and the initial camera orientation.
57
+ */
58
+ static make(manager, defaults, cameraControl, mode, qsKeyYaw = YAW_QS_KEY, qsKeyPitch = PITCH_QS_KEY, qsKeyDistance = DISTANCE_QS_KEY) {
59
+ var _a, _b;
60
+ const qsKeyValues = CfgHistoryManager.currentQsKeyValues();
61
+ // First try to use the state, if that doesn't work use the query string
62
+ let initial;
63
+ const initialMessage = CfgHistoryManager.getMessageFromCurrentHistoryState(STAGE_CAMERA_CONF_MESSAGE_KEY);
64
+ if (initialMessage !== undefined) {
65
+ initial = initialMessage.cameraConf;
66
+ }
67
+ else {
68
+ initial = {
69
+ yaw: (_a = degToRadOrUndefined(qsAsNumber(qsKeyValues, qsKeyYaw))) !== null && _a !== void 0 ? _a : defaults.yaw,
70
+ pitch: (_b = degToRadOrUndefined(qsAsNumber(qsKeyValues, qsKeyPitch))) !== null && _b !== void 0 ? _b : defaults.pitch,
71
+ distance: qsAsNumber(qsKeyValues, qsKeyDistance !== null && qsKeyDistance !== void 0 ? qsKeyDistance : defaults.distance),
72
+ };
73
+ }
74
+ const instance = new CfgHistoryToCameraConfConnector(manager, defaults, initial, cameraControl, mode, qsKeyYaw, qsKeyPitch, qsKeyDistance);
75
+ return { instance, initial };
76
+ }
77
+ makeSendData(cameraConf, initial) {
78
+ const qsKeyValues = new Map();
79
+ if (!initial) {
80
+ addToMapAndRound(qsKeyValues, this._qsKeyYaw, radToDegOrUndefined(cameraConf.yaw), radToDegOrUndefined(this.defaults.yaw));
81
+ addToMapAndRound(qsKeyValues, this._qsKeyPitch, radToDegOrUndefined(cameraConf.pitch), radToDegOrUndefined(this.defaults.pitch));
82
+ addToMapAndRound(qsKeyValues, this._qsKeyDistance, cameraConf.distanceWasAutoSet ? undefined : cameraConf.distance, this.defaults.distance);
83
+ }
84
+ return {
85
+ message: CfgIOCameraConfConnector.makeMessage(cameraConf, initial),
86
+ qsKeyValues,
87
+ mode: this._mode,
88
+ };
89
+ }
90
+ }
@@ -1,36 +1,36 @@
1
- import { CfgIOManager } from "@configura/web-api";
2
- import { Observable } from "@configura/web-utilities";
3
- import { CfgOrbitalCameraControlProps } from "../camera/CfgOrbitalCameraControlProps.js";
4
- export declare type CfgCameraConfMessage = {
5
- version: string;
6
- initial: boolean;
7
- cameraConf: CfgOrbitalCameraControlProps;
8
- };
9
- export declare const STAGE_CAMERA_CONF_MESSAGE_KEY = "stagecameraconf";
10
- export declare const STAGE_CAMERA_MESSAGE_VERSION = "1.0";
11
- declare type CameraConfMessageCallback = (message: CfgCameraConfMessage) => Promise<void>;
12
- declare type CameraConfCallback = (conf: CfgOrbitalCameraControlProps) => Promise<void>;
13
- /**
14
- * Base class for connecting the camera configuration to an IO channel
15
- */
16
- export declare abstract class CfgIOCameraConfConnector<S> {
17
- private readonly _ioManager;
18
- private readonly _stopListenToMessage;
19
- private readonly _stopListenToCameraConf;
20
- constructor(_ioManager: CfgIOManager<S>, initial: CfgOrbitalCameraControlProps, cameraControl: Observable<CfgOrbitalCameraControlProps>);
21
- destroy: () => void;
22
- private _latestSentData;
23
- private _sendWithoutDuplicates;
24
- private _send;
25
- protected abstract makeSendData(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): S;
26
- static makeMessage(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgCameraConfMessage;
27
- static makeMessageListener(callback: CameraConfMessageCallback): (message: unknown) => Promise<void>;
28
- /**
29
- * Register the callback to listen for Product Configuration messages
30
- * @returns A function which when called will cancel listening
31
- */
32
- static listenForMessage<S>(callback: CameraConfMessageCallback, ioManager: CfgIOManager<S>): () => void;
33
- static listenForCamera(callback: CameraConfCallback, cameraControl: Observable<CfgOrbitalCameraControlProps>): () => void;
34
- }
35
- export {};
1
+ import { CfgIOManager } from "@configura/web-api";
2
+ import { Observable } from "@configura/web-utilities";
3
+ import { CfgOrbitalCameraControlProps } from "../camera/CfgOrbitalCameraControlProps.js";
4
+ export declare type CfgCameraConfMessage = {
5
+ version: string;
6
+ initial: boolean;
7
+ cameraConf: CfgOrbitalCameraControlProps;
8
+ };
9
+ export declare const STAGE_CAMERA_CONF_MESSAGE_KEY = "stagecameraconf";
10
+ export declare const STAGE_CAMERA_MESSAGE_VERSION = "1.0";
11
+ declare type CameraConfMessageCallback = (message: CfgCameraConfMessage) => Promise<void>;
12
+ declare type CameraConfCallback = (conf: CfgOrbitalCameraControlProps) => Promise<void>;
13
+ /**
14
+ * Base class for connecting the camera configuration to an IO channel
15
+ */
16
+ export declare abstract class CfgIOCameraConfConnector<S> {
17
+ private readonly _ioManager;
18
+ private readonly _stopListenToMessage;
19
+ private readonly _stopListenToCameraConf;
20
+ constructor(_ioManager: CfgIOManager<S>, initial: CfgOrbitalCameraControlProps, cameraControl: Observable<CfgOrbitalCameraControlProps>);
21
+ destroy: () => void;
22
+ private _latestSentData;
23
+ private _sendWithoutDuplicates;
24
+ private _send;
25
+ protected abstract makeSendData(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): S;
26
+ static makeMessage(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgCameraConfMessage;
27
+ static makeMessageListener(callback: CameraConfMessageCallback): (message: unknown) => Promise<void>;
28
+ /**
29
+ * Register the callback to listen for Product Configuration messages
30
+ * @returns A function which when called will cancel listening
31
+ */
32
+ static listenForMessage<S>(callback: CameraConfMessageCallback, ioManager: CfgIOManager<S>): () => void;
33
+ static listenForCamera(callback: CameraConfCallback, cameraControl: Observable<CfgOrbitalCameraControlProps>): () => void;
34
+ }
35
+ export {};
36
36
  //# sourceMappingURL=CfgIOCameraConfConnector.d.ts.map