不同轴上的幅度相同?

时间:2014-08-29 20:40:04

标签: variables vector unity3d magnitude

是否可以将对象的大小放在一个轴上并将其放在变量中并将其分配给不同轴上的单独对象?规模不是那么有效吗?

1 个答案:

答案 0 :(得分:-1)

//this is the first axis    
Vector3 axis1 = whatever;
//this is the second axis
Vector3 axis2 = whatever;
//this normalizes the second axis
axis2.Normalize();
//this multiplies the the second axis with the first axis' magnitude
axis2 *= axis1.magnitude;