diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-12-29 13:20:55 +0000 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-12-29 13:20:55 +0000 | 
| commit | 0841ead91c49a212134f19f7c0b411984b0fda29 (patch) | |
| tree | 605d5e8e512747c79875d2c3a185c9740f7d1080 /lib | |
| parent | Run shadow mapper in camera relative space (diff) | |
| download | ilt-0841ead91c49a212134f19f7c0b411984b0fda29.tar.bz2 ilt-0841ead91c49a212134f19f7c0b411984b0fda29.tar.xz ilt-0841ead91c49a212134f19f7c0b411984b0fda29.zip  | |
Remove weird operator! on vec2/3
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/maths.cpp | 2 | ||||
| -rw-r--r-- | lib/maths.h | 12 | 
2 files changed, 1 insertions, 13 deletions
diff --git a/lib/maths.cpp b/lib/maths.cpp index 5430ef6..0c25820 100644 --- a/lib/maths.cpp +++ b/lib/maths.cpp @@ -9,7 +9,7 @@ glm::mat4  flat_orientation(const Direction3D & diff)  {  	static const auto oneeighty {glm::rotate(pi, up)}; -	const auto flatdiff {glm::normalize(!!diff)}; +	const auto flatdiff {glm::normalize(diff.xy() ^ 0.F)};  	auto e {glm::orientation(flatdiff, north)};  	// Handle if diff is exactly opposite to north  	return (std::isnan(e[0][0])) ? oneeighty : e; diff --git a/lib/maths.h b/lib/maths.h index cf369a7..dd83c4b 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -99,12 +99,6 @@ perspective_divide(glm::vec<4, T, Q> v)  	return v / v.w;  } -constexpr inline Position2D -operator!(const Position3D & v) -{ -	return {v.x, v.y}; -} -  constexpr inline Position3D  operator^(const Position2D & v, float z)  { @@ -117,12 +111,6 @@ operator^(const Position3D & v, float w)  	return {v.x, v.y, v.z, w};  } -constexpr inline Position3D -operator!(const Position2D & v) -{ -	return v ^ 0.F; -} -  template<glm::length_t L1, glm::length_t L2, typename T, glm::qualifier Q>  inline constexpr glm::vec<L1 + L2, T, Q>  operator||(const glm::vec<L1, T, Q> v1, const glm::vec<L2, T, Q> v2)  | 
