Merge branch 'dev'
Conflicts: src/line.hpp src/platformset.cpp src/vector.hpp
This commit is contained in:
commit
5a71b943b2
22 changed files with 835 additions and 32 deletions
14
src/line.hpp
14
src/line.hpp
|
@ -23,6 +23,8 @@
|
|||
#include "compatibility.h"
|
||||
#include "vector.hpp"
|
||||
#include "vectormath.hpp"
|
||||
#include <ciso646>
|
||||
#include <cstdint>
|
||||
|
||||
namespace cloonel {
|
||||
template <typename T, uint32_t S>
|
||||
|
@ -36,6 +38,7 @@ namespace cloonel {
|
|||
Line ( const Line& parOther );
|
||||
Line ( const Point& parStart, const Point& parEnd );
|
||||
Line ( const Point& parStart, const Point& parDirection, Scalar parLength ) : Line(parStart, parStart + parDirection * parLength) { }
|
||||
Line ( Scalar parX1, Scalar parY1, Scalar parX2, Scalar parY2 );
|
||||
~Line ( void ) noexcept = default;
|
||||
|
||||
Point& Start ( void ) { return m_points.x(); }
|
||||
|
@ -43,8 +46,15 @@ namespace cloonel {
|
|||
const Point& Start ( void ) const { return m_points.x(); }
|
||||
const Point& End ( void ) const { return m_points.y(); }
|
||||
|
||||
Point& operator[] ( int parIndex ) { assert(parIndex >= 0); return m_points[static_cast<uint32_t>(parIndex)]; }
|
||||
const Point& operator[] ( int parIndex ) const { assert(parIndex >= 0); return m_points[static_cast<uint32_t>(parIndex)]; }
|
||||
Point& operator[] ( uint32_t parIndex ) { return m_points[parIndex]; }
|
||||
const Point& operator[] ( uint32_t parIndex ) const { return m_points[parIndex]; }
|
||||
|
||||
Line& operator+= ( const Point& parRhs ) a_flatten;
|
||||
Line& operator-= ( const Point& parRhs ) a_flatten;
|
||||
template <typename U>
|
||||
Line& operator*= ( const Vector<U, S>& parRhs ) a_flatten;
|
||||
|
||||
private:
|
||||
Vector<Point, 2> m_points;
|
||||
|
@ -58,6 +68,10 @@ namespace cloonel {
|
|||
Line<T, S> operator+ ( const Vector<T, S>& parLhs, Line<T, S> parRhs ) a_pure a_flatten;
|
||||
template <typename T, uint32_t S>
|
||||
Line<T, S> operator- ( const Vector<T, S>& parLhs, Line<T, S> parRhs ) a_pure a_flatten;
|
||||
template <typename T, typename U, uint32_t S>
|
||||
Line<T, S> operator* ( const Vector<U, S>& parLhs, Line<T, S> parRhs ) a_pure a_flatten;
|
||||
template <typename T, typename U, uint32_t S>
|
||||
Line<T, S> operator* ( Line<T, S> parLhs, const Vector<U, S>& parRhs ) a_pure a_flatten;
|
||||
|
||||
template <typename T>
|
||||
bool operator> ( const Vector<T, 2>& parLhs, const Line<T, 2>& parRhs ) a_pure;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue