History

vec3FromScriptValue replacement attempt

ksuprynowicz committed 3 years ago

Commit dba09251 parent 3a2075012 files · +133 −10Browse files

Showing the changes to libraries/script-engine/src/SpatialEvent.cpp (1 of 12 files). Show all

Unified · Split

libraries/script-engine/src/SpatialEvent.cpp+11−1
@@ -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
21SpatialEvent::SpatialEvent() :22SpatialEvent::SpatialEvent() :
22 locTranslation(0.0f),23 locTranslation(0.0f),
@@ -38,11 +39,20 @@ SpatialEvent::SpatialEvent(const SpatialEvent& event) { · 15 unmodified lines
38ScriptValue SpatialEvent::toScriptValue(ScriptEngine* engine, const SpatialEvent& event) {39ScriptValue 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t