【Cocos2d-x】角度转换

前端之家收集整理的这篇文章主要介绍了【Cocos2d-x】角度转换前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
CCPoint location = nearEnemy-> _sprite-> getPosition();
auto vector = location - _sprite-> getPosition();
auto radians = atan2f(vector. y,vector. x);

auto rotateDegree = CC_RADIANS_TO_DEGREES(radians);

猜你在找的Cocos2d-x相关文章