@configura/babylon-view 1.4.0-alpha.4 → 1.4.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 (125) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/animation/AnimatableObject.d.ts +8 -8
  4. package/dist/animation/AnimatableObject.js +3 -3
  5. package/dist/animation/animator/Animator.d.ts +33 -33
  6. package/dist/animation/animator/Animator.js +58 -58
  7. package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
  8. package/dist/animation/animator/AnimatorEasing.js +31 -31
  9. package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
  10. package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
  11. package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
  12. package/dist/animation/animator/AnimatorHighlight.js +32 -32
  13. package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
  14. package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
  15. package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
  16. package/dist/animation/animator/AnimatorQueue.js +57 -57
  17. package/dist/animation/animator/AnimatorScale.d.ts +8 -8
  18. package/dist/animation/animator/AnimatorScale.js +13 -13
  19. package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
  20. package/dist/animation/animator/AnimatorSpin.js +13 -13
  21. package/dist/animation/animator/EasingFunctions.d.ts +35 -35
  22. package/dist/animation/animator/EasingFunctions.js +137 -137
  23. package/dist/animation/coordinator/Coordinator.d.ts +28 -28
  24. package/dist/animation/coordinator/Coordinator.js +47 -47
  25. package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
  26. package/dist/animation/coordinator/CoordinatorDropAndSpin.js +133 -133
  27. package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
  28. package/dist/animation/coordinator/CoordinatorIdentity.js +12 -12
  29. package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
  30. package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
  31. package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
  32. package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
  33. package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
  34. package/dist/animation/coordinator/CoordinatorPulseBounce.js +40 -40
  35. package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
  36. package/dist/animation/coordinator/CoordinatorPulseHighlight.js +34 -34
  37. package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
  38. package/dist/animation/coordinator/CoordinatorPulseInflate.js +30 -30
  39. package/dist/camera/CameraCreator.d.ts +5 -5
  40. package/dist/camera/CameraCreator.js +4 -4
  41. package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -26
  42. package/dist/camera/CfgArcRotateCameraPointersInput.js +264 -264
  43. package/dist/camera/CfgOrbitalCamera.d.ts +68 -68
  44. package/dist/camera/CfgOrbitalCamera.js +250 -250
  45. package/dist/camera/CfgOrbitalCameraControlProps.d.ts +6 -6
  46. package/dist/camera/CfgOrbitalCameraControlProps.js +3 -3
  47. package/dist/camera/GradingApplier.d.ts +3 -3
  48. package/dist/camera/GradingApplier.js +48 -48
  49. package/dist/engine/EngineCreator.d.ts +3 -3
  50. package/dist/engine/EngineCreator.js +10 -10
  51. package/dist/geometry/CfgGeometry.d.ts +29 -29
  52. package/dist/geometry/CfgGeometry.js +146 -146
  53. package/dist/geometry/CfgMesh.d.ts +10 -10
  54. package/dist/geometry/CfgMesh.js +38 -38
  55. package/dist/geometry/geoSplitter.d.ts +8 -8
  56. package/dist/geometry/geoSplitter.js +192 -192
  57. package/dist/geometry/stretch/CfgMorphTarget.d.ts +15 -15
  58. package/dist/geometry/stretch/CfgMorphTarget.js +65 -65
  59. package/dist/geometry/stretch/CfgStretchData.d.ts +114 -114
  60. package/dist/geometry/stretch/CfgStretchData.js +340 -340
  61. package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +16 -16
  62. package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -95
  63. package/dist/index.d.ts +13 -13
  64. package/dist/index.js +13 -13
  65. package/dist/light/CfgDirectionalLight.d.ts +8 -8
  66. package/dist/light/CfgDirectionalLight.js +18 -18
  67. package/dist/light/CfgHemisphericLight.d.ts +7 -7
  68. package/dist/light/CfgHemisphericLight.js +17 -17
  69. package/dist/light/CfgPointLight.d.ts +8 -8
  70. package/dist/light/CfgPointLight.js +18 -18
  71. package/dist/light/DefaultLightRig.d.ts +19 -19
  72. package/dist/light/DefaultLightRig.js +77 -77
  73. package/dist/light/LightRigCreator.d.ts +9 -9
  74. package/dist/light/LightRigCreator.js +3 -3
  75. package/dist/material/CfgMaterial.d.ts +68 -68
  76. package/dist/material/CfgMaterial.js +482 -482
  77. package/dist/material/DummyMaterialCreator.d.ts +4 -4
  78. package/dist/material/DummyMaterialCreator.js +15 -15
  79. package/dist/material/material.d.ts +18 -18
  80. package/dist/material/material.js +128 -128
  81. package/dist/material/texture.d.ts +14 -14
  82. package/dist/material/texture.js +306 -306
  83. package/dist/nodes/CfgContentRootNode.d.ts +19 -19
  84. package/dist/nodes/CfgContentRootNode.js +75 -75
  85. package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -55
  86. package/dist/nodes/CfgDeferredMeshNode.js +377 -377
  87. package/dist/nodes/CfgProductNode.d.ts +126 -126
  88. package/dist/nodes/CfgProductNode.js +578 -578
  89. package/dist/nodes/CfgSymNode.d.ts +50 -50
  90. package/dist/nodes/CfgSymNode.js +249 -249
  91. package/dist/nodes/CfgSymRootNode.d.ts +45 -45
  92. package/dist/nodes/CfgSymRootNode.js +220 -220
  93. package/dist/nodes/CfgTransformNode.d.ts +33 -33
  94. package/dist/nodes/CfgTransformNode.js +83 -83
  95. package/dist/scene/SceneCreator.d.ts +6 -6
  96. package/dist/scene/SceneCreator.js +22 -22
  97. package/dist/utilities/CfgBoundingBox.d.ts +21 -21
  98. package/dist/utilities/CfgBoundingBox.js +81 -81
  99. package/dist/utilities/anchor/anchor.d.ts +51 -51
  100. package/dist/utilities/anchor/anchor.js +136 -136
  101. package/dist/utilities/anchor/anchorMap.d.ts +20 -20
  102. package/dist/utilities/anchor/anchorMap.js +111 -111
  103. package/dist/utilities/utilities3D.d.ts +70 -70
  104. package/dist/utilities/utilities3D.js +265 -265
  105. package/dist/utilities/utilitiesColor.d.ts +18 -18
  106. package/dist/utilities/utilitiesColor.js +48 -48
  107. package/dist/utilities/utilitiesImage.d.ts +6 -6
  108. package/dist/utilities/utilitiesImage.js +107 -107
  109. package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -7
  110. package/dist/utilities/utilitiesSymRootIdentifier.js +26 -26
  111. package/dist/view/BaseView.d.ts +78 -78
  112. package/dist/view/BaseView.js +297 -297
  113. package/dist/view/BaseViewConfiguration.d.ts +32 -32
  114. package/dist/view/BaseViewConfiguration.js +8 -8
  115. package/dist/view/RenderEnv.d.ts +43 -43
  116. package/dist/view/RenderEnv.js +7 -7
  117. package/dist/view/SingleProductDefaultCameraView.d.ts +33 -33
  118. package/dist/view/SingleProductDefaultCameraView.js +141 -141
  119. package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +46 -46
  120. package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
  121. package/dist/view/SingleProductView.d.ts +42 -42
  122. package/dist/view/SingleProductView.js +206 -206
  123. package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
  124. package/dist/view/SingleProductViewConfiguration.js +19 -19
  125. package/package.json +5 -5
@@ -1,115 +1,115 @@
1
- import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
2
- import { LengthValue, StretchMap } from "@configura/web-api";
3
- import { SymNode } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
4
- import { DetailLevel } from "@configura/web-core/dist/cm/geometry/DetailMask.js";
5
- import { Logger } from "@configura/web-utilities";
6
- /**
7
- * How far along from sp to ep is a point on a plane crossing the sp to ep line?
8
- * 1 means at ep, 0 means at sp.
9
- */
10
- export declare function calculateAlongness(p: Vector3, sp: Vector3, spToEpLength: number, normalizedNormal: Vector3): number;
11
- /**
12
- * Where does the point p end up given the CfgStretchDatas and the StretchMap.
13
- * This is the same equations that Babylon uses for stretching, only Babylon does it in the
14
- * shaders during rendering and is thus GPU accelerated.
15
- * This version is much slower, but that is okay as long as this function is sparingly used.
16
- */
17
- export declare const toStretchedPoint: (p: Vector3, stretchDatas: CfgStretchData[], stretchReferenceLengthsByMeasureParamCode: StretchMap) => Vector3;
18
- /**
19
- * The end of a section is the beginning of the next.
20
- * Start/end are redundant, but both are kept for ease of access.
21
- * The first section will have startAlongness 0. This does not mean that things can't be outside.
22
- * The start section should be thought of as endless in the sp-direction.
23
- * The last section will have endAlongness 0. This does not mean that things can't be outside.
24
- * The end section should be thought of as endless in the ep-direction.
25
- */
26
- export declare type StretchSection = {
27
- last: boolean;
28
- sizeChange: number;
29
- move: boolean;
30
- startAlongness: number;
31
- endAlongness: number;
32
- atTwiceTranslation: number;
33
- atTwiceScale: number;
34
- };
35
- /**
36
- * Please note that stretch is not bound to be contained between sp and ep.
37
- *
38
- * The thinking in the equations in CfgStretchData is that we want to support MorphTargets in an as
39
- * efficient manner as possible. As MorphTargets work by morphing between pre-compiled meshes we
40
- * calculate what happens if you stretch to twice the referenceLength, to make MorphTargets for
41
- * twice the referenceLength, and then calculate how these MorphTargets should be applied to
42
- * achieve to requested referenceLength.
43
- *
44
- * This adaption to MorphTargets might make the code for stretching points for other purposes look
45
- * (be) a bit complicated. However, as a mesh often contains millions of vertices that needs to be
46
- * moved and calculating for bounding boxes, and anchor points and such moves very few vertices,
47
- * this is okay.
48
- *
49
- * Using "Twice" as the precomputed target is arbitrarily, we just chose it because it makes
50
- * equations simple.
51
- */
52
- export declare class CfgStretchData {
53
- readonly detailLevel: DetailLevel;
54
- readonly measureParam: string;
55
- readonly originalReferenceLength: number | undefined;
56
- readonly sp: Vector3;
57
- readonly ep: Vector3;
58
- readonly spToEpLength: number;
59
- readonly originalSpToEpLength: number;
60
- readonly normal: Vector3;
61
- readonly normalNormalized: Vector3;
62
- readonly sections: StretchSection[];
63
- static make(logger: Logger, symNode: SymNode, detailLevel: DetailLevel): CfgStretchData;
64
- private static processSections;
65
- /**
66
- * It is assumed that the symNode passed really is stretch (symNodeIsStretch has been run)
67
- * so any data missing for stretch will be an Exception.
68
- *
69
- * @param detailLevel
70
- * @param measureParam Name of the parameter controlling the stretch
71
- * @param originalReferenceLength Server-side calculated original referenceLength. We do not
72
- * actually use this for anything, but it can be handy for debug.
73
- * @param sp Start Point, the start anchor of the stretch line.
74
- * @param ep End Point, the end anchor of the stretch line.
75
- * @param spToEpLength Distance from sp to ep.
76
- * @param originalSpToEpLength spToEpLength before transforms.
77
- * @param normal The normal is from sp to ep and is the normal of every plane that divides this
78
- * stretch.
79
- * @param normalNormalized Normalized version of normal
80
- * @param sections The slices the model is sliced into
81
- */
82
- private constructor();
83
- private _hash;
84
- get hash(): number;
85
- /** How far along between sp and ep is p? */
86
- getAlongness: (p: Vector3) => number;
87
- /**
88
- * If the Matrix is identity the original CfgStretchData is returned.
89
- * If not a new CfgStretchData will be created.
90
- * sp, ep, spToEpLength, normal, normalNormalized, scale will be cloned and transformed
91
- * The rest will still reference the original objects
92
- */
93
- applyMatrix(matrix: Matrix): CfgStretchData;
94
- /**
95
- * Calculates the translation of a point which moves it from its original position to where it
96
- * would be if we stretched to twice the reference length. Please note: this gives the
97
- * translation, not the new location. The new location will be p.add(stretchPointToTwice(p))
98
- */
99
- stretchPointToTwice(p: Vector3): Vector3;
100
- /**
101
- * Given a reference length calculates the influence that should be applied to a MorphTarget to
102
- * achieve the requested length, given that these MorphTargets are constructed so that they
103
- * will double the length when the influence 1 is applied.
104
- *
105
- * Please note that the referenceLength is the wanted length between sp and ep, that is, the
106
- * stretch line. This line does not have to be span the entire model. Also, there can be
107
- * multiple stretch lines that are not orthogonal to this, and the will also affect the actual
108
- * size. Finally there can be transforms applied in the tree. So, the referenceLength will only
109
- * be the actual length of the model in specific cases. However, we believe that models with
110
- * stretch are often constructed in such a way that in real use cases the referenceLength is
111
- * the actual real length.
112
- */
113
- calculateInfluenceGivenTwiceMorphTarget(referenceLength: LengthValue): number;
114
- }
1
+ import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
2
+ import { LengthValue, StretchMap } from "@configura/web-api";
3
+ import { SymNode } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
4
+ import { DetailLevel } from "@configura/web-core/dist/cm/geometry/DetailMask.js";
5
+ import { Logger } from "@configura/web-utilities";
6
+ /**
7
+ * How far along from sp to ep is a point on a plane crossing the sp to ep line?
8
+ * 1 means at ep, 0 means at sp.
9
+ */
10
+ export declare function calculateAlongness(p: Vector3, sp: Vector3, spToEpLength: number, normalizedNormal: Vector3): number;
11
+ /**
12
+ * Where does the point p end up given the CfgStretchDatas and the StretchMap.
13
+ * This is the same equations that Babylon uses for stretching, only Babylon does it in the
14
+ * shaders during rendering and is thus GPU accelerated.
15
+ * This version is much slower, but that is okay as long as this function is sparingly used.
16
+ */
17
+ export declare const toStretchedPoint: (p: Vector3, stretchDatas: CfgStretchData[], stretchReferenceLengthsByMeasureParamCode: StretchMap) => Vector3;
18
+ /**
19
+ * The end of a section is the beginning of the next.
20
+ * Start/end are redundant, but both are kept for ease of access.
21
+ * The first section will have startAlongness 0. This does not mean that things can't be outside.
22
+ * The start section should be thought of as endless in the sp-direction.
23
+ * The last section will have endAlongness 0. This does not mean that things can't be outside.
24
+ * The end section should be thought of as endless in the ep-direction.
25
+ */
26
+ export declare type StretchSection = {
27
+ last: boolean;
28
+ sizeChange: number;
29
+ move: boolean;
30
+ startAlongness: number;
31
+ endAlongness: number;
32
+ atTwiceTranslation: number;
33
+ atTwiceScale: number;
34
+ };
35
+ /**
36
+ * Please note that stretch is not bound to be contained between sp and ep.
37
+ *
38
+ * The thinking in the equations in CfgStretchData is that we want to support MorphTargets in an as
39
+ * efficient manner as possible. As MorphTargets work by morphing between pre-compiled meshes we
40
+ * calculate what happens if you stretch to twice the referenceLength, to make MorphTargets for
41
+ * twice the referenceLength, and then calculate how these MorphTargets should be applied to
42
+ * achieve to requested referenceLength.
43
+ *
44
+ * This adaption to MorphTargets might make the code for stretching points for other purposes look
45
+ * (be) a bit complicated. However, as a mesh often contains millions of vertices that needs to be
46
+ * moved and calculating for bounding boxes, and anchor points and such moves very few vertices,
47
+ * this is okay.
48
+ *
49
+ * Using "Twice" as the precomputed target is arbitrarily, we just chose it because it makes
50
+ * equations simple.
51
+ */
52
+ export declare class CfgStretchData {
53
+ readonly detailLevel: DetailLevel;
54
+ readonly measureParam: string;
55
+ readonly originalReferenceLength: number | undefined;
56
+ readonly sp: Vector3;
57
+ readonly ep: Vector3;
58
+ readonly spToEpLength: number;
59
+ readonly originalSpToEpLength: number;
60
+ readonly normal: Vector3;
61
+ readonly normalNormalized: Vector3;
62
+ readonly sections: StretchSection[];
63
+ static make(logger: Logger, symNode: SymNode, detailLevel: DetailLevel): CfgStretchData;
64
+ private static processSections;
65
+ /**
66
+ * It is assumed that the symNode passed really is stretch (symNodeIsStretch has been run)
67
+ * so any data missing for stretch will be an Exception.
68
+ *
69
+ * @param detailLevel
70
+ * @param measureParam Name of the parameter controlling the stretch
71
+ * @param originalReferenceLength Server-side calculated original referenceLength. We do not
72
+ * actually use this for anything, but it can be handy for debug.
73
+ * @param sp Start Point, the start anchor of the stretch line.
74
+ * @param ep End Point, the end anchor of the stretch line.
75
+ * @param spToEpLength Distance from sp to ep.
76
+ * @param originalSpToEpLength spToEpLength before transforms.
77
+ * @param normal The normal is from sp to ep and is the normal of every plane that divides this
78
+ * stretch.
79
+ * @param normalNormalized Normalized version of normal
80
+ * @param sections The slices the model is sliced into
81
+ */
82
+ private constructor();
83
+ private _hash;
84
+ get hash(): number;
85
+ /** How far along between sp and ep is p? */
86
+ getAlongness: (p: Vector3) => number;
87
+ /**
88
+ * If the Matrix is identity the original CfgStretchData is returned.
89
+ * If not a new CfgStretchData will be created.
90
+ * sp, ep, spToEpLength, normal, normalNormalized, scale will be cloned and transformed
91
+ * The rest will still reference the original objects
92
+ */
93
+ applyMatrix(matrix: Matrix): CfgStretchData;
94
+ /**
95
+ * Calculates the translation of a point which moves it from its original position to where it
96
+ * would be if we stretched to twice the reference length. Please note: this gives the
97
+ * translation, not the new location. The new location will be p.add(stretchPointToTwice(p))
98
+ */
99
+ stretchPointToTwice(p: Vector3): Vector3;
100
+ /**
101
+ * Given a reference length calculates the influence that should be applied to a MorphTarget to
102
+ * achieve the requested length, given that these MorphTargets are constructed so that they
103
+ * will double the length when the influence 1 is applied.
104
+ *
105
+ * Please note that the referenceLength is the wanted length between sp and ep, that is, the
106
+ * stretch line. This line does not have to be span the entire model. Also, there can be
107
+ * multiple stretch lines that are not orthogonal to this, and the will also affect the actual
108
+ * size. Finally there can be transforms applied in the tree. So, the referenceLength will only
109
+ * be the actual length of the model in specific cases. However, we believe that models with
110
+ * stretch are often constructed in such a way that in real use cases the referenceLength is
111
+ * the actual real length.
112
+ */
113
+ calculateInfluenceGivenTwiceMorphTarget(referenceLength: LengthValue): number;
114
+ }
115
115
  //# sourceMappingURL=CfgStretchData.d.ts.map