Skip to main content
gamedev.net
🔒 Locked

code

Started by flashlaser 2 replies 200+ views
Original Post
flashlaser
flashlaser
I got this code for computing a Oriented Bounding Box from www.magic-software.com. Can someone explain to me whats happening and how to use this function.
void Box2::ComputeVertices (Vector2 akVertex[4]) const
{
    Vector2 akEAxis[2] =
    {
        m_afExtent[0]*m_akAxis[0],
        m_afExtent[1]*m_akAxis[1]
    };

    akVertex[0] = m_kCenter - akEAxis[0] - akEAxis[1];
    akVertex[1] = m_kCenter + akEAxis[0] - akEAxis[1];
    akVertex[2] = m_kCenter + akEAxis[0] + akEAxis[1];
    akVertex[3] = m_kCenter - akEAxis[0] + akEAxis[1];
}
 
The code is called MgcBox2.cpp under 2d core.
Ganryu
Ganryu
Not that i''m a good c++ programmer, but to me it looks like the code takes for vertices and makes a box out of them.
flashlaser
flashlaser
Can you be more specific?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.