@babylonjs/core 5.51.0 → 5.52.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 (66) hide show
  1. package/Animations/animatable.d.ts +5 -3
  2. package/Animations/animatable.js +10 -7
  3. package/Animations/animatable.js.map +1 -1
  4. package/Animations/animationGroup.js +3 -1
  5. package/Animations/animationGroup.js.map +1 -1
  6. package/Animations/runtimeAnimation.d.ts +1 -0
  7. package/Animations/runtimeAnimation.js +1 -0
  8. package/Animations/runtimeAnimation.js.map +1 -1
  9. package/Engines/thinEngine.js +2 -2
  10. package/Engines/thinEngine.js.map +1 -1
  11. package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +4 -0
  12. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +37 -2
  13. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  14. package/Materials/Node/nodeMaterialDecorator.d.ts +1 -1
  15. package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
  16. package/Materials/PBR/pbrMaterial.js +1 -0
  17. package/Materials/PBR/pbrMaterial.js.map +1 -1
  18. package/Materials/Textures/cubeTexture.js +7 -1
  19. package/Materials/Textures/cubeTexture.js.map +1 -1
  20. package/Misc/environmentTextureTools.js +7 -0
  21. package/Misc/environmentTextureTools.js.map +1 -1
  22. package/Misc/observable.js +3 -0
  23. package/Misc/observable.js.map +1 -1
  24. package/Misc/virtualJoystick.js +2 -2
  25. package/Misc/virtualJoystick.js.map +1 -1
  26. package/Particles/gpuParticleSystem.js +18 -14
  27. package/Particles/gpuParticleSystem.js.map +1 -1
  28. package/Physics/v2/IPhysicsEnginePlugin.d.ts +126 -19
  29. package/Physics/v2/IPhysicsEnginePlugin.js +6 -0
  30. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  31. package/Physics/v2/physicsAggregate.d.ts +7 -1
  32. package/Physics/v2/physicsAggregate.js +21 -7
  33. package/Physics/v2/physicsAggregate.js.map +1 -1
  34. package/Physics/v2/physicsBody.d.ts +25 -17
  35. package/Physics/v2/physicsBody.js +46 -20
  36. package/Physics/v2/physicsBody.js.map +1 -1
  37. package/Physics/v2/physicsEngineComponent.d.ts +10 -0
  38. package/Physics/v2/physicsEngineComponent.js +27 -0
  39. package/Physics/v2/physicsEngineComponent.js.map +1 -1
  40. package/Physics/v2/physicsMaterial.d.ts +52 -46
  41. package/Physics/v2/physicsMaterial.js +23 -80
  42. package/Physics/v2/physicsMaterial.js.map +1 -1
  43. package/Physics/v2/physicsShape.d.ts +27 -2
  44. package/Physics/v2/physicsShape.js +52 -1
  45. package/Physics/v2/physicsShape.js.map +1 -1
  46. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +59 -13
  47. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +131 -54
  48. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  49. package/Rendering/depthRenderer.js +1 -1
  50. package/Rendering/depthRenderer.js.map +1 -1
  51. package/Rendering/depthRendererSceneComponent.d.ts +2 -1
  52. package/Rendering/depthRendererSceneComponent.js +2 -2
  53. package/Rendering/depthRendererSceneComponent.js.map +1 -1
  54. package/Shaders/sprites.fragment.js +6 -1
  55. package/Shaders/sprites.fragment.js.map +1 -1
  56. package/Shaders/ssao2.fragment.js +0 -2
  57. package/Shaders/ssao2.fragment.js.map +1 -1
  58. package/Sprites/spriteManager.d.ts +7 -0
  59. package/Sprites/spriteManager.js +27 -0
  60. package/Sprites/spriteManager.js.map +1 -1
  61. package/Sprites/spriteRenderer.d.ts +8 -0
  62. package/Sprites/spriteRenderer.js +42 -19
  63. package/Sprites/spriteRenderer.js.map +1 -1
  64. package/assetContainer.js +1 -1
  65. package/assetContainer.js.map +1 -1
  66. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"physicsMaterial.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsMaterial.ts"],"names":[],"m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9C,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { IPhysicsEnginePluginV2 } from \"./IPhysicsEnginePlugin\";\r\n\r\n/**\r\n * Physics material class\r\n * Helps setting friction and restitution that are used to compute responding forces in collision response\r\n */\r\nexport class PhysicsMaterial {\r\n /**\r\n * V2 Physics plugin private data for a physics material\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n protected _physicsPlugin: IPhysicsEnginePluginV2;\r\n\r\n /**\r\n * Constructor of the physics material.\r\n * @param friction - The friction of the material.\r\n * @param restitution - The restitution of the material.\r\n * @param scene - The scene to which the physics engine belongs.\r\n *\r\n * This code is useful for initializing the physics material with the\r\n * given friction, restitution and scene. It also checks if the\r\n * physics engine and plugin are available and if the plugin version\r\n * is correct. If all conditions are met, it initializes the material\r\n * with the physics plugin.\r\n */\r\n constructor(friction: number, restitution: number, scene: Scene) {\r\n const physicsEngine = scene.getPhysicsEngine();\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n this._physicsPlugin.initMaterial(this);\r\n }\r\n\r\n /**\r\n * Sets the friction of the physics engine.\r\n * @param friction - The friction to set.\r\n *\r\n * This method is useful for setting the friction of the physics engine, which is important for simulating realistic physics.\r\n * The friction determines how much an object will slow down when it is in contact with another object.\r\n * This is important for simulating realistic physics, such as when an object slides across a surface.\r\n */\r\n public setFriction(friction: number): void {\r\n this._physicsPlugin.setFriction(this, friction);\r\n }\r\n\r\n /**\r\n * Gets the friction of the physics engine.\r\n *\r\n * @returns The friction of the physics engine.\r\n *\r\n * This method is useful for getting the friction of the physics engine, which is used to calculate the force of friction between two objects.\r\n * Knowing the friction of the engine can help to accurately simulate the physical behavior of objects in the engine.\r\n */\r\n public getFriction(): number {\r\n return this._physicsPlugin.getFriction(this);\r\n }\r\n\r\n /**\r\n * Sets the restitution of the physics body.\r\n * @param restitution A number between 0 and 1 that represents the restitution of the body.\r\n *\r\n * This method is useful for setting the restitution of a physics body, which is the amount of energy that is retained after a collision.\r\n * A restitution of 0 means that no energy is retained, while a restitution of 1 means that all energy is retained.\r\n * Setting the restitution of a body can help to create realistic physics simulations.\r\n */\r\n public setRestitution(restitution: number): void {\r\n this._physicsPlugin.setRestitution(this, restitution);\r\n }\r\n\r\n /**\r\n * Gets the restitution of the physics engine.\r\n * @returns The restitution of the physics engine.\r\n *\r\n * This method is useful for retrieving the restitution of the physics engine, which is the amount of energy that is preserved after two objects collide.\r\n * Knowing the restitution of the physics engine can help to accurately simulate the behavior of objects in the physics engine.\r\n */\r\n public getRestitution(): number {\r\n return this._physicsPlugin.getRestitution(this);\r\n }\r\n\r\n /**\r\n * Disposes the material.\r\n *\r\n * This method is useful for cleaning up the material when it is no longer needed.\r\n * It calls the disposeMaterial method of the physics plugin, which is responsible for disposing the material and freeing up any resources associated with it.\r\n * This ensures that the material is properly disposed of and does not cause any memory leaks.\r\n */\r\n public dispose(): void {\r\n this._physicsPlugin.disposeMaterial(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsMaterial.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsMaterial.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,0BAwBX;AAxBD,WAAY,0BAA0B;IAClC;;;OAGG;IACH,+FAAc,CAAA;IACd;;;OAGG;IACH,iFAAO,CAAA;IACP;;OAEG;IACH,iFAAO,CAAA;IACP;;OAEG;IACH,iGAAe,CAAA;IACf;;;OAGG;IACH,mFAAQ,CAAA;AACZ,CAAC,EAxBW,0BAA0B,KAA1B,0BAA0B,QAwBrC","sourcesContent":["/**\r\n * Determines how values from the PhysicsMaterial are combined when\r\n * two objects are in contact. When each PhysicsMaterial specifies\r\n * a different combine mode for some property, the combine mode which\r\n * is used will be selected based on their order in this enum - i.e.\r\n * a value later in this list will be preferentially used.\r\n */\r\nexport enum PhysicsMaterialCombineMode {\r\n /**\r\n * The final value will be the geometric mean of the two values:\r\n * sqrt( valueA * valueB )\r\n */\r\n GEOMETRIC_MEAN,\r\n /**\r\n * The final value will be the smaller of the two:\r\n * min( valueA , valueB )\r\n */\r\n MINIMUM,\r\n /* The final value will be the larger of the two:\r\n * max( valueA , valueB )\r\n */\r\n MAXIMUM,\r\n /* The final value will be the arithmetic mean of the two values:\r\n * (valueA + valueB) / 2\r\n */\r\n ARITHMETIC_MEAN,\r\n /**\r\n * The final value will be the product of the two values:\r\n * valueA * valueB\r\n */\r\n MULTIPLY,\r\n}\r\n\r\n/**\r\n * Physics material class\r\n * Helps setting friction and restitution that are used to compute responding forces in collision response\r\n */\r\nexport interface PhysicsMaterial {\r\n /**\r\n * Sets the friction used by this material\r\n *\r\n * The friction determines how much an object will slow down when it is in contact with another object.\r\n * This is important for simulating realistic physics, such as when an object slides across a surface.\r\n *\r\n * If not provided, a default value of 0.5 will be used.\r\n */\r\n friction?: number;\r\n\r\n /**\r\n * Sets the static friction used by this material.\r\n *\r\n * Static friction is the friction that must be overcome before a pair of objects can start sliding\r\n * relative to each other; for physically-realistic behaviour, it should be at least as high as the\r\n * normal friction value. If not provided, the friction value will be used\r\n */\r\n staticFriction?: number;\r\n\r\n /**\r\n * Sets the restitution of the physics material.\r\n *\r\n * The restitution is a factor which describes, the amount of energy that is retained after a collision,\r\n * which should be a number between 0 and 1..\r\n *\r\n * A restitution of 0 means that no energy is retained and the objects will not bounce off each other,\r\n * while a restitution of 1 means that all energy is retained and the objects will bounce.\r\n *\r\n * Note, though, due that due to the simulation implementation, an object with a restitution of 1 may\r\n * still lose energy over time.\r\n *\r\n * If not provided, a default value of 0 will be used.\r\n */\r\n restitution?: number;\r\n\r\n /**\r\n * Describes how two different friction values should be combined. See PhysicsMaterialCombineMode for\r\n * more details.\r\n *\r\n * If not provided, will use PhysicsMaterialCombineMode.MINIMUM\r\n */\r\n frictionCombine?: PhysicsMaterialCombineMode;\r\n\r\n /**\r\n * Describes how two different restitution values should be combined. See PhysicsMaterialCombineMode for\r\n * more details.\r\n *\r\n * If not provided, will use PhysicsMaterialCombineMode.MAXIMUM\r\n */\r\n restitutionCombine?: PhysicsMaterialCombineMode;\r\n}\r\n"]}
@@ -1,10 +1,10 @@
1
1
  import type { TransformNode } from "../../Meshes/transformNode";
2
+ import type { AbstractMesh } from "../../Meshes/abstractMesh";
2
3
  import type { BoundingBox } from "../../Culling/boundingBox";
3
4
  import { ShapeType } from "./IPhysicsEnginePlugin";
4
5
  import type { PhysicsShapeParameters } from "./IPhysicsEnginePlugin";
5
6
  import type { PhysicsMaterial } from "./physicsMaterial";
6
- import type { Vector3 } from "../../Maths/math.vector";
7
- import type { Quaternion } from "../../Maths/math.vector";
7
+ import { Vector3, Quaternion } from "../../Maths/math.vector";
8
8
  import type { Mesh } from "../../Meshes/mesh";
9
9
  import type { Scene } from "../../scene";
10
10
  /**
@@ -39,6 +39,7 @@ export declare class PhysicsShape {
39
39
  */
40
40
  private _physicsPlugin;
41
41
  private _type;
42
+ private _material;
42
43
  /**
43
44
  * Constructs a new physics shape.
44
45
  * @param options The options for the physics shape. These are:
@@ -123,6 +124,12 @@ export declare class PhysicsShapeSphere extends PhysicsShape {
123
124
  * @param scene scene to attach to
124
125
  */
125
126
  constructor(center: Vector3, radius: number, scene: Scene);
127
+ /**
128
+ *
129
+ * @param mesh
130
+ * @returns PhysicsShapeSphere
131
+ */
132
+ static FromMesh(mesh: AbstractMesh): PhysicsShapeSphere;
126
133
  }
127
134
  /**
128
135
  * Helper object to create a capsule shape
@@ -136,6 +143,12 @@ export declare class PhysicsShapeCapsule extends PhysicsShape {
136
143
  * @param scene scene to attach to
137
144
  */
138
145
  constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene);
146
+ /**
147
+ * Derive an approximate capsule from the transform node. Note, this is
148
+ * not the optimal bounding capsule.
149
+ * @param TransformNode node Node from which to derive a cylinder shape
150
+ */
151
+ static FromMesh(mesh: AbstractMesh): PhysicsShapeCapsule;
139
152
  }
140
153
  /**
141
154
  * Helper object to create a cylinder shape
@@ -149,6 +162,12 @@ export declare class PhysicsShapeCylinder extends PhysicsShape {
149
162
  * @param scene scene to attach to
150
163
  */
151
164
  constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene);
165
+ /**
166
+ * Derive an approximate cylinder from the transform node. Note, this is
167
+ * not the optimal bounding cylinder.
168
+ * @param TransformNode node Node from which to derive a cylinder shape
169
+ */
170
+ static FromMesh(mesh: AbstractMesh): PhysicsShapeCylinder;
152
171
  }
153
172
  /**
154
173
  * Helper object to create a box shape
@@ -162,6 +181,12 @@ export declare class PhysicsShapeBox extends PhysicsShape {
162
181
  * @param scene scene to attach to
163
182
  */
164
183
  constructor(center: Vector3, rotation: Quaternion, extents: Vector3, scene: Scene);
184
+ /**
185
+ *
186
+ * @param mesh
187
+ * @returns PhysicsShapeBox
188
+ */
189
+ static FromMesh(mesh: AbstractMesh): PhysicsShapeBox;
165
190
  }
166
191
  /**
167
192
  * Helper object to create a convex hull shape
@@ -1,4 +1,5 @@
1
1
  import { ShapeType } from "./IPhysicsEnginePlugin.js";
2
+ import { Vector3, Quaternion } from "../../Maths/math.vector.js";
2
3
  /**
3
4
  * PhysicsShape class.
4
5
  * This class is useful for creating a physics shape that can be used in a physics engine.
@@ -75,13 +76,14 @@ export class PhysicsShape {
75
76
  */
76
77
  setMaterial(material) {
77
78
  this._physicsPlugin.setMaterial(this, material);
79
+ this._material = material;
78
80
  }
79
81
  /**
80
82
  *
81
83
  * @returns
82
84
  */
83
85
  getMaterial() {
84
- return this._physicsPlugin.getMaterial(this);
86
+ return this._material;
85
87
  }
86
88
  /**
87
89
  *
@@ -145,6 +147,18 @@ export class PhysicsShapeSphere extends PhysicsShape {
145
147
  constructor(center, radius, scene) {
146
148
  super({ type: ShapeType.SPHERE, parameters: { center: center, radius: radius } }, scene);
147
149
  }
150
+ /**
151
+ *
152
+ * @param mesh
153
+ * @returns PhysicsShapeSphere
154
+ */
155
+ static FromMesh(mesh) {
156
+ const bounds = mesh.getBoundingInfo();
157
+ //<todo.eoin We don't use bounding sphere because the results seem to be wrong
158
+ const centerLocal = bounds.boundingBox.center;
159
+ const radius = bounds.boundingBox.extendSize.x;
160
+ return new PhysicsShapeSphere(centerLocal, radius, mesh.getScene());
161
+ }
148
162
  }
149
163
  /**
150
164
  * Helper object to create a capsule shape
@@ -160,6 +174,19 @@ export class PhysicsShapeCapsule extends PhysicsShape {
160
174
  constructor(pointA, pointB, radius, scene) {
161
175
  super({ type: ShapeType.CAPSULE, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);
162
176
  }
177
+ /**
178
+ * Derive an approximate capsule from the transform node. Note, this is
179
+ * not the optimal bounding capsule.
180
+ * @param TransformNode node Node from which to derive a cylinder shape
181
+ */
182
+ static FromMesh(mesh) {
183
+ const boundsLocal = mesh.getBoundingInfo();
184
+ const radius = boundsLocal.boundingBox.extendSize.x;
185
+ const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y - radius, 0);
186
+ const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);
187
+ const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);
188
+ return new PhysicsShapeCapsule(pointA, pointB, radius, mesh.getScene());
189
+ }
163
190
  }
164
191
  /**
165
192
  * Helper object to create a cylinder shape
@@ -175,6 +202,19 @@ export class PhysicsShapeCylinder extends PhysicsShape {
175
202
  constructor(pointA, pointB, radius, scene) {
176
203
  super({ type: ShapeType.CYLINDER, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);
177
204
  }
205
+ /**
206
+ * Derive an approximate cylinder from the transform node. Note, this is
207
+ * not the optimal bounding cylinder.
208
+ * @param TransformNode node Node from which to derive a cylinder shape
209
+ */
210
+ static FromMesh(mesh) {
211
+ const boundsLocal = mesh.getBoundingInfo();
212
+ const radius = boundsLocal.boundingBox.extendSize.x;
213
+ const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y, 0);
214
+ const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);
215
+ const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);
216
+ return new PhysicsShapeCylinder(pointA, pointB, radius, mesh.getScene());
217
+ }
178
218
  }
179
219
  /**
180
220
  * Helper object to create a box shape
@@ -190,6 +230,17 @@ export class PhysicsShapeBox extends PhysicsShape {
190
230
  constructor(center, rotation, extents, scene) {
191
231
  super({ type: ShapeType.BOX, parameters: { center: center, rotation: rotation, extents: extents } }, scene);
192
232
  }
233
+ /**
234
+ *
235
+ * @param mesh
236
+ * @returns PhysicsShapeBox
237
+ */
238
+ static FromMesh(mesh) {
239
+ const bounds = mesh.getBoundingInfo();
240
+ const centerLocal = bounds.boundingBox.center;
241
+ const extents = bounds.boundingBox.extendSize.scale(2.0); //<todo.eoin extendSize seems to really be half-extents?
242
+ return new PhysicsShapeBox(centerLocal, Quaternion.Identity(), extents, mesh.getScene());
243
+ }
193
244
  }
194
245
  /**
195
246
  * Helper object to create a convex hull shape
@@ -1 +1 @@
1
- {"version":3,"file":"physicsShape.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsShape.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA0BnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAYrB;;;;;;;;;;;;OAYG;IACH,YAAY,OAA2B,EAAE,KAAY;;QAxBrD;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QAsBhC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,aAAa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AE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC9C;;;;OAIG;IACH,YAAY,IAAU,EAAE,KAAY;QAChC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACnD;;;OAGG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;CACJ","sourcesContent":["import type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport { ShapeType } from \"./IPhysicsEnginePlugin\";\r\nimport type { IPhysicsEnginePluginV2, PhysicsShapeParameters } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport type { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Quaternion } from \"../../Maths/math.vector\";\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Options for creating a physics shape\r\n */\r\nexport interface PhysicShapeOptions {\r\n /**\r\n * The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n */\r\n type?: ShapeType;\r\n /**\r\n * The parameters of the shape. Varies depending of the shape type.\r\n */\r\n parameters?: PhysicsShapeParameters;\r\n /**\r\n * Reference to an already existing physics shape in the plugin.\r\n */\r\n pluginData?: any;\r\n}\r\n\r\n/**\r\n * PhysicsShape class.\r\n * This class is useful for creating a physics shape that can be used in a physics engine.\r\n * A Physic Shape determine how collision are computed. It must be attached to a body.\r\n */\r\nexport class PhysicsShape {\r\n /**\r\n * V2 Physics plugin private data for single shape\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n\r\n private _type: ShapeType;\r\n\r\n /**\r\n * Constructs a new physics shape.\r\n * @param options The options for the physics shape. These are:\r\n * * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n * * parameters: The parameters of the shape.\r\n * * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.\r\n * You need to specify either type or pluginData.\r\n * @param scene The scene the shape belongs to.\r\n *\r\n * This code is useful for creating a new physics shape with the given type, options, and scene.\r\n * It also checks that the physics engine and plugin version are correct.\r\n * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.\r\n */\r\n constructor(options: PhysicShapeOptions, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine();\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n\r\n if (options.pluginData !== undefined && options.pluginData !== null) {\r\n this._pluginData = options.pluginData;\r\n this._type = this._physicsPlugin.getShapeType(this);\r\n } else if (options.type !== undefined && options.type !== null) {\r\n this._type = options.type;\r\n const parameters = options.parameters ?? {};\r\n this._physicsPlugin.initShape(this, options.type, parameters);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public get type(): ShapeType {\r\n return this._type;\r\n }\r\n\r\n /**\r\n *\r\n * @param layer\r\n */\r\n public setFilterLayer(layer: number): void {\r\n this._physicsPlugin.setFilterLayer(this, layer);\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getFilterLayer(): number {\r\n return this._physicsPlugin.getFilterLayer(this);\r\n }\r\n\r\n /**\r\n *\r\n * @param materialId\r\n */\r\n public setMaterial(material: PhysicsMaterial): void {\r\n this._physicsPlugin.setMaterial(this, material);\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getMaterial(): PhysicsMaterial | undefined {\r\n return this._physicsPlugin.getMaterial(this);\r\n }\r\n\r\n /**\r\n *\r\n * @param density\r\n */\r\n public setDensity(density: number): void {\r\n this._physicsPlugin.setDensity(this, density);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public getDensity(): number {\r\n return this._physicsPlugin.getDensity(this);\r\n }\r\n\r\n /**\r\n *\r\n * @param newChild\r\n * @param childTransform\r\n */\r\n public addChild(newChild: PhysicsShape, childTransform: TransformNode): void {\r\n this._physicsPlugin.addChild(this, newChild, childTransform);\r\n }\r\n\r\n /**\r\n *\r\n * @param childIndex\r\n */\r\n public removeChild(childIndex: number): void {\r\n this._physicsPlugin.removeChild(this, childIndex);\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getNumChildren(): number {\r\n return this._physicsPlugin.getNumChildren(this);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBoundingBox(this);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public dispose() {\r\n this._physicsPlugin.disposeShape(this);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a sphere shape\r\n */\r\nexport class PhysicsShapeSphere extends PhysicsShape {\r\n /** @internal */\r\n /**\r\n * Constructor for the Sphere Shape\r\n * @param center local center of the sphere\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.SPHERE, parameters: { center: center, radius: radius } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a capsule shape\r\n */\r\nexport class PhysicsShapeCapsule extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the capsule segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.CAPSULE, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a cylinder shape\r\n */\r\nexport class PhysicsShapeCylinder extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the cylinder segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.CYLINDER, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a box shape\r\n */\r\nexport class PhysicsShapeBox extends PhysicsShape {\r\n /**\r\n *\r\n * @param center local center of the sphere\r\n * @param rotation local orientation\r\n * @param extents size of the box in each direction\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, rotation: Quaternion, extents: Vector3, scene: Scene) {\r\n super({ type: ShapeType.BOX, parameters: { center: center, rotation: rotation, extents: extents } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a convex hull shape\r\n */\r\nexport class PhysicsShapeConvexHull extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh to be used as topology infos for the convex hull\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: ShapeType.CONVEX_HULL, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a mesh shape\r\n */\r\nexport class PhysicsShapeMesh extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh topology that will be used to create the shape\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: ShapeType.MESH, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * A shape container holds a variable number of shapes. Use AddChild to append to newly created parent container.\r\n */\r\nexport class PhysicsShapeContainer extends PhysicsShape {\r\n /**\r\n * Constructor of the Shape container\r\n * @param scene scene to attach to\r\n */\r\n constructor(scene: Scene) {\r\n super({ type: ShapeType.CONTAINER, parameters: {} }, scene);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsShape.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsShape.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAuB9D;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAcrB;;;;;;;;;;;;OAYG;IACH,YAAY,OAA2B,EAAE,KAAY;;QA1BrD;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QAwBhC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QACD,IAAI,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACvE;QACD,MAAM,aAAa,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;QACvD,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QACD,IAAI,CAAC,cAAc,GAAG,aAAuC,CAAC;QAE9D,IAAI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,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,wDAAwD;QAClH,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7F,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IACpD;;;;OAIG;IACH,YAAY,IAAU,EAAE,KAAY;QAChC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC9C;;;;OAIG;IACH,YAAY,IAAU,EAAE,KAAY;QAChC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACnD;;;OAGG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;CACJ","sourcesContent":["import type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport { ShapeType } from \"./IPhysicsEnginePlugin\";\r\nimport type { IPhysicsEnginePluginV2, PhysicsShapeParameters } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\n\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Options for creating a physics shape\r\n */\r\nexport interface PhysicShapeOptions {\r\n /**\r\n * The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n */\r\n type?: ShapeType;\r\n /**\r\n * The parameters of the shape. Varies depending of the shape type.\r\n */\r\n parameters?: PhysicsShapeParameters;\r\n /**\r\n * Reference to an already existing physics shape in the plugin.\r\n */\r\n pluginData?: any;\r\n}\r\n\r\n/**\r\n * PhysicsShape class.\r\n * This class is useful for creating a physics shape that can be used in a physics engine.\r\n * A Physic Shape determine how collision are computed. It must be attached to a body.\r\n */\r\nexport class PhysicsShape {\r\n /**\r\n * V2 Physics plugin private data for single shape\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n\r\n private _type: ShapeType;\r\n\r\n private _material: PhysicsMaterial;\r\n\r\n /**\r\n * Constructs a new physics shape.\r\n * @param options The options for the physics shape. These are:\r\n * * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER\r\n * * parameters: The parameters of the shape.\r\n * * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.\r\n * You need to specify either type or pluginData.\r\n * @param scene The scene the shape belongs to.\r\n *\r\n * This code is useful for creating a new physics shape with the given type, options, and scene.\r\n * It also checks that the physics engine and plugin version are correct.\r\n * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.\r\n */\r\n constructor(options: PhysicShapeOptions, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine();\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n\r\n if (options.pluginData !== undefined && options.pluginData !== null) {\r\n this._pluginData = options.pluginData;\r\n this._type = this._physicsPlugin.getShapeType(this);\r\n } else if (options.type !== undefined && options.type !== null) {\r\n this._type = options.type;\r\n const parameters = options.parameters ?? {};\r\n this._physicsPlugin.initShape(this, options.type, parameters);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public get type(): ShapeType {\r\n return this._type;\r\n }\r\n\r\n /**\r\n *\r\n * @param layer\r\n */\r\n public setFilterLayer(layer: number): void {\r\n this._physicsPlugin.setFilterLayer(this, layer);\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getFilterLayer(): number {\r\n return this._physicsPlugin.getFilterLayer(this);\r\n }\r\n\r\n /**\r\n *\r\n * @param materialId\r\n */\r\n public setMaterial(material: PhysicsMaterial): void {\r\n this._physicsPlugin.setMaterial(this, material);\r\n this._material = material;\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getMaterial(): PhysicsMaterial | undefined {\r\n return this._material;\r\n }\r\n\r\n /**\r\n *\r\n * @param density\r\n */\r\n public setDensity(density: number): void {\r\n this._physicsPlugin.setDensity(this, density);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public getDensity(): number {\r\n return this._physicsPlugin.getDensity(this);\r\n }\r\n\r\n /**\r\n *\r\n * @param newChild\r\n * @param childTransform\r\n */\r\n public addChild(newChild: PhysicsShape, childTransform: TransformNode): void {\r\n this._physicsPlugin.addChild(this, newChild, childTransform);\r\n }\r\n\r\n /**\r\n *\r\n * @param childIndex\r\n */\r\n public removeChild(childIndex: number): void {\r\n this._physicsPlugin.removeChild(this, childIndex);\r\n }\r\n\r\n /**\r\n *\r\n * @returns\r\n */\r\n public getNumChildren(): number {\r\n return this._physicsPlugin.getNumChildren(this);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBoundingBox(this);\r\n }\r\n\r\n /**\r\n *\r\n */\r\n public dispose() {\r\n this._physicsPlugin.disposeShape(this);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a sphere shape\r\n */\r\nexport class PhysicsShapeSphere extends PhysicsShape {\r\n /** @internal */\r\n /**\r\n * Constructor for the Sphere Shape\r\n * @param center local center of the sphere\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.SPHERE, parameters: { center: center, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n *\r\n * @param mesh\r\n * @returns PhysicsShapeSphere\r\n */\r\n static FromMesh(mesh: AbstractMesh) {\r\n const bounds = mesh.getBoundingInfo();\r\n //<todo.eoin We don't use bounding sphere because the results seem to be wrong\r\n const centerLocal = bounds.boundingBox.center;\r\n const radius = bounds.boundingBox.extendSize.x;\r\n return new PhysicsShapeSphere(centerLocal, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a capsule shape\r\n */\r\nexport class PhysicsShapeCapsule extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the capsule segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.CAPSULE, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate capsule from the transform node. Note, this is\r\n * not the optimal bounding capsule.\r\n * @param TransformNode node Node from which to derive a cylinder shape\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCapsule {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y - radius, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCapsule(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a cylinder shape\r\n */\r\nexport class PhysicsShapeCylinder extends PhysicsShape {\r\n /**\r\n *\r\n * @param pointA Starting point that defines the cylinder segment\r\n * @param pointB ending point of that same segment\r\n * @param radius radius\r\n * @param scene scene to attach to\r\n */\r\n constructor(pointA: Vector3, pointB: Vector3, radius: number, scene: Scene) {\r\n super({ type: ShapeType.CYLINDER, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);\r\n }\r\n\r\n /**\r\n * Derive an approximate cylinder from the transform node. Note, this is\r\n * not the optimal bounding cylinder.\r\n * @param TransformNode node Node from which to derive a cylinder shape\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeCylinder {\r\n const boundsLocal = mesh.getBoundingInfo();\r\n const radius = boundsLocal.boundingBox.extendSize.x;\r\n const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y, 0);\r\n const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);\r\n const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);\r\n return new PhysicsShapeCylinder(pointA, pointB, radius, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a box shape\r\n */\r\nexport class PhysicsShapeBox extends PhysicsShape {\r\n /**\r\n *\r\n * @param center local center of the sphere\r\n * @param rotation local orientation\r\n * @param extents size of the box in each direction\r\n * @param scene scene to attach to\r\n */\r\n constructor(center: Vector3, rotation: Quaternion, extents: Vector3, scene: Scene) {\r\n super({ type: ShapeType.BOX, parameters: { center: center, rotation: rotation, extents: extents } }, scene);\r\n }\r\n\r\n /**\r\n *\r\n * @param mesh\r\n * @returns PhysicsShapeBox\r\n */\r\n static FromMesh(mesh: AbstractMesh): PhysicsShapeBox {\r\n const bounds = mesh.getBoundingInfo();\r\n const centerLocal = bounds.boundingBox.center;\r\n const extents = bounds.boundingBox.extendSize.scale(2.0); //<todo.eoin extendSize seems to really be half-extents?\r\n return new PhysicsShapeBox(centerLocal, Quaternion.Identity(), extents, mesh.getScene());\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a convex hull shape\r\n */\r\nexport class PhysicsShapeConvexHull extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh to be used as topology infos for the convex hull\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: ShapeType.CONVEX_HULL, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * Helper object to create a mesh shape\r\n */\r\nexport class PhysicsShapeMesh extends PhysicsShape {\r\n /**\r\n *\r\n * @param mesh the mesh topology that will be used to create the shape\r\n * @param scene scene to attach to\r\n */\r\n constructor(mesh: Mesh, scene: Scene) {\r\n super({ type: ShapeType.MESH, parameters: { mesh: mesh } }, scene);\r\n }\r\n}\r\n\r\n/**\r\n * A shape container holds a variable number of shapes. Use AddChild to append to newly created parent container.\r\n */\r\nexport class PhysicsShapeContainer extends PhysicsShape {\r\n /**\r\n * Constructor of the Shape container\r\n * @param scene scene to attach to\r\n */\r\n constructor(scene: Scene) {\r\n super({ type: ShapeType.CONTAINER, parameters: {} }, scene);\r\n }\r\n}\r\n"]}
@@ -42,23 +42,31 @@ export declare class SSAO2RenderingPipeline extends PostProcessRenderPipeline {
42
42
  */
43
43
  maxZ: number;
44
44
  /**
45
- * In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much
45
+ * In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much.
46
46
  */
47
47
  minZAspect: number;
48
+ private _epsilon;
49
+ /**
50
+ * Used in SSAO calculations to compensate for accuracy issues with depth values. Default 0.02.
51
+ *
52
+ * Normally you do not need to change this value, but you can experiment with it if you get a lot of in false self-occlusion on flat surfaces when using fewer than 16 samples. Useful range is normally [0..0.1] but higher values is allowed.
53
+ */
54
+ set epsilon(n: number);
55
+ get epsilon(): number;
48
56
  private _samples;
49
57
  /**
50
- * Number of samples used for the SSAO calculations. Default value is 8
58
+ * Number of samples used for the SSAO calculations. Default value is 8.
51
59
  */
52
60
  set samples(n: number);
53
61
  get samples(): number;
54
62
  private _textureSamples;
55
63
  /**
56
- * Number of samples to use for antialiasing
64
+ * Number of samples to use for antialiasing.
57
65
  */
58
66
  set textureSamples(n: number);
59
67
  get textureSamples(): number;
60
68
  /**
61
- * Force rendering the geometry through geometry buffer
69
+ * Force rendering the geometry through geometry buffer.
62
70
  */
63
71
  private _forceGeometryBuffer;
64
72
  private get _geometryBufferRenderer();
@@ -67,29 +75,64 @@ export declare class SSAO2RenderingPipeline extends PostProcessRenderPipeline {
67
75
  * Ratio object used for SSAO ratio and blur ratio
68
76
  */
69
77
  private _ratio;
78
+ private _textureType;
70
79
  /**
71
80
  * Dynamically generated sphere sampler.
72
81
  */
73
82
  private _sampleSphere;
74
83
  /**
75
- * Blur filter offsets
84
+ * The radius around the analyzed pixel used by the SSAO post-process. Default value is 2.0
85
+ */
86
+ radius: number;
87
+ /**
88
+ * The base color of the SSAO post-process
89
+ * The final result is "base + ssao" between [0, 1]
90
+ */
91
+ base: number;
92
+ private _bypassBlur;
93
+ /**
94
+ * Skips the denoising (blur) stage of the SSAO calculations.
95
+ *
96
+ * Useful to temporarily set while experimenting with the other SSAO2 settings.
76
97
  */
77
- private _samplerOffsets;
98
+ set bypassBlur(b: boolean);
99
+ get bypassBlur(): boolean;
78
100
  private _expensiveBlur;
79
101
  /**
80
- * If bilateral blur should be used
102
+ * Enables the configurable bilateral denoising (blurring) filter. Default is true.
103
+ * Set to false to instead use a legacy bilateral filter that can't be configured.
104
+ *
105
+ * The denoising filter runs after the SSAO calculations and is a very important step. Both options results in a so called bilateral being used, but the "expensive" one can be
106
+ * configured in several ways to fit your scene.
81
107
  */
82
108
  set expensiveBlur(b: boolean);
83
109
  get expensiveBlur(): boolean;
84
110
  /**
85
- * The radius around the analyzed pixel used by the SSAO post-process. Default value is 2.0
111
+ * The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. Default value is 16.
112
+ *
113
+ * A higher value should result in smoother shadows but will use more processing time in the shaders.
114
+ *
115
+ * A high value can cause the shadows to get to blurry or create visible artifacts (bands) near sharp details in the geometry. The artifacts can sometimes be mitigated by increasing the bilateralSoften setting.
86
116
  */
87
- radius: number;
117
+ bilateralSamples: number;
88
118
  /**
89
- * The base color of the SSAO post-process
90
- * The final result is "base + ssao" between [0, 1]
119
+ * Controls the shape of the denoising kernel used by the bilateral filter. Default value is 0.
120
+ *
121
+ * By default the bilateral filter acts like a box-filter, treating all samples on the same depth with equal weights. This is effective to maximize the denoising effect given a limited set of samples. However, it also often results in visible ghosting around sharp shadow regions and can spread out lines over large areas so they are no longer visible.
122
+ *
123
+ * Increasing this setting will make the filter pay less attention to samples further away from the center sample, reducing many artifacts but at the same time increasing noise.
124
+ *
125
+ * Useful value range is [0..1].
91
126
  */
92
- base: number;
127
+ bilateralSoften: number;
128
+ /**
129
+ * How forgiving the bilateral denoiser should be when rejecting samples. Default value is 0.
130
+ *
131
+ * A higher value results in the bilateral filter being more forgiving and thus doing a better job at denoising slanted and curved surfaces, but can lead to shadows spreading out around corners or between objects that are close to each other depth wise.
132
+ *
133
+ * Useful value range is normally [0..1], but higher values are allowed.
134
+ */
135
+ bilateralTolerance: number;
93
136
  /**
94
137
  * Support test.
95
138
  */
@@ -125,9 +168,12 @@ export declare class SSAO2RenderingPipeline extends PostProcessRenderPipeline {
125
168
  * @param disableGeometryBufferRenderer
126
169
  */
127
170
  dispose(disableGeometryBufferRenderer?: boolean): void;
128
- private _createBlurPostProcess;
129
171
  /** @internal */
130
172
  _rebuild(): void;
173
+ private _getSamplersForBlur;
174
+ private _getDefinesForBlur;
175
+ private _createBlurPostProcess;
176
+ private _createBlurFilter;
131
177
  private _bits;
132
178
  private _radicalInverse_VdC;
133
179
  private _hammersley;