@babylonjs/core 6.43.0 → 6.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/Animations/animatable.js +2 -2
  2. package/Animations/animatable.js.map +1 -1
  3. package/Animations/animationGroup.d.ts +4 -2
  4. package/Animations/animationGroup.js +22 -2
  5. package/Animations/animationGroup.js.map +1 -1
  6. package/Culling/ray.d.ts +12 -1
  7. package/Culling/ray.js +20 -3
  8. package/Culling/ray.js.map +1 -1
  9. package/Debug/skeletonViewer.d.ts +2 -0
  10. package/Debug/skeletonViewer.js +111 -50
  11. package/Debug/skeletonViewer.js.map +1 -1
  12. package/Engines/engine.d.ts +14 -3
  13. package/Engines/engine.js +11 -0
  14. package/Engines/engine.js.map +1 -1
  15. package/Engines/nullEngine.d.ts +2 -0
  16. package/Engines/nullEngine.js +3 -0
  17. package/Engines/nullEngine.js.map +1 -1
  18. package/Engines/thinEngine.d.ts +4 -1
  19. package/Engines/thinEngine.js +2 -2
  20. package/Engines/thinEngine.js.map +1 -1
  21. package/Inputs/scene.inputManager.js +2 -2
  22. package/Inputs/scene.inputManager.js.map +1 -1
  23. package/Materials/Node/nodeMaterial.d.ts +50 -0
  24. package/Materials/Node/nodeMaterial.js +50 -0
  25. package/Materials/Node/nodeMaterial.js.map +1 -1
  26. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -1
  27. package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
  28. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  29. package/Meshes/Node/Blocks/geometryDistanceBlock.d.ts +30 -0
  30. package/Meshes/Node/Blocks/geometryDistanceBlock.js +63 -0
  31. package/Meshes/Node/Blocks/geometryDistanceBlock.js.map +1 -0
  32. package/Meshes/Node/Blocks/geometryDotBlock.d.ts +30 -0
  33. package/Meshes/Node/Blocks/geometryDotBlock.js +63 -0
  34. package/Meshes/Node/Blocks/geometryDotBlock.js.map +1 -0
  35. package/Meshes/Node/Blocks/geometryLengthBlock.d.ts +26 -0
  36. package/Meshes/Node/Blocks/geometryLengthBlock.js +52 -0
  37. package/Meshes/Node/Blocks/geometryLengthBlock.js.map +1 -0
  38. package/Meshes/Node/Blocks/geometryPosterizeBlock.d.ts +31 -0
  39. package/Meshes/Node/Blocks/geometryPosterizeBlock.js +63 -0
  40. package/Meshes/Node/Blocks/geometryPosterizeBlock.js.map +1 -0
  41. package/Meshes/Node/Blocks/geometryReplaceColorBlock.d.ts +38 -0
  42. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js +88 -0
  43. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -0
  44. package/Meshes/Node/Blocks/geometryRotate2dBlock.d.ts +30 -0
  45. package/Meshes/Node/Blocks/geometryRotate2dBlock.js +59 -0
  46. package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -0
  47. package/Meshes/Node/index.d.ts +6 -0
  48. package/Meshes/Node/index.js +6 -0
  49. package/Meshes/Node/index.js.map +1 -1
  50. package/XR/features/Layers/WebXRCompositionLayer.d.ts +48 -0
  51. package/XR/features/Layers/WebXRCompositionLayer.js +94 -0
  52. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -0
  53. package/XR/features/Layers/WebXRProjectionLayer.d.ts +10 -0
  54. package/XR/features/Layers/WebXRProjectionLayer.js +51 -0
  55. package/XR/features/Layers/WebXRProjectionLayer.js.map +1 -0
  56. package/XR/features/WebXRControllerPointerSelection.js +4 -1
  57. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  58. package/XR/features/WebXRControllerTeleportation.js +11 -10
  59. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  60. package/XR/features/WebXRHandTracking.d.ts +7 -1
  61. package/XR/features/WebXRHandTracking.js +28 -26
  62. package/XR/features/WebXRHandTracking.js.map +1 -1
  63. package/XR/features/WebXRLayers.d.ts +44 -26
  64. package/XR/features/WebXRLayers.js +204 -153
  65. package/XR/features/WebXRLayers.js.map +1 -1
  66. package/XR/features/WebXRNearInteraction.js +16 -1
  67. package/XR/features/WebXRNearInteraction.js.map +1 -1
  68. package/XR/webXRCamera.js +10 -0
  69. package/XR/webXRCamera.js.map +1 -1
  70. package/XR/webXRDefaultExperience.d.ts +9 -0
  71. package/XR/webXRDefaultExperience.js +8 -0
  72. package/XR/webXRDefaultExperience.js.map +1 -1
  73. package/XR/webXRExperienceHelper.js +1 -1
  74. package/XR/webXRExperienceHelper.js.map +1 -1
  75. package/XR/webXRFeaturesManager.js +8 -2
  76. package/XR/webXRFeaturesManager.js.map +1 -1
  77. package/XR/webXRLayerWrapper.d.ts +12 -3
  78. package/XR/webXRLayerWrapper.js +18 -2
  79. package/XR/webXRLayerWrapper.js.map +1 -1
  80. package/XR/webXRRenderTargetTextureProvider.js +0 -5
  81. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  82. package/XR/webXRSessionManager.d.ts +9 -1
  83. package/XR/webXRSessionManager.js +24 -5
  84. package/XR/webXRSessionManager.js.map +1 -1
  85. package/package.json +1 -1
  86. package/scene.d.ts +9 -1
  87. package/scene.js +4 -4
  88. package/scene.js.map +1 -1
@@ -0,0 +1,88 @@
1
+ import { RegisterClass } from "../../../Misc/typeStore.js";
2
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
3
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
4
+ /**
5
+ * Block used to replace a color by another one
6
+ */
7
+ export class GeometryReplaceColorBlock extends NodeGeometryBlock {
8
+ /**
9
+ * Creates a new GeometryReplaceColorBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name) {
13
+ super(name);
14
+ this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
15
+ this.registerInput("reference", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
+ this.registerInput("distance", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this.registerInput("replacement", NodeGeometryBlockConnectionPointTypes.AutoDetect);
18
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
19
+ this._outputs[0]._typeConnectionSource = this._inputs[0];
20
+ this._linkConnectionTypes(0, 1);
21
+ this._linkConnectionTypes(0, 3);
22
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
23
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
24
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
25
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
26
+ this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
27
+ this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
28
+ }
29
+ /**
30
+ * Gets the current class name
31
+ * @returns the class name
32
+ */
33
+ getClassName() {
34
+ return "GeometryReplaceColorBlock";
35
+ }
36
+ /**
37
+ * Gets the value input component
38
+ */
39
+ get value() {
40
+ return this._inputs[0];
41
+ }
42
+ /**
43
+ * Gets the reference input component
44
+ */
45
+ get reference() {
46
+ return this._inputs[1];
47
+ }
48
+ /**
49
+ * Gets the distance input component
50
+ */
51
+ get distance() {
52
+ return this._inputs[2];
53
+ }
54
+ /**
55
+ * Gets the replacement input component
56
+ */
57
+ get replacement() {
58
+ return this._inputs[3];
59
+ }
60
+ /**
61
+ * Gets the output component
62
+ */
63
+ get output() {
64
+ return this._outputs[0];
65
+ }
66
+ _buildBlock() {
67
+ if (!this.value.isConnected || !this.reference.isConnected || !this.distance.isConnected || !this.replacement.isConnected) {
68
+ this.output._storedFunction = null;
69
+ this.output._storedValue = null;
70
+ return;
71
+ }
72
+ this.output._storedFunction = (state) => {
73
+ const value = this.value.getConnectedValue(state);
74
+ const reference = this.reference.getConnectedValue(state);
75
+ const distance = this.distance.getConnectedValue(state);
76
+ const replacement = this.replacement.getConnectedValue(state);
77
+ if (value.subtract(reference).length() < distance) {
78
+ return replacement;
79
+ }
80
+ else {
81
+ return value;
82
+ }
83
+ };
84
+ return this;
85
+ }
86
+ }
87
+ RegisterClass("BABYLON.GeometryReplaceColorBlock", GeometryReplaceColorBlock);
88
+ //# sourceMappingURL=geometryReplaceColorBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometryReplaceColorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryReplaceColorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC5D;;;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,WAAW,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC5E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACpF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,I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C,KAAK,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;YACvH,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACxD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE9D,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,GAAG,QAAQ,EAAE;gBAC/C,OAAO,WAAW,CAAC;aACtB;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to replace a color by another one\r\n */\r\nexport class GeometryReplaceColorBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryReplaceColorBlock\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\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"reference\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"distance\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerInput(\"replacement\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n this._linkConnectionTypes(0, 3);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryReplaceColorBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the reference input component\r\n */\r\n public get reference(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the distance input component\r\n */\r\n public get distance(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the replacement input component\r\n */\r\n public get replacement(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.reference.isConnected || !this.distance.isConnected || !this.replacement.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const reference = this.reference.getConnectedValue(state);\r\n const distance = this.distance.getConnectedValue(state);\r\n const replacement = this.replacement.getConnectedValue(state);\r\n\r\n if (value.subtract(reference).length() < distance) {\r\n return replacement;\r\n } else {\r\n return value;\r\n }\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryReplaceColorBlock\", GeometryReplaceColorBlock);\r\n"]}
@@ -0,0 +1,30 @@
1
+ import { NodeGeometryBlock } from "../nodeGeometryBlock";
2
+ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
3
+ /**
4
+ * Block used to rotate a 2d vector by a given angle
5
+ */
6
+ export declare class GeometryRotate2dBlock extends NodeGeometryBlock {
7
+ /**
8
+ * Creates a new GeometryRotate2dBlock
9
+ * @param name defines the block name
10
+ */
11
+ constructor(name: string);
12
+ /**
13
+ * Gets the current class name
14
+ * @returns the class name
15
+ */
16
+ getClassName(): string;
17
+ /**
18
+ * Gets the input vector
19
+ */
20
+ get input(): NodeGeometryConnectionPoint;
21
+ /**
22
+ * Gets the input angle
23
+ */
24
+ get angle(): NodeGeometryConnectionPoint;
25
+ /**
26
+ * Gets the output component
27
+ */
28
+ get output(): NodeGeometryConnectionPoint;
29
+ protected _buildBlock(): this | undefined;
30
+ }
@@ -0,0 +1,59 @@
1
+ import { Vector2 } from "../../../Maths/math.vector.js";
2
+ import { RegisterClass } from "../../../Misc/typeStore.js";
3
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
4
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
5
+ /**
6
+ * Block used to rotate a 2d vector by a given angle
7
+ */
8
+ export class GeometryRotate2dBlock extends NodeGeometryBlock {
9
+ /**
10
+ * Creates a new GeometryRotate2dBlock
11
+ * @param name defines the block name
12
+ */
13
+ constructor(name) {
14
+ super(name);
15
+ this.registerInput("input", NodeGeometryBlockConnectionPointTypes.Vector2);
16
+ this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Vector2);
18
+ }
19
+ /**
20
+ * Gets the current class name
21
+ * @returns the class name
22
+ */
23
+ getClassName() {
24
+ return "GeometryRotate2dBlock";
25
+ }
26
+ /**
27
+ * Gets the input vector
28
+ */
29
+ get input() {
30
+ return this._inputs[0];
31
+ }
32
+ /**
33
+ * Gets the input angle
34
+ */
35
+ get angle() {
36
+ return this._inputs[1];
37
+ }
38
+ /**
39
+ * Gets the output component
40
+ */
41
+ get output() {
42
+ return this._outputs[0];
43
+ }
44
+ _buildBlock() {
45
+ if (!this.angle.isConnected || !this.input.isConnected) {
46
+ this.output._storedFunction = null;
47
+ this.output._storedValue = null;
48
+ return;
49
+ }
50
+ this.output._storedFunction = (state) => {
51
+ const input = this.input.getConnectedValue(state);
52
+ const angle = this.angle.getConnectedValue(state);
53
+ return new Vector2(Math.cos(angle) * input.x - Math.sin(angle) * input.y, Math.sin(angle) * input.x + Math.cos(angle) * input.y);
54
+ };
55
+ return this;
56
+ }
57
+ }
58
+ RegisterClass("BABYLON.GeometryRotate2dBlock", GeometryRotate2dBlock);
59
+ //# sourceMappingURL=geometryRotate2dBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometryRotate2dBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryRotate2dBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,yBA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G,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrI,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to rotate a 2d vector by a given angle\r\n */\r\nexport class GeometryRotate2dBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryRotate2dBlock\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(\"input\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n this.registerInput(\"angle\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryRotate2dBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input vector\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the input angle\r\n */\r\n public get angle(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.angle.isConnected || !this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state) as Vector2;\r\n const angle = this.angle.getConnectedValue(state);\r\n return new Vector2(Math.cos(angle) * input.x - Math.sin(angle) * input.y, Math.sin(angle) * input.x + Math.cos(angle) * input.y);\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryRotate2dBlock\", GeometryRotate2dBlock);\r\n"]}
@@ -72,3 +72,9 @@ export * from "./Blocks/geometryClampBlock";
72
72
  export * from "./Blocks/geometryCrossBlock";
73
73
  export * from "./Blocks/geometryCurveBlock";
74
74
  export * from "./Blocks/geometryDesaturateBlock";
75
+ export * from "./Blocks/geometryPosterizeBlock";
76
+ export * from "./Blocks/geometryReplaceColorBlock";
77
+ export * from "./Blocks/geometryDistanceBlock";
78
+ export * from "./Blocks/geometryDotBlock";
79
+ export * from "./Blocks/geometryLengthBlock";
80
+ export * from "./Blocks/geometryRotate2dBlock";
@@ -72,4 +72,10 @@ export * from "./Blocks/geometryClampBlock.js";
72
72
  export * from "./Blocks/geometryCrossBlock.js";
73
73
  export * from "./Blocks/geometryCurveBlock.js";
74
74
  export * from "./Blocks/geometryDesaturateBlock.js";
75
+ export * from "./Blocks/geometryPosterizeBlock.js";
76
+ export * from "./Blocks/geometryReplaceColorBlock.js";
77
+ export * from "./Blocks/geometryDistanceBlock.js";
78
+ export * from "./Blocks/geometryDotBlock.js";
79
+ export * from "./Blocks/geometryLengthBlock.js";
80
+ export * from "./Blocks/geometryRotate2dBlock.js";
75
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @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Ac,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7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4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\n"]}
@@ -0,0 +1,48 @@
1
+ import type { InternalTexture } from "../../../Materials/Textures/internalTexture.js";
2
+ import type { RenderTargetTexture } from "../../../Materials/Textures/renderTargetTexture.js";
3
+ import type { Viewport } from "../../../Maths/math.viewport.js";
4
+ import { Observable } from "../../../Misc/observable.js";
5
+ import type { WebXRLayerType } from "../../webXRLayerWrapper.js";
6
+ import { WebXRLayerWrapper } from "../../webXRLayerWrapper.js";
7
+ import { WebXRLayerRenderTargetTextureProvider } from "../../webXRRenderTargetTextureProvider.js";
8
+ import type { WebXRSessionManager } from "../../webXRSessionManager.js";
9
+ import type { Nullable } from "../../../types.js";
10
+ /**
11
+ * Wraps xr composition layers.
12
+ * @internal
13
+ */
14
+ export declare class WebXRCompositionLayerWrapper extends WebXRLayerWrapper {
15
+ getWidth: () => number;
16
+ getHeight: () => number;
17
+ readonly layer: XRCompositionLayer;
18
+ readonly layerType: WebXRLayerType;
19
+ readonly isMultiview: boolean;
20
+ createRTTProvider: (xrSessionManager: WebXRSessionManager) => WebXRLayerRenderTargetTextureProvider;
21
+ _originalInternalTexture: Nullable<InternalTexture>;
22
+ constructor(getWidth: () => number, getHeight: () => number, layer: XRCompositionLayer, layerType: WebXRLayerType, isMultiview: boolean, createRTTProvider: (xrSessionManager: WebXRSessionManager) => WebXRLayerRenderTargetTextureProvider, _originalInternalTexture?: Nullable<InternalTexture>);
23
+ }
24
+ /**
25
+ * Provides render target textures and other important rendering information for a given XRCompositionLayer.
26
+ * @internal
27
+ */
28
+ export declare class WebXRCompositionLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {
29
+ protected readonly _xrSessionManager: WebXRSessionManager;
30
+ protected readonly _xrWebGLBinding: XRWebGLBinding;
31
+ readonly layerWrapper: WebXRCompositionLayerWrapper;
32
+ protected _lastSubImages: Map<XREye, XRWebGLSubImage>;
33
+ private _compositionLayer;
34
+ /**
35
+ * Fires every time a new render target texture is created (either for eye, for view, or for the entire frame)
36
+ */
37
+ onRenderTargetTextureCreatedObservable: Observable<{
38
+ texture: RenderTargetTexture;
39
+ eye?: XREye | undefined;
40
+ }>;
41
+ constructor(_xrSessionManager: WebXRSessionManager, _xrWebGLBinding: XRWebGLBinding, layerWrapper: WebXRCompositionLayerWrapper);
42
+ protected _getRenderTargetForSubImage(subImage: XRWebGLSubImage, eye?: XREye): RenderTargetTexture;
43
+ private _getSubImageForEye;
44
+ getRenderTargetTextureForEye(eye?: XREye): Nullable<RenderTargetTexture>;
45
+ getRenderTargetTextureForView(view?: XRView): Nullable<RenderTargetTexture>;
46
+ protected _setViewportForSubImage(viewport: Viewport, subImage: XRWebGLSubImage): void;
47
+ trySetViewportForView(viewport: Viewport, view: XRView): boolean;
48
+ }
@@ -0,0 +1,94 @@
1
+ import { Observable } from "../../../Misc/observable.js";
2
+ import { WebXRLayerWrapper } from "../../webXRLayerWrapper.js";
3
+ import { WebXRLayerRenderTargetTextureProvider } from "../../webXRRenderTargetTextureProvider.js";
4
+ /**
5
+ * Wraps xr composition layers.
6
+ * @internal
7
+ */
8
+ export class WebXRCompositionLayerWrapper extends WebXRLayerWrapper {
9
+ constructor(getWidth, getHeight, layer, layerType, isMultiview, createRTTProvider, _originalInternalTexture = null) {
10
+ super(getWidth, getHeight, layer, layerType, createRTTProvider);
11
+ this.getWidth = getWidth;
12
+ this.getHeight = getHeight;
13
+ this.layer = layer;
14
+ this.layerType = layerType;
15
+ this.isMultiview = isMultiview;
16
+ this.createRTTProvider = createRTTProvider;
17
+ this._originalInternalTexture = _originalInternalTexture;
18
+ }
19
+ }
20
+ /**
21
+ * Provides render target textures and other important rendering information for a given XRCompositionLayer.
22
+ * @internal
23
+ */
24
+ export class WebXRCompositionLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {
25
+ constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {
26
+ super(_xrSessionManager.scene, layerWrapper);
27
+ this._xrSessionManager = _xrSessionManager;
28
+ this._xrWebGLBinding = _xrWebGLBinding;
29
+ this.layerWrapper = layerWrapper;
30
+ this._lastSubImages = new Map();
31
+ /**
32
+ * Fires every time a new render target texture is created (either for eye, for view, or for the entire frame)
33
+ */
34
+ this.onRenderTargetTextureCreatedObservable = new Observable();
35
+ this._compositionLayer = layerWrapper.layer;
36
+ }
37
+ _getRenderTargetForSubImage(subImage, eye = "none") {
38
+ const lastSubImage = this._lastSubImages.get(eye);
39
+ const eyeIndex = eye == "right" ? 1 : 0;
40
+ const colorTextureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;
41
+ const colorTextureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;
42
+ if (!this._renderTargetTextures[eyeIndex] || lastSubImage?.textureWidth !== colorTextureWidth || lastSubImage?.textureHeight !== colorTextureHeight) {
43
+ let depthStencilTexture;
44
+ const depthStencilTextureWidth = subImage.depthStencilTextureWidth ?? colorTextureWidth;
45
+ const depthStencilTextureHeight = subImage.depthStencilTextureHeight ?? colorTextureHeight;
46
+ if (colorTextureWidth === depthStencilTextureWidth || colorTextureHeight === depthStencilTextureHeight) {
47
+ depthStencilTexture = subImage.depthStencilTexture;
48
+ }
49
+ this._renderTargetTextures[eyeIndex] = this._createRenderTargetTexture(colorTextureWidth, colorTextureHeight, null, subImage.colorTexture, depthStencilTexture, this.layerWrapper.isMultiview);
50
+ this._framebufferDimensions = {
51
+ framebufferWidth: colorTextureWidth,
52
+ framebufferHeight: colorTextureHeight,
53
+ };
54
+ this.onRenderTargetTextureCreatedObservable.notifyObservers({ texture: this._renderTargetTextures[eyeIndex], eye });
55
+ }
56
+ this._lastSubImages.set(eye, subImage);
57
+ return this._renderTargetTextures[eyeIndex];
58
+ }
59
+ _getSubImageForEye(eye) {
60
+ const currentFrame = this._xrSessionManager.currentFrame;
61
+ if (currentFrame) {
62
+ return this._xrWebGLBinding.getSubImage(this._compositionLayer, currentFrame, eye);
63
+ }
64
+ return null;
65
+ }
66
+ getRenderTargetTextureForEye(eye) {
67
+ const subImage = this._getSubImageForEye(eye);
68
+ if (subImage) {
69
+ return this._getRenderTargetForSubImage(subImage, eye);
70
+ }
71
+ return null;
72
+ }
73
+ getRenderTargetTextureForView(view) {
74
+ return this.getRenderTargetTextureForEye(view?.eye);
75
+ }
76
+ _setViewportForSubImage(viewport, subImage) {
77
+ const textureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;
78
+ const textureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;
79
+ const xrViewport = subImage.viewport;
80
+ viewport.x = xrViewport.x / textureWidth;
81
+ viewport.y = xrViewport.y / textureHeight;
82
+ viewport.width = xrViewport.width / textureWidth;
83
+ viewport.height = xrViewport.height / textureHeight;
84
+ }
85
+ trySetViewportForView(viewport, view) {
86
+ const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForEye(view.eye);
87
+ if (subImage) {
88
+ this._setViewportForSubImage(viewport, subImage);
89
+ return true;
90
+ }
91
+ return false;
92
+ }
93
+ }
94
+ //# sourceMappingURL=WebXRCompositionLayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXRCompositionLayer.js","sourceRoot":"","sources":["../../../../../../dev/core/src/XR/features/Layers/WebXRCompositionLayer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,oCAA6B;AAElD,OAAO,EAAE,iBAAiB,EAAE,mCAAkC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,kDAAiD;AAIjG;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,iBAAiB;IAC/D,YACW,QAAsB,EACtB,SAAuB,EACd,KAAyB,EACzB,SAAyB,EACzB,WAAoB,EAC7B,iBAAmG,EACnG,2BAAsD,IAAI;QAEjE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QARzD,aAAQ,GAAR,QAAQ,CAAc;QACtB,cAAS,GAAT,SAAS,CAAc;QACd,UAAK,GAAL,KAAK,CAAoB;QACzB,cAAS,GAAT,SAAS,CAAgB;QACzB,gBAAW,GAAX,WAAW,CAAS;QAC7B,sBAAiB,GAAjB,iBAAiB,CAAkF;QACnG,6BAAwB,GAAxB,wBAAwB,CAAkC;IAGrE,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,gDAAiD,SAAQ,qCAAqC;IAQvG,YACuB,iBAAsC,EACtC,eAA+B,EAClC,YAA0C;QAE1D,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAJ1B,sBAAiB,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AM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACrC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,YAAY,CAAC;QACzC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,aAAa,CAAC;QAC1C,QAAQ,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,GAAG,YAAY,CAAC;QACjD,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,aAAa,CAAC;IACxD,CAAC;IAEM,qBAAqB,CAAC,QAAkB,EAAE,IAAY;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxF,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"core/Materials/Textures/internalTexture\";\r\nimport type { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\r\nimport type { Viewport } from \"core/Maths/math.viewport\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { WebXRLayerType } from \"core/XR/webXRLayerWrapper\";\r\nimport { WebXRLayerWrapper } from \"core/XR/webXRLayerWrapper\";\r\nimport { WebXRLayerRenderTargetTextureProvider } from \"core/XR/webXRRenderTargetTextureProvider\";\r\nimport type { WebXRSessionManager } from \"core/XR/webXRSessionManager\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\n/**\r\n * Wraps xr composition layers.\r\n * @internal\r\n */\r\nexport class WebXRCompositionLayerWrapper extends WebXRLayerWrapper {\r\n constructor(\r\n public getWidth: () => number,\r\n public getHeight: () => number,\r\n public readonly layer: XRCompositionLayer,\r\n public readonly layerType: WebXRLayerType,\r\n public readonly isMultiview: boolean,\r\n public createRTTProvider: (xrSessionManager: WebXRSessionManager) => WebXRLayerRenderTargetTextureProvider,\r\n public _originalInternalTexture: Nullable<InternalTexture> = null\r\n ) {\r\n super(getWidth, getHeight, layer, layerType, createRTTProvider);\r\n }\r\n}\r\n\r\n/**\r\n * Provides render target textures and other important rendering information for a given XRCompositionLayer.\r\n * @internal\r\n */\r\nexport class WebXRCompositionLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {\r\n protected _lastSubImages = new Map<XREye, XRWebGLSubImage>();\r\n private _compositionLayer: XRCompositionLayer;\r\n /**\r\n * Fires every time a new render target texture is created (either for eye, for view, or for the entire frame)\r\n */\r\n public onRenderTargetTextureCreatedObservable = new Observable<{ texture: RenderTargetTexture; eye?: XREye }>();\r\n\r\n constructor(\r\n protected readonly _xrSessionManager: WebXRSessionManager,\r\n protected readonly _xrWebGLBinding: XRWebGLBinding,\r\n public readonly layerWrapper: WebXRCompositionLayerWrapper\r\n ) {\r\n super(_xrSessionManager.scene, layerWrapper);\r\n this._compositionLayer = layerWrapper.layer;\r\n }\r\n\r\n protected _getRenderTargetForSubImage(subImage: XRWebGLSubImage, eye: XREye = \"none\") {\r\n const lastSubImage = this._lastSubImages.get(eye);\r\n const eyeIndex = eye == \"right\" ? 1 : 0;\r\n\r\n const colorTextureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;\r\n const colorTextureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;\r\n\r\n if (!this._renderTargetTextures[eyeIndex] || lastSubImage?.textureWidth !== colorTextureWidth || lastSubImage?.textureHeight !== colorTextureHeight) {\r\n let depthStencilTexture;\r\n const depthStencilTextureWidth = subImage.depthStencilTextureWidth ?? colorTextureWidth;\r\n const depthStencilTextureHeight = subImage.depthStencilTextureHeight ?? colorTextureHeight;\r\n if (colorTextureWidth === depthStencilTextureWidth || colorTextureHeight === depthStencilTextureHeight) {\r\n depthStencilTexture = subImage.depthStencilTexture;\r\n }\r\n\r\n this._renderTargetTextures[eyeIndex] = this._createRenderTargetTexture(\r\n colorTextureWidth,\r\n colorTextureHeight,\r\n null,\r\n subImage.colorTexture,\r\n depthStencilTexture,\r\n this.layerWrapper.isMultiview\r\n );\r\n\r\n this._framebufferDimensions = {\r\n framebufferWidth: colorTextureWidth,\r\n framebufferHeight: colorTextureHeight,\r\n };\r\n this.onRenderTargetTextureCreatedObservable.notifyObservers({ texture: this._renderTargetTextures[eyeIndex], eye });\r\n }\r\n\r\n this._lastSubImages.set(eye, subImage);\r\n return this._renderTargetTextures[eyeIndex];\r\n }\r\n private _getSubImageForEye(eye?: XREye): Nullable<XRWebGLSubImage> {\r\n const currentFrame = this._xrSessionManager.currentFrame;\r\n if (currentFrame) {\r\n return this._xrWebGLBinding.getSubImage(this._compositionLayer, currentFrame, eye);\r\n }\r\n return null;\r\n }\r\n public getRenderTargetTextureForEye(eye?: XREye): Nullable<RenderTargetTexture> {\r\n const subImage = this._getSubImageForEye(eye);\r\n if (subImage) {\r\n return this._getRenderTargetForSubImage(subImage, eye);\r\n }\r\n return null;\r\n }\r\n public getRenderTargetTextureForView(view?: XRView): Nullable<RenderTargetTexture> {\r\n return this.getRenderTargetTextureForEye(view?.eye);\r\n }\r\n\r\n protected _setViewportForSubImage(viewport: Viewport, subImage: XRWebGLSubImage) {\r\n const textureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;\r\n const textureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;\r\n const xrViewport = subImage.viewport;\r\n viewport.x = xrViewport.x / textureWidth;\r\n viewport.y = xrViewport.y / textureHeight;\r\n viewport.width = xrViewport.width / textureWidth;\r\n viewport.height = xrViewport.height / textureHeight;\r\n }\r\n\r\n public trySetViewportForView(viewport: Viewport, view: XRView): boolean {\r\n const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForEye(view.eye);\r\n if (subImage) {\r\n this._setViewportForSubImage(viewport, subImage);\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,10 @@
1
+ import { WebXRCompositionLayerWrapper } from "./WebXRCompositionLayer";
2
+ /**
3
+ * Wraps xr projection layers.
4
+ * @internal
5
+ */
6
+ export declare class WebXRProjectionLayerWrapper extends WebXRCompositionLayerWrapper {
7
+ readonly layer: XRProjectionLayer;
8
+ constructor(layer: XRProjectionLayer, isMultiview: boolean, xrGLBinding: XRWebGLBinding);
9
+ }
10
+ export declare const defaultXRProjectionLayerInit: XRProjectionLayerInit;
@@ -0,0 +1,51 @@
1
+ import { WebXRCompositionLayerRenderTargetTextureProvider, WebXRCompositionLayerWrapper } from "./WebXRCompositionLayer.js";
2
+ /**
3
+ * Wraps xr projection layers.
4
+ * @internal
5
+ */
6
+ export class WebXRProjectionLayerWrapper extends WebXRCompositionLayerWrapper {
7
+ constructor(layer, isMultiview, xrGLBinding) {
8
+ super(() => layer.textureWidth, () => layer.textureHeight, layer, "XRProjectionLayer", isMultiview, (sessionManager) => new WebXRProjectionLayerRenderTargetTextureProvider(sessionManager, xrGLBinding, this));
9
+ this.layer = layer;
10
+ }
11
+ }
12
+ /**
13
+ * Provides render target textures and other important rendering information for a given XRProjectionLayer.
14
+ * @internal
15
+ */
16
+ class WebXRProjectionLayerRenderTargetTextureProvider extends WebXRCompositionLayerRenderTargetTextureProvider {
17
+ constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {
18
+ super(_xrSessionManager, _xrWebGLBinding, layerWrapper);
19
+ this.layerWrapper = layerWrapper;
20
+ this._projectionLayer = layerWrapper.layer;
21
+ }
22
+ _getSubImageForView(view) {
23
+ return this._xrWebGLBinding.getViewSubImage(this._projectionLayer, view);
24
+ }
25
+ getRenderTargetTextureForView(view) {
26
+ return this._getRenderTargetForSubImage(this._getSubImageForView(view), view.eye);
27
+ }
28
+ getRenderTargetTextureForEye(eye) {
29
+ const lastSubImage = this._lastSubImages.get(eye);
30
+ if (lastSubImage) {
31
+ return this._getRenderTargetForSubImage(lastSubImage, eye);
32
+ }
33
+ return null;
34
+ }
35
+ trySetViewportForView(viewport, view) {
36
+ const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForView(view);
37
+ if (subImage) {
38
+ this._setViewportForSubImage(viewport, subImage);
39
+ return true;
40
+ }
41
+ return false;
42
+ }
43
+ }
44
+ export const defaultXRProjectionLayerInit = {
45
+ textureType: "texture",
46
+ colorFormat: 0x1908 /* WebGLRenderingContext.RGBA */,
47
+ depthFormat: 0x88f0 /* WebGLRenderingContext.DEPTH24_STENCIL8 */,
48
+ scaleFactor: 1.0,
49
+ clearOnAccess: false,
50
+ };
51
+ //# sourceMappingURL=WebXRProjectionLayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXRProjectionLayer.js","sourceRoot":"","sources":["../../../../../../dev/core/src/XR/features/Layers/WebXRProjectionLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gDAAgD,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAKzH;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IACzE,YACoB,KAAwB,EACxC,WAAoB,EACpB,WAA2B;QAE3B,KAAK,CACD,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,EACxB,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,EACzB,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,CAAC,cAAc,EAAE,EAAE,CAAC,IAAI,+CAA+C,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,CAC7G,CAAC;QAXc,UAAK,GAAL,KAAK,CAAmB;IAY5C,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,+CAAgD,SAAQ,gDAAgD;IAG1G,YACI,iBAAsC,EACtC,eAA+B,EACf,YAAyC;QAEzD,KAAK,CAAC,iBAAiB,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAFxC,iBAAY,GAAZ,YAAY,CAA6B;QAGzD,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC;IAC/C,CAAC;IAEO,mBAAmB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC7E,CAAC;IAEM,6BAA6B,CAAC,IAAY;QAC7C,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACtF,CAAC;IAEM,4BAA4B,CAAC,GAAU;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,YAAY,EAAE;YACd,OAAO,IAAI,CAAC,2BAA2B,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;SAC9D;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,qBAAqB,CAAC,QAAkB,EAAE,IAAY;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACrF,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,4BAA4B,GAA0B;IAC/D,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,MAAM,CAAC,gCAAgC;IACpD,WAAW,EAAE,MAAM,CAAC,4CAA4C;IAChE,WAAW,EAAE,GAAG;IAChB,aAAa,EAAE,KAAK;CACvB,CAAC","sourcesContent":["import type { WebXRSessionManager } from \"core/XR/webXRSessionManager\";\r\nimport { WebXRCompositionLayerRenderTargetTextureProvider, WebXRCompositionLayerWrapper } from \"./WebXRCompositionLayer\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\r\nimport type { Viewport } from \"core/Maths/math.viewport\";\r\n\r\n/**\r\n * Wraps xr projection layers.\r\n * @internal\r\n */\r\nexport class WebXRProjectionLayerWrapper extends WebXRCompositionLayerWrapper {\r\n constructor(\r\n public readonly layer: XRProjectionLayer,\r\n isMultiview: boolean,\r\n xrGLBinding: XRWebGLBinding\r\n ) {\r\n super(\r\n () => layer.textureWidth,\r\n () => layer.textureHeight,\r\n layer,\r\n \"XRProjectionLayer\",\r\n isMultiview,\r\n (sessionManager) => new WebXRProjectionLayerRenderTargetTextureProvider(sessionManager, xrGLBinding, this)\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Provides render target textures and other important rendering information for a given XRProjectionLayer.\r\n * @internal\r\n */\r\nclass WebXRProjectionLayerRenderTargetTextureProvider extends WebXRCompositionLayerRenderTargetTextureProvider {\r\n private readonly _projectionLayer: XRProjectionLayer;\r\n\r\n constructor(\r\n _xrSessionManager: WebXRSessionManager,\r\n _xrWebGLBinding: XRWebGLBinding,\r\n public readonly layerWrapper: WebXRProjectionLayerWrapper\r\n ) {\r\n super(_xrSessionManager, _xrWebGLBinding, layerWrapper);\r\n this._projectionLayer = layerWrapper.layer;\r\n }\r\n\r\n private _getSubImageForView(view: XRView): XRWebGLSubImage {\r\n return this._xrWebGLBinding.getViewSubImage(this._projectionLayer, view);\r\n }\r\n\r\n public getRenderTargetTextureForView(view: XRView): Nullable<RenderTargetTexture> {\r\n return this._getRenderTargetForSubImage(this._getSubImageForView(view), view.eye);\r\n }\r\n\r\n public getRenderTargetTextureForEye(eye: XREye): Nullable<RenderTargetTexture> {\r\n const lastSubImage = this._lastSubImages.get(eye);\r\n if (lastSubImage) {\r\n return this._getRenderTargetForSubImage(lastSubImage, eye);\r\n }\r\n return null;\r\n }\r\n\r\n public trySetViewportForView(viewport: Viewport, view: XRView): boolean {\r\n const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForView(view);\r\n if (subImage) {\r\n this._setViewportForSubImage(viewport, subImage);\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport const defaultXRProjectionLayerInit: XRProjectionLayerInit = {\r\n textureType: \"texture\",\r\n colorFormat: 0x1908 /* WebGLRenderingContext.RGBA */,\r\n depthFormat: 0x88f0 /* WebGLRenderingContext.DEPTH24_STENCIL8 */,\r\n scaleFactor: 1.0,\r\n clearOnAccess: false,\r\n};\r\n"]}
@@ -58,6 +58,7 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature {
58
58
  case "gaze":
59
59
  return this._attachGazeMode(xrController);
60
60
  case "screen":
61
+ case "transient-pointer":
61
62
  return this._attachScreenRayMode(xrController);
62
63
  }
63
64
  };
@@ -240,7 +241,9 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature {
240
241
  if (typeof this._screenCoordinatesRef.x === "number" &&
241
242
  typeof this._screenCoordinatesRef.y === "number" &&
242
243
  !isNaN(this._screenCoordinatesRef.x) &&
243
- !isNaN(this._screenCoordinatesRef.y)) {
244
+ !isNaN(this._screenCoordinatesRef.y) &&
245
+ this._screenCoordinatesRef.x !== Infinity &&
246
+ this._screenCoordinatesRef.y !== Infinity) {
244
247
  scene.pointerX = this._screenCoordinatesRef.x;
245
248
  scene.pointerY = this._screenCoordinatesRef.y;
246
249
  controllerData.screenCoordinates = {