diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-16 16:41:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-16 16:41:35 +0200 |
commit | a8207b2dc7bebafd266f95371cc9707425110eba (patch) | |
tree | 79f52c0f21e8b1300165361c86055cc359f6b0e4 /core/math | |
parent | 970cbb460899ec68df7596f06b64bb5be81cea1c (diff) | |
parent | 21d281c4a953404c8f13e1cb7ee8d4cf9c25bb4c (diff) |
Merge pull request #10264 from Rubonnek/use-const-reference
Use const reference where favorable
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/plane.cpp | 4 | ||||
-rw-r--r-- | core/math/plane.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/math/plane.cpp b/core/math/plane.cpp index f5e92866c4..17928d07c3 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -103,7 +103,7 @@ bool Plane::intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r return true; } -bool Plane::intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const { +bool Plane::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection) const { Vector3 segment = p_dir; real_t den = normal.dot(segment); @@ -128,7 +128,7 @@ bool Plane::intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersectio return true; } -bool Plane::intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const { +bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 *p_intersection) const { Vector3 segment = p_begin - p_end; real_t den = normal.dot(segment); diff --git a/core/math/plane.h b/core/math/plane.h index 92ebcd8024..73d584e553 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -56,8 +56,8 @@ public: /* intersections */ bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = 0) const; - bool intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const; - bool intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const; + bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection) const; + bool intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 *p_intersection) const; _FORCE_INLINE_ Vector3 project(const Vector3 &p_point) const { |