MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / lineProjection

Method lineProjection

source/core/StarLine.hpp:216–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 // from 0.0 to 1.0
215 template <size_t P = N>
216 typename std::enable_if<P == 2 && N == P, T>::type lineProjection(VectorType const& l2) const {
217 VectorType d = diff();
218 return ((l2[0] - min()[0]) * d[0] + (l2[1] - min()[1]) * d[1]) / d.magnitudeSquared();
219 }
220
221 template <size_t P = N>
222 typename std::enable_if<P == 2 && N == P, T>::type distanceTo(VectorType const& l, bool infinite = false) const {

Callers 1

collisionMoveMethod · 0.80

Calls 1

magnitudeSquaredMethod · 0.80

Tested by

no test coverage detected