0
-(CGAffineTransform) nodeToParentTransform
{
b2Vec2 pos = body_->GetPosition();
float x = pos.x * PTM_RATIO;
float y = pos.y * PTM_RATIO;
if (ignoreAnchorPointForPosition_) {
x += anchorPointInPoints_.x;
y += anchorPointInPoints_.y;
}
// Make matrix
float radians = body_->GetAngle();
float c = cosf(radians);
float s = sinf(radians);
if(! CGPointEqualToPoint(anchorPointInPoints_, CGPointZero)){
x += c*-anchorPointInPoints_.x + -s*-anchorPointInPoints_.y;
y += s*-anchorPointInPoints_.x + c*-anchorPointInPoints_.y;
}
// Rot, Translate Matrix
transform_ = CGAffineTransformMake(c, s,
-s, c,
x, y);
return transform_;
}
그것은의를 PhysicsSprite.mm 파일에 있습니다.
어쩌면 그것은 일 것입니다. 저는 공간 구조가있는입니다. 누군가 설명 할 수 있다면 매우 고맙습니다.
고마워요.
예, 그렇습니다. ...이 코드 조각을 완전히 제거하면 내 장면의 객체가 중력과 함께 움직이지 않아서 왜 그런지 이해하지 못합니다. –