Merge branch '0.9.6' of https://github.com/g-truc/glm into 0.9.6
commit
67c62d8b1c
160 changed files with 1498 additions and 1401 deletions
@ -1,328 +1,598 @@ |
|||||||
/////////////////////////////////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
||||||
// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) |
// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) |
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
||||||
// Created : 2013-11-22 |
// Created : 2013-11-22 |
||||||
// Updated : 2013-11-22 |
// Updated : 2013-12-18 |
||||||
// Licence : This source is under MIT License |
// Licence : This source is under MIT License |
||||||
// File : glm/gtx/inl.inl |
// File : glm/gtx/inl.inl |
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
||||||
|
|
||||||
#include "../matrix.hpp" |
#include <iomanip> // std::setfill<>, std::fixed, std::setprecision, std::right, std::setw |
||||||
// #include <boost/io/ios_state.hpp> // boost::io::ios_all_saver |
#include <ostream> // std::basic_ostream<> |
||||||
#include <iomanip> // std::setfill<>, std::fixed, std::setprecision, std::right, |
|
||||||
// std::setw |
|
||||||
#include <ostream> // std::basic_ostream<> |
|
||||||
|
|
||||||
namespace glm{ |
namespace glm{ |
||||||
namespace io |
namespace io |
||||||
{ |
{ |
||||||
|
template <typename CTy> |
||||||
/* explicit */ GLM_FUNC_QUALIFIER |
/* explicit */ GLM_FUNC_QUALIFIER |
||||||
precision_guard::precision_guard() |
format_punct<CTy>::format_punct(size_t a) |
||||||
: precision_ (precision()), |
: std::locale::facet(a), |
||||||
value_width_(value_width()) |
formatted (true), |
||||||
{} |
precision (3), |
||||||
|
width (1 + 4 + 1 + precision), |
||||||
GLM_FUNC_QUALIFIER |
separator (','), |
||||||
precision_guard::~precision_guard() |
delim_left ('['), |
||||||
{ |
delim_right (']'), |
||||||
value_width() = value_width_; |
space (' '), |
||||||
precision() = precision_; |
newline ('\n'), |
||||||
} |
order (row_major) |
||||||
|
{} |
||||||
/* explicit */ GLM_FUNC_QUALIFIER |
|
||||||
format_guard::format_guard() |
template <typename CTy> |
||||||
: order_(order()), |
/* explicit */ GLM_FUNC_QUALIFIER |
||||||
cr_ (cr()) |
format_punct<CTy>::format_punct(format_punct const& a) |
||||||
{} |
: std::locale::facet(0), |
||||||
|
formatted (a.formatted), |
||||||
GLM_FUNC_QUALIFIER |
precision (a.precision), |
||||||
format_guard::~format_guard() |
width (a.width), |
||||||
{ |
separator (a.separator), |
||||||
cr() = cr_; |
delim_left (a.delim_left), |
||||||
order() = order_; |
delim_right (a.delim_right), |
||||||
} |
space (a.space), |
||||||
|
newline (a.newline), |
||||||
GLM_FUNC_QUALIFIER unsigned& precision() |
order (a.order) |
||||||
{ |
{} |
||||||
static unsigned p(3); |
|
||||||
|
template <typename CTy> std::locale::id format_punct<CTy>::id; |
||||||
return p; |
|
||||||
} |
template <typename CTy, typename CTr> |
||||||
|
/* explicit */ GLM_FUNC_QUALIFIER basic_state_saver<CTy,CTr>::basic_state_saver(std::basic_ios<CTy,CTr>& a) |
||||||
GLM_FUNC_QUALIFIER unsigned& value_width() |
: state_ (a), |
||||||
{ |
flags_ (a.flags()), |
||||||
static unsigned p(9); |
precision_(a.precision()), |
||||||
|
width_ (a.width()), |
||||||
return p; |
fill_ (a.fill()), |
||||||
} |
locale_ (a.getloc()) |
||||||
|
{} |
||||||
GLM_FUNC_QUALIFIER format_guard::order_t& order() |
|
||||||
{ |
template <typename CTy, typename CTr> |
||||||
static format_guard::order_t p(format_guard::row_major); |
GLM_FUNC_QUALIFIER basic_state_saver<CTy,CTr>::~basic_state_saver() |
||||||
|
{ |
||||||
return p; |
state_.imbue(locale_); |
||||||
} |
state_.fill(fill_); |
||||||
|
state_.width(width_); |
||||||
GLM_FUNC_QUALIFIER char& |
state_.precision(precision_); |
||||||
cr() |
state_.flags(flags_); |
||||||
{ |
} |
||||||
static char p('\n'); return p; |
|
||||||
} |
template <typename CTy, typename CTr> |
||||||
|
/* explicit */ GLM_FUNC_QUALIFIER basic_format_saver<CTy,CTr>::basic_format_saver(std::basic_ios<CTy,CTr>& a) |
||||||
GLM_FUNC_QUALIFIER std::ios_base& column_major(std::ios_base& os) |
: bss_(a) |
||||||
{ |
{ |
||||||
order() = format_guard::column_major; |
a.imbue(std::locale(a.getloc(), new format_punct<CTy>(get_facet<format_punct<CTy> >(a)))); |
||||||
|
} |
||||||
return os; |
|
||||||
} |
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER |
||||||
GLM_FUNC_QUALIFIER std::ios_base& row_major(std::ios_base& os) |
basic_format_saver<CTy,CTr>::~basic_format_saver() |
||||||
{ |
{} |
||||||
order() = format_guard::row_major; |
|
||||||
|
/* explicit */ GLM_FUNC_QUALIFIER precision::precision(unsigned a) |
||||||
return os; |
: value(a) |
||||||
} |
{} |
||||||
|
|
||||||
GLM_FUNC_QUALIFIER std::ios_base& formatted(std::ios_base& os) |
/* explicit */ GLM_FUNC_QUALIFIER width::width(unsigned a) |
||||||
{ |
: value(a) |
||||||
cr() = '\n'; |
{} |
||||||
|
|
||||||
return os; |
template <typename CTy> |
||||||
} |
/* explicit */ GLM_FUNC_QUALIFIER delimeter<CTy>::delimeter(CTy a, CTy b, CTy c) |
||||||
|
: value() |
||||||
GLM_FUNC_QUALIFIER std::ios_base& unformatted(std::ios_base& os) |
{ |
||||||
{ |
value[0] = a; |
||||||
cr() = ' '; |
value[1] = b; |
||||||
|
value[2] = c; |
||||||
return os; |
} |
||||||
} |
|
||||||
|
/* explicit */ GLM_FUNC_QUALIFIER |
||||||
|
order::order(order_type a) |
||||||
|
: value(a) |
||||||
|
{} |
||||||
|
|
||||||
|
template <typename FTy, typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER FTy const& get_facet(std::basic_ios<CTy,CTr>& ios) |
||||||
|
{ |
||||||
|
if (!std::has_facet<FTy>(ios.getloc())) { |
||||||
|
ios.imbue(std::locale(ios.getloc(), new FTy)); |
||||||
|
} |
||||||
|
|
||||||
|
return std::use_facet<FTy>(ios.getloc()); |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>& ios) |
||||||
|
{ |
||||||
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(ios)).formatted = true; |
||||||
|
|
||||||
|
return ios; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>& unformatted(std::basic_ios<CTy,CTr>& ios) |
||||||
|
{ |
||||||
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(ios)).formatted = false; |
||||||
|
|
||||||
|
return ios; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, precision const& a) |
||||||
|
{ |
||||||
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).precision = a.value; |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, width const& a) |
||||||
|
{ |
||||||
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).width = a.value; |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, delimeter<CTy> const& a) |
||||||
|
{ |
||||||
|
format_punct<CTy> & fmt(const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os))); |
||||||
|
|
||||||
|
fmt.delim_left = a.value[0]; |
||||||
|
fmt.delim_right = a.value[1]; |
||||||
|
fmt.separator = a.value[2]; |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, order const& a) |
||||||
|
{ |
||||||
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).order = a.value; |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
} // namespace io |
} // namespace io |
||||||
|
|
||||||
namespace detail |
namespace detail |
||||||
{ |
{ |
||||||
// functions, inlined (inline) |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tquat<T,P> const& a) |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
{ |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tquat<T,P> const& a) |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
{ |
|
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
if(cerberus) |
||||||
|
{ |
||||||
if (cerberus) { |
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
// boost::io::ios_all_saver const ias(os); |
|
||||||
|
if(fmt.formatted) |
||||||
os << std::fixed << std::setprecision(io::precision()) |
{ |
||||||
<< '[' |
io::basic_state_saver<CTy> const bss(os); |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.w << ',' |
|
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.x << ',' |
os << std::fixed |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.y << ',' |
<< std::right |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.z |
<< std::setprecision(fmt.precision) |
||||||
<< ']'; |
<< std::setfill(fmt.space) |
||||||
} |
<< fmt.delim_left |
||||||
|
<< std::setw(fmt.width) << a.w << fmt.separator |
||||||
return os; |
<< std::setw(fmt.width) << a.x << fmt.separator |
||||||
} |
<< std::setw(fmt.width) << a.y << fmt.separator |
||||||
|
<< std::setw(fmt.width) << a.z |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
<< fmt.delim_right; |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a) |
} |
||||||
{ |
else |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
os << a.w << fmt.space << a.x << fmt.space << a.y << fmt.space << a.z; |
||||||
if (cerberus) { |
} |
||||||
// boost::io::ios_all_saver const ias(os); |
} |
||||||
|
|
||||||
os << std::fixed << std::setprecision(io::precision()) |
return os; |
||||||
<< '[' |
} |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.x << ',' |
|
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.y |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
<< ']'; |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a) |
||||||
} |
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
return os; |
|
||||||
} |
if(cerberus) |
||||||
|
{ |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec3<T,P> const& a) |
|
||||||
{ |
if(fmt.formatted) |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
io::basic_state_saver<CTy> const bss(os); |
||||||
if (cerberus) { |
|
||||||
// boost::io::ios_all_saver const ias(os); |
os << std::fixed |
||||||
|
<< std::right |
||||||
os << std::fixed << std::setprecision(io::precision()) |
<< std::setprecision(fmt.precision) |
||||||
<< '[' |
<< std::setfill(fmt.space) |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.x << ',' |
<< fmt.delim_left |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.y << ',' |
<< std::setw(fmt.width) << a.x << fmt.separator |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.z |
<< std::setw(fmt.width) << a.y |
||||||
<< ']'; |
<< fmt.delim_right; |
||||||
} |
} |
||||||
|
else |
||||||
return os; |
{ |
||||||
} |
os << a.x << fmt.space << a.y; |
||||||
|
} |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
} |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec4<T,P> const& a) |
|
||||||
{ |
return os; |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
} |
||||||
|
|
||||||
if (cerberus) { |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
// boost::io::ios_all_saver const ias(os); |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec3<T,P> const& a) |
||||||
|
{ |
||||||
os << std::fixed << std::setprecision(io::precision()) |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
<< '[' |
|
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.x << ',' |
if(cerberus) |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.y << ',' |
{ |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.z << ',' |
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
<< std::right << std::setfill<CTy>(' ') << std::setw(io::value_width()) << a.w |
|
||||||
<< ']'; |
if(fmt.formatted) |
||||||
} |
{ |
||||||
|
io::basic_state_saver<CTy> const bss(os); |
||||||
return os; |
|
||||||
} |
os << std::fixed |
||||||
|
<< std::right |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
<< std::setprecision(fmt.precision) |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x2<T,P> const& m) |
<< std::setfill(fmt.space) |
||||||
{ |
<< fmt.delim_left |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
<< std::setw(fmt.width) << a.x << fmt.separator |
||||||
|
<< std::setw(fmt.width) << a.y << fmt.separator |
||||||
if (cerberus) { |
<< std::setw(fmt.width) << a.z |
||||||
|
<< fmt.delim_right; |
||||||
os << io::cr() |
} |
||||||
<< '[' << m[0] << io::cr() |
else |
||||||
<< ' ' << m[1] << ']'; |
{ |
||||||
} |
os << a.x << fmt.space << a.y << fmt.space << a.z; |
||||||
|
} |
||||||
return os; |
} |
||||||
} |
|
||||||
|
return os; |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
} |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x3<T,P> const& m) |
|
||||||
{ |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec4<T,P> const& a) |
||||||
|
{ |
||||||
if (cerberus) { |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
os << io::cr() |
if(cerberus) |
||||||
<< '[' << m[0] << io::cr() |
{ |
||||||
<< ' ' << m[1] << ']'; |
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
} |
|
||||||
|
if(fmt.formatted) |
||||||
return os; |
{ |
||||||
} |
io::basic_state_saver<CTy> const bss(os); |
||||||
|
|
||||||
template <typename CTy, typename CTr, typename T, precision P> |
os << std::fixed |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x4<T,P> const& m) |
<< std::right |
||||||
{ |
<< std::setprecision(fmt.precision) |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
<< std::setfill(fmt.space) |
||||||
|
<< fmt.delim_left |
||||||
if (cerberus) { |
<< std::setw(fmt.width) << a.x << fmt.separator |
||||||
|
<< std::setw(fmt.width) << a.y << fmt.separator |
||||||
os << io::cr() |
<< std::setw(fmt.width) << a.z << fmt.separator |
||||||
<< '[' << m[0] << io::cr() |
<< std::setw(fmt.width) << a.w |
||||||
<< ' ' << m[1] << ']'; |
<< fmt.delim_right; |
||||||
} |
} |
||||||
|
else |
||||||
return os; |
{ |
||||||
} |
os << a.x << fmt.space << a.y << fmt.space << a.z << fmt.space << a.w; |
||||||
|
} |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
} |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x2<T,P> const& m) |
|
||||||
{ |
return os; |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
} |
||||||
|
|
||||||
if (cerberus) { |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x2<T,P> const& a) |
||||||
os << io::cr() |
{ |
||||||
<< '[' << m[0] << io::cr() |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
<< ' ' << m[1] << io::cr() |
|
||||||
<< ' ' << m[2] << ']'; |
if(cerberus) |
||||||
} |
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
return os; |
tmat2x2<T,P> m(a); |
||||||
} |
|
||||||
|
if(io::row_major == fmt.order) |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
m = transpose(a); |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x3<T,P> const& m) |
|
||||||
{ |
if(fmt.formatted) |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
os << fmt.newline |
||||||
if (cerberus) { |
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.delim_right; |
||||||
os << io::cr() |
} |
||||||
<< '[' << m[0] << io::cr() |
else |
||||||
<< ' ' << m[1] << io::cr() |
{ |
||||||
<< ' ' << m[2] << ']'; |
os << m[0] << fmt.space << m[1]; |
||||||
} |
} |
||||||
|
} |
||||||
return os; |
|
||||||
} |
return os; |
||||||
|
} |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
|
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x4<T,P> const& m) |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
{ |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x3<T,P> const& a) |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
if (cerberus) { |
|
||||||
|
if(cerberus) |
||||||
os << io::cr() |
{ |
||||||
<< '[' << m[0] << io::cr() |
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
<< ' ' << m[1] << io::cr() |
tmat3x2<T,P> m(a); |
||||||
<< ' ' << m[2] << ']'; |
|
||||||
} |
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
return os; |
|
||||||
} |
if(fmt.formatted) |
||||||
|
{ |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
os << fmt.newline |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x2<T,P> const& m) |
<< fmt.delim_left << m[0] << fmt.newline |
||||||
{ |
<< fmt.space << m[1] << fmt.newline |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
<< fmt.space << m[2] << fmt.delim_right; |
||||||
|
} |
||||||
if (cerberus) { |
else |
||||||
|
{ |
||||||
os << io::cr() |
os << m[0] << fmt.space << m[1] << fmt.space << m[2]; |
||||||
<< '[' << m[0] << io::cr() |
} |
||||||
<< ' ' << m[1] << io::cr() |
} |
||||||
<< ' ' << m[2] << io::cr() |
|
||||||
<< ' ' << m[3] << ']'; |
return os; |
||||||
} |
} |
||||||
|
|
||||||
return os; |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
} |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x4<T,P> const& a) |
||||||
|
{ |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x3<T,P> const& m) |
|
||||||
{ |
if(cerberus) |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
if (cerberus) { |
tmat4x2<T,P> m(a); |
||||||
|
|
||||||
os << io::cr() |
if(io::row_major == fmt.order) |
||||||
<< '[' << m[0] << io::cr() |
m = transpose(a); |
||||||
<< ' ' << m[1] << io::cr() |
|
||||||
<< ' ' << m[2] << io::cr() |
|
||||||
<< ' ' << m[3] << ']'; |
if(fmt.formatted) |
||||||
} |
{ |
||||||
|
os << fmt.newline |
||||||
return os; |
<< fmt.delim_left << m[0] << fmt.newline |
||||||
} |
<< fmt.space << m[1] << fmt.newline |
||||||
|
<< fmt.space << m[2] << fmt.newline |
||||||
template <typename CTy, typename CTr, typename T, precision P> |
<< fmt.space << m[3] << fmt.delim_right; |
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x4<T,P> const& m) |
} |
||||||
{ |
else |
||||||
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
{ |
||||||
|
os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; |
||||||
if (cerberus) { |
} |
||||||
|
} |
||||||
os << io::cr() |
|
||||||
<< '[' << m[0] << io::cr() |
return os; |
||||||
<< ' ' << m[1] << io::cr() |
} |
||||||
<< ' ' << m[2] << io::cr() |
|
||||||
<< ' ' << m[3] << ']'; |
template <typename CTy, typename CTr, typename T, precision P> |
||||||
} |
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x2<T,P> const& a) |
||||||
|
{ |
||||||
return os; |
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
} |
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat2x3<T,P> m(a); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if(fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x3<T,P> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat3x3<T,P> m(a); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if(fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.newline |
||||||
|
<< fmt.space << m[2] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1] << fmt.space << m[2]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x4<T,P> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat4x3<T,P> m(a); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if (fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.newline |
||||||
|
<< fmt.space << m[2] << fmt.newline |
||||||
|
<< fmt.space << m[3] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x2<T,P> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat2x4<T,P> m(a); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if (fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x3<T,P> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat3x4<T,P> m(a); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if(fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.newline |
||||||
|
<< fmt.space << m[2] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1] << fmt.space << m[2]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x4<T,P> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat4x4<T,P> m(a); |
||||||
|
|
||||||
|
if (io::row_major == fmt.order) |
||||||
|
m = transpose(a); |
||||||
|
|
||||||
|
if(fmt.formatted) |
||||||
|
{ |
||||||
|
os << fmt.newline |
||||||
|
<< fmt.delim_left << m[0] << fmt.newline |
||||||
|
<< fmt.space << m[1] << fmt.newline |
||||||
|
<< fmt.space << m[2] << fmt.newline |
||||||
|
<< fmt.space << m[3] << fmt.delim_right; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P> |
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<( |
||||||
|
std::basic_ostream<CTy,CTr> & os, |
||||||
|
std::pair<tmat4x4<T,P> const, tmat4x4<T,P> const> const& a) |
||||||
|
{ |
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); |
||||||
|
|
||||||
|
if(cerberus) |
||||||
|
{ |
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); |
||||||
|
tmat4x4<T,P> ml(a.first); |
||||||
|
tmat4x4<T,P> mr(a.second); |
||||||
|
|
||||||
|
if(io::row_major == fmt.order) |
||||||
|
{ |
||||||
|
ml = transpose(a.first); |
||||||
|
mr = transpose(a.second); |
||||||
|
} |
||||||
|
|
||||||
|
if(fmt.formatted) |
||||||
|
{ |
||||||
|
CTy const & l(fmt.delim_left); |
||||||
|
CTy const & r(fmt.delim_right); |
||||||
|
CTy const & s(fmt.space); |
||||||
|
|
||||||
|
os << fmt.newline |
||||||
|
<< l << ml[0] << s << s << l << mr[0] << fmt.newline |
||||||
|
<< s << ml[1] << s << s << s << mr[1] << fmt.newline |
||||||
|
<< s << ml[2] << s << s << s << mr[2] << fmt.newline |
||||||
|
<< s << ml[3] << r << s << s << mr[3] << r; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
os << ml << fmt.space << mr; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return os; |
||||||
|
} |
||||||
}//namespace detail |
}//namespace detail |
||||||
}//namespace glm |
}//namespace glm |
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue