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.

最后修改:2011年1月4日 Tuesday 21:19

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。