Commit d9a6ac31 authored by cutealien's avatar cutealien

- line2d::getMiddle and line3d::getMiddle work now also with integers. But can...

- line2d::getMiddle and line3d::getMiddle work now also with integers. But can be slower in debug and for compilers which are not optimizing division by 2 to multiplication by 0.5 for floats also in release (if that still matters we need a template specialization here).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4070 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d9f49f04
Changes in 1.8 (??.??.2011) Changes in 1.8 (??.??.2011)
- line2d::getMiddle and line3d::getMiddle work now also with integers. But can be slower for compilers which are not optimizing division by 2 to multiplication by 0.5 for floats.
- Add IGUIEnvironment::getHovered to get the element most recently known to be under the mouse cursor - Add IGUIEnvironment::getHovered to get the element most recently known to be under the mouse cursor
......
...@@ -60,7 +60,7 @@ class line2d ...@@ -60,7 +60,7 @@ class line2d
/** \return center of the line. */ /** \return center of the line. */
vector2d<T> getMiddle() const vector2d<T> getMiddle() const
{ {
return (start + end) * (T)0.5; return (start + end)/(T)2;
} }
//! Get the vector of the line. //! Get the vector of the line.
......
...@@ -63,7 +63,7 @@ class line3d ...@@ -63,7 +63,7 @@ class line3d
/** \return Center of line. */ /** \return Center of line. */
vector3d<T> getMiddle() const vector3d<T> getMiddle() const
{ {
return (start + end) * (T)0.5; return (start + end)/(T)2;
} }
//! Get vector of line //! Get vector of line
......
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