开发者

How to set the length of a vector (in xna)

开发者 https://www.devze.com 2022-12-09 04:30 出处:网络
Hey, I\'m wondering if there\'s a function out there to set the length of an XNA framework Vector3, like in c++ it would just be VECTOR.setLen开发者_Python百科gth( x ).

Hey, I'm wondering if there's a function out there to set the length of an XNA framework Vector3, like in c++ it would just be VECTOR.setLen开发者_Python百科gth( x ). Either that or the basic math to do it manually would be nice :)


Normalize it and then multiply it by the desired length.

vec = Vector3.Normalize(vec) * length;
0

精彩评论

暂无评论...
验证码 换一张
取 消