adding serialization for Qvector

This commit is contained in:
Eric Levin 2015-05-27 13:47:47 -07:00
parent 62539719df
commit 8edc883e4d
3 changed files with 9 additions and 1 deletions

View file

@ -56,7 +56,7 @@ bool LineEntityItem::setProperties(const EntityItemProperties& properties) {
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
SET_ENTITY_PROPERTY_FROM_PwaROPERTIES(lineWidth, setLineWidth);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lineWidth, setLineWidth);
if (somethingChanged) {
bool wantDebug = false;

View file

@ -358,6 +358,7 @@ bool OctreePacketData::appendValue(quint64 value) {
}
bool OctreePacketData::appendValue(float value) {
const unsigned char* data = (const unsigned char*)&value;
int length = sizeof(value);
bool success = append(data, length);
@ -379,6 +380,10 @@ bool OctreePacketData::appendValue(const glm::vec3& value) {
return success;
}
bool OctreePacketData::appendValue(const QVector<glm::vec3>& value){
}
bool OctreePacketData::appendValue(const glm::quat& value) {
const size_t VALUES_PER_QUAT = 4;
const size_t PACKED_QUAT_SIZE = sizeof(uint16_t) * VALUES_PER_QUAT;

View file

@ -162,6 +162,9 @@ public:
/// appends a non-position vector to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendValue(const glm::vec3& value);
//appends a QVector of vec3's to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendValue(const QVector<glm::vec3>& value);
/// appends a packed quat to the end of the stream, may fail if new data stream is too long to fit in packet
bool appendValue(const glm::quat& value);