From f5877593170e59d231b1564d18b1df79efc2909b Mon Sep 17 00:00:00 2001 From: Anselme Date: Sun, 22 Jan 2017 11:18:30 +0100 Subject: [PATCH] added vec4 and mat3 types --- src/property.cpp | 14 ++++++++++++++ src/property.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/src/property.cpp b/src/property.cpp index 4efe4f8..409187e 100644 --- a/src/property.cpp +++ b/src/property.cpp @@ -71,6 +71,20 @@ template <> std::istream& Property::loadBinary(std::istream& is) { re template <> std::istream& Property::loadAscii(std::istream& is) { is.ignore(1); for(int i=0; i> (glm::value_ptr(value)[i]), is.ignore(1); return is; } template <> AbstractProperty::PropertyType Property::getStaticPropertyType() { return AbstractProperty::VEC3; } +// VEC4 PROPERTY +template <> std::ostream& Property::saveBinary(std::ostream& os) { return os.write((char*)glm::value_ptr(value), sizeof(float)*value.length()); } +template <> std::ostream& Property::saveAscii(std::ostream& os) { os << "["; for(int i=0; i std::istream& Property::loadBinary(std::istream& is) { return is.read((char*)glm::value_ptr(value), sizeof(float)*value.length()); } +template <> std::istream& Property::loadAscii(std::istream& is) { is.ignore(1); for(int i=0; i> (glm::value_ptr(value)[i]), is.ignore(1); return is; } +template <> AbstractProperty::PropertyType Property::getStaticPropertyType() { return AbstractProperty::VEC4; } + +// MAT3 PROPERTY +template <> std::ostream& Property::saveBinary(std::ostream& os) { return os.write((char*)glm::value_ptr(value), sizeof(float)*value.length()); } +template <> std::ostream& Property::saveAscii(std::ostream& os) { os << "["; for(int i=0; i std::istream& Property::loadBinary(std::istream& is) { return is.read((char*)glm::value_ptr(value), sizeof(float)*value.length()); } +template <> std::istream& Property::loadAscii(std::istream& is) { is.ignore(1); for(int i=0; i> (glm::value_ptr(value)[i]), is.ignore(1); return is; } +template <> AbstractProperty::PropertyType Property::getStaticPropertyType() { return AbstractProperty::MAT3; } + // MAT4 PROPERTY template <> std::ostream& Property::saveBinary(std::ostream& os) { return os.write((char*)glm::value_ptr(value), sizeof(float)*value.length()); } template <> std::ostream& Property::saveAscii(std::ostream& os) { os << "["; for(int i=0; i