Class PhysicsHelper
Methods
apply Radial Explosion Force
-
applyRadialExplosionForce(
origin: Vector3,
radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions,
strength?: number,
falloff?: PhysicsRadialImpulseFalloff,
): Nullable<PhysicsRadialExplosionEvent>Applies a radial explosion force
Parameters
- origin: Vector3
the origin of the explosion
- radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions
the radius or the options of radial explosion
Optionalstrength: numberthe explosion strength
Optionalfalloff: PhysicsRadialImpulseFalloffpossible options: Constant & Linear. Defaults to Constant
Returns Nullable<PhysicsRadialExplosionEvent>
A physics radial explosion event, or null
- origin: Vector3
apply Radial Explosion Impulse
-
applyRadialExplosionImpulse(
origin: Vector3,
radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions,
strength?: number,
falloff?: PhysicsRadialImpulseFalloff,
): Nullable<PhysicsRadialExplosionEvent>Applies a radial explosion impulse
Parameters
- origin: Vector3
the origin of the explosion
- radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions
the radius or the options of radial explosion
Optionalstrength: numberthe explosion strength
Optionalfalloff: PhysicsRadialImpulseFalloffpossible options: Constant & Linear. Defaults to Constant
Returns Nullable<PhysicsRadialExplosionEvent>
A physics radial explosion event, or null
- origin: Vector3
gravitational Field
-
gravitationalField(
origin: Vector3,
radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions,
strength?: number,
falloff?: PhysicsRadialImpulseFalloff,
): Nullable<PhysicsGravitationalFieldEvent>Creates a gravitational field
Parameters
- origin: Vector3
the origin of the gravitational field
- radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions
the radius or the options of radial gravitational field
Optionalstrength: numberthe gravitational field strength
Optionalfalloff: PhysicsRadialImpulseFalloffpossible options: Constant & Linear. Defaults to Constant
Returns Nullable<PhysicsGravitationalFieldEvent>
A physics gravitational field event, or null
- origin: Vector3
updraft
-
updraft(
origin: Vector3,
radiusOrEventOptions: number | PhysicsUpdraftEventOptions,
strength?: number,
height?: number,
updraftMode?: PhysicsUpdraftMode,
): Nullable<PhysicsUpdraftEvent>Creates a physics updraft event
Parameters
- origin: Vector3
the origin of the updraft
- radiusOrEventOptions: number | PhysicsUpdraftEventOptions
the radius or the options of the updraft
Optionalstrength: numberthe strength of the updraft
Optionalheight: numberthe height of the updraft
OptionalupdraftMode: PhysicsUpdraftModepossible options: Center & Perpendicular. Defaults to Center
Returns Nullable<PhysicsUpdraftEvent>
A physics updraft event, or null
- origin: Vector3
vortex
-
vortex(
origin: Vector3,
radiusOrEventOptions: number | PhysicsVortexEventOptions,
strength?: number,
height?: number,
): Nullable<PhysicsVortexEvent>Creates a physics vortex event
Parameters
- origin: Vector3
the of the vortex
- radiusOrEventOptions: number | PhysicsVortexEventOptions
the radius or the options of the vortex
Optionalstrength: numberthe strength of the vortex
Optionalheight: numberthe height of the vortex
Returns Nullable<PhysicsVortexEvent>
a Physics vortex event, or null A physics vortex event or null
- origin: Vector3
A helper for physics simulations
See
https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class