Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lask1

Pages: [1]
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 degrees


void 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);
}
 

Now it is perfect.

2
General discussions / Re: SFML Box2D another example
« on: March 01, 2013, 09:00:48 pm »
lol the Box2D system is in radians while sfml is in degrees


void 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.

Pages: [1]
anything