heelp please people ,
I am using a follow spline animator
core::array<core::vector3df> PositionPoints;
PositionPoints.push_back(core::vector3df(x11,y11,z11));
PositionPoints.push_back(core::vector3df(x21,y21,z21));
PositionPoints.push_back(core::vector3df(x31,y31,z31));
ISceneNodeAnimator* sa;
sa= smgr->createFollowSplineAnimator(device->getTimer()->getTime(),PositionPoints,0.2);
i have managed to make it stop on last point (by cheking area around it)
but can i get info on where the camera is at the moment? for example heading from (x11,y11,z11) to (x21,y21,z21) or should i do it manuall (i dont want to there are a lot of points )
-----
if its not possible at least tell me how to do something every 5 seconds
FollowSplineAnimator get on which point of trajectory is it?
FollowSplineAnimator get on which point of trajectory is it?
using Visual Studio 2003 , I use 3D Max 7, I love irrlicht its a really good and easy engine
what about something like this
If you just want the pos of the cam, do Camera->getPosition()
Code: Select all
vector3df CamPos = Camera->getPosition();
s32 Index=-1;
f32 ShortestDistSQInv=0;
u32 PointCount=PositionPoints.size();
for(s32 i=0;i<PointCount;i++)
{
f32 DistInv;
DistInv=1.f / PositionPoints[i].getDistanceFromSQ(CamPos);
if(Dist > ShortestDistSQInv)
{
Index=i;
ShortestDistSQInv=DistInv;
}
}
if(Index!=-1)
{
//The closest point is PositionPoins[i], doesn't care if it's the next or prev point, just closest.
}
else
{
//Your code doesn't contain any points :)
}
If you don't have anything nice to say, don't say anything at all.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
What a peculiar question. I'd like to think that it's not as simple as node->getPosition() / node->getAbsolutePosition(); for (one of?) the node(s) that the animator is applied to.mrAlmond wrote:I reopen this thread because I really need to know the current position of the spline animator...I'm not moving the camera so I don't need to know its position, I'm just moving meshes...please help!
Are you perhaps saying that you've created an animator but that it's not attached to any node?
If so, then the easiest way to get the position would be to just attach it to an empty scene node, created with ISceneManager::addEmptySceneNode(), then retrieve that node's position.
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