Commit 84de6cb2 authored by cutealien's avatar cutealien

triangle3d constructor and line3d::getIntersectionWithSphere passing vectors...

triangle3d constructor and line3d::getIntersectionWithSphere passing vectors now as const-ref instead of per value. Thx @nemo for reporting.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4719 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c7bc66a2
...@@ -110,7 +110,7 @@ class line3d ...@@ -110,7 +110,7 @@ class line3d
\return True if there is an intersection. \return True if there is an intersection.
If there is one, the distance to the first intersection point If there is one, the distance to the first intersection point
is stored in outdistance. */ is stored in outdistance. */
bool getIntersectionWithSphere(vector3d<T> sorigin, T sradius, f64& outdistance) const bool getIntersectionWithSphere(const vector3d<T>& sorigin, T sradius, f64& outdistance) const
{ {
const vector3d<T> q = sorigin - start; const vector3d<T> q = sorigin - start;
T c = q.getLength(); T c = q.getLength();
......
...@@ -24,7 +24,7 @@ namespace core ...@@ -24,7 +24,7 @@ namespace core
//! Constructor for an all 0 triangle //! Constructor for an all 0 triangle
triangle3d() {} triangle3d() {}
//! Constructor for triangle with given three vertices //! Constructor for triangle with given three vertices
triangle3d(vector3d<T> v1, vector3d<T> v2, vector3d<T> v3) : pointA(v1), pointB(v2), pointC(v3) {} triangle3d(const vector3d<T>& v1, const vector3d<T>& v2, const vector3d<T>& v3) : pointA(v1), pointB(v2), pointC(v3) {}
//! Equality operator //! Equality operator
bool operator==(const triangle3d<T>& other) const bool operator==(const triangle3d<T>& other) const
......
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