@configura/babylon-view 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +5 -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 +76 -73
- package/dist/camera/CfgOrbitalCamera.js +281 -260
- package/dist/camera/CfgOrbitalCameraControlProps.d.ts +14 -11
- package/dist/camera/CfgOrbitalCameraControlProps.js +7 -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 +31 -29
- package/dist/io/CfgHistoryToCameraConfConnector.js +90 -80
- package/dist/io/CfgIOCameraConfConnector.d.ts +35 -35
- package/dist/io/CfgIOCameraConfConnector.js +81 -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 +38 -37
- package/dist/view/SingleProductDefaultCameraView.js +149 -145
- package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +44 -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,46 +1,46 @@
|
|
|
1
|
-
import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
-
import { CfgMaterialMapping, DtoTransform as ModelTransform, RootNodeSource } from "@configura/web-api";
|
|
3
|
-
import { SymNode } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
|
|
4
|
-
import { LengthUnit, Logger } from "@configura/web-utilities";
|
|
5
|
-
import { CoordinatorWithMeta } from "../animation/coordinator/Coordinator.js";
|
|
6
|
-
import { CfgStretchData } from "../geometry/stretch/CfgStretchData.js";
|
|
7
|
-
import { CfgAnchorRef, CfgAnchorTargetNode } from "../utilities/anchor/anchor.js";
|
|
8
|
-
import { RenderEnv } from "../view/RenderEnv.js";
|
|
9
|
-
import { CfgProductNode } from "./CfgProductNode.js";
|
|
10
|
-
import { CfgSymNode } from "./CfgSymNode.js";
|
|
11
|
-
export declare const MESH_UNIT: LengthUnit;
|
|
12
|
-
export declare function isSymRootNode(value: unknown): value is CfgSymRootNode;
|
|
13
|
-
export declare class CfgSymRootNode extends CfgSymNode {
|
|
14
|
-
private _isForDebug;
|
|
15
|
-
_identifier: string;
|
|
16
|
-
readonly anchorRef: CfgAnchorRef | undefined;
|
|
17
|
-
static makeCfgSymRootFromRootNodeSource(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, rootNodeSource: RootNodeSource): Promise<CfgSymRootNode | undefined>;
|
|
18
|
-
static makeCfgSymRootFromUrl(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, symUrl: string, transform: ModelTransform | undefined, anchorRef: CfgAnchorRef | undefined): Promise<CfgSymRootNode | undefined>;
|
|
19
|
-
static makeCfgSymRootFromFile(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, file: File): Promise<CfgSymRootNode | undefined>;
|
|
20
|
-
get cfgClassName(): string;
|
|
21
|
-
static makeCfgSymRootFromSymNode(logger: Logger, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, isForDebug: boolean, identifier: string, transform: ModelTransform | undefined, anchorRef: CfgAnchorRef | undefined, symNode: SymNode): Promise<CfgSymRootNode | undefined>;
|
|
22
|
-
private _destroyed;
|
|
23
|
-
private _originalMatrixWithModelTransform;
|
|
24
|
-
private _stretchDatas;
|
|
25
|
-
private _anchorTarget;
|
|
26
|
-
private _stretchedAnchorPointMatrix;
|
|
27
|
-
private constructor();
|
|
28
|
-
get isForDebug(): boolean;
|
|
29
|
-
isSameIdentifierTransformAndAnchor(rootNodeSource: RootNodeSource): boolean;
|
|
30
|
-
destroy(): void;
|
|
31
|
-
isDestroyed(): boolean;
|
|
32
|
-
applyGeo(): void;
|
|
33
|
-
setMaterialsAndLoad(areasToMaterials: CfgMaterialMapping, animatorCoordinator?: CoordinatorWithMeta): Promise<void>;
|
|
34
|
-
applyMaterial(): void;
|
|
35
|
-
private _modelTransform?;
|
|
36
|
-
private get modelTransform();
|
|
37
|
-
private set modelTransform(value);
|
|
38
|
-
get originalMatrix(): Matrix;
|
|
39
|
-
get stretchDatas(): CfgStretchData[];
|
|
40
|
-
get accumulatedStretchDatas(): CfgStretchData[];
|
|
41
|
-
setAnchorTarget(anchorTarget: CfgAnchorTargetNode | undefined): void;
|
|
42
|
-
refreshStretch(): void;
|
|
43
|
-
protected addInspectorProperties(): void;
|
|
44
|
-
private get _inspectorIsForDebug();
|
|
45
|
-
}
|
|
1
|
+
import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
+
import { CfgMaterialMapping, DtoTransform as ModelTransform, RootNodeSource } from "@configura/web-api";
|
|
3
|
+
import { SymNode } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
|
|
4
|
+
import { LengthUnit, Logger } from "@configura/web-utilities";
|
|
5
|
+
import { CoordinatorWithMeta } from "../animation/coordinator/Coordinator.js";
|
|
6
|
+
import { CfgStretchData } from "../geometry/stretch/CfgStretchData.js";
|
|
7
|
+
import { CfgAnchorRef, CfgAnchorTargetNode } from "../utilities/anchor/anchor.js";
|
|
8
|
+
import { RenderEnv } from "../view/RenderEnv.js";
|
|
9
|
+
import { CfgProductNode } from "./CfgProductNode.js";
|
|
10
|
+
import { CfgSymNode } from "./CfgSymNode.js";
|
|
11
|
+
export declare const MESH_UNIT: LengthUnit;
|
|
12
|
+
export declare function isSymRootNode(value: unknown): value is CfgSymRootNode;
|
|
13
|
+
export declare class CfgSymRootNode extends CfgSymNode {
|
|
14
|
+
private _isForDebug;
|
|
15
|
+
_identifier: string;
|
|
16
|
+
readonly anchorRef: CfgAnchorRef | undefined;
|
|
17
|
+
static makeCfgSymRootFromRootNodeSource(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, rootNodeSource: RootNodeSource): Promise<CfgSymRootNode | undefined>;
|
|
18
|
+
static makeCfgSymRootFromUrl(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, symUrl: string, transform: ModelTransform | undefined, anchorRef: CfgAnchorRef | undefined): Promise<CfgSymRootNode | undefined>;
|
|
19
|
+
static makeCfgSymRootFromFile(logger: Logger, isForDebug: boolean, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, file: File): Promise<CfgSymRootNode | undefined>;
|
|
20
|
+
get cfgClassName(): string;
|
|
21
|
+
static makeCfgSymRootFromSymNode(logger: Logger, renderEnvironment: RenderEnv, cfgProductNodeParent: CfgProductNode, isForDebug: boolean, identifier: string, transform: ModelTransform | undefined, anchorRef: CfgAnchorRef | undefined, symNode: SymNode): Promise<CfgSymRootNode | undefined>;
|
|
22
|
+
private _destroyed;
|
|
23
|
+
private _originalMatrixWithModelTransform;
|
|
24
|
+
private _stretchDatas;
|
|
25
|
+
private _anchorTarget;
|
|
26
|
+
private _stretchedAnchorPointMatrix;
|
|
27
|
+
private constructor();
|
|
28
|
+
get isForDebug(): boolean;
|
|
29
|
+
isSameIdentifierTransformAndAnchor(rootNodeSource: RootNodeSource): boolean;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
isDestroyed(): boolean;
|
|
32
|
+
applyGeo(): void;
|
|
33
|
+
setMaterialsAndLoad(areasToMaterials: CfgMaterialMapping, animatorCoordinator?: CoordinatorWithMeta): Promise<void>;
|
|
34
|
+
applyMaterial(): void;
|
|
35
|
+
private _modelTransform?;
|
|
36
|
+
private get modelTransform();
|
|
37
|
+
private set modelTransform(value);
|
|
38
|
+
get originalMatrix(): Matrix;
|
|
39
|
+
get stretchDatas(): CfgStretchData[];
|
|
40
|
+
get accumulatedStretchDatas(): CfgStretchData[];
|
|
41
|
+
setAnchorTarget(anchorTarget: CfgAnchorTargetNode | undefined): void;
|
|
42
|
+
refreshStretch(): void;
|
|
43
|
+
protected addInspectorProperties(): void;
|
|
44
|
+
private get _inspectorIsForDebug();
|
|
45
|
+
}
|
|
46
46
|
//# sourceMappingURL=CfgSymRootNode.d.ts.map
|
|
@@ -1,229 +1,229 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { InspectableType } from "@babylonjs/core/Misc/iInspectable.js";
|
|
11
|
-
import { isModel, } from "@configura/web-api";
|
|
12
|
-
import { SymGfxMode } from "@configura/web-core/dist/cm/format/cmsym/components/SymComponent.js";
|
|
13
|
-
import { loadSymFile, makeSymFromDex, } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
|
|
14
|
-
import { DetailLevel } from "@configura/web-core/dist/cm/geometry/DetailMask.js";
|
|
15
|
-
import { Point } from "@configura/web-core/dist/cm/geometry/Point.js";
|
|
16
|
-
import { readFileToArrayBuffer } from "@configura/web-utilities";
|
|
17
|
-
import { CfgStretchData } from "../geometry/stretch/CfgStretchData.js";
|
|
18
|
-
import { CfgAnchorRef, updatedStretchedAnchorPointMatrix, } from "../utilities/anchor/anchor.js";
|
|
19
|
-
import { modelTransformToSymTransform, symTransformToMatrix } from "../utilities/utilities3D.js";
|
|
20
|
-
import { isSameIdentifierTransformAndAnchor, makeIdentifier, makeIdentifierFromRootNodeSource, } from "../utilities/utilitiesSymRootIdentifier.js";
|
|
21
|
-
import { CfgSymNode } from "./CfgSymNode.js";
|
|
22
|
-
// It is currently assumed that all meshes are in meters
|
|
23
|
-
export const MESH_UNIT = "m";
|
|
24
|
-
export function isSymRootNode(value) {
|
|
25
|
-
return value instanceof CfgSymRootNode;
|
|
26
|
-
}
|
|
27
|
-
function loadCachedSymNode(logger, url, renderEnvironment) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
return renderEnvironment.symNodeCache.get(url, () => {
|
|
30
|
-
return loadSymFile(logger, url, renderEnvironment.dexManager);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function getBestMatchingDetailLevel(logger, symNode, allowedLevels) {
|
|
35
|
-
const symReps = symNode.symReps();
|
|
36
|
-
if (symReps === undefined) {
|
|
37
|
-
logger.warn("node has no SymReps", symNode);
|
|
38
|
-
return DetailLevel.undefined;
|
|
39
|
-
}
|
|
40
|
-
const detailMask = symReps.detailMask(SymGfxMode.x3D);
|
|
41
|
-
if (detailMask === undefined) {
|
|
42
|
-
logger.warn("symReps has no DetailMask", symReps);
|
|
43
|
-
return DetailLevel.undefined;
|
|
44
|
-
}
|
|
45
|
-
const detailLevel = detailMask.getBestMatch(allowedLevels);
|
|
46
|
-
if (detailLevel === undefined) {
|
|
47
|
-
logger.warn("No matching DetailLevel found", `available:${Array.from(detailMask.detailSet().values()).join(", ")}`, `allowed:${allowedLevels instanceof Array ? allowedLevels.join(", ") : allowedLevels}`);
|
|
48
|
-
return DetailLevel.undefined;
|
|
49
|
-
}
|
|
50
|
-
return detailLevel || DetailLevel.undefined;
|
|
51
|
-
}
|
|
52
|
-
export class CfgSymRootNode extends CfgSymNode {
|
|
53
|
-
constructor(renderEnvironment, cfgProductNodeParent, _isForDebug, detailLevel, symNode, _identifier, modelTransform, anchorRef) {
|
|
54
|
-
super(renderEnvironment, cfgProductNodeParent, undefined, detailLevel, symNode);
|
|
55
|
-
this._isForDebug = _isForDebug;
|
|
56
|
-
this._identifier = _identifier;
|
|
57
|
-
this.anchorRef = anchorRef;
|
|
58
|
-
this._destroyed = false;
|
|
59
|
-
this.name = "(SymRoot) " + symNode.id;
|
|
60
|
-
this.modelTransform = modelTransform;
|
|
61
|
-
this.initTransform();
|
|
62
|
-
}
|
|
63
|
-
static makeCfgSymRootFromRootNodeSource(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
return isModel(rootNodeSource)
|
|
66
|
-
? this.makeCfgSymRootFromUrl(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource.uri, rootNodeSource.t, CfgAnchorRef.make(rootNodeSource.anchor))
|
|
67
|
-
: this.makeCfgSymRootFromFile(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
static makeCfgSymRootFromUrl(logger, isForDebug, renderEnvironment, cfgProductNodeParent, symUrl, transform, anchorRef) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
if (!/.cmsym$/i.test(symUrl)) {
|
|
73
|
-
renderEnvironment.notifyError(logger.errorAsObject("Unsupported model URL (not cmsym format): ", symUrl));
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
const symNode = yield loadCachedSymNode(logger, symUrl, renderEnvironment);
|
|
78
|
-
return this.makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, makeIdentifier("uri", symUrl), transform, anchorRef, symNode);
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
logger.errorFromCaught(e);
|
|
82
|
-
renderEnvironment.notifyError("Failed to load model-file. Please reload or change selection.");
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
static makeCfgSymRootFromFile(logger, isForDebug, renderEnvironment, cfgProductNodeParent, file) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const arrayBuffer = yield readFileToArrayBuffer(file);
|
|
89
|
-
const dexObj = renderEnvironment.dexManager.arrayBufferToDexObj(logger, "", arrayBuffer.buffer);
|
|
90
|
-
const symNode = makeSymFromDex(logger, dexObj);
|
|
91
|
-
return this.makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, makeIdentifier("file", file.name), undefined, undefined, symNode);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
get cfgClassName() {
|
|
95
|
-
return "CfgSymRootNode";
|
|
96
|
-
}
|
|
97
|
-
static makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, identifier, transform, anchorRef, symNode) {
|
|
98
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
if (symNode === undefined) {
|
|
100
|
-
logger.warn("No symNode");
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const detailLevel = getBestMatchingDetailLevel(logger, symNode, renderEnvironment.allowedDetailLevels);
|
|
104
|
-
const node = new this(renderEnvironment, cfgProductNodeParent, isForDebug, detailLevel, symNode, identifier, transform, anchorRef);
|
|
105
|
-
yield this.initCfgSymNode(node);
|
|
106
|
-
return node;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
get isForDebug() {
|
|
110
|
-
return this._isForDebug;
|
|
111
|
-
}
|
|
112
|
-
isSameIdentifierTransformAndAnchor(rootNodeSource) {
|
|
113
|
-
return isSameIdentifierTransformAndAnchor(this._identifier, this.modelTransform, this.anchorRef, makeIdentifierFromRootNodeSource(rootNodeSource), isModel(rootNodeSource) ? rootNodeSource.t : undefined, isModel(rootNodeSource) ? CfgAnchorRef.make(rootNodeSource.anchor) : undefined);
|
|
114
|
-
}
|
|
115
|
-
destroy() {
|
|
116
|
-
this._destroyed = true;
|
|
117
|
-
}
|
|
118
|
-
isDestroyed() {
|
|
119
|
-
return this._destroyed;
|
|
120
|
-
}
|
|
121
|
-
applyGeo() {
|
|
122
|
-
if (this._destroyed) {
|
|
123
|
-
throw Error("Apply geo on destroyed node");
|
|
124
|
-
}
|
|
125
|
-
return super.applyGeo();
|
|
126
|
-
}
|
|
127
|
-
setMaterialsAndLoad(areasToMaterials, animatorCoordinator) {
|
|
128
|
-
const _super = Object.create(null, {
|
|
129
|
-
setMaterialsAndLoad: { get: () => super.setMaterialsAndLoad }
|
|
130
|
-
});
|
|
131
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
if (this._destroyed) {
|
|
133
|
-
throw Error("setMaterials on destroyed node");
|
|
134
|
-
}
|
|
135
|
-
yield _super.setMaterialsAndLoad.call(this, areasToMaterials, animatorCoordinator);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
applyMaterial() {
|
|
139
|
-
if (this._destroyed) {
|
|
140
|
-
throw Error("applyMaterial on destroyed node");
|
|
141
|
-
}
|
|
142
|
-
super.applyMaterial();
|
|
143
|
-
}
|
|
144
|
-
get modelTransform() {
|
|
145
|
-
return this._modelTransform;
|
|
146
|
-
}
|
|
147
|
-
set modelTransform(value) {
|
|
148
|
-
this._modelTransform = value;
|
|
149
|
-
this._originalMatrixWithModelTransform = undefined;
|
|
150
|
-
}
|
|
151
|
-
get originalMatrix() {
|
|
152
|
-
var _a, _b, _c;
|
|
153
|
-
if (this._originalMatrixWithModelTransform === undefined) {
|
|
154
|
-
const matrix = super.originalMatrix.clone();
|
|
155
|
-
const modelTransform = this.modelTransform;
|
|
156
|
-
if (modelTransform !== undefined) {
|
|
157
|
-
const modelSymTransform = modelTransformToSymTransform(modelTransform);
|
|
158
|
-
const modelMatrix = symTransformToMatrix(modelSymTransform.transform());
|
|
159
|
-
// The pivot point needs to compensate for any translation stored in the CmSym
|
|
160
|
-
// file. The same type of compensation is done in SymTransform#totalTransform.
|
|
161
|
-
let pivot = (_b = (_a = this._symNode.symTransform()) === null || _a === void 0 ? void 0 : _a.pivot) !== null && _b !== void 0 ? _b : new Point(0, 0, 0);
|
|
162
|
-
const pos = (_c = this._symNode.symTransform()) === null || _c === void 0 ? void 0 : _c.pos;
|
|
163
|
-
if (pos !== undefined) {
|
|
164
|
-
pivot = pivot.add(pos);
|
|
165
|
-
}
|
|
166
|
-
matrix.addTranslationFromFloats(-pivot.x, -pivot.y, -pivot.z);
|
|
167
|
-
matrix.multiplyToRef(modelMatrix, matrix);
|
|
168
|
-
matrix.addTranslationFromFloats(pivot.x, pivot.y, pivot.z);
|
|
169
|
-
}
|
|
170
|
-
const stretchedAnchorPointMatrix = this._stretchedAnchorPointMatrix;
|
|
171
|
-
if (stretchedAnchorPointMatrix !== undefined) {
|
|
172
|
-
matrix.multiplyToRef(stretchedAnchorPointMatrix, matrix);
|
|
173
|
-
}
|
|
174
|
-
this._originalMatrixWithModelTransform = matrix;
|
|
175
|
-
}
|
|
176
|
-
return this._originalMatrixWithModelTransform;
|
|
177
|
-
}
|
|
178
|
-
get stretchDatas() {
|
|
179
|
-
if (this._stretchDatas === undefined) {
|
|
180
|
-
const logger = this.logger;
|
|
181
|
-
const detailLevel = this._detailLevel;
|
|
182
|
-
const stretchDatas = [];
|
|
183
|
-
for (const childNode of this._symNode.children(logger, true, true).values()) {
|
|
184
|
-
if (!childNode.isStretch(logger, detailLevel)) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
const stretchData = CfgStretchData.make(logger, childNode, detailLevel);
|
|
188
|
-
if (stretchData === undefined) {
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
stretchDatas.push(stretchData);
|
|
192
|
-
}
|
|
193
|
-
this._stretchDatas = stretchDatas;
|
|
194
|
-
}
|
|
195
|
-
return this._stretchDatas;
|
|
196
|
-
}
|
|
197
|
-
get accumulatedStretchDatas() {
|
|
198
|
-
return this.stretchDatas;
|
|
199
|
-
}
|
|
200
|
-
setAnchorTarget(anchorTarget) {
|
|
201
|
-
this._anchorTarget = anchorTarget;
|
|
202
|
-
}
|
|
203
|
-
refreshStretch() {
|
|
204
|
-
super.refreshStretch();
|
|
205
|
-
const updated = updatedStretchedAnchorPointMatrix(this.anchorRef, this._anchorTarget, this._stretchedAnchorPointMatrix);
|
|
206
|
-
if (updated === undefined) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
this._stretchedAnchorPointMatrix = updated;
|
|
210
|
-
this._originalMatrixWithModelTransform = undefined; // Reset the matrix
|
|
211
|
-
this.initTransform();
|
|
212
|
-
}
|
|
213
|
-
addInspectorProperties() {
|
|
214
|
-
super.addInspectorProperties();
|
|
215
|
-
this.addInspectableCustomProperty({
|
|
216
|
-
label: "Is for Debug",
|
|
217
|
-
propertyName: "_inspectorIsForDebug",
|
|
218
|
-
type: InspectableType.String,
|
|
219
|
-
});
|
|
220
|
-
this.addInspectableCustomProperty({
|
|
221
|
-
label: "SymUrl",
|
|
222
|
-
propertyName: "_symUrl",
|
|
223
|
-
type: InspectableType.String,
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
get _inspectorIsForDebug() {
|
|
227
|
-
return this._isForDebug ? "Yes" : "No";
|
|
228
|
-
}
|
|
229
|
-
}
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { InspectableType } from "@babylonjs/core/Misc/iInspectable.js";
|
|
11
|
+
import { isModel, } from "@configura/web-api";
|
|
12
|
+
import { SymGfxMode } from "@configura/web-core/dist/cm/format/cmsym/components/SymComponent.js";
|
|
13
|
+
import { loadSymFile, makeSymFromDex, } from "@configura/web-core/dist/cm/format/cmsym/SymNode.js";
|
|
14
|
+
import { DetailLevel } from "@configura/web-core/dist/cm/geometry/DetailMask.js";
|
|
15
|
+
import { Point } from "@configura/web-core/dist/cm/geometry/Point.js";
|
|
16
|
+
import { readFileToArrayBuffer } from "@configura/web-utilities";
|
|
17
|
+
import { CfgStretchData } from "../geometry/stretch/CfgStretchData.js";
|
|
18
|
+
import { CfgAnchorRef, updatedStretchedAnchorPointMatrix, } from "../utilities/anchor/anchor.js";
|
|
19
|
+
import { modelTransformToSymTransform, symTransformToMatrix } from "../utilities/utilities3D.js";
|
|
20
|
+
import { isSameIdentifierTransformAndAnchor, makeIdentifier, makeIdentifierFromRootNodeSource, } from "../utilities/utilitiesSymRootIdentifier.js";
|
|
21
|
+
import { CfgSymNode } from "./CfgSymNode.js";
|
|
22
|
+
// It is currently assumed that all meshes are in meters
|
|
23
|
+
export const MESH_UNIT = "m";
|
|
24
|
+
export function isSymRootNode(value) {
|
|
25
|
+
return value instanceof CfgSymRootNode;
|
|
26
|
+
}
|
|
27
|
+
function loadCachedSymNode(logger, url, renderEnvironment) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
return renderEnvironment.symNodeCache.get(url, () => {
|
|
30
|
+
return loadSymFile(logger, url, renderEnvironment.dexManager);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function getBestMatchingDetailLevel(logger, symNode, allowedLevels) {
|
|
35
|
+
const symReps = symNode.symReps();
|
|
36
|
+
if (symReps === undefined) {
|
|
37
|
+
logger.warn("node has no SymReps", symNode);
|
|
38
|
+
return DetailLevel.undefined;
|
|
39
|
+
}
|
|
40
|
+
const detailMask = symReps.detailMask(SymGfxMode.x3D);
|
|
41
|
+
if (detailMask === undefined) {
|
|
42
|
+
logger.warn("symReps has no DetailMask", symReps);
|
|
43
|
+
return DetailLevel.undefined;
|
|
44
|
+
}
|
|
45
|
+
const detailLevel = detailMask.getBestMatch(allowedLevels);
|
|
46
|
+
if (detailLevel === undefined) {
|
|
47
|
+
logger.warn("No matching DetailLevel found", `available:${Array.from(detailMask.detailSet().values()).join(", ")}`, `allowed:${allowedLevels instanceof Array ? allowedLevels.join(", ") : allowedLevels}`);
|
|
48
|
+
return DetailLevel.undefined;
|
|
49
|
+
}
|
|
50
|
+
return detailLevel || DetailLevel.undefined;
|
|
51
|
+
}
|
|
52
|
+
export class CfgSymRootNode extends CfgSymNode {
|
|
53
|
+
constructor(renderEnvironment, cfgProductNodeParent, _isForDebug, detailLevel, symNode, _identifier, modelTransform, anchorRef) {
|
|
54
|
+
super(renderEnvironment, cfgProductNodeParent, undefined, detailLevel, symNode);
|
|
55
|
+
this._isForDebug = _isForDebug;
|
|
56
|
+
this._identifier = _identifier;
|
|
57
|
+
this.anchorRef = anchorRef;
|
|
58
|
+
this._destroyed = false;
|
|
59
|
+
this.name = "(SymRoot) " + symNode.id;
|
|
60
|
+
this.modelTransform = modelTransform;
|
|
61
|
+
this.initTransform();
|
|
62
|
+
}
|
|
63
|
+
static makeCfgSymRootFromRootNodeSource(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
return isModel(rootNodeSource)
|
|
66
|
+
? this.makeCfgSymRootFromUrl(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource.uri, rootNodeSource.t, CfgAnchorRef.make(rootNodeSource.anchor))
|
|
67
|
+
: this.makeCfgSymRootFromFile(logger, isForDebug, renderEnvironment, cfgProductNodeParent, rootNodeSource);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
static makeCfgSymRootFromUrl(logger, isForDebug, renderEnvironment, cfgProductNodeParent, symUrl, transform, anchorRef) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
if (!/.cmsym$/i.test(symUrl)) {
|
|
73
|
+
renderEnvironment.notifyError(logger.errorAsObject("Unsupported model URL (not cmsym format): ", symUrl));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const symNode = yield loadCachedSymNode(logger, symUrl, renderEnvironment);
|
|
78
|
+
return this.makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, makeIdentifier("uri", symUrl), transform, anchorRef, symNode);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
logger.errorFromCaught(e);
|
|
82
|
+
renderEnvironment.notifyError("Failed to load model-file. Please reload or change selection.");
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static makeCfgSymRootFromFile(logger, isForDebug, renderEnvironment, cfgProductNodeParent, file) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const arrayBuffer = yield readFileToArrayBuffer(file);
|
|
89
|
+
const dexObj = renderEnvironment.dexManager.arrayBufferToDexObj(logger, "", arrayBuffer.buffer);
|
|
90
|
+
const symNode = makeSymFromDex(logger, dexObj);
|
|
91
|
+
return this.makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, makeIdentifier("file", file.name), undefined, undefined, symNode);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
get cfgClassName() {
|
|
95
|
+
return "CfgSymRootNode";
|
|
96
|
+
}
|
|
97
|
+
static makeCfgSymRootFromSymNode(logger, renderEnvironment, cfgProductNodeParent, isForDebug, identifier, transform, anchorRef, symNode) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
if (symNode === undefined) {
|
|
100
|
+
logger.warn("No symNode");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const detailLevel = getBestMatchingDetailLevel(logger, symNode, renderEnvironment.allowedDetailLevels);
|
|
104
|
+
const node = new this(renderEnvironment, cfgProductNodeParent, isForDebug, detailLevel, symNode, identifier, transform, anchorRef);
|
|
105
|
+
yield this.initCfgSymNode(node);
|
|
106
|
+
return node;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
get isForDebug() {
|
|
110
|
+
return this._isForDebug;
|
|
111
|
+
}
|
|
112
|
+
isSameIdentifierTransformAndAnchor(rootNodeSource) {
|
|
113
|
+
return isSameIdentifierTransformAndAnchor(this._identifier, this.modelTransform, this.anchorRef, makeIdentifierFromRootNodeSource(rootNodeSource), isModel(rootNodeSource) ? rootNodeSource.t : undefined, isModel(rootNodeSource) ? CfgAnchorRef.make(rootNodeSource.anchor) : undefined);
|
|
114
|
+
}
|
|
115
|
+
destroy() {
|
|
116
|
+
this._destroyed = true;
|
|
117
|
+
}
|
|
118
|
+
isDestroyed() {
|
|
119
|
+
return this._destroyed;
|
|
120
|
+
}
|
|
121
|
+
applyGeo() {
|
|
122
|
+
if (this._destroyed) {
|
|
123
|
+
throw Error("Apply geo on destroyed node");
|
|
124
|
+
}
|
|
125
|
+
return super.applyGeo();
|
|
126
|
+
}
|
|
127
|
+
setMaterialsAndLoad(areasToMaterials, animatorCoordinator) {
|
|
128
|
+
const _super = Object.create(null, {
|
|
129
|
+
setMaterialsAndLoad: { get: () => super.setMaterialsAndLoad }
|
|
130
|
+
});
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
if (this._destroyed) {
|
|
133
|
+
throw Error("setMaterials on destroyed node");
|
|
134
|
+
}
|
|
135
|
+
yield _super.setMaterialsAndLoad.call(this, areasToMaterials, animatorCoordinator);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
applyMaterial() {
|
|
139
|
+
if (this._destroyed) {
|
|
140
|
+
throw Error("applyMaterial on destroyed node");
|
|
141
|
+
}
|
|
142
|
+
super.applyMaterial();
|
|
143
|
+
}
|
|
144
|
+
get modelTransform() {
|
|
145
|
+
return this._modelTransform;
|
|
146
|
+
}
|
|
147
|
+
set modelTransform(value) {
|
|
148
|
+
this._modelTransform = value;
|
|
149
|
+
this._originalMatrixWithModelTransform = undefined;
|
|
150
|
+
}
|
|
151
|
+
get originalMatrix() {
|
|
152
|
+
var _a, _b, _c;
|
|
153
|
+
if (this._originalMatrixWithModelTransform === undefined) {
|
|
154
|
+
const matrix = super.originalMatrix.clone();
|
|
155
|
+
const modelTransform = this.modelTransform;
|
|
156
|
+
if (modelTransform !== undefined) {
|
|
157
|
+
const modelSymTransform = modelTransformToSymTransform(modelTransform);
|
|
158
|
+
const modelMatrix = symTransformToMatrix(modelSymTransform.transform());
|
|
159
|
+
// The pivot point needs to compensate for any translation stored in the CmSym
|
|
160
|
+
// file. The same type of compensation is done in SymTransform#totalTransform.
|
|
161
|
+
let pivot = (_b = (_a = this._symNode.symTransform()) === null || _a === void 0 ? void 0 : _a.pivot) !== null && _b !== void 0 ? _b : new Point(0, 0, 0);
|
|
162
|
+
const pos = (_c = this._symNode.symTransform()) === null || _c === void 0 ? void 0 : _c.pos;
|
|
163
|
+
if (pos !== undefined) {
|
|
164
|
+
pivot = pivot.add(pos);
|
|
165
|
+
}
|
|
166
|
+
matrix.addTranslationFromFloats(-pivot.x, -pivot.y, -pivot.z);
|
|
167
|
+
matrix.multiplyToRef(modelMatrix, matrix);
|
|
168
|
+
matrix.addTranslationFromFloats(pivot.x, pivot.y, pivot.z);
|
|
169
|
+
}
|
|
170
|
+
const stretchedAnchorPointMatrix = this._stretchedAnchorPointMatrix;
|
|
171
|
+
if (stretchedAnchorPointMatrix !== undefined) {
|
|
172
|
+
matrix.multiplyToRef(stretchedAnchorPointMatrix, matrix);
|
|
173
|
+
}
|
|
174
|
+
this._originalMatrixWithModelTransform = matrix;
|
|
175
|
+
}
|
|
176
|
+
return this._originalMatrixWithModelTransform;
|
|
177
|
+
}
|
|
178
|
+
get stretchDatas() {
|
|
179
|
+
if (this._stretchDatas === undefined) {
|
|
180
|
+
const logger = this.logger;
|
|
181
|
+
const detailLevel = this._detailLevel;
|
|
182
|
+
const stretchDatas = [];
|
|
183
|
+
for (const childNode of this._symNode.children(logger, true, true).values()) {
|
|
184
|
+
if (!childNode.isStretch(logger, detailLevel)) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const stretchData = CfgStretchData.make(logger, childNode, detailLevel);
|
|
188
|
+
if (stretchData === undefined) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
stretchDatas.push(stretchData);
|
|
192
|
+
}
|
|
193
|
+
this._stretchDatas = stretchDatas;
|
|
194
|
+
}
|
|
195
|
+
return this._stretchDatas;
|
|
196
|
+
}
|
|
197
|
+
get accumulatedStretchDatas() {
|
|
198
|
+
return this.stretchDatas;
|
|
199
|
+
}
|
|
200
|
+
setAnchorTarget(anchorTarget) {
|
|
201
|
+
this._anchorTarget = anchorTarget;
|
|
202
|
+
}
|
|
203
|
+
refreshStretch() {
|
|
204
|
+
super.refreshStretch();
|
|
205
|
+
const updated = updatedStretchedAnchorPointMatrix(this.anchorRef, this._anchorTarget, this._stretchedAnchorPointMatrix);
|
|
206
|
+
if (updated === undefined) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
this._stretchedAnchorPointMatrix = updated;
|
|
210
|
+
this._originalMatrixWithModelTransform = undefined; // Reset the matrix
|
|
211
|
+
this.initTransform();
|
|
212
|
+
}
|
|
213
|
+
addInspectorProperties() {
|
|
214
|
+
super.addInspectorProperties();
|
|
215
|
+
this.addInspectableCustomProperty({
|
|
216
|
+
label: "Is for Debug",
|
|
217
|
+
propertyName: "_inspectorIsForDebug",
|
|
218
|
+
type: InspectableType.String,
|
|
219
|
+
});
|
|
220
|
+
this.addInspectableCustomProperty({
|
|
221
|
+
label: "SymUrl",
|
|
222
|
+
propertyName: "_symUrl",
|
|
223
|
+
type: InspectableType.String,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
get _inspectorIsForDebug() {
|
|
227
|
+
return this._isForDebug ? "Yes" : "No";
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
-
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
3
|
-
import { IInspectable } from "@babylonjs/core/Misc/iInspectable.js";
|
|
4
|
-
import { Node } from "@babylonjs/core/node.js";
|
|
5
|
-
import { RenderEnv } from "../view/RenderEnv.js";
|
|
6
|
-
export declare abstract class CfgTransformNode extends TransformNode {
|
|
7
|
-
protected _renderEnvironment: RenderEnv;
|
|
8
|
-
constructor(_renderEnvironment: RenderEnv, name: string);
|
|
9
|
-
/**
|
|
10
|
-
* Provides a class name to show in the Babylon.js Inspector.
|
|
11
|
-
* Override in subclasses.
|
|
12
|
-
*/
|
|
13
|
-
get cfgClassName(): string;
|
|
14
|
-
protected getChildrenForAnimation(): CfgTransformNode[];
|
|
15
|
-
clear(dispose: boolean): void;
|
|
16
|
-
add(...objects: Node[]): void;
|
|
17
|
-
abstract get originalMatrix(): Matrix;
|
|
18
|
-
/**
|
|
19
|
-
* Recursively calculates the world matrix based on originalMatrix on nodes which inherits
|
|
20
|
-
* CfgTransformNode.
|
|
21
|
-
*/
|
|
22
|
-
get worldOriginalMatrix(): Matrix;
|
|
23
|
-
remove(dispose: boolean, ...objects: Node[]): this;
|
|
24
|
-
/**
|
|
25
|
-
* Adds the property to the instance so it shows up in the Babylon.js Inspector.
|
|
26
|
-
*
|
|
27
|
-
* TODO Babylon: Currently they show up as editable, even though they are used to display
|
|
28
|
-
* read-only information. Metadata seems to be more correct, but is not (yet?) included by the
|
|
29
|
-
* Inspector.
|
|
30
|
-
*/
|
|
31
|
-
protected addInspectableCustomProperty(property: IInspectable): void;
|
|
32
|
-
protected addInspectorProperties(): void;
|
|
33
|
-
}
|
|
1
|
+
import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
2
|
+
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
3
|
+
import { IInspectable } from "@babylonjs/core/Misc/iInspectable.js";
|
|
4
|
+
import { Node } from "@babylonjs/core/node.js";
|
|
5
|
+
import { RenderEnv } from "../view/RenderEnv.js";
|
|
6
|
+
export declare abstract class CfgTransformNode extends TransformNode {
|
|
7
|
+
protected _renderEnvironment: RenderEnv;
|
|
8
|
+
constructor(_renderEnvironment: RenderEnv, name: string);
|
|
9
|
+
/**
|
|
10
|
+
* Provides a class name to show in the Babylon.js Inspector.
|
|
11
|
+
* Override in subclasses.
|
|
12
|
+
*/
|
|
13
|
+
get cfgClassName(): string;
|
|
14
|
+
protected getChildrenForAnimation(): CfgTransformNode[];
|
|
15
|
+
clear(dispose: boolean): void;
|
|
16
|
+
add(...objects: Node[]): void;
|
|
17
|
+
abstract get originalMatrix(): Matrix;
|
|
18
|
+
/**
|
|
19
|
+
* Recursively calculates the world matrix based on originalMatrix on nodes which inherits
|
|
20
|
+
* CfgTransformNode.
|
|
21
|
+
*/
|
|
22
|
+
get worldOriginalMatrix(): Matrix;
|
|
23
|
+
remove(dispose: boolean, ...objects: Node[]): this;
|
|
24
|
+
/**
|
|
25
|
+
* Adds the property to the instance so it shows up in the Babylon.js Inspector.
|
|
26
|
+
*
|
|
27
|
+
* TODO Babylon: Currently they show up as editable, even though they are used to display
|
|
28
|
+
* read-only information. Metadata seems to be more correct, but is not (yet?) included by the
|
|
29
|
+
* Inspector.
|
|
30
|
+
*/
|
|
31
|
+
protected addInspectableCustomProperty(property: IInspectable): void;
|
|
32
|
+
protected addInspectorProperties(): void;
|
|
33
|
+
}
|
|
34
34
|
//# sourceMappingURL=CfgTransformNode.d.ts.map
|