mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:17:28 +02:00
Add global timestamp to recordings
This commit is contained in:
parent
f5b53a77ab
commit
59637390a2
2 changed files with 6 additions and 2 deletions
|
@ -33,7 +33,6 @@ static const char MAGIC_NUMBER[MAGIC_NUMBER_SIZE] = {17, 72, 70, 82, 13, 10, 26,
|
||||||
// Version (Major, Minor)
|
// Version (Major, Minor)
|
||||||
static const QPair<quint8, quint8> VERSION(0, 1);
|
static const QPair<quint8, quint8> VERSION(0, 1);
|
||||||
|
|
||||||
// TODO: remove operators
|
|
||||||
void operator<<(QDebug& stream, glm::vec3 vector) {
|
void operator<<(QDebug& stream, glm::vec3 vector) {
|
||||||
stream << vector.x << vector.y << vector.z;
|
stream << vector.x << vector.y << vector.z;
|
||||||
}
|
}
|
||||||
|
@ -114,6 +113,7 @@ void Recorder::startRecording() {
|
||||||
_recording->clear();
|
_recording->clear();
|
||||||
|
|
||||||
RecordingContext& context = _recording->getContext();
|
RecordingContext& context = _recording->getContext();
|
||||||
|
context.globalTimestamp = usecTimestampNow();
|
||||||
context.domain = NodeList::getInstance()->getDomainHandler().getHostname();
|
context.domain = NodeList::getInstance()->getDomainHandler().getHostname();
|
||||||
context.position = _avatar->getPosition();
|
context.position = _avatar->getPosition();
|
||||||
context.orientation = _avatar->getOrientation();
|
context.orientation = _avatar->getOrientation();
|
||||||
|
@ -481,6 +481,8 @@ void writeRecordingToFile(RecordingPointer recording, QString filename) {
|
||||||
|
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
RecordingContext& context = recording->getContext();
|
RecordingContext& context = recording->getContext();
|
||||||
|
// Global Timestamp
|
||||||
|
fileStream << context.globalTimestamp;
|
||||||
// Domain
|
// Domain
|
||||||
fileStream << context.domain;
|
fileStream << context.domain;
|
||||||
// Position
|
// Position
|
||||||
|
@ -710,7 +712,8 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, QString filen
|
||||||
|
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
RecordingContext& context = recording->getContext();
|
RecordingContext& context = recording->getContext();
|
||||||
|
// Global Timestamp
|
||||||
|
fileStream >> context.globalTimestamp;
|
||||||
// Domain
|
// Domain
|
||||||
fileStream >> context.domain;
|
fileStream >> context.domain;
|
||||||
// Position
|
// Position
|
||||||
|
|
|
@ -80,6 +80,7 @@ private:
|
||||||
|
|
||||||
class RecordingContext {
|
class RecordingContext {
|
||||||
public:
|
public:
|
||||||
|
quint64 globalTimestamp;
|
||||||
QString domain;
|
QString domain;
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::quat orientation;
|
glm::quat orientation;
|
||||||
|
|
Loading…
Reference in a new issue