@babylonjs/core 5.45.0 → 5.45.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 (55) hide show
  1. package/Engines/thinEngine.js +2 -2
  2. package/Engines/thinEngine.js.map +1 -1
  3. package/Inputs/scene.inputManager.js +12 -1
  4. package/Inputs/scene.inputManager.js.map +1 -1
  5. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +7 -0
  6. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +30 -1
  7. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  8. package/Materials/Textures/texture.d.ts +2 -2
  9. package/Materials/Textures/texture.js +2 -2
  10. package/Materials/Textures/texture.js.map +1 -1
  11. package/Materials/Textures/videoTexture.d.ts +1 -0
  12. package/Materials/Textures/videoTexture.js +19 -8
  13. package/Materials/Textures/videoTexture.js.map +1 -1
  14. package/Materials/clipPlaneMaterialHelper.js +22 -19
  15. package/Materials/clipPlaneMaterialHelper.js.map +1 -1
  16. package/Misc/khronosTextureContainer2.js +3 -5
  17. package/Misc/khronosTextureContainer2.js.map +1 -1
  18. package/Physics/index.d.ts +1 -0
  19. package/Physics/index.js +1 -0
  20. package/Physics/index.js.map +1 -1
  21. package/Physics/physicsHelper.d.ts +452 -1
  22. package/Physics/physicsHelper.js +877 -2
  23. package/Physics/physicsHelper.js.map +1 -1
  24. package/Physics/v1/index.d.ts +0 -1
  25. package/Physics/v1/index.js +0 -1
  26. package/Physics/v1/index.js.map +1 -1
  27. package/Physics/v2/IPhysicsEnginePlugin.d.ts +8 -1
  28. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  29. package/Physics/v2/index.d.ts +1 -0
  30. package/Physics/v2/index.js +1 -0
  31. package/Physics/v2/index.js.map +1 -1
  32. package/Physics/v2/physicsAggregate.d.ts +39 -19
  33. package/Physics/v2/physicsAggregate.js +61 -5
  34. package/Physics/v2/physicsAggregate.js.map +1 -1
  35. package/Physics/v2/physicsBody.d.ts +37 -1
  36. package/Physics/v2/physicsBody.js +71 -1
  37. package/Physics/v2/physicsBody.js.map +1 -1
  38. package/Physics/v2/physicsEngine.d.ts +7 -2
  39. package/Physics/v2/physicsEngine.js +9 -2
  40. package/Physics/v2/physicsEngine.js.map +1 -1
  41. package/Physics/v2/physicsShape.d.ts +30 -44
  42. package/Physics/v2/physicsShape.js +30 -44
  43. package/Physics/v2/physicsShape.js.map +1 -1
  44. package/Shaders/ShadersInclude/bumpFragment.js +1 -0
  45. package/Shaders/ShadersInclude/bumpFragment.js.map +1 -1
  46. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +4 -1
  47. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  48. package/Shaders/sprites.fragment.js +1 -1
  49. package/Shaders/sprites.fragment.js.map +1 -1
  50. package/assetContainer.js +1 -1
  51. package/assetContainer.js.map +1 -1
  52. package/package.json +1 -1
  53. package/Physics/v1/physicsHelper.d.ts +0 -411
  54. package/Physics/v1/physicsHelper.js +0 -709
  55. package/Physics/v1/physicsHelper.js.map +0 -1
@@ -1,411 +0,0 @@
1
- import type { Nullable } from "../../types";
2
- import { Vector3 } from "../../Maths/math.vector";
3
- import type { Mesh } from "../../Meshes/mesh";
4
- import type { Scene } from "../../scene";
5
- import type { PhysicsImpostor } from "./physicsImpostor";
6
- /**
7
- * A helper for physics simulations
8
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
9
- */
10
- export declare class PhysicsHelper {
11
- private _scene;
12
- private _physicsEngine;
13
- /**
14
- * Initializes the Physics helper
15
- * @param scene Babylon.js scene
16
- */
17
- constructor(scene: Scene);
18
- /**
19
- * Applies a radial explosion impulse
20
- * @param origin the origin of the explosion
21
- * @param radiusOrEventOptions the radius or the options of radial explosion
22
- * @param strength the explosion strength
23
- * @param falloff possible options: Constant & Linear. Defaults to Constant
24
- * @returns A physics radial explosion event, or null
25
- */
26
- applyRadialExplosionImpulse(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsRadialExplosionEvent>;
27
- /**
28
- * Applies a radial explosion force
29
- * @param origin the origin of the explosion
30
- * @param radiusOrEventOptions the radius or the options of radial explosion
31
- * @param strength the explosion strength
32
- * @param falloff possible options: Constant & Linear. Defaults to Constant
33
- * @returns A physics radial explosion event, or null
34
- */
35
- applyRadialExplosionForce(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsRadialExplosionEvent>;
36
- /**
37
- * Creates a gravitational field
38
- * @param origin the origin of the explosion
39
- * @param radiusOrEventOptions the radius or the options of radial explosion
40
- * @param strength the explosion strength
41
- * @param falloff possible options: Constant & Linear. Defaults to Constant
42
- * @returns A physics gravitational field event, or null
43
- */
44
- gravitationalField(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsGravitationalFieldEvent>;
45
- /**
46
- * Creates a physics updraft event
47
- * @param origin the origin of the updraft
48
- * @param radiusOrEventOptions the radius or the options of the updraft
49
- * @param strength the strength of the updraft
50
- * @param height the height of the updraft
51
- * @param updraftMode possible options: Center & Perpendicular. Defaults to Center
52
- * @returns A physics updraft event, or null
53
- */
54
- updraft(origin: Vector3, radiusOrEventOptions: number | PhysicsUpdraftEventOptions, strength?: number, height?: number, updraftMode?: PhysicsUpdraftMode): Nullable<PhysicsUpdraftEvent>;
55
- /**
56
- * Creates a physics vortex event
57
- * @param origin the of the vortex
58
- * @param radiusOrEventOptions the radius or the options of the vortex
59
- * @param strength the strength of the vortex
60
- * @param height the height of the vortex
61
- * @returns a Physics vortex event, or null
62
- * A physics vortex event or null
63
- */
64
- vortex(origin: Vector3, radiusOrEventOptions: number | PhysicsVortexEventOptions, strength?: number, height?: number): Nullable<PhysicsVortexEvent>;
65
- }
66
- /**
67
- * Represents a physics radial explosion event
68
- */
69
- declare class PhysicsRadialExplosionEvent {
70
- private _scene;
71
- private _options;
72
- private _sphere;
73
- private _dataFetched;
74
- /**
75
- * Initializes a radial explosion event
76
- * @param _scene BabylonJS scene
77
- * @param _options The options for the vortex event
78
- */
79
- constructor(_scene: Scene, _options: PhysicsRadialExplosionEventOptions);
80
- /**
81
- * Returns the data related to the radial explosion event (sphere).
82
- * @returns The radial explosion event data
83
- */
84
- getData(): PhysicsRadialExplosionEventData;
85
- /**
86
- * Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
87
- * @param impostor A physics imposter
88
- * @param origin the origin of the explosion
89
- * @returns {Nullable<PhysicsHitData>} A physics force and contact point, or null
90
- */
91
- getImpostorHitData(impostor: PhysicsImpostor, origin: Vector3): Nullable<PhysicsHitData>;
92
- /**
93
- * Triggers affected impostors callbacks
94
- * @param affectedImpostorsWithData defines the list of affected impostors (including associated data)
95
- */
96
- triggerAffectedImpostorsCallback(affectedImpostorsWithData: Array<PhysicsAffectedImpostorWithData>): void;
97
- /**
98
- * Disposes the sphere.
99
- * @param force Specifies if the sphere should be disposed by force
100
- */
101
- dispose(force?: boolean): void;
102
- /*** Helpers ***/
103
- private _prepareSphere;
104
- private _intersectsWithSphere;
105
- }
106
- /**
107
- * Represents a gravitational field event
108
- */
109
- declare class PhysicsGravitationalFieldEvent {
110
- private _physicsHelper;
111
- private _scene;
112
- private _origin;
113
- private _options;
114
- private _tickCallback;
115
- private _sphere;
116
- private _dataFetched;
117
- /**
118
- * Initializes the physics gravitational field event
119
- * @param _physicsHelper A physics helper
120
- * @param _scene BabylonJS scene
121
- * @param _origin The origin position of the gravitational field event
122
- * @param _options The options for the vortex event
123
- */
124
- constructor(_physicsHelper: PhysicsHelper, _scene: Scene, _origin: Vector3, _options: PhysicsRadialExplosionEventOptions);
125
- /**
126
- * Returns the data related to the gravitational field event (sphere).
127
- * @returns A gravitational field event
128
- */
129
- getData(): PhysicsGravitationalFieldEventData;
130
- /**
131
- * Enables the gravitational field.
132
- */
133
- enable(): void;
134
- /**
135
- * Disables the gravitational field.
136
- */
137
- disable(): void;
138
- /**
139
- * Disposes the sphere.
140
- * @param force The force to dispose from the gravitational field event
141
- */
142
- dispose(force?: boolean): void;
143
- private _tick;
144
- }
145
- /**
146
- * Represents a physics updraft event
147
- */
148
- declare class PhysicsUpdraftEvent {
149
- private _scene;
150
- private _origin;
151
- private _options;
152
- private _physicsEngine;
153
- private _originTop;
154
- private _originDirection;
155
- private _tickCallback;
156
- private _cylinder;
157
- private _cylinderPosition;
158
- private _dataFetched;
159
- /**
160
- * Initializes the physics updraft event
161
- * @param _scene BabylonJS scene
162
- * @param _origin The origin position of the updraft
163
- * @param _options The options for the updraft event
164
- */
165
- constructor(_scene: Scene, _origin: Vector3, _options: PhysicsUpdraftEventOptions);
166
- /**
167
- * Returns the data related to the updraft event (cylinder).
168
- * @returns A physics updraft event
169
- */
170
- getData(): PhysicsUpdraftEventData;
171
- /**
172
- * Enables the updraft.
173
- */
174
- enable(): void;
175
- /**
176
- * Disables the updraft.
177
- */
178
- disable(): void;
179
- /**
180
- * Disposes the cylinder.
181
- * @param force Specifies if the updraft should be disposed by force
182
- */
183
- dispose(force?: boolean): void;
184
- private _getImpostorHitData;
185
- private _tick;
186
- /*** Helpers ***/
187
- private _prepareCylinder;
188
- private _intersectsWithCylinder;
189
- }
190
- /**
191
- * Represents a physics vortex event
192
- */
193
- declare class PhysicsVortexEvent {
194
- private _scene;
195
- private _origin;
196
- private _options;
197
- private _physicsEngine;
198
- private _originTop;
199
- private _tickCallback;
200
- private _cylinder;
201
- private _cylinderPosition;
202
- private _dataFetched;
203
- /**
204
- * Initializes the physics vortex event
205
- * @param _scene The BabylonJS scene
206
- * @param _origin The origin position of the vortex
207
- * @param _options The options for the vortex event
208
- */
209
- constructor(_scene: Scene, _origin: Vector3, _options: PhysicsVortexEventOptions);
210
- /**
211
- * Returns the data related to the vortex event (cylinder).
212
- * @returns The physics vortex event data
213
- */
214
- getData(): PhysicsVortexEventData;
215
- /**
216
- * Enables the vortex.
217
- */
218
- enable(): void;
219
- /**
220
- * Disables the cortex.
221
- */
222
- disable(): void;
223
- /**
224
- * Disposes the sphere.
225
- * @param force
226
- */
227
- dispose(force?: boolean): void;
228
- private _getImpostorHitData;
229
- private _tick;
230
- /*** Helpers ***/
231
- private _prepareCylinder;
232
- private _intersectsWithCylinder;
233
- }
234
- /**
235
- * Options fot the radial explosion event
236
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
237
- */
238
- export declare class PhysicsRadialExplosionEventOptions {
239
- /**
240
- * The radius of the sphere for the radial explosion.
241
- */
242
- radius: number;
243
- /**
244
- * The strength of the explosion.
245
- */
246
- strength: number;
247
- /**
248
- * The strength of the force in correspondence to the distance of the affected object
249
- */
250
- falloff: PhysicsRadialImpulseFalloff;
251
- /**
252
- * Sphere options for the radial explosion.
253
- */
254
- sphere: {
255
- segments: number;
256
- diameter: number;
257
- };
258
- /**
259
- * Sphere options for the radial explosion.
260
- */
261
- affectedImpostorsCallback: (affectedImpostorsWithData: Array<PhysicsAffectedImpostorWithData>) => void;
262
- }
263
- /**
264
- * Options fot the updraft event
265
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
266
- */
267
- export declare class PhysicsUpdraftEventOptions {
268
- /**
269
- * The radius of the cylinder for the vortex
270
- */
271
- radius: number;
272
- /**
273
- * The strength of the updraft.
274
- */
275
- strength: number;
276
- /**
277
- * The height of the cylinder for the updraft.
278
- */
279
- height: number;
280
- /**
281
- * The mode for the the updraft.
282
- */
283
- updraftMode: PhysicsUpdraftMode;
284
- }
285
- /**
286
- * Options fot the vortex event
287
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
288
- */
289
- export declare class PhysicsVortexEventOptions {
290
- /**
291
- * The radius of the cylinder for the vortex
292
- */
293
- radius: number;
294
- /**
295
- * The strength of the vortex.
296
- */
297
- strength: number;
298
- /**
299
- * The height of the cylinder for the vortex.
300
- */
301
- height: number;
302
- /**
303
- * At which distance, relative to the radius the centripetal forces should kick in? Range: 0-1
304
- */
305
- centripetalForceThreshold: number;
306
- /**
307
- * This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when below the threshold.
308
- */
309
- centripetalForceMultiplier: number;
310
- /**
311
- * This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when above the threshold.
312
- */
313
- centrifugalForceMultiplier: number;
314
- /**
315
- * This multiplier determines with how much force the objects will be pushed upwards, when in the vortex.
316
- */
317
- updraftForceMultiplier: number;
318
- }
319
- /**
320
- * The strength of the force in correspondence to the distance of the affected object
321
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
322
- */
323
- export declare enum PhysicsRadialImpulseFalloff {
324
- /** Defines that impulse is constant in strength across it's whole radius */
325
- Constant = 0,
326
- /** Defines that impulse gets weaker if it's further from the origin */
327
- Linear = 1
328
- }
329
- /**
330
- * The strength of the force in correspondence to the distance of the affected object
331
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
332
- */
333
- export declare enum PhysicsUpdraftMode {
334
- /** Defines that the upstream forces will pull towards the top center of the cylinder */
335
- Center = 0,
336
- /** Defines that once a impostor is inside the cylinder, it will shoot out perpendicular from the ground of the cylinder */
337
- Perpendicular = 1
338
- }
339
- /**
340
- * Interface for a physics hit data
341
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
342
- */
343
- export interface PhysicsHitData {
344
- /**
345
- * The force applied at the contact point
346
- */
347
- force: Vector3;
348
- /**
349
- * The contact point
350
- */
351
- contactPoint: Vector3;
352
- /**
353
- * The distance from the origin to the contact point
354
- */
355
- distanceFromOrigin: number;
356
- }
357
- /**
358
- * Interface for radial explosion event data
359
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
360
- */
361
- export interface PhysicsRadialExplosionEventData {
362
- /**
363
- * A sphere used for the radial explosion event
364
- */
365
- sphere: Mesh;
366
- }
367
- /**
368
- * Interface for gravitational field event data
369
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
370
- */
371
- export interface PhysicsGravitationalFieldEventData {
372
- /**
373
- * A sphere mesh used for the gravitational field event
374
- */
375
- sphere: Mesh;
376
- }
377
- /**
378
- * Interface for updraft event data
379
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
380
- */
381
- export interface PhysicsUpdraftEventData {
382
- /**
383
- * A cylinder used for the updraft event
384
- */
385
- cylinder: Mesh;
386
- }
387
- /**
388
- * Interface for vortex event data
389
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
390
- */
391
- export interface PhysicsVortexEventData {
392
- /**
393
- * A cylinder used for the vortex event
394
- */
395
- cylinder: Mesh;
396
- }
397
- /**
398
- * Interface for an affected physics impostor
399
- * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
400
- */
401
- export interface PhysicsAffectedImpostorWithData {
402
- /**
403
- * The impostor affected by the effect
404
- */
405
- impostor: PhysicsImpostor;
406
- /**
407
- * The data about the hit/force from the explosion
408
- */
409
- hitData: PhysicsHitData;
410
- }
411
- export {};