Method GetImpulseFromForce
GetImpulseFromForce(in PhysicsMass, float, in float3, in ForceMode, in float, out float3, out PhysicsMass)
Converts a force into an impulse based on the force mode and the bodies mass and inertia properties, and scale.
Declaration
public static void GetImpulseFromForce(this in PhysicsMass bodyMass, float bodyScale, in float3 force, in ForceMode mode, in float timestep, out float3 impulse, out PhysicsMass impulseMass)
Parameters
Type | Name | Description |
---|---|---|
PhysicsMass | bodyMass | The body's PhysicsMass component. |
float | bodyScale | The body's uniform scale. |
float3 | force | The force to be applied to a body. |
ForceMode | mode | The method used to apply the force to its targets. |
float | timestep | The change in time from the current to the next frame. |
float3 | impulse | [out] A returned impulse proportional to the provided 'force' and based on the supplied 'mode'. |
PhysicsMass | impulseMass | [out] A returned PhysicsMass component to be passed to an Apply function. |
GetImpulseFromForce(in PhysicsMass, in float3, in ForceMode, in float, out float3, out PhysicsMass)
Converts a force into an impulse based on the force mode and the bodies mass and inertia properties. Assumes that there is no scale. GetImpulseFromForce(in PhysicsMass, float, in float3, in ForceMode, in float, out float3, out PhysicsMass)
Declaration
public static void GetImpulseFromForce(this in PhysicsMass bodyMass, in float3 force, in ForceMode mode, in float timestep, out float3 impulse, out PhysicsMass impulseMass)
Parameters
Type | Name | Description |
---|---|---|
PhysicsMass | bodyMass | The body mass. |
float3 | force | The force. |
ForceMode | mode | The mode. |
float | timestep | The timestep. |
float3 | impulse | [out] The impulse. |
PhysicsMass | impulseMass | [out] The impulse mass. |