开发者

Box2d:negative value return from GetLinearVelocity();

开发者 https://www.devze.com 2023-01-10 07:43 出处:网络
When I use the following, somet开发者_StackOverflow中文版imes I get a negative value in mmVelik.x and mVelik.y.

When I use the following, somet开发者_StackOverflow中文版imes I get a negative value in mmVelik.x and mVelik.y. Can anyone explain why??

b2Vec2 mVelik = ballBody->GetLinearVelocity();


If the value couldn't be negative, then objects would only be able to move in one direction. If the x value is positive, the velocity is toward the right, if it's negative, then toward the left. And ditto for the y value (down/up).

0

精彩评论

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