Problems building or running the engine, queries about how to use features etc.
MarkD
Gnoblar
Posts: 2 Joined: Tue Feb 22, 2005 6:44 pm
Quote
0
login to like this post
Post
by MarkD » Tue Feb 22, 2005 7:11 pm
When i Do this:
Real MoveFactor = 80.0 * evt.timeSinceLastFrame;
mShipNode->yaw(MoveFactor);
I receiver an error of "Cannot convert Real to Radian", so i have to Cast the value of MoveFactor to "Radian", then the source stays this way:
Real MoveFactor = 80.0 * evt.timeSinceLastFrame;
mShipNode->yaw((Radian)MoveFactor);
Is there a better solution?
PS: I get this error in many places, especially when using lights!
_mental_
OGRE Retired Team Member
Posts: 419 Joined: Mon Jan 27, 2003 11:51 pm
Location: The Woodlands, TX
Contact:
Quote
0
login to like this post
Post
by _mental_ » Tue Feb 22, 2005 7:19 pm
Try the following:
mShipNode->yaw(Radian(MoveFactor));
sinbad
OGRE Retired Team Member
Posts: 19269 Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:
Quote
0
login to like this post
Post
by sinbad » Tue Feb 22, 2005 7:20 pm
This changed in 0.15.x - you have to use explicit Radian and Degree classes to be clear about what units you're using. The best way is not to cast, but to construct:
Code: Select all
mShipNode->yaw(Radian(MoveFactor));
[edit]damn, _mental_ beat me
[/edit]
Emmeran
Goblin
Posts: 272 Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen
Contact:
Quote
0
login to like this post
Post
by Emmeran » Tue Feb 22, 2005 7:38 pm
you don't need to cast yourself... u could just do this:
Code: Select all
Radian MoveFactor = 80.0 * evt.timeSinceLastFrame;
mShipNode->yaw(MoveFactor);
haffax
OGRE Retired Moderator
Posts: 4823 Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:
Quote
0
login to like this post
Post
by haffax » Tue Feb 22, 2005 7:45 pm
Actually the SceneNode methods interpreted Real values for angles as degree, so with the factors given in the tutorial Degree(MoveFactor) is better than Radian(MoveFactor). And casting here is highly unsave, because it depends on the Radian implementation. If it works it does so only by accident.
MarkD
Gnoblar
Posts: 2 Joined: Tue Feb 22, 2005 6:44 pm
Quote
0
login to like this post
Post
by MarkD » Tue Feb 22, 2005 8:03 pm
Thanks for the Very Fast Help!!!!