MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / reflect

Method reflect

olcPixelGameEngine.h:762–765  ·  view source on GitHub ↗

Assuming this vector is incident, given a normal, return the reflection

Source from the content-addressed store, hash-verified

760
761 // Assuming this vector is incident, given a normal, return the reflection
762 inline constexpr v_2d reflect(const v_2d& n) const
763 {
764 return (*this) - 2.0 * (this->dot(n) * n);
765 }
766
767 // Allow 'casting' from other v_2d types
768 template<class F>

Callers

nothing calls this directly

Calls 1

dotMethod · 0.95

Tested by

no test coverage detected