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

Method clamp

olcPixelGameEngine.h:732–735  ·  view source on GitHub ↗

Clamp the components of this vector in between the 'element-wise' minimum and maximum of 2 other vectors

Source from the content-addressed store, hash-verified

730
731 // Clamp the components of this vector in between the 'element-wise' minimum and maximum of 2 other vectors
732 inline constexpr v_2d clamp(const v_2d& v1, const v_2d& v2) const
733 {
734 return this->max(v1).min(v2);
735 }
736
737 // Linearly interpolate between this vector, and another vector, given normalised parameter 't'
738 inline constexpr v_2d lerp(const v_2d& v1, const double t) const

Callers 3

SetWorldScaleMethod · 0.45
ZoomAtScreenPosMethod · 0.45
SetZoomMethod · 0.45

Calls 2

maxMethod · 0.95
minMethod · 0.45

Tested by

no test coverage detected