Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (mPath.size() > 1)
- {
- ESM::Pathgrid::Point secondNode = *(++mPath.begin());
- osg::Vec3f firstNodeVec3f = MakeOsgVec3(mPathgrid->mPoints[startNode]);
- osg::Vec3f secondNodeVec3f = MakeOsgVec3(secondNode);
- osg::Vec3f toSecondNodeVec3f = secondNodeVec3f - firstNodeVec3f;
- osg::Vec3f toStartPointVec3f = startPointInLocalCoords - firstNodeVec3f;
- if (toSecondNodeVec3f * toStartPointVec3f > 0)
- {
- ESM::Pathgrid::Point temp(secondNode);
- converter.toWorld(temp);
- bool isPathClear = !MWBase::Environment::get().getWorld()->castRay(startPoint.mX, startPoint.mY, startPoint.mZ, temp.mX, temp.mY,temp.mZ);
- if (isPathClear)
- mPath.pop_front();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement