Method ApplyExplosionForce
ApplyExplosionForce(ref PhysicsVelocity, in PhysicsMass, in PhysicsCollider, in float3, in quaternion, in float, float, in float3, in float, in float, in float3, in CollisionFilter, in float, ForceMode)
Converts a force into an impulse based on the force mode and the bodies mass and inertia properties. Equivalent to UnityEngine.Rigidbody.AddExplosionForce.
Declaration
public static void ApplyExplosionForce(this ref PhysicsVelocity bodyVelocity, in PhysicsMass bodyMass, in PhysicsCollider bodyCollider, in float3 bodyPosition, in quaternion bodyOrientation, in float bodyScale, float explosionForce, in float3 explosionPosition, in float explosionRadius, in float timestep, in float3 up, in CollisionFilter explosionFilter, in float upwardsModifier = 0, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
PhysicsVelocity | bodyVelocity | [in,out] The body's PhysicsVelocity component. |
PhysicsMass | bodyMass | The body's PhysicsMass component. |
PhysicsCollider | bodyCollider | The body's PhysicsCollider component. |
float3 | bodyPosition | The body's world-space position. |
quaternion | bodyOrientation | The body's world-space rotation. |
float | bodyScale | The body's world-space scale. |
float | explosionForce | The force of the explosion (which may be modified by distance). |
float3 | explosionPosition | The centre of the sphere within which the explosion has its effect. |
float | explosionRadius | The radius of the sphere within which the explosion has its effect. |
float | timestep | The change in time from the current to the next frame. |
float3 | up |
in the opposite direction to PhysicsStep.Gravity. |
CollisionFilter | explosionFilter | Filter determining whether an explosion should be applied to the body. |
float | upwardsModifier | (Optional) Adjustment to the apparent position of the explosion to make it seem to lift objects. |
ForceMode | mode | (Optional) The method used to apply the force to its targets. |
ApplyExplosionForce(ref PhysicsVelocity, in PhysicsMass, in PhysicsCollider, in float3, in quaternion, float, in float3, in float, in float, in float3, in float, ForceMode)
Converts a force into an impulse based on the force mode and the bodies mass and inertia properties. Equivalent to UnityEngine.Rigidbody.AddExplosionForce. ExplosionFilter is set to CollisionFilter.Default Assumes that there is no scale. ApplyExplosionForce(ref PhysicsVelocity, PhysicsMass, PhysicsCollider, float3, quaternion, float, float, float3, float, float, float3, CollisionFilter,float, ForceMode)
Declaration
public static void ApplyExplosionForce(this ref PhysicsVelocity bodyVelocity, in PhysicsMass bodyMass, in PhysicsCollider bodyCollider, in float3 bodyPosition, in quaternion bodyOrientation, float explosionForce, in float3 explosionPosition, in float explosionRadius, in float timestep, in float3 up, in float upwardsModifier = 0, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
PhysicsVelocity | bodyVelocity | [in,out] The body velocity. |
PhysicsMass | bodyMass | The body mass. |
PhysicsCollider | bodyCollider | The body collider. |
float3 | bodyPosition | The body position. |
quaternion | bodyOrientation | The body orientation. |
float | explosionForce | The explosion force. |
float3 | explosionPosition | The explosion position. |
float | explosionRadius | The explosion radius. |
float | timestep | The timestep. |
float3 | up | The up. |
float | upwardsModifier | (Optional) The upwards modifier. |
ForceMode | mode | (Optional) The mode. |