What exactly is the units for this "speed" value? I tried setting it to 1 guessing it would be one orbit/sec and was wrong.
createFlyCircleAnimator (
center vector3df(x,y,z),
f32 radius=100.f,
f32 speed=0.001f,
direction vector3df(x,y,z)
);
createFlyCircleAnimator speed value
Hmm. I took Calc III 3 times, you'd think I'd remember this should work...JP wrote:Could be units per second...
Code: Select all
void CSceneNodeAnimatorFlyCircle::init()
{
Direction.normalize();
if (Direction.Y != 0)
VecV = core::vector3df(50,0,0).crossProduct(Direction).normalize();
else
VecV = core::vector3df(0,50,0).crossProduct(Direction).normalize();
VecU = VecV.crossProduct(Direction).normalize();
}
//! animates a scene node
void CSceneNodeAnimatorFlyCircle::animateNode(ISceneNode* node, u32 timeMs)
{
if ( 0 == node )
return;
const f32 t = (timeMs-StartTime) * Speed;
node->setPosition(Center + Radius * ((VecU*cosf(t)) + (VecV*sinf(t))));
}
jaxl wrote:Hmm. I took Calc III 3 times, you'd think I'd remember this should work...JP wrote:Could be units per second...
Perhaps per ms? I dug out some code..
Code: Select all
void CSceneNodeAnimatorFlyCircle::init()
{
Direction.normalize();
if (Direction.Y != 0)
VecV = core::vector3df(50,0,0).crossProduct(Direction).normalize();
else
VecV = core::vector3df(0,50,0).crossProduct(Direction).normalize();
VecU = VecV.crossProduct(Direction).normalize();
}
//! animates a scene node
void CSceneNodeAnimatorFlyCircle::animateNode(ISceneNode* node, u32 timeMs)
{
if ( 0 == node )
return;
const f32 t = (timeMs-StartTime) * Speed;
node->setPosition(Center + Radius * ((VecU*cosf(t)) + (VecV*sinf(t))));
}
Last edited by jaxl on Fri Jan 16, 2009 4:27 pm, edited 1 time in total.
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Heh, it appears to be radians per millisecond. I mean, obviously!
We can either comment it as that, or change it to (e.g.) degrees per second in 1.6. Opinions?
We can either comment it as that, or change it to (e.g.) degrees per second in 1.6. Opinions?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Fair enough. Documented on 1.5 in SVN 2084, and it'll filter down to the trunk later.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
