summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-12 07:57:47 +0200
committerGitHub <noreply@github.com>2016-06-12 07:57:47 +0200
commitb403ad4d68eb1e730d5b514d3bfceea0de932bfa (patch)
tree2c332eef23ae5eb816d08786fb2f87535b289ca5 /src/Vector3.h
parentMerge pull request #3225 from cuberite/FixAutoAPI (diff)
parentNormalized Vector3 API to use the same capitalization as all else. (diff)
downloadcuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar.gz
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar.bz2
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar.lz
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar.xz
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.tar.zst
cuberite-b403ad4d68eb1e730d5b514d3bfceea0de932bfa.zip
Diffstat (limited to 'src/Vector3.h')
-rw-r--r--src/Vector3.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Vector3.h b/src/Vector3.h
index 19ab0b021..4fa9ff46c 100644
--- a/src/Vector3.h
+++ b/src/Vector3.h
@@ -107,19 +107,20 @@ public:
return x * a_Rhs.x + y * a_Rhs.y + z * a_Rhs.z;
}
- inline void abs()
+ /** Updates each coord to its absolute value */
+ inline void Abs()
{
x = (x < 0) ? -x : x;
y = (y < 0) ? -y : y;
z = (z < 0) ? -z : z;
}
- // We can't use a capital letter, because we wouldn't be able to call the normal Clamp function.
- inline void clamp(T a_Min, T a_Max)
+ /** Clamps each coord into the specified range. */
+ inline void Clamp(T a_Min, T a_Max)
{
- x = Clamp(x, a_Min, a_Max);
- y = Clamp(y, a_Min, a_Max);
- z = Clamp(z, a_Min, a_Max);
+ x = ::Clamp(x, a_Min, a_Max);
+ y = ::Clamp(y, a_Min, a_Max);
+ z = ::Clamp(z, a_Min, a_Max);
}
inline Vector3<T> Cross(const Vector3<T> & a_Rhs) const