2015-02-19 13:28:36 +11:00
|
|
|
/*
|
2018-08-04 15:14:06 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2015-02-19 13:28:36 +11:00
|
|
|
*
|
2018-03-13 22:37:40 +11:00
|
|
|
* Copyright 2018 Danny Robson <danny@nerdcruft.net>
|
2015-02-19 13:28:36 +11:00
|
|
|
*/
|
|
|
|
|
2017-11-22 16:49:37 +11:00
|
|
|
#include "iostream.hpp"
|
2015-02-19 13:28:36 +11:00
|
|
|
|
2017-11-22 16:49:37 +11:00
|
|
|
#include "sphere.hpp"
|
2018-03-13 22:37:40 +11:00
|
|
|
#include "plane.hpp"
|
|
|
|
#include "frustum.hpp"
|
2016-03-11 12:48:19 +11:00
|
|
|
#include "../coord/iostream.hpp"
|
2015-02-19 13:28:36 +11:00
|
|
|
|
|
|
|
|
2015-10-13 18:19:47 +11:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2015-02-19 13:28:36 +11:00
|
|
|
template <size_t S, typename T>
|
2015-10-13 18:19:47 +11:00
|
|
|
std::ostream&
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::geom::operator<< (std::ostream &os, cruft::geom::sphere<S,T> s)
|
2015-02-19 13:28:36 +11:00
|
|
|
{
|
2015-10-13 18:19:47 +11:00
|
|
|
return os << "sphere(" << s.centre << ',' << s.radius << ')';
|
2015-02-19 13:28:36 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-08-05 14:42:02 +10:00
|
|
|
template std::ostream& cruft::geom::operator<< (std::ostream&, cruft::geom::sphere<2,float>);
|
|
|
|
template std::ostream& cruft::geom::operator<< (std::ostream&, cruft::geom::sphere<3,float>);
|
2018-03-13 22:37:40 +11:00
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
template <size_t S, typename T>
|
|
|
|
std::ostream&
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::geom::operator<< (std::ostream &os, plane<S,T> val)
|
2018-03-13 22:37:40 +11:00
|
|
|
{
|
|
|
|
return os << val.coefficients;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-08-05 14:42:02 +10:00
|
|
|
template std::ostream& cruft::geom::operator<< (std::ostream&, plane<2,float>);
|
|
|
|
template std::ostream& cruft::geom::operator<< (std::ostream&, plane<3,float>);
|
2018-03-13 22:37:40 +11:00
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
template <typename T>
|
|
|
|
std::ostream&
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::geom::operator<< (std::ostream &os, frustum<T> val)
|
2018-03-13 22:37:40 +11:00
|
|
|
{
|
2018-08-05 14:42:02 +10:00
|
|
|
return os << "[ " << cruft::make_infix (val.planes) << " ]";
|
2018-03-13 22:37:40 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-08-05 14:42:02 +10:00
|
|
|
template std::ostream& cruft::geom::operator<< (std::ostream&, frustum<float>);
|