History

vec3FromScriptValue replacement attempt

ksuprynowicz committed 3 years ago

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

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 12 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+14−1
@@ -1698,9 +1698,14 @@ ScriptValue RayToEntityIntersectionResultToScriptValue(ScriptEngine* engine, con · 1697 unmodified lines
16981698 obj.setProperty("face", boxFaceToString(value.face));
16991699 Q_ASSERT(value.face < 7);
17001700
1701+#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1702+ ScriptValue intersection = vec3ToScriptValueFast(engine, value.intersection);
1703+ ScriptValue surfaceNormal = vec3ToScriptValueFast(engine, value.surfaceNormal);
1704+#else
17011705 ScriptValue intersection = vec3ToScriptValue(engine, value.intersection);
1702− obj.setProperty("intersection", intersection);
17031706 ScriptValue surfaceNormal = vec3ToScriptValue(engine, value.surfaceNormal);
1707+#endif
1708+ obj.setProperty("intersection", intersection);
17041709 obj.setProperty("surfaceNormal", surfaceNormal);
17051710 obj.setProperty("extraInfo", engine->toScriptValue(value.extraInfo));
17061711 return obj;
@@ -1717,11 +1722,19 @@ bool RayToEntityIntersectionResultFromScriptValue(const ScriptValue& object, Ray · 10 unmodified lines
17171722
17181723 ScriptValue intersection = object.property("intersection");
17191724 if (intersection.isValid()) {
1725+#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1726+ vec3FromScriptValueFast(intersection, value.intersection);
1727+#else
17201728 vec3FromScriptValue(intersection, value.intersection);
1729+#endif
17211730 }
17221731 ScriptValue surfaceNormal = object.property("surfaceNormal");
17231732 if (surfaceNormal.isValid()) {
1733+#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1734+ vec3FromScriptValueFast(surfaceNormal, value.surfaceNormal);
1735+#else
17241736 vec3FromScriptValue(surfaceNormal, value.surfaceNormal);
1737+#endif
17251738 }
17261739 value.extraInfo = object.property("extraInfo").toVariant().toMap();
17271740 return true;

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