39 std::pair<RailGroup*, Ogre::Real> closest((
RailGroup*)NULL, std::numeric_limits<Ogre::Real>::infinity());
40 std::pair<RailGroup*, Ogre::Real> current((
RailGroup*)NULL, std::numeric_limits<Ogre::Real>::infinity());
44 if (!itNode->sn_attach_self && !itNode->sn_attach_foreign)
51 itNode->AttachToRail(NULL);
59 if ((
this != actor.GetRef() && !itNode->sn_attach_foreign) || (
this == actor.GetRef() && !itNode->sn_attach_self))
63 if (current.second < closest.second)
67 itNode->AttachToRail(closest.first);
75 std::pair<RailGroup*, Ogre::Real> closest((
RailGroup*)NULL, std::numeric_limits<Ogre::Real>::infinity());
78 Ogre::Real lenToCurRail = std::numeric_limits<Ogre::Real>::infinity();
80 for (std::vector<RailGroup*>::iterator itGroup = actor->
m_railgroups.begin();
85 if (*itGroup ==
nullptr)
89 lenToCurRail = node.
getLenTo(curRail);
91 if (lenToCurRail < node.GetAttachmentDistance() && lenToCurRail < closest.second)
93 closest.first = (*itGroup);
94 closest.second = lenToCurRail;
107 it->UpdatePosition();
108 it->UpdateForces(dt);
118 it->ResetPositions();
126 it->ResetSlideNode();
134 it->UpdatePosition();