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
1698 obj.setProperty("face", boxFaceToString(value.face));1698 obj.setProperty("face", boxFaceToString(value.face));
1699 Q_ASSERT(value.face < 7);1699 Q_ASSERT(value.face < 7);
1700 1700
1701#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1702 ScriptValue intersection = vec3ToScriptValueFast(engine, value.intersection);
1703 ScriptValue surfaceNormal = vec3ToScriptValueFast(engine, value.surfaceNormal);
1704#else
1701 ScriptValue intersection = vec3ToScriptValue(engine, value.intersection);1705 ScriptValue intersection = vec3ToScriptValue(engine, value.intersection);
1702 obj.setProperty("intersection", intersection);
1703 ScriptValue surfaceNormal = vec3ToScriptValue(engine, value.surfaceNormal);1706 ScriptValue surfaceNormal = vec3ToScriptValue(engine, value.surfaceNormal);
1707#endif
1708 obj.setProperty("intersection", intersection);
1704 obj.setProperty("surfaceNormal", surfaceNormal);1709 obj.setProperty("surfaceNormal", surfaceNormal);
1705 obj.setProperty("extraInfo", engine->toScriptValue(value.extraInfo));1710 obj.setProperty("extraInfo", engine->toScriptValue(value.extraInfo));
1706 return obj;1711 return obj;
@@ -1717,11 +1722,19 @@ bool RayToEntityIntersectionResultFromScriptValue(const ScriptValue& object, Ray · 10 unmodified lines
1717 1722
1718 ScriptValue intersection = object.property("intersection");1723 ScriptValue intersection = object.property("intersection");
1719 if (intersection.isValid()) {1724 if (intersection.isValid()) {
1725#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1726 vec3FromScriptValueFast(intersection, value.intersection);
1727#else
1720 vec3FromScriptValue(intersection, value.intersection);1728 vec3FromScriptValue(intersection, value.intersection);
1729#endif
1721 }1730 }
1722 ScriptValue surfaceNormal = object.property("surfaceNormal");1731 ScriptValue surfaceNormal = object.property("surfaceNormal");
1723 if (surfaceNormal.isValid()) {1732 if (surfaceNormal.isValid()) {
1733#ifdef CONVERSIONS_OPTIMIZED_FOR_V8
1734 vec3FromScriptValueFast(surfaceNormal, value.surfaceNormal);
1735#else
1724 vec3FromScriptValue(surfaceNormal, value.surfaceNormal);1736 vec3FromScriptValue(surfaceNormal, value.surfaceNormal);
1737#endif
1725 }1738 }
1726 value.extraInfo = object.property("extraInfo").toVariant().toMap();1739 value.extraInfo = object.property("extraInfo").toVariant().toMap();
1727 return true;1740 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