Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. if (mPath.size() > 1)
  2. {
  3. ESM::Pathgrid::Point secondNode = *(++mPath.begin());
  4. osg::Vec3f firstNodeVec3f = MakeOsgVec3(mPathgrid->mPoints[startNode]);
  5. osg::Vec3f secondNodeVec3f = MakeOsgVec3(secondNode);
  6. osg::Vec3f toSecondNodeVec3f = secondNodeVec3f - firstNodeVec3f;
  7. osg::Vec3f toStartPointVec3f = startPointInLocalCoords - firstNodeVec3f;
  8. if (toSecondNodeVec3f * toStartPointVec3f > 0)
  9. {
  10. ESM::Pathgrid::Point temp(secondNode);
  11. converter.toWorld(temp);
  12. bool isPathClear = !MWBase::Environment::get().getWorld()->castRay(startPoint.mX, startPoint.mY, startPoint.mZ, temp.mX, temp.mY,temp.mZ);
  13. if (isPathClear)
  14. mPath.pop_front();
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement