1
General discussions / Re: SFML Box2D another example
« on: March 04, 2013, 08:28:10 pm »lol the Box2D system is in radians while sfml is in degreesvoid CBox::update() {
m_shape.SetRotation( m_body->GetAngle() * (180/3.14) );
m_shape.SetPosition( m_body->GetPosition().x*PPM, m_body->GetPosition().y*PPM);
}
That is the change I made and now it works perfect.
Nevermind something still need to be changed.
void CBox::update() {
m_shape.SetRotation( -m_body->GetAngle() * (180/3.14159265359) );
m_shape.SetPosition( m_body->GetPosition().x*PPM, m_body->GetPosition().y*PPM);
}
m_shape.SetRotation( -m_body->GetAngle() * (180/3.14159265359) );
m_shape.SetPosition( m_body->GetPosition().x*PPM, m_body->GetPosition().y*PPM);
}
Now it is perfect.