【发布时间】:2014-09-04 19:19:01
【问题描述】:
我在unity pong tutorial 中找到了以下代码:
// Give the ball some initial movement direction
rigidbody2D.velocity = Vector2.one.normalized * speed;
有人知道标准化 Vector2.one 的意义吗?据我了解,向量一是 (1,1) 并且已经归一化了?
【问题讨论】:
我在unity pong tutorial 中找到了以下代码:
// Give the ball some initial movement direction
rigidbody2D.velocity = Vector2.one.normalized * speed;
有人知道标准化 Vector2.one 的意义吗?据我了解,向量一是 (1,1) 并且已经归一化了?
【问题讨论】:
(1, 1) 的长度是sqrt(2),而不是1。
标准化版本为(sqrt(0.5), sqrt(0.5))。
【讨论】: