@onerjs/core 8.54.1 → 8.54.2

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 (84) hide show
  1. package/Collisions/gpuPicker.js +7 -6
  2. package/Collisions/gpuPicker.js.map +1 -1
  3. package/Engines/Extensions/engine.texture2DArrayImageSource.d.ts +6 -0
  4. package/Engines/Extensions/engine.texture2DArrayImageSource.js +9 -0
  5. package/Engines/Extensions/engine.texture2DArrayImageSource.js.map +1 -0
  6. package/Engines/Extensions/engine.texture2DArrayImageSource.pure.d.ts +7 -0
  7. package/Engines/Extensions/engine.texture2DArrayImageSource.pure.js +40 -0
  8. package/Engines/Extensions/engine.texture2DArrayImageSource.pure.js.map +1 -0
  9. package/Engines/Extensions/engine.texture2DArrayImageSource.types.d.ts +21 -0
  10. package/Engines/Extensions/engine.texture2DArrayImageSource.types.js +2 -0
  11. package/Engines/Extensions/engine.texture2DArrayImageSource.types.js.map +1 -0
  12. package/Engines/Extensions/pure.d.ts +1 -0
  13. package/Engines/Extensions/pure.js +1 -0
  14. package/Engines/Extensions/pure.js.map +1 -1
  15. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.d.ts +6 -0
  16. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.js +9 -0
  17. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.js.map +1 -0
  18. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.pure.d.ts +7 -0
  19. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.pure.js +23 -0
  20. package/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.pure.js.map +1 -0
  21. package/Engines/WebGPU/Extensions/pure.d.ts +1 -0
  22. package/Engines/WebGPU/Extensions/pure.js +1 -0
  23. package/Engines/WebGPU/Extensions/pure.js.map +1 -1
  24. package/Engines/engine.d.ts +30 -0
  25. package/Engines/thinNativeEngine.pure.js +4 -4
  26. package/Engines/thinNativeEngine.pure.js.map +1 -1
  27. package/Lights/Clustered/clusteredLightContainer.pure.js +6 -0
  28. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  29. package/Loading/Plugins/babylonFileLoader.d.ts +10 -0
  30. package/Loading/Plugins/babylonFileLoader.js +18 -0
  31. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  32. package/Loading/Plugins/babylonFileLoader.pure.js +10 -2
  33. package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
  34. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -1
  35. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  36. package/Materials/Node/nodeMaterial.pure.d.ts +13 -5
  37. package/Materials/Node/nodeMaterial.pure.js +20 -2
  38. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  39. package/Materials/Textures/index.d.ts +1 -0
  40. package/Materials/Textures/index.js +1 -0
  41. package/Materials/Textures/index.js.map +1 -1
  42. package/Materials/Textures/pure.d.ts +1 -0
  43. package/Materials/Textures/pure.js +1 -0
  44. package/Materials/Textures/pure.js.map +1 -1
  45. package/Materials/Textures/rawTexture2DArray.functions.d.ts +66 -0
  46. package/Materials/Textures/rawTexture2DArray.functions.js +130 -0
  47. package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -0
  48. package/Materials/Textures/renderTargetTexture.pure.js +7 -0
  49. package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
  50. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +13 -0
  51. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +15 -0
  52. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  53. package/Misc/snapshotRenderingHelper.js +2 -1
  54. package/Misc/snapshotRenderingHelper.js.map +1 -1
  55. package/Physics/v2/Plugins/havokPlugin.js +15 -0
  56. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  57. package/Physics/v2/characterController.d.ts +17 -0
  58. package/Physics/v2/characterController.js +40 -0
  59. package/Physics/v2/characterController.js.map +1 -1
  60. package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +3 -1
  61. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +25 -4
  62. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
  63. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -5
  64. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  65. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.d.ts +3 -1
  66. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +16 -4
  67. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  68. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +6 -5
  69. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  70. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +3 -1
  71. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +16 -4
  72. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  73. package/Rendering/depthRenderer.d.ts +2 -0
  74. package/Rendering/depthRenderer.js +2 -0
  75. package/Rendering/depthRenderer.js.map +1 -1
  76. package/Rendering/depthRenderer.pure.js +3 -2
  77. package/Rendering/depthRenderer.pure.js.map +1 -1
  78. package/Rendering/fluidRenderer/fluidRenderer.pure.js +6 -0
  79. package/Rendering/fluidRenderer/fluidRenderer.pure.js.map +1 -1
  80. package/Rendering/geometryBufferRenderer.pure.js +5 -5
  81. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  82. package/XR/features/WebXRBodyTracking.pure.d.ts +0 -28
  83. package/XR/features/WebXRBodyTracking.pure.js.map +1 -1
  84. package/package.json +1 -1
@@ -184,6 +184,7 @@ export declare class PhysicsCharacterController {
184
184
  private _body;
185
185
  private _transformNode;
186
186
  private _ownShape;
187
+ protected _shapeOptions: CharacterShapeOptions;
187
188
  private _manifold;
188
189
  private _stepUpSavedManifold;
189
190
  private _lastDisplacement;
@@ -326,6 +327,22 @@ export declare class PhysicsCharacterController {
326
327
  * Set shape used for collision
327
328
  */
328
329
  set shape(value: PhysicsShape);
330
+ /**
331
+ * Get the shape options used to build the collision shape
332
+ */
333
+ get shapeOptions(): CharacterShapeOptions;
334
+ /**
335
+ * Set new shape options and rebuild the collision shape accordingly.
336
+ * When the options provide an explicit `shape`, it is used directly; otherwise
337
+ * a capsule is created from the `capsuleHeight` / `capsuleRadius` values. The
338
+ * resulting shape is assigned through the shape setter, which releases the
339
+ * previously owned shape.
340
+ * @param characterShapeOptions character physics shape options
341
+ * @param preserveFootPosition when true (default), the controller position is adapted so the
342
+ * world-space foot position (center - up * footOffset) is kept fixed as the height changes; when
343
+ * false, the position is left unchanged.
344
+ */
345
+ setShapeOptions(characterShapeOptions: CharacterShapeOptions, preserveFootPosition?: boolean): void;
329
346
  /**
330
347
  * Character position
331
348
  * @returns Character position
@@ -198,6 +198,7 @@ export class PhysicsCharacterController {
198
198
  this._tmpVecs[0].set(0, h * 0.5 - r, 0);
199
199
  this._tmpVecs[1].set(0, -h * 0.5 + r, 0);
200
200
  this._ownShape = !characterShapeOptions.shape;
201
+ this._shapeOptions = characterShapeOptions;
201
202
  this._shape = characterShapeOptions.shape ?? new PhysicsShapeCapsule(this._tmpVecs[0], this._tmpVecs[1], r, scene);
202
203
  this._transformNode = new TransformNode("CCTransformNode", scene);
203
204
  this._transformNode.position.copyFrom(this._position);
@@ -244,6 +245,45 @@ export class PhysicsCharacterController {
244
245
  this._body.shape = this._shape;
245
246
  this._ownShape = false;
246
247
  }
248
+ /**
249
+ * Get the shape options used to build the collision shape
250
+ */
251
+ get shapeOptions() {
252
+ return this._shapeOptions;
253
+ }
254
+ /**
255
+ * Set new shape options and rebuild the collision shape accordingly.
256
+ * When the options provide an explicit `shape`, it is used directly; otherwise
257
+ * a capsule is created from the `capsuleHeight` / `capsuleRadius` values. The
258
+ * resulting shape is assigned through the shape setter, which releases the
259
+ * previously owned shape.
260
+ * @param characterShapeOptions character physics shape options
261
+ * @param preserveFootPosition when true (default), the controller position is adapted so the
262
+ * world-space foot position (center - up * footOffset) is kept fixed as the height changes; when
263
+ * false, the position is left unchanged.
264
+ */
265
+ setShapeOptions(characterShapeOptions, preserveFootPosition = true) {
266
+ this._shapeOptions = characterShapeOptions;
267
+ const r = characterShapeOptions.capsuleRadius ?? 0.6;
268
+ const h = characterShapeOptions.capsuleHeight ?? 1.8;
269
+ const newFootOffset = h * 0.5;
270
+ if (preserveFootPosition) {
271
+ // Compute the current world-space foot position (center - up * footOffset), then move the
272
+ // center so the feet stay fixed for the new half-height: center = foot + up * newFootOffset.
273
+ const foot = this._tmpVecs[2];
274
+ this.up.scaleToRef(this.footOffset, foot);
275
+ this._position.subtractToRef(foot, foot);
276
+ this.up.scaleToRef(newFootOffset, this._tmpVecs[3]);
277
+ foot.addToRef(this._tmpVecs[3], this._position);
278
+ this._transformNode.position.copyFrom(this._position);
279
+ }
280
+ this.footOffset = newFootOffset;
281
+ this._tmpVecs[0].set(0, h * 0.5 - r, 0);
282
+ this._tmpVecs[1].set(0, -h * 0.5 + r, 0);
283
+ const ownShape = !characterShapeOptions.shape;
284
+ this.shape = characterShapeOptions.shape ?? new PhysicsShapeCapsule(this._tmpVecs[0], this._tmpVecs[1], r, this._scene);
285
+ this._ownShape = ownShape;
286
+ }
247
287
  /**
248
288
  * Character position
249
289
  * @returns Character position