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 | 17 | #include "ScriptEngine.h" |
| 18 | 18 | #include "ScriptValueUtils.h" |
| 19 | 19 | #include "ScriptValue.h" |
| 20 | +#include "v8/FastScriptValueUtils.h" | |
| 20 | 21 | |
| 21 | 22 | SpatialEvent::SpatialEvent() : |
| 22 | 23 | locTranslation(0.0f), |
| @@ -38,11 +39,20 @@ SpatialEvent::SpatialEvent(const SpatialEvent& event) { · 15 unmodified lines | ||
| 38 | 39 | ScriptValue SpatialEvent::toScriptValue(ScriptEngine* engine, const SpatialEvent& event) { |
| 39 | 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 | 50 | obj.setProperty("locTranslation", vec3ToScriptValue(engine, event.locTranslation) ); |
| 42 | 51 | obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) ); |
| 43 | 52 | obj.setProperty("absTranslation", vec3ToScriptValue(engine, event.absTranslation)); |
| 44 | 53 | obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation)); |
| 45 | − | |
| 54 | +#endif | |
| 55 | + | |
| 46 | 56 | return obj; |
| 47 | 57 | } |
| 48 | 58 | |