@onerjs/core 8.35.7 → 8.35.8
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/nativeHelpers.js +7 -0
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +2 -0
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- 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/FrameGraph/Node/nodeRenderGraph.d.ts +0 -5
- package/FrameGraph/Node/nodeRenderGraph.js +0 -7
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +0 -6
- package/FrameGraph/frameGraph.js +0 -23
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +0 -1
- package/FrameGraph/frameGraphObjectList.js +0 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +0 -1
- package/FrameGraph/frameGraphRenderContext.js +0 -1
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphRenderTarget.d.ts +0 -1
- package/FrameGraph/frameGraphRenderTarget.js +0 -1
- package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +0 -1
- package/FrameGraph/frameGraphTask.js +0 -1
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +0 -1
- package/FrameGraph/frameGraphTextureManager.js +0 -1
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +6 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +100 -41
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.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/Particles/Node/Blocks/particleVectorMathBlock.d.ts +3 -7
- package/Particles/Node/Blocks/particleVectorMathBlock.js +15 -32
- package/Particles/Node/Blocks/particleVectorMathBlock.js.map +1 -1
- 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,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,aAAa,CA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,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"]}
|
|
@@ -6,7 +6,9 @@ import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare enum ParticleVectorMathBlockOperations {
|
|
8
8
|
/** Dot product */
|
|
9
|
-
Dot = 0
|
|
9
|
+
Dot = 0,
|
|
10
|
+
/** Distance between two vectors */
|
|
11
|
+
Distance = 1
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Block used to apply math operations that only apply to vectors
|
|
@@ -16,7 +18,6 @@ export declare class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
|
16
18
|
* Gets or sets the operation applied by the block
|
|
17
19
|
*/
|
|
18
20
|
operation: ParticleVectorMathBlockOperations;
|
|
19
|
-
private readonly _connectionObservers;
|
|
20
21
|
/**
|
|
21
22
|
* Create a new ParticleVectorMathBlock
|
|
22
23
|
* @param name defines the block name
|
|
@@ -40,11 +41,6 @@ export declare class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
|
40
41
|
*/
|
|
41
42
|
get output(): NodeParticleConnectionPoint;
|
|
42
43
|
_build(state: NodeParticleBuildState): void;
|
|
43
|
-
private _updateInputOutputTypes;
|
|
44
|
-
/**
|
|
45
|
-
* Release resources
|
|
46
|
-
*/
|
|
47
|
-
dispose(): void;
|
|
48
44
|
/**
|
|
49
45
|
* Serializes this block in a JSON representation
|
|
50
46
|
* @returns the serialized block object
|
|
@@ -11,6 +11,8 @@ export var ParticleVectorMathBlockOperations;
|
|
|
11
11
|
(function (ParticleVectorMathBlockOperations) {
|
|
12
12
|
/** Dot product */
|
|
13
13
|
ParticleVectorMathBlockOperations[ParticleVectorMathBlockOperations["Dot"] = 0] = "Dot";
|
|
14
|
+
/** Distance between two vectors */
|
|
15
|
+
ParticleVectorMathBlockOperations[ParticleVectorMathBlockOperations["Distance"] = 1] = "Distance";
|
|
14
16
|
})(ParticleVectorMathBlockOperations || (ParticleVectorMathBlockOperations = {}));
|
|
15
17
|
/**
|
|
16
18
|
* Block used to apply math operations that only apply to vectors
|
|
@@ -26,19 +28,9 @@ export class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
|
26
28
|
* Gets or sets the operation applied by the block
|
|
27
29
|
*/
|
|
28
30
|
this.operation = ParticleVectorMathBlockOperations.Dot;
|
|
29
|
-
this.registerInput("left", NodeParticleBlockConnectionPointTypes.
|
|
30
|
-
this.registerInput("right", NodeParticleBlockConnectionPointTypes.
|
|
31
|
-
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.
|
|
32
|
-
this.output._typeConnectionSource = this.left;
|
|
33
|
-
this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3);
|
|
34
|
-
this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3);
|
|
35
|
-
this._linkConnectionTypes(0, 1);
|
|
36
|
-
this._connectionObservers = [
|
|
37
|
-
this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
38
|
-
this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
39
|
-
this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
40
|
-
this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
41
|
-
];
|
|
31
|
+
this.registerInput("left", NodeParticleBlockConnectionPointTypes.Vector3);
|
|
32
|
+
this.registerInput("right", NodeParticleBlockConnectionPointTypes.Vector3);
|
|
33
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Float);
|
|
42
34
|
}
|
|
43
35
|
/**
|
|
44
36
|
* Gets the current class name
|
|
@@ -81,29 +73,17 @@ export class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
|
81
73
|
};
|
|
82
74
|
break;
|
|
83
75
|
}
|
|
76
|
+
case ParticleVectorMathBlockOperations.Distance: {
|
|
77
|
+
func = (state) => {
|
|
78
|
+
return Vector3.Distance(left.getConnectedValue(state), right.getConnectedValue(state));
|
|
79
|
+
};
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
84
82
|
}
|
|
85
83
|
this.output._storedFunction = (state) => {
|
|
86
84
|
return func(state);
|
|
87
85
|
};
|
|
88
86
|
}
|
|
89
|
-
_updateInputOutputTypes() {
|
|
90
|
-
// First update the output type with the initial assumption that we'll base it on the left input.
|
|
91
|
-
this.output._typeConnectionSource = this.left;
|
|
92
|
-
// If left is not connected, then instead use the type of right if it's connected.
|
|
93
|
-
if (!this.left.isConnected && this.right.isConnected) {
|
|
94
|
-
this.output._typeConnectionSource = this.right;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Release resources
|
|
99
|
-
*/
|
|
100
|
-
dispose() {
|
|
101
|
-
super.dispose();
|
|
102
|
-
for (const observer of this._connectionObservers) {
|
|
103
|
-
observer.remove();
|
|
104
|
-
}
|
|
105
|
-
this._connectionObservers.length = 0;
|
|
106
|
-
}
|
|
107
87
|
/**
|
|
108
88
|
* Serializes this block in a JSON representation
|
|
109
89
|
* @returns the serialized block object
|
|
@@ -126,7 +106,10 @@ __decorate([
|
|
|
126
106
|
editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
127
107
|
notifiers: { rebuild: true },
|
|
128
108
|
embedded: true,
|
|
129
|
-
options: [
|
|
109
|
+
options: [
|
|
110
|
+
{ label: "Dot", value: ParticleVectorMathBlockOperations.Dot },
|
|
111
|
+
{ label: "Distance", value: ParticleVectorMathBlockOperations.Distance },
|
|
112
|
+
],
|
|
130
113
|
})
|
|
131
114
|
], ParticleVectorMathBlock.prototype, "operation", void 0);
|
|
132
115
|
RegisterClass("BABYLON.ParticleVectorMathBlock", ParticleVectorMathBlock);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particleVectorMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleVectorMathBlock.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"particleVectorMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleVectorMathBlock.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;GAEG;AACH,MAAM,CAAN,IAAY,iCAKX;AALD,WAAY,iCAAiC;IACzC,kBAAkB;IAClB,uFAAG,CAAA;IACH,mCAAmC;IACnC,iGAAQ,CAAA;AACZ,CAAC,EALW,iCAAiC,KAAjC,iCAAiC,QAK5C;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAc1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAlBhB;;WAEG;QASI,cAAS,GAAG,iCAAiC,CAAC,GAAG,CAAC;QASrD,IAAI,CAAC,aAAa,CAAC,MAAM,EA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CAAiC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC9C,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE;oBACb,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC3F,CAAC,CAAC;gBACF,MAAM;YACV,CAAC;QACL,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAE/C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACa,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;IACnD,CAAC;CACJ;AA/FU;IARN,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,EAAE;YAC9D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,iCAAiC,CAAC,QAAQ,EAAE;SAC3E;KACJ,CAAC;0DACuD;AAiG7D,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\n\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Operations supported by the Vector Math block\r\n */\r\nexport enum ParticleVectorMathBlockOperations {\r\n /** Dot product */\r\n Dot,\r\n /** Distance between two vectors */\r\n Distance,\r\n}\r\n\r\n/**\r\n * Block used to apply math operations that only apply to vectors\r\n */\r\nexport class ParticleVectorMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Dot\", value: ParticleVectorMathBlockOperations.Dot },\r\n { label: \"Distance\", value: ParticleVectorMathBlockOperations.Distance },\r\n ],\r\n })\r\n public operation = ParticleVectorMathBlockOperations.Dot;\r\n\r\n /**\r\n * Create a new ParticleVectorMathBlock\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(\"left\", NodeParticleBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.Vector3);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Float);\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 \"ParticleVectorMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n switch (this.operation) {\r\n case ParticleVectorMathBlockOperations.Dot: {\r\n func = (state) => {\r\n return Vector3.Dot(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n break;\r\n }\r\n case ParticleVectorMathBlockOperations.Distance: {\r\n func = (state) => {\r\n return Vector3.Distance(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the block from a JSON object\r\n * @param serializationObject the JSON object to deserialize from\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleVectorMathBlock\", ParticleVectorMathBlock);\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,OAA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B,CAAC;IAC7C,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IAC3C,CAAC;IAUD,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;IAC9C,CAAC;IAMM,mBAAmB,CAAC,IAAY;QACnC,MAAM,IAAI,KAAK,CAAC,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"]}
|