Showing the changes to libraries/script-engine/src/SpatialEvent.cpp (1 of 12 files). Show all
Unified · Split
| @@ -17,6 +17,7 @@ · 16 unmodified lines | |||
| 17 | #include "ScriptEngine.h" | 17 | #include "ScriptEngine.h" |
| 18 | #include "ScriptValueUtils.h" | 18 | #include "ScriptValueUtils.h" |
| 19 | #include "ScriptValue.h" | 19 | #include "ScriptValue.h" |
| 20 | #include "v8/FastScriptValueUtils.h" | ||
| 20 | 21 | ||
| 21 | SpatialEvent::SpatialEvent() : | 22 | SpatialEvent::SpatialEvent() : |
| 22 | locTranslation(0.0f), | 23 | locTranslation(0.0f), |
| @@ -38,11 +39,20 @@ SpatialEvent::SpatialEvent(const SpatialEvent& event) { · 15 unmodified lines | |||
| 38 | ScriptValue SpatialEvent::toScriptValue(ScriptEngine* engine, const SpatialEvent& event) { | 39 | ScriptValue SpatialEvent::toScriptValue(ScriptEngine* engine, const SpatialEvent& event) { |
| 39 | ScriptValue obj = engine->newObject(); | 40 | ScriptValue obj = engine->newObject(); |
| 40 | 41 | ||
| 42 | #ifdef CONVERSIONS_OPTIMIZED_FOR_V8 | ||
| 43 | obj.setProperty("locTranslation", vec3ToScriptValueFast(engine, event.locTranslation) ); | ||
| 44 | //V8TODO: optimize | ||
| 45 | obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) ); | ||
| 46 | obj.setProperty("absTranslation", vec3ToScriptValueFast(engine, event.absTranslation)); | ||
| 47 | //V8TODO: optimize | ||
| 48 | obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation)); | ||
| 49 | #else | ||
| 41 | obj.setProperty("locTranslation", vec3ToScriptValue(engine, event.locTranslation) ); | 50 | obj.setProperty("locTranslation", vec3ToScriptValue(engine, event.locTranslation) ); |
| 42 | obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) ); | 51 | obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) ); |
| 43 | obj.setProperty("absTranslation", vec3ToScriptValue(engine, event.absTranslation)); | 52 | obj.setProperty("absTranslation", vec3ToScriptValue(engine, event.absTranslation)); |
| 44 | obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation)); | 53 | obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation)); |
| 45 | 54 | #endif | |
| 55 | |||
| 46 | return obj; | 56 | return obj; |
| 47 | } | 57 | } |
| 48 | 58 | ||