Small OgreBites bug?
Posted: Sun Jan 22, 2012 1:50 am
I think I just found a small bug in OgreBites/SdkTrays:
should be
Code: Select all
/*-----------------------------------------------------------------------------
| Converts a 3D scene position to a 2D screen coordinate (in pixels).
-----------------------------------------------------------------------------*/
static Ogre::Vector2 sceneToScreen(const Ogre::Camera* cam, const Ogre::Vector3& pt)
{
Ogre::Vector3 result = cam->getProjectionMatrix() * cam->getViewMatrix() * pt;
return Ogre::Vector2((result.x + 1) / 2, -(result.y + 1) / 2);
}
Code: Select all
/*-----------------------------------------------------------------------------
| Converts a 3D scene position to a 2D screen coordinate (in pixels).
-----------------------------------------------------------------------------*/
static Ogre::Vector2 sceneToScreen(const Ogre::Camera* cam, const Ogre::Vector3& pt)
{
Ogre::Vector3 result = cam->getProjectionMatrix() * cam->getViewMatrix() * pt;
return Ogre::Vector2((result.x + 1) / 2, (-result.y + 1) / 2);
}