@babylonjs/core 8.45.4 → 8.45.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/webAudio/components/webAudioParameterComponent.js +5 -1
- package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.loadFile.d.ts +11 -0
- package/Engines/AbstractEngine/abstractEngine.loadFile.js +12 -0
- package/Engines/AbstractEngine/abstractEngine.loadFile.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.d.ts +1 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js +4 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js.map +1 -0
- package/Engines/AbstractEngine/index.d.ts +2 -0
- package/Engines/AbstractEngine/index.js +2 -0
- package/Engines/AbstractEngine/index.js.map +1 -1
- package/Engines/Native/Extensions/index.d.ts +1 -0
- package/Engines/Native/Extensions/index.js +2 -0
- package/Engines/Native/Extensions/index.js.map +1 -0
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.d.ts +27 -0
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.js +96 -0
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.js.map +1 -0
- package/Engines/Native/nativePipelineContext.d.ts +2 -2
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +3 -3
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Native/validatedNativeDataStream.js +2 -2
- package/Engines/Native/validatedNativeDataStream.js.map +1 -1
- package/Engines/abstractEngine.d.ts +9 -0
- package/Engines/abstractEngine.js +13 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +2 -6
- package/Engines/engine.js +2 -13
- package/Engines/engine.js.map +1 -1
- package/Engines/index.d.ts +1 -0
- package/Engines/index.js +1 -0
- package/Engines/index.js.map +1 -1
- package/Engines/nativeEngine.d.ts +19 -536
- package/Engines/nativeEngine.js +27 -2127
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +2 -0
- package/Engines/nullEngine.js +2 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinNativeEngine.d.ts +537 -0
- package/Engines/thinNativeEngine.js +2033 -0
- package/Engines/thinNativeEngine.js.map +1 -0
- package/Engines/webgpuEngine.d.ts +2 -0
- package/Engines/webgpuEngine.js +2 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Misc/tools.d.ts +3 -1
- package/Misc/tools.js +76 -59
- package/Misc/tools.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +2 -0
- package/Particles/Node/Blocks/index.js +2 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleClampBlock.d.ts +42 -0
- package/Particles/Node/Blocks/particleClampBlock.js +114 -0
- package/Particles/Node/Blocks/particleClampBlock.js.map +1 -0
- package/XR/native/nativeXRFrame.js +1 -1
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
2
|
+
import type { NodeParticleConnectionPoint } from "../nodeParticleBlockConnectionPoint.js";
|
|
3
|
+
import type { NodeParticleBuildState } from "../nodeParticleBuildState.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to clamp a float
|
|
6
|
+
*/
|
|
7
|
+
export declare class ParticleClampBlock extends NodeParticleBlock {
|
|
8
|
+
/** Gets or sets the minimum range */
|
|
9
|
+
get minimum(): number;
|
|
10
|
+
set minimum(value: number);
|
|
11
|
+
/** Gets or sets the maximum range */
|
|
12
|
+
get maximum(): number;
|
|
13
|
+
set maximum(value: number);
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new ParticleClampBlock
|
|
16
|
+
* @param name defines the block name
|
|
17
|
+
*/
|
|
18
|
+
constructor(name: string);
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current class name
|
|
21
|
+
* @returns the class name
|
|
22
|
+
*/
|
|
23
|
+
getClassName(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the value input component
|
|
26
|
+
*/
|
|
27
|
+
get value(): NodeParticleConnectionPoint;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the min input component
|
|
30
|
+
*/
|
|
31
|
+
get min(): NodeParticleConnectionPoint;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the max input component
|
|
34
|
+
*/
|
|
35
|
+
get max(): NodeParticleConnectionPoint;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the output component
|
|
38
|
+
*/
|
|
39
|
+
get output(): NodeParticleConnectionPoint;
|
|
40
|
+
_build(state: NodeParticleBuildState): this | undefined;
|
|
41
|
+
_deserialize(serializationObject: any): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { Vector2, Vector3 } from "../../../Maths/math.vector.js";
|
|
3
|
+
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
4
|
+
import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
5
|
+
import { Color4 } from "../../../Maths/math.color.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block used to clamp a float
|
|
8
|
+
*/
|
|
9
|
+
export class ParticleClampBlock extends NodeParticleBlock {
|
|
10
|
+
/** Gets or sets the minimum range */
|
|
11
|
+
get minimum() {
|
|
12
|
+
return this.min.value;
|
|
13
|
+
}
|
|
14
|
+
set minimum(value) {
|
|
15
|
+
this.min.value = value;
|
|
16
|
+
}
|
|
17
|
+
/** Gets or sets the maximum range */
|
|
18
|
+
get maximum() {
|
|
19
|
+
return this.max.value;
|
|
20
|
+
}
|
|
21
|
+
set maximum(value) {
|
|
22
|
+
this.max.value = value;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new ParticleClampBlock
|
|
26
|
+
* @param name defines the block name
|
|
27
|
+
*/
|
|
28
|
+
constructor(name) {
|
|
29
|
+
super(name);
|
|
30
|
+
this.registerInput("value", NodeParticleBlockConnectionPointTypes.AutoDetect);
|
|
31
|
+
this.registerInput("min", NodeParticleBlockConnectionPointTypes.Float, true, 0);
|
|
32
|
+
this.registerInput("max", NodeParticleBlockConnectionPointTypes.Float, true, 1);
|
|
33
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
|
|
34
|
+
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
35
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);
|
|
36
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);
|
|
37
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);
|
|
38
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.FloatGradient);
|
|
39
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector2Gradient);
|
|
40
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3Gradient);
|
|
41
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Color4Gradient);
|
|
42
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.System);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Gets the current class name
|
|
46
|
+
* @returns the class name
|
|
47
|
+
*/
|
|
48
|
+
getClassName() {
|
|
49
|
+
return "ParticleClampBlock";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Gets the value input component
|
|
53
|
+
*/
|
|
54
|
+
get value() {
|
|
55
|
+
return this._inputs[0];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Gets the min input component
|
|
59
|
+
*/
|
|
60
|
+
get min() {
|
|
61
|
+
return this._inputs[1];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Gets the max input component
|
|
65
|
+
*/
|
|
66
|
+
get max() {
|
|
67
|
+
return this._inputs[2];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets the output component
|
|
71
|
+
*/
|
|
72
|
+
get output() {
|
|
73
|
+
return this._outputs[0];
|
|
74
|
+
}
|
|
75
|
+
_build(state) {
|
|
76
|
+
if (!this.value.isConnected) {
|
|
77
|
+
this.output._storedFunction = null;
|
|
78
|
+
this.output._storedValue = null;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const func = (value, min, max) => {
|
|
82
|
+
return Math.max(min, Math.min(value, max));
|
|
83
|
+
};
|
|
84
|
+
this.output._storedFunction = (state) => {
|
|
85
|
+
const value = this.value.getConnectedValue(state);
|
|
86
|
+
const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;
|
|
87
|
+
const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;
|
|
88
|
+
switch (this.value.type) {
|
|
89
|
+
case NodeParticleBlockConnectionPointTypes.Int:
|
|
90
|
+
case NodeParticleBlockConnectionPointTypes.Float: {
|
|
91
|
+
return func(value, min, max);
|
|
92
|
+
}
|
|
93
|
+
case NodeParticleBlockConnectionPointTypes.Vector2: {
|
|
94
|
+
return new Vector2(func(value.x, min, max), func(value.y, min, max));
|
|
95
|
+
}
|
|
96
|
+
case NodeParticleBlockConnectionPointTypes.Vector3: {
|
|
97
|
+
return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));
|
|
98
|
+
}
|
|
99
|
+
case NodeParticleBlockConnectionPointTypes.Color4: {
|
|
100
|
+
return new Color4(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return 0;
|
|
104
|
+
};
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
_deserialize(serializationObject) {
|
|
108
|
+
super._deserialize(serializationObject);
|
|
109
|
+
this.minimum = serializationObject.minimum;
|
|
110
|
+
this.maximum = serializationObject.maximum;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
RegisterClass("BABYLON.ParticleClampBlock", ParticleClampBlock);
|
|
114
|
+
//# sourceMappingURL=particleClampBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particleClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleClampBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IACrD,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO,CAAC,KAAa;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO,CAAC,KAAa;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,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1H,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"../../../Maths/math.color\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class ParticleClampBlock extends NodeParticleBlock {\r\n /** Gets or sets the minimum range */\r\n public get minimum() {\r\n return this.min.value;\r\n }\r\n\r\n public set minimum(value: number) {\r\n this.min.value = value;\r\n }\r\n\r\n /** Gets or sets the maximum range */\r\n public get maximum() {\r\n return this.max.value;\r\n }\r\n\r\n public set maximum(value: number) {\r\n this.max.value = value;\r\n }\r\n\r\n /**\r\n * Creates a new ParticleClampBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"min\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"max\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.FloatGradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector2Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Color4Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.System);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleClampBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build(state: NodeParticleBuildState) {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(value, min, max);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(value.x, min, max), func(value.y, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleClampBlock\", ParticleClampBlock);\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeXRFrame.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/native/nativeXRFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nativeXRFrame.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/native/nativeXRFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AASzE,gBAAgB;AAChB,MAAM,OAAO,aAAa;IAStB,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,YAAoB,WAA2B;QAA3B,gBAAW,GAAX,WAAW,CAAgB;QAZ9B,iBAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,YAAO,GAAW;YAC/B,SAAS,EAAE,IAAI,CAAC,YA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C,kDAAkD,CAAC,CAAC;QACpE,qDAAqD;IACzD,CAAC;CACJ;AAED,mEAAmE;AACnE,uBAAuB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { RegisterNativeTypeAsync } from \"../../Engines/thinNativeEngine\";\r\n\r\n/** @internal */\r\ninterface INativeXRFrame extends XRFrame {\r\n // Native-only helper functions\r\n getPoseData: (space: XRSpace, baseSpace: XRReferenceSpace, vectorBuffer: ArrayBuffer, matrixBuffer: ArrayBuffer) => XRPose;\r\n _imageTrackingResults?: XRImageTrackingResult[];\r\n}\r\n\r\n/** @internal */\r\nexport class NativeXRFrame implements XRFrame {\r\n private readonly _xrTransform = new XRRigidTransform();\r\n private readonly _xrPose: XRPose = {\r\n transform: this._xrTransform,\r\n emulatedPosition: false,\r\n };\r\n // Enough space for position, orientation\r\n private readonly _xrPoseVectorData = new Float32Array(4 + 4);\r\n\r\n public get session(): XRSession {\r\n return this._nativeImpl.session;\r\n }\r\n\r\n constructor(private _nativeImpl: INativeXRFrame) {}\r\n\r\n public getPose(space: XRSpace, baseSpace: XRReferenceSpace): XRPose | undefined {\r\n if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {\r\n return undefined;\r\n }\r\n const position = this._xrTransform.position as DOMPoint;\r\n position.x = this._xrPoseVectorData[0];\r\n position.y = this._xrPoseVectorData[1];\r\n position.z = this._xrPoseVectorData[2];\r\n position.w = this._xrPoseVectorData[3];\r\n\r\n const orientation = this._xrTransform.orientation as DOMPoint;\r\n orientation.x = this._xrPoseVectorData[4];\r\n orientation.y = this._xrPoseVectorData[5];\r\n orientation.z = this._xrPoseVectorData[6];\r\n orientation.w = this._xrPoseVectorData[7];\r\n return this._xrPose;\r\n }\r\n\r\n public readonly fillPoses = this._nativeImpl.fillPoses!.bind(this._nativeImpl);\r\n\r\n public readonly getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResultsForTransientInput = () => {\r\n throw new Error(\"XRFrame.getHitTestResultsForTransientInput not supported on native.\");\r\n };\r\n\r\n public get trackedAnchors(): XRAnchorSet | undefined {\r\n return this._nativeImpl.trackedAnchors;\r\n }\r\n\r\n public readonly createAnchor = this._nativeImpl.createAnchor!.bind(this._nativeImpl);\r\n\r\n public get worldInformation(): XRWorldInformation | undefined {\r\n return this._nativeImpl.worldInformation;\r\n }\r\n\r\n public get detectedPlanes(): XRPlaneSet | undefined {\r\n return this._nativeImpl.detectedPlanes;\r\n }\r\n\r\n public readonly getJointPose = this._nativeImpl.getJointPose!.bind(this._nativeImpl);\r\n\r\n public readonly fillJointRadii = this._nativeImpl.fillJointRadii!.bind(this._nativeImpl);\r\n\r\n public readonly getLightEstimate = () => {\r\n throw new Error(\"XRFrame.getLightEstimate not supported on native.\");\r\n };\r\n\r\n public get featurePointCloud(): number[] | undefined {\r\n return this._nativeImpl.featurePointCloud;\r\n }\r\n\r\n public readonly getImageTrackingResults = (): XRImageTrackingResult[] => {\r\n return this._nativeImpl._imageTrackingResults ?? [];\r\n };\r\n\r\n public getDepthInformation(view: XRView): XRCPUDepthInformation | undefined {\r\n throw new Error(\"This function is not available in Babylon Native\");\r\n // return this._nativeImpl.getDepthInformation(view);\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\r\nRegisterNativeTypeAsync(\"NativeXRFrame\", NativeXRFrame);\r\n"]}
|