port of collision class

This commit is contained in:
Konstantin Käfer
2014-03-17 16:53:40 +01:00
parent 88af0b8b6c
commit 1f2c71ec8b
9 changed files with 415 additions and 22 deletions

View File

@@ -15,11 +15,31 @@ inline T max(T a, T b) {
return b > a ? b : a;
}
template <typename T>
inline T max(T a, T b, T c) {
return max(max(a, b), c);
}
template <typename T>
inline T max(T a, T b, T c, T d) {
return max(max(a, b), max(c, d));
}
template <typename T>
inline T min(T a, T b) {
return b < a ? b : a;
}
template <typename T>
inline T min(T a, T b, T c) {
return min(min(a, b), c);
}
template <typename T>
inline T min(T a, T b, T c, T d) {
return min(min(a, b), min(c, d));
}
// Find the angle of the two vectors, solving the formula for the cross product
// a x b = |a||b|sin(θ) for θ.
template <typename T = double, typename S>