Vector2.sqrMagnitude 长度平方

var sqrMagnitude : float

Description描述

Returns the squared length of this vector (Read Only).

返回这个向量的长度的平方(只读)。

Calculating the squared magnitude instead of the magnitude is much faster. Often if you are comparing magnitudes of two vectors you can just compare their squared magnitudes.

计算长度的平方而不是magnitude是更快的。如果你是比较两个向量的长度差,你可以比较他们的平方长度。

参考:magnitude.

Page last updated: 2011-1-4