Box2D.Dynamics.Body.ApplyLinearImpulse C# (CSharp) Method

ApplyLinearImpulse() public method

Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This wakes up the body.
public ApplyLinearImpulse ( Vec2 impulse, Vec2 point ) : void
impulse Box2D.Common.Vec2 the world impulse vector, usually in N-seconds or kg-m/s.
point Box2D.Common.Vec2 the world position of the point of application.
return void
        public void ApplyLinearImpulse(Vec2 impulse, Vec2 point)
        {
            if (m_type != BodyType.Dynamic)
            {
                return;
            }

            if (Awake == false)
            {
                Awake = true;
            }

            // Vec2 temp = tltemp.get();
            // temp.set(impulse).mulLocal(m_invMass);
            // m_linearVelocity.addLocal(temp);
            //
            // temp.set(point).subLocal(m_sweep.c);
            // m_angularVelocity += m_invI * Vec2.cross(temp, impulse);

            m_linearVelocity.X += impulse.X * InvMass;
            m_linearVelocity.Y += impulse.Y * InvMass;

            m_angularVelocity += InvI * ((point.X - Sweep.C.X) * impulse.Y - (point.Y - Sweep.C.Y) * impulse.X);
        }