Send view scaling over parallel connection

This commit is contained in:
Emil Axelsson
2018-03-20 14:23:46 +01:00
parent 2eae7ac26d
commit 0fcd3d9fab
5 changed files with 24 additions and 1 deletions
@@ -41,6 +41,7 @@ public:
glm::dvec3 position;
glm::quat rotation;
std::string focusNode;
float scale;
bool followFocusNodeRotation;
};
@@ -49,6 +49,7 @@ struct CameraKeyframe {
glm::dquat _rotation;
bool _followNodeRotation;
std::string _focusNode;
float _scale;
double _timestamp;
@@ -88,6 +89,12 @@ struct CameraKeyframe {
_focusNode.data() + nodeNameLength
);
buffer.insert(
buffer.end(),
reinterpret_cast<char*>(&_scale),
reinterpret_cast<char*>(&_scale) + sizeof(_scale)
);
// Add timestamp
buffer.insert(
buffer.end(),
@@ -124,6 +131,11 @@ struct CameraKeyframe {
_focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size);
offset += size;
// Scale
size = sizeof(_scale);
memcpy(&_scale, buffer.data() + offset, size);
offset += size;
// Timestamp
size = sizeof(_timestamp);
memcpy(&_timestamp, buffer.data() + offset, size);