How to detect the magnitude of a collision?

I want to calculate how hard an object hits another object.

for example, if a rock was lightly thrown at glass wall, it wont break through. But if its thrown with more force, it’ll break through easily.

Is this achieved by just calculating the velocity or is there more to it?

I found the getImpulse method and I believe this is the value to get when you want to detect how hard 2 nodes collide with each other.

onPostSolve(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
        // will be called every time collider contact should be resolved
        console.log('onPostSolve: ' + contact.getImpulse().normalImpulses[0]); // SOLVED
}

Here are the logs:

Low Velocity:
Screen Shot 2023-07-13 at 6.06.51 PM

High Velocity:
Screen Shot 2023-07-13 at 6.08.12 PM