Garry's Mod Wiki

Garry's Mod Wiki

  number Vector:Distance2DSqr( Vector otherVec )

Description

Returns the squared distance between 2 vectors in 2D space, ignoring the Z axis. This is faster than Vector:Distance2D as calculating the square root is an expensive process.

Squared distances should not be summed. If you need to sum distances, use Vector:Distance2D.

When performing a distance check, ensure the distance being checked against is squared.

Arguments

1 Vector otherVec
The vector to calculate the distance to.

Returns

1 number
Squared distance to the vector in 2D space.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...