AngleUnitsToRadians returns Real instead of Radian

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
ls129
Kobold
Posts: 26
Joined: Sun Sep 28, 2003 2:12 am
x 1
Contact:

AngleUnitsToRadians returns Real instead of Radian

Post by ls129 »

Haven't touched my ogre code in a while and i'm now trying to recompile stuff from last year and this code:

Code: Select all

Ypitch.FromAngleAxis(Ogre::Math::AngleUnitsToRadians(camnode->m_cam.CameraUpPitch), Ogre::Vector3::UNIT_X);
is giving me this error:

Code: Select all

EZPhysicsOgre.cpp(219) : error C2664: 'Ogre::Quaternion::FromAngleAxis' : cannot convert parameter 1 from 'Ogre::Real' to 'const Ogre::Radian &'
Its nice that Radian and Angle have replaced Real but shouldn't then AngleUnitsToRadians() return Radian ?

Update: i'm trying to read through the ogremath.h to understand the new convention.. :evil:
User avatar
ls129
Kobold
Posts: 26
Joined: Sun Sep 28, 2003 2:12 am
x 1
Contact:

Post by ls129 »

Changed the line to:

Code: Select all

Ypitch.FromAngleAxis(Ogre::Radian(camnode->m_cam.CameraUpPitch), Ogre::Vector3::UNIT_X);
now i dont get compilation error, just hope that it will have the desired effect.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

What does 'CameraUpPitch' return? Real or Radian?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
ls129
Kobold
Posts: 26
Joined: Sun Sep 28, 2003 2:12 am
x 1
Contact:

Post by ls129 »

jacmoe wrote:What does 'CameraUpPitch' return? Real or Radian?
float
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

That's the problem, then. Real really is float typedef'd.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

If your value is in radians, then this is the correct way to do it. All angles in Ogre must be passed as Radian or Degree classes since 0.14 in order to ensure the units are explicit.
Post Reply