Make isBetweenPoints-check include the begin and end points.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1483 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-08-10 16:14:03 +00:00
parent aca761b6d6
commit 9f390fe59c
3 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
Changes in version 1.5 (... 2008)
- isBetweenPoints return true now even for the begin and end points, i.e. line segments are now including their start and end.
- Fix XML reader creation for non-existing files and invalid callbacks.
- Avoid loading textures which are not used by the mesh in b3d loader.

View File

@ -218,8 +218,8 @@ public:
bool isBetweenPoints(const vector2d<T>& begin, const vector2d<T>& end) const
{
const T f = (end - begin).getLengthSQ();
return getDistanceFromSQ(begin) < f &&
getDistanceFromSQ(end) < f;
return getDistanceFromSQ(begin) <= f &&
getDistanceFromSQ(end) <= f;
}
//! Get the interpolated vector

View File

@ -117,8 +117,8 @@ namespace core
bool isBetweenPoints(const vector3d<T>& begin, const vector3d<T>& end) const
{
const T f = (end - begin).getLengthSQ();
return getDistanceFromSQ(begin) < f &&
getDistanceFromSQ(end) < f;
return getDistanceFromSQ(begin) <= f &&
getDistanceFromSQ(end) <= f;
}
//! Normalizes the vector.