Commit 9f390fe5 authored by hybrid's avatar hybrid

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
parent aca761b6
Changes in version 1.5 (... 2008) 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. - Fix XML reader creation for non-existing files and invalid callbacks.
- Avoid loading textures which are not used by the mesh in b3d loader. - Avoid loading textures which are not used by the mesh in b3d loader.
......
...@@ -218,8 +218,8 @@ public: ...@@ -218,8 +218,8 @@ public:
bool isBetweenPoints(const vector2d<T>& begin, const vector2d<T>& end) const bool isBetweenPoints(const vector2d<T>& begin, const vector2d<T>& end) const
{ {
const T f = (end - begin).getLengthSQ(); const T f = (end - begin).getLengthSQ();
return getDistanceFromSQ(begin) < f && return getDistanceFromSQ(begin) <= f &&
getDistanceFromSQ(end) < f; getDistanceFromSQ(end) <= f;
} }
//! Get the interpolated vector //! Get the interpolated vector
......
...@@ -117,8 +117,8 @@ namespace core ...@@ -117,8 +117,8 @@ namespace core
bool isBetweenPoints(const vector3d<T>& begin, const vector3d<T>& end) const bool isBetweenPoints(const vector3d<T>& begin, const vector3d<T>& end) const
{ {
const T f = (end - begin).getLengthSQ(); const T f = (end - begin).getLengthSQ();
return getDistanceFromSQ(begin) < f && return getDistanceFromSQ(begin) <= f &&
getDistanceFromSQ(end) < f; getDistanceFromSQ(end) <= f;
} }
//! Normalizes the vector. //! Normalizes the vector.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment