1
我有一個姿態recignizer,我需要旋轉體:Box2D的身體旋轉
- (void) rotate:(UIGestureRecognizer*)recognizer node:(CCNode*)node
{
b2Body *body = (b2Body*)[node.parent userData];
UIRotationGestureRecognizer* rotate = (UIRotationGestureRecognizer*)recognizer;
b2Vec2 pos = body->GetPosition();
body->SetTransform(pos, (- rotate.rotation));
}
offcorse,當我開始旋轉時,它從零角度開始。 * 但是如何從當前角度繼續旋轉? *我不能只添加rotate.rotation
tu當前角度:這種方法每一次都會調用,角度是從開始時的手勢開始計算的。跟蹤實際的當前角度(不anctive手勢的角度),將是一個非常艱鉅的任務,我認爲