@configura/babylon-view 2.0.0-alpha.0 → 2.0.0-alpha.3
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.
- package/.eslintrc.json +18 -18
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/animation/AnimatableObject.d.ts +8 -8
- package/dist/animation/AnimatableObject.js +3 -3
- package/dist/animation/animator/Animator.d.ts +33 -33
- package/dist/animation/animator/Animator.js +58 -58
- package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
- package/dist/animation/animator/AnimatorEasing.js +31 -31
- package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
- package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
- package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
- package/dist/animation/animator/AnimatorHighlight.js +32 -32
- package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
- package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
- package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
- package/dist/animation/animator/AnimatorQueue.js +57 -57
- package/dist/animation/animator/AnimatorScale.d.ts +8 -8
- package/dist/animation/animator/AnimatorScale.js +13 -13
- package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
- package/dist/animation/animator/AnimatorSpin.js +13 -13
- package/dist/animation/animator/EasingFunctions.d.ts +35 -35
- package/dist/animation/animator/EasingFunctions.js +137 -137
- package/dist/animation/coordinator/Coordinator.d.ts +28 -28
- package/dist/animation/coordinator/Coordinator.js +53 -53
- package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
- package/dist/animation/coordinator/CoordinatorDropAndSpin.js +138 -138
- package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
- package/dist/animation/coordinator/CoordinatorIdentity.js +14 -14
- package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
- package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
- package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
- package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
- package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
- package/dist/animation/coordinator/CoordinatorPulseBounce.js +35 -35
- package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
- package/dist/animation/coordinator/CoordinatorPulseHighlight.js +29 -29
- package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
- package/dist/animation/coordinator/CoordinatorPulseInflate.js +23 -23
- package/dist/camera/CameraCreator.d.ts +5 -5
- package/dist/camera/CameraCreator.js +4 -4
- package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -26
- package/dist/camera/CfgArcRotateCameraPointersInput.js +266 -266
- package/dist/camera/CfgOrbitalCamera.d.ts +73 -73
- package/dist/camera/CfgOrbitalCamera.js +260 -260
- package/dist/camera/CfgOrbitalCameraControlProps.d.ts +11 -11
- package/dist/camera/CfgOrbitalCameraControlProps.js +6 -6
- package/dist/camera/GradingApplier.d.ts +3 -3
- package/dist/camera/GradingApplier.js +48 -48
- package/dist/engine/EngineCreator.d.ts +3 -3
- package/dist/engine/EngineCreator.js +10 -10
- package/dist/geometry/CfgGeometry.d.ts +29 -29
- package/dist/geometry/CfgGeometry.js +146 -146
- package/dist/geometry/CfgMesh.d.ts +10 -10
- package/dist/geometry/CfgMesh.js +38 -38
- package/dist/geometry/geoSplitter.d.ts +8 -8
- package/dist/geometry/geoSplitter.js +192 -192
- package/dist/geometry/stretch/CfgMorphTarget.d.ts +15 -15
- package/dist/geometry/stretch/CfgMorphTarget.js +65 -65
- package/dist/geometry/stretch/CfgStretchData.d.ts +116 -116
- package/dist/geometry/stretch/CfgStretchData.js +350 -350
- package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +16 -16
- package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -95
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -16
- package/dist/io/CfgHistoryToCameraConfConnector.d.ts +29 -29
- package/dist/io/CfgHistoryToCameraConfConnector.js +80 -80
- package/dist/io/CfgIOCameraConfConnector.d.ts +35 -35
- package/dist/io/CfgIOCameraConfConnector.js +82 -82
- package/dist/io/CfgObservableStateToCameraConfConnector.d.ts +10 -10
- package/dist/io/CfgObservableStateToCameraConfConnector.js +11 -11
- package/dist/io/CfgWindowMessageToCameraConfConnector.d.ts +10 -10
- package/dist/io/CfgWindowMessageToCameraConfConnector.js +11 -11
- package/dist/light/CfgDirectionalLight.d.ts +8 -8
- package/dist/light/CfgDirectionalLight.js +18 -18
- package/dist/light/CfgHemisphericLight.d.ts +7 -7
- package/dist/light/CfgHemisphericLight.js +17 -17
- package/dist/light/CfgPointLight.d.ts +8 -8
- package/dist/light/CfgPointLight.js +18 -18
- package/dist/light/DefaultLightRig.d.ts +19 -19
- package/dist/light/DefaultLightRig.js +77 -77
- package/dist/light/LightRigCreator.d.ts +9 -9
- package/dist/light/LightRigCreator.js +3 -3
- package/dist/material/CfgMaterial.d.ts +68 -68
- package/dist/material/CfgMaterial.js +482 -482
- package/dist/material/DummyMaterialCreator.d.ts +4 -4
- package/dist/material/DummyMaterialCreator.js +15 -15
- package/dist/material/material.d.ts +18 -18
- package/dist/material/material.js +128 -128
- package/dist/material/texture.d.ts +14 -14
- package/dist/material/texture.js +306 -306
- package/dist/nodes/CfgContentRootNode.d.ts +19 -19
- package/dist/nodes/CfgContentRootNode.js +75 -75
- package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -55
- package/dist/nodes/CfgDeferredMeshNode.js +378 -378
- package/dist/nodes/CfgProductNode.d.ts +127 -127
- package/dist/nodes/CfgProductNode.js +598 -598
- package/dist/nodes/CfgSymNode.d.ts +50 -50
- package/dist/nodes/CfgSymNode.js +249 -249
- package/dist/nodes/CfgSymRootNode.d.ts +45 -45
- package/dist/nodes/CfgSymRootNode.js +229 -229
- package/dist/nodes/CfgTransformNode.d.ts +33 -33
- package/dist/nodes/CfgTransformNode.js +83 -83
- package/dist/scene/SceneCreator.d.ts +6 -6
- package/dist/scene/SceneCreator.js +22 -22
- package/dist/utilities/CfgBoundingBox.d.ts +21 -21
- package/dist/utilities/CfgBoundingBox.js +81 -81
- package/dist/utilities/anchor/anchor.d.ts +50 -50
- package/dist/utilities/anchor/anchor.js +133 -133
- package/dist/utilities/anchor/anchorMap.d.ts +20 -20
- package/dist/utilities/anchor/anchorMap.js +111 -111
- package/dist/utilities/utilities3D.d.ts +70 -70
- package/dist/utilities/utilities3D.js +265 -265
- package/dist/utilities/utilitiesColor.d.ts +18 -18
- package/dist/utilities/utilitiesColor.js +50 -50
- package/dist/utilities/utilitiesImage.d.ts +6 -6
- package/dist/utilities/utilitiesImage.js +107 -107
- package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -7
- package/dist/utilities/utilitiesSymRootIdentifier.js +26 -26
- package/dist/view/BaseView.d.ts +78 -78
- package/dist/view/BaseView.js +303 -303
- package/dist/view/BaseViewConfiguration.d.ts +32 -32
- package/dist/view/BaseViewConfiguration.js +10 -10
- package/dist/view/RenderEnv.d.ts +43 -43
- package/dist/view/RenderEnv.js +7 -7
- package/dist/view/SingleProductDefaultCameraView.d.ts +37 -37
- package/dist/view/SingleProductDefaultCameraView.js +145 -145
- package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +42 -42
- package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
- package/dist/view/SingleProductView.d.ts +44 -44
- package/dist/view/SingleProductView.js +212 -212
- package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
- package/dist/view/SingleProductViewConfiguration.js +19 -19
- package/package.json +5 -5
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
2
|
-
import { InspectableType } from "@babylonjs/core/Misc/iInspectable.js";
|
|
3
|
-
export class CfgTransformNode extends TransformNode {
|
|
4
|
-
constructor(_renderEnvironment, name) {
|
|
5
|
-
super(name, _renderEnvironment.scene);
|
|
6
|
-
this._renderEnvironment = _renderEnvironment;
|
|
7
|
-
this.addInspectorProperties();
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Provides a class name to show in the Babylon.js Inspector.
|
|
11
|
-
* Override in subclasses.
|
|
12
|
-
*/
|
|
13
|
-
get cfgClassName() {
|
|
14
|
-
return "CfgTransformNode";
|
|
15
|
-
}
|
|
16
|
-
getChildrenForAnimation() {
|
|
17
|
-
const result = [];
|
|
18
|
-
for (const c of this.getChildren()) {
|
|
19
|
-
if (c instanceof CfgTransformNode) {
|
|
20
|
-
result.push(c);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
clear(dispose) {
|
|
26
|
-
const children = this.getChildren();
|
|
27
|
-
if (children.length > 0) {
|
|
28
|
-
this.remove(dispose, ...children.slice());
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
add(...objects) {
|
|
32
|
-
for (const obj of objects) {
|
|
33
|
-
if (obj === this) {
|
|
34
|
-
console.error("CfgTransformNode.add: object can't be added as a child of itself.", obj);
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
obj.parent = this;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Recursively calculates the world matrix based on originalMatrix on nodes which inherits
|
|
42
|
-
* CfgTransformNode.
|
|
43
|
-
*/
|
|
44
|
-
get worldOriginalMatrix() {
|
|
45
|
-
const o = this.originalMatrix;
|
|
46
|
-
const p = this.parent;
|
|
47
|
-
if (p && p instanceof CfgTransformNode) {
|
|
48
|
-
return o.multiply(p.worldOriginalMatrix);
|
|
49
|
-
}
|
|
50
|
-
return o;
|
|
51
|
-
}
|
|
52
|
-
remove(dispose, ...objects) {
|
|
53
|
-
for (const obj of objects) {
|
|
54
|
-
if (dispose) {
|
|
55
|
-
obj.dispose();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
obj.parent = null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Adds the property to the instance so it shows up in the Babylon.js Inspector.
|
|
65
|
-
*
|
|
66
|
-
* TODO Babylon: Currently they show up as editable, even though they are used to display
|
|
67
|
-
* read-only information. Metadata seems to be more correct, but is not (yet?) included by the
|
|
68
|
-
* Inspector.
|
|
69
|
-
*/
|
|
70
|
-
addInspectableCustomProperty(property) {
|
|
71
|
-
if (this.inspectableCustomProperties === undefined) {
|
|
72
|
-
this.inspectableCustomProperties = [];
|
|
73
|
-
}
|
|
74
|
-
this.inspectableCustomProperties.push(property);
|
|
75
|
-
}
|
|
76
|
-
addInspectorProperties() {
|
|
77
|
-
this.addInspectableCustomProperty({
|
|
78
|
-
label: "Cfg Class",
|
|
79
|
-
propertyName: "cfgClassName",
|
|
80
|
-
type: InspectableType.String,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
1
|
+
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
2
|
+
import { InspectableType } from "@babylonjs/core/Misc/iInspectable.js";
|
|
3
|
+
export class CfgTransformNode extends TransformNode {
|
|
4
|
+
constructor(_renderEnvironment, name) {
|
|
5
|
+
super(name, _renderEnvironment.scene);
|
|
6
|
+
this._renderEnvironment = _renderEnvironment;
|
|
7
|
+
this.addInspectorProperties();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Provides a class name to show in the Babylon.js Inspector.
|
|
11
|
+
* Override in subclasses.
|
|
12
|
+
*/
|
|
13
|
+
get cfgClassName() {
|
|
14
|
+
return "CfgTransformNode";
|
|
15
|
+
}
|
|
16
|
+
getChildrenForAnimation() {
|
|
17
|
+
const result = [];
|
|
18
|
+
for (const c of this.getChildren()) {
|
|
19
|
+
if (c instanceof CfgTransformNode) {
|
|
20
|
+
result.push(c);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
clear(dispose) {
|
|
26
|
+
const children = this.getChildren();
|
|
27
|
+
if (children.length > 0) {
|
|
28
|
+
this.remove(dispose, ...children.slice());
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
add(...objects) {
|
|
32
|
+
for (const obj of objects) {
|
|
33
|
+
if (obj === this) {
|
|
34
|
+
console.error("CfgTransformNode.add: object can't be added as a child of itself.", obj);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
obj.parent = this;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Recursively calculates the world matrix based on originalMatrix on nodes which inherits
|
|
42
|
+
* CfgTransformNode.
|
|
43
|
+
*/
|
|
44
|
+
get worldOriginalMatrix() {
|
|
45
|
+
const o = this.originalMatrix;
|
|
46
|
+
const p = this.parent;
|
|
47
|
+
if (p && p instanceof CfgTransformNode) {
|
|
48
|
+
return o.multiply(p.worldOriginalMatrix);
|
|
49
|
+
}
|
|
50
|
+
return o;
|
|
51
|
+
}
|
|
52
|
+
remove(dispose, ...objects) {
|
|
53
|
+
for (const obj of objects) {
|
|
54
|
+
if (dispose) {
|
|
55
|
+
obj.dispose();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
obj.parent = null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Adds the property to the instance so it shows up in the Babylon.js Inspector.
|
|
65
|
+
*
|
|
66
|
+
* TODO Babylon: Currently they show up as editable, even though they are used to display
|
|
67
|
+
* read-only information. Metadata seems to be more correct, but is not (yet?) included by the
|
|
68
|
+
* Inspector.
|
|
69
|
+
*/
|
|
70
|
+
addInspectableCustomProperty(property) {
|
|
71
|
+
if (this.inspectableCustomProperties === undefined) {
|
|
72
|
+
this.inspectableCustomProperties = [];
|
|
73
|
+
}
|
|
74
|
+
this.inspectableCustomProperties.push(property);
|
|
75
|
+
}
|
|
76
|
+
addInspectorProperties() {
|
|
77
|
+
this.addInspectableCustomProperty({
|
|
78
|
+
label: "Cfg Class",
|
|
79
|
+
propertyName: "cfgClassName",
|
|
80
|
+
type: InspectableType.String,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Engine } from "@babylonjs/core/Engines/engine.js";
|
|
2
|
-
import "@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js";
|
|
3
|
-
import "@babylonjs/core/Misc/dds.js";
|
|
4
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
|
5
|
-
export declare type SceneCreator = (engine: Engine) => Scene;
|
|
6
|
-
export declare function getDefaultScene(engine: Engine, envUrl?: string): Scene;
|
|
1
|
+
import { Engine } from "@babylonjs/core/Engines/engine.js";
|
|
2
|
+
import "@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js";
|
|
3
|
+
import "@babylonjs/core/Misc/dds.js";
|
|
4
|
+
import { Scene } from "@babylonjs/core/scene.js";
|
|
5
|
+
export declare type SceneCreator = (engine: Engine) => Scene;
|
|
6
|
+
export declare function getDefaultScene(engine: Engine, envUrl?: string): Scene;
|
|
7
7
|
//# sourceMappingURL=SceneCreator.d.ts.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture.js";
|
|
2
|
-
import "@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js"; // Needed for environment map
|
|
3
|
-
import { Color4 } from "@babylonjs/core/Maths/math.color.js";
|
|
4
|
-
import "@babylonjs/core/Misc/dds.js"; // Needed for environment map
|
|
5
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
|
6
|
-
const DEFAULT_ENV_URL = "https://catalogueapi-demo.configura.com/envmap/default.env";
|
|
7
|
-
export function getDefaultScene(engine, envUrl) {
|
|
8
|
-
const scene = new Scene(engine);
|
|
9
|
-
// If the alpha component of the clearColor is set to 0, then the color components MUST also be
|
|
10
|
-
// set to 0. Otherwise the color components will sneak into transparent objects in the scene.
|
|
11
|
-
//
|
|
12
|
-
// This is because WebGL uses premultiplied alpha colors by default. In premultiplied alpha the
|
|
13
|
-
// color components have already been multiplied by the alpha value, and "X * 0" is always
|
|
14
|
-
// zero, no matter what X is. A color like "1, 0, 0, 0" is thus not an valid premultiplied
|
|
15
|
-
// color and the results is per the WebGL specs undefined.
|
|
16
|
-
scene.clearColor = new Color4(0, 0, 0, 0).toLinearSpace();
|
|
17
|
-
const hdrTexture = CubeTexture.CreateFromPrefilteredData(envUrl || DEFAULT_ENV_URL, scene);
|
|
18
|
-
hdrTexture.gammaSpace = false;
|
|
19
|
-
scene.environmentTexture = hdrTexture;
|
|
20
|
-
scene.environmentIntensity = 0.55;
|
|
21
|
-
return scene;
|
|
22
|
-
}
|
|
1
|
+
import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture.js";
|
|
2
|
+
import "@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js"; // Needed for environment map
|
|
3
|
+
import { Color4 } from "@babylonjs/core/Maths/math.color.js";
|
|
4
|
+
import "@babylonjs/core/Misc/dds.js"; // Needed for environment map
|
|
5
|
+
import { Scene } from "@babylonjs/core/scene.js";
|
|
6
|
+
const DEFAULT_ENV_URL = "https://catalogueapi-demo.configura.com/envmap/default.env";
|
|
7
|
+
export function getDefaultScene(engine, envUrl) {
|
|
8
|
+
const scene = new Scene(engine);
|
|
9
|
+
// If the alpha component of the clearColor is set to 0, then the color components MUST also be
|
|
10
|
+
// set to 0. Otherwise the color components will sneak into transparent objects in the scene.
|
|
11
|
+
//
|
|
12
|
+
// This is because WebGL uses premultiplied alpha colors by default. In premultiplied alpha the
|
|
13
|
+
// color components have already been multiplied by the alpha value, and "X * 0" is always
|
|
14
|
+
// zero, no matter what X is. A color like "1, 0, 0, 0" is thus not an valid premultiplied
|
|
15
|
+
// color and the results is per the WebGL specs undefined.
|
|
16
|
+
scene.clearColor = new Color4(0, 0, 0, 0).toLinearSpace();
|
|
17
|
+
const hdrTexture = CubeTexture.CreateFromPrefilteredData(envUrl || DEFAULT_ENV_URL, scene);
|
|
18
|
+
hdrTexture.gammaSpace = false;
|
|
19
|
+
scene.environmentTexture = hdrTexture;
|
|
20
|
+
scene.environmentIntensity = 0.55;
|
|
21
|
+
return scene;
|
|
22
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
-
export declare class CfgBoundingBox {
|
|
3
|
-
minimum: Vector3;
|
|
4
|
-
maximum: Vector3;
|
|
5
|
-
constructor(minimum?: Vector3, maximum?: Vector3);
|
|
6
|
-
/**
|
|
7
|
-
* Means that the bounding box should be seen as "undefined", which is not the same as "zero"
|
|
8
|
-
*/
|
|
9
|
-
private _isEmpty;
|
|
10
|
-
reConstruct(minimum: Vector3, maximum: Vector3): CfgBoundingBox;
|
|
11
|
-
copyFrom(source: CfgBoundingBox): CfgBoundingBox;
|
|
12
|
-
clone(): CfgBoundingBox;
|
|
13
|
-
get center(): Vector3;
|
|
14
|
-
translate(vec: Vector3): CfgBoundingBox;
|
|
15
|
-
expand(otherBoundingBox: CfgBoundingBox): CfgBoundingBox;
|
|
16
|
-
expandWithPoint(point: Vector3): CfgBoundingBox;
|
|
17
|
-
applyMatrix(matrix: Matrix): CfgBoundingBox;
|
|
18
|
-
get spaceDiagonal(): number;
|
|
19
|
-
get isEmpty(): boolean;
|
|
20
|
-
get corners(): Vector3[];
|
|
21
|
-
}
|
|
1
|
+
import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
+
export declare class CfgBoundingBox {
|
|
3
|
+
minimum: Vector3;
|
|
4
|
+
maximum: Vector3;
|
|
5
|
+
constructor(minimum?: Vector3, maximum?: Vector3);
|
|
6
|
+
/**
|
|
7
|
+
* Means that the bounding box should be seen as "undefined", which is not the same as "zero"
|
|
8
|
+
*/
|
|
9
|
+
private _isEmpty;
|
|
10
|
+
reConstruct(minimum: Vector3, maximum: Vector3): CfgBoundingBox;
|
|
11
|
+
copyFrom(source: CfgBoundingBox): CfgBoundingBox;
|
|
12
|
+
clone(): CfgBoundingBox;
|
|
13
|
+
get center(): Vector3;
|
|
14
|
+
translate(vec: Vector3): CfgBoundingBox;
|
|
15
|
+
expand(otherBoundingBox: CfgBoundingBox): CfgBoundingBox;
|
|
16
|
+
expandWithPoint(point: Vector3): CfgBoundingBox;
|
|
17
|
+
applyMatrix(matrix: Matrix): CfgBoundingBox;
|
|
18
|
+
get spaceDiagonal(): number;
|
|
19
|
+
get isEmpty(): boolean;
|
|
20
|
+
get corners(): Vector3[];
|
|
21
|
+
}
|
|
22
22
|
//# sourceMappingURL=CfgBoundingBox.d.ts.map
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
-
export class CfgBoundingBox {
|
|
3
|
-
constructor(minimum, maximum) {
|
|
4
|
-
/**
|
|
5
|
-
* Means that the bounding box should be seen as "undefined", which is not the same as "zero"
|
|
6
|
-
*/
|
|
7
|
-
this._isEmpty = true;
|
|
8
|
-
this.minimum = (minimum === null || minimum === void 0 ? void 0 : minimum.clone()) || Vector3.Zero();
|
|
9
|
-
this.maximum = (maximum === null || maximum === void 0 ? void 0 : maximum.clone()) || Vector3.Zero();
|
|
10
|
-
this._isEmpty = minimum === undefined && maximum === undefined;
|
|
11
|
-
}
|
|
12
|
-
reConstruct(minimum, maximum) {
|
|
13
|
-
this.minimum.copyFrom(minimum);
|
|
14
|
-
this.maximum.copyFrom(maximum);
|
|
15
|
-
this._isEmpty = false;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
copyFrom(source) {
|
|
19
|
-
this.reConstruct(source.minimum, source.maximum);
|
|
20
|
-
this._isEmpty = source.isEmpty;
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
clone() {
|
|
24
|
-
return new CfgBoundingBox(this.minimum, this.maximum);
|
|
25
|
-
}
|
|
26
|
-
get center() {
|
|
27
|
-
return Vector3.Center(this.minimum, this.maximum);
|
|
28
|
-
}
|
|
29
|
-
translate(vec) {
|
|
30
|
-
this.minimum.addInPlace(vec);
|
|
31
|
-
this.maximum.addInPlace(vec);
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
expand(otherBoundingBox) {
|
|
35
|
-
if (otherBoundingBox.isEmpty) {
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
if (this.isEmpty) {
|
|
39
|
-
this.reConstruct(otherBoundingBox.minimum, otherBoundingBox.maximum);
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
this.reConstruct(this.minimum.minimizeInPlace(otherBoundingBox.minimum), this.maximum.maximizeInPlace(otherBoundingBox.maximum));
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
expandWithPoint(point) {
|
|
46
|
-
if (this.isEmpty) {
|
|
47
|
-
this.reConstruct(point, point);
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
this.reConstruct(this.minimum.minimizeInPlace(point), this.maximum.maximizeInPlace(point));
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
applyMatrix(matrix) {
|
|
54
|
-
if (this.isEmpty) {
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
// Transform can be rotation, in which case we might need to re-minimize/maximize
|
|
58
|
-
const transformedMin = Vector3.TransformCoordinates(this.minimum, matrix);
|
|
59
|
-
const transformedMax = Vector3.TransformCoordinates(this.maximum, matrix);
|
|
60
|
-
this.reConstruct(transformedMin.clone().minimizeInPlace(transformedMax), transformedMax.maximizeInPlace(transformedMin));
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
get spaceDiagonal() {
|
|
64
|
-
if (this.isEmpty) {
|
|
65
|
-
return 0;
|
|
66
|
-
}
|
|
67
|
-
const minimum = this.minimum.asArray();
|
|
68
|
-
const maximum = this.maximum.asArray();
|
|
69
|
-
return Math.sqrt(minimum.reduce((a, c, i) => a + Math.pow(maximum[i] - c, 2)));
|
|
70
|
-
}
|
|
71
|
-
get isEmpty() {
|
|
72
|
-
return this._isEmpty;
|
|
73
|
-
}
|
|
74
|
-
get corners() {
|
|
75
|
-
const corners = [];
|
|
76
|
-
for (let a = 0; a < 8; a++) {
|
|
77
|
-
corners.push(new Vector3(((a & 1) === 0 ? this.minimum : this.maximum).x, ((a & 2) === 0 ? this.minimum : this.maximum).y, ((a & 4) === 0 ? this.minimum : this.maximum).z));
|
|
78
|
-
}
|
|
79
|
-
return corners;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
1
|
+
import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
+
export class CfgBoundingBox {
|
|
3
|
+
constructor(minimum, maximum) {
|
|
4
|
+
/**
|
|
5
|
+
* Means that the bounding box should be seen as "undefined", which is not the same as "zero"
|
|
6
|
+
*/
|
|
7
|
+
this._isEmpty = true;
|
|
8
|
+
this.minimum = (minimum === null || minimum === void 0 ? void 0 : minimum.clone()) || Vector3.Zero();
|
|
9
|
+
this.maximum = (maximum === null || maximum === void 0 ? void 0 : maximum.clone()) || Vector3.Zero();
|
|
10
|
+
this._isEmpty = minimum === undefined && maximum === undefined;
|
|
11
|
+
}
|
|
12
|
+
reConstruct(minimum, maximum) {
|
|
13
|
+
this.minimum.copyFrom(minimum);
|
|
14
|
+
this.maximum.copyFrom(maximum);
|
|
15
|
+
this._isEmpty = false;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
copyFrom(source) {
|
|
19
|
+
this.reConstruct(source.minimum, source.maximum);
|
|
20
|
+
this._isEmpty = source.isEmpty;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
clone() {
|
|
24
|
+
return new CfgBoundingBox(this.minimum, this.maximum);
|
|
25
|
+
}
|
|
26
|
+
get center() {
|
|
27
|
+
return Vector3.Center(this.minimum, this.maximum);
|
|
28
|
+
}
|
|
29
|
+
translate(vec) {
|
|
30
|
+
this.minimum.addInPlace(vec);
|
|
31
|
+
this.maximum.addInPlace(vec);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
expand(otherBoundingBox) {
|
|
35
|
+
if (otherBoundingBox.isEmpty) {
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
if (this.isEmpty) {
|
|
39
|
+
this.reConstruct(otherBoundingBox.minimum, otherBoundingBox.maximum);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
this.reConstruct(this.minimum.minimizeInPlace(otherBoundingBox.minimum), this.maximum.maximizeInPlace(otherBoundingBox.maximum));
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
expandWithPoint(point) {
|
|
46
|
+
if (this.isEmpty) {
|
|
47
|
+
this.reConstruct(point, point);
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
this.reConstruct(this.minimum.minimizeInPlace(point), this.maximum.maximizeInPlace(point));
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
applyMatrix(matrix) {
|
|
54
|
+
if (this.isEmpty) {
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
// Transform can be rotation, in which case we might need to re-minimize/maximize
|
|
58
|
+
const transformedMin = Vector3.TransformCoordinates(this.minimum, matrix);
|
|
59
|
+
const transformedMax = Vector3.TransformCoordinates(this.maximum, matrix);
|
|
60
|
+
this.reConstruct(transformedMin.clone().minimizeInPlace(transformedMax), transformedMax.maximizeInPlace(transformedMin));
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
get spaceDiagonal() {
|
|
64
|
+
if (this.isEmpty) {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
const minimum = this.minimum.asArray();
|
|
68
|
+
const maximum = this.maximum.asArray();
|
|
69
|
+
return Math.sqrt(minimum.reduce((a, c, i) => a + Math.pow(maximum[i] - c, 2)));
|
|
70
|
+
}
|
|
71
|
+
get isEmpty() {
|
|
72
|
+
return this._isEmpty;
|
|
73
|
+
}
|
|
74
|
+
get corners() {
|
|
75
|
+
const corners = [];
|
|
76
|
+
for (let a = 0; a < 8; a++) {
|
|
77
|
+
corners.push(new Vector3(((a & 1) === 0 ? this.minimum : this.maximum).x, ((a & 2) === 0 ? this.minimum : this.maximum).y, ((a & 4) === 0 ? this.minimum : this.maximum).z));
|
|
78
|
+
}
|
|
79
|
+
return corners;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { Matrix, Vector3 } from "@babylonjs/core";
|
|
2
|
-
import { DtoMeasureParam } from "@configura/web-api";
|
|
3
|
-
import { CfgMeasureDefinition, CfgMeasurePriority } from "@configura/web-api/dist/CfgMeasure";
|
|
4
|
-
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
5
|
-
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
6
|
-
export declare type CfgAnchorTargetNode = CfgSymRootNode;
|
|
7
|
-
export declare type CfgAnchorableNode = CfgSymRootNode | CfgProductNode;
|
|
8
|
-
export declare function nodeEqualsMeasurePriorityNodeReference(node: CfgAnchorTargetNode, ref: CfgMeasurePriority): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* The measureParamCode points to Measures inside Models. A Model can be used multiple times in a Product.
|
|
11
|
-
* More than one Model can use the same measureParamCode. Therefore what Measure an AnchorRef points to
|
|
12
|
-
* can be ambiguous. To help resolve the ambiguities, an anchorRef can have measurePriorities that
|
|
13
|
-
* governs which target it prefers to be anchored to.
|
|
14
|
-
*
|
|
15
|
-
* This method sorts the targets so that the highest priority (lowest index) one is first.
|
|
16
|
-
* Sorting is done in place on the original array.
|
|
17
|
-
*/
|
|
18
|
-
export declare const getAnchorTargetPriorityComparer: (measureDefinitions: CfgMeasureDefinition[]) => (measureParamCode: string, l: CfgAnchorTargetNode, r: CfgAnchorTargetNode) => number;
|
|
19
|
-
/**
|
|
20
|
-
* It might be possible in the future to anchor to other things than Measures (which are primarily)
|
|
21
|
-
* used for stretch, but for now we can only support anchoring to the ends of a Measure.
|
|
22
|
-
* toSp means anchor to start point, else end point.
|
|
23
|
-
* The DtoMeasureParam class is used in several different contexts. To make the intent inside Stage
|
|
24
|
-
* clear CfgAnchorRef exists, which including only what is relevant for when used for anchoring.
|
|
25
|
-
*/
|
|
26
|
-
export declare class CfgAnchorRef {
|
|
27
|
-
readonly stretchSymNodeId: string;
|
|
28
|
-
readonly toSp: boolean;
|
|
29
|
-
static make(m: DtoMeasureParam | undefined): CfgAnchorRef | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* The name stretchSymNodeId might seem confusing. And it is. Turns out CET is implemented so
|
|
32
|
-
* that it bases its anchoring on symNode Id containing the stretch. Not the measureParamId.
|
|
33
|
-
*/
|
|
34
|
-
private constructor();
|
|
35
|
-
equal(other: CfgAnchorRef): boolean;
|
|
36
|
-
}
|
|
37
|
-
/** Gets the coordinates of the anchor point relative the anchor target. */
|
|
38
|
-
export declare function getRawAnchorPoint(anchorTarget: CfgAnchorTargetNode | undefined, anchorRef: CfgAnchorRef | undefined): Vector3 | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Calculate a matrix which is the translation that makes a point move as if it was a child of
|
|
41
|
-
* anchorTarget and then moved to the end of the anchorPoint.
|
|
42
|
-
*
|
|
43
|
-
* It is assumed that all anchoring happens on symRoot/additionalProduct-level and therefore all anchorees are
|
|
44
|
-
* siblings to the anchorers.
|
|
45
|
-
*
|
|
46
|
-
* Application of anchoring happens from anchor tree root and out, so that originalMatrix of
|
|
47
|
-
* anchorTarget will already have any anchoring and stretch applied.
|
|
48
|
-
*/
|
|
49
|
-
export declare function getStretchedAnchorPointMatrix(anchorRef: CfgAnchorRef | undefined, anchorTarget: CfgAnchorTargetNode | undefined): Matrix | undefined;
|
|
50
|
-
export declare function updatedStretchedAnchorPointMatrix(anchorRef: CfgAnchorRef | undefined, anchorTarget: CfgAnchorTargetNode | undefined, currentStretchedAnchorPointMatrix: Matrix | undefined): Matrix | undefined;
|
|
1
|
+
import { Matrix, Vector3 } from "@babylonjs/core";
|
|
2
|
+
import { DtoMeasureParam } from "@configura/web-api";
|
|
3
|
+
import { CfgMeasureDefinition, CfgMeasurePriority } from "@configura/web-api/dist/CfgMeasure";
|
|
4
|
+
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
5
|
+
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
6
|
+
export declare type CfgAnchorTargetNode = CfgSymRootNode;
|
|
7
|
+
export declare type CfgAnchorableNode = CfgSymRootNode | CfgProductNode;
|
|
8
|
+
export declare function nodeEqualsMeasurePriorityNodeReference(node: CfgAnchorTargetNode, ref: CfgMeasurePriority): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The measureParamCode points to Measures inside Models. A Model can be used multiple times in a Product.
|
|
11
|
+
* More than one Model can use the same measureParamCode. Therefore what Measure an AnchorRef points to
|
|
12
|
+
* can be ambiguous. To help resolve the ambiguities, an anchorRef can have measurePriorities that
|
|
13
|
+
* governs which target it prefers to be anchored to.
|
|
14
|
+
*
|
|
15
|
+
* This method sorts the targets so that the highest priority (lowest index) one is first.
|
|
16
|
+
* Sorting is done in place on the original array.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAnchorTargetPriorityComparer: (measureDefinitions: CfgMeasureDefinition[]) => (measureParamCode: string, l: CfgAnchorTargetNode, r: CfgAnchorTargetNode) => number;
|
|
19
|
+
/**
|
|
20
|
+
* It might be possible in the future to anchor to other things than Measures (which are primarily)
|
|
21
|
+
* used for stretch, but for now we can only support anchoring to the ends of a Measure.
|
|
22
|
+
* toSp means anchor to start point, else end point.
|
|
23
|
+
* The DtoMeasureParam class is used in several different contexts. To make the intent inside Stage
|
|
24
|
+
* clear CfgAnchorRef exists, which including only what is relevant for when used for anchoring.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CfgAnchorRef {
|
|
27
|
+
readonly stretchSymNodeId: string;
|
|
28
|
+
readonly toSp: boolean;
|
|
29
|
+
static make(m: DtoMeasureParam | undefined): CfgAnchorRef | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The name stretchSymNodeId might seem confusing. And it is. Turns out CET is implemented so
|
|
32
|
+
* that it bases its anchoring on symNode Id containing the stretch. Not the measureParamId.
|
|
33
|
+
*/
|
|
34
|
+
private constructor();
|
|
35
|
+
equal(other: CfgAnchorRef): boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Gets the coordinates of the anchor point relative the anchor target. */
|
|
38
|
+
export declare function getRawAnchorPoint(anchorTarget: CfgAnchorTargetNode | undefined, anchorRef: CfgAnchorRef | undefined): Vector3 | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Calculate a matrix which is the translation that makes a point move as if it was a child of
|
|
41
|
+
* anchorTarget and then moved to the end of the anchorPoint.
|
|
42
|
+
*
|
|
43
|
+
* It is assumed that all anchoring happens on symRoot/additionalProduct-level and therefore all anchorees are
|
|
44
|
+
* siblings to the anchorers.
|
|
45
|
+
*
|
|
46
|
+
* Application of anchoring happens from anchor tree root and out, so that originalMatrix of
|
|
47
|
+
* anchorTarget will already have any anchoring and stretch applied.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getStretchedAnchorPointMatrix(anchorRef: CfgAnchorRef | undefined, anchorTarget: CfgAnchorTargetNode | undefined): Matrix | undefined;
|
|
50
|
+
export declare function updatedStretchedAnchorPointMatrix(anchorRef: CfgAnchorRef | undefined, anchorTarget: CfgAnchorTargetNode | undefined, currentStretchedAnchorPointMatrix: Matrix | undefined): Matrix | undefined;
|
|
51
51
|
//# sourceMappingURL=anchor.d.ts.map
|