我用的是2.2.4 版本,在运行test的时候出现这个问题,CC_ENABLE_BOX2D_INTEGRATION=1 已经打开了
注释掉这两行就能运行,b2Body 里面的SetTransform 看着没问题,有人知道什么原因吗?
void CCPhysicsSprite::setPosition(const CCPoint &pos)
{
float angle = m_pB2Body->GetAngle();
// m_pB2Body->SetTransform(b2Vec2(pos.x / m_fPTMRatio, pos.y / m_fPTMRatio), angle);
}
void CCPhysicsSprite::setRotation(float fRotation)
{
if (m_bIgnoreBodyRotation)
{
CCSprite::setRotation(fRotation);
}
else
{
b2Vec2 p = m_pB2Body->GetPosition();
float radians = CC_DEGREES_TO_RADIANS(fRotation);
// m_pB2Body->SetTransform(p, radians);
}
}