| 253 | /// or equal zero it returns p1. |
| 254 | template <typename T> |
| 255 | Point<T> PointAtSegment(Point<T> const & p1, Point<T> const & p2, T shiftFromP1) |
| 256 | { |
| 257 | Point<T> p12 = p2 - p1; |
| 258 | shiftFromP1 = math::Clamp(shiftFromP1, static_cast<T>(0.0), static_cast<T>(p12.Length())); |
| 259 | return p1 + p12.Normalize() * shiftFromP1; |
| 260 | } |
| 261 | |
| 262 | template <class TArchive, class PointT> |
| 263 | TArchive & operator>>(TArchive & ar, Point<PointT> & pt) |