overte/libraries/script-engine/src/SpatialEvent.cpp
2014-10-27 14:47:44 -07:00

46 lines
No EOL
1.3 KiB
C++

//
// SpatialEvent.cpp
// script-engine/src
//
// Created by Stephen Birarda on 2014-10-27.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <RegisteredMetaTypes.h>
#include "SpatialEvent.h"
SpatialEvent::SpatialEvent() :
locTranslation(0.0f),
locRotation(),
absTranslation(0.0f),
absRotation()
{
}
SpatialEvent::SpatialEvent(const SpatialEvent& event) {
locTranslation = event.locTranslation;
locRotation = event.locRotation;
absTranslation = event.absTranslation;
absRotation = event.absRotation;
}
QScriptValue SpatialEvent::toScriptValue(QScriptEngine* engine, const SpatialEvent& event) {
QScriptValue obj = engine->newObject();
obj.setProperty("locTranslation", vec3toScriptValue(engine, event.locTranslation) );
obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) );
obj.setProperty("absTranslation", vec3toScriptValue(engine, event.absTranslation) );
obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation) );
return obj;
}
void SpatialEvent::fromScriptValue(const QScriptValue& object,SpatialEvent& event) {
// nothing for now...
}