Browse Source

Align glm vector elements when printing

master
Riyyi 4 years ago
parent
commit
225dff18c7
  1. 18
      inferno/src/inferno/component/transformcomponent.cpp

18
inferno/src/inferno/component/transformcomponent.cpp

@ -4,17 +4,29 @@ namespace Inferno {
const LogStream& operator<<(const LogStream& stream, const glm::vec2& value) const LogStream& operator<<(const LogStream& stream, const glm::vec2& value)
{ {
return stream << "{ " << value.x << ", " << value.y << " }"; return stream << "{ "
<< (value.x >= 0 ? " " : "") << value.x << ", "
<< (value.y >= 0 ? " " : "") << value.y
<< " }";
} }
const LogStream& operator<<(const LogStream& stream, const glm::vec3& value) const LogStream& operator<<(const LogStream& stream, const glm::vec3& value)
{ {
return stream << "{ " << value.x << ", " << value.y << ", " << value.z << " }"; return stream << "{ "
<< (value.x >= 0 ? " " : "") << value.x << ", "
<< (value.y >= 0 ? " " : "") << value.y << ", "
<< (value.z >= 0 ? " " : "") << value.z
<< " }";
} }
const LogStream& operator<<(const LogStream& stream, const glm::vec4& value) const LogStream& operator<<(const LogStream& stream, const glm::vec4& value)
{ {
return stream << "{ " << value.x << ", " << value.y << ", " << value.z << ", " << value.w << " }"; return stream << "{ "
<< (value.x >= 0 ? " " : "") << value.x << ", "
<< (value.y >= 0 ? " " : "") << value.y << ", "
<< (value.z >= 0 ? " " : "") << value.z << ", "
<< (value.w >= 0 ? " " : "") << value.w
<< " }";
} }
const LogStream& operator<<(const LogStream& stream, const glm::mat4& value) const LogStream& operator<<(const LogStream& stream, const glm::mat4& value)

Loading…
Cancel
Save