History

expanded RayPick JS API

SamGondelman committed 9 years ago

Commit c7f0f031 parent d1566808 files · +130 −159Browse files

Showing the changes to interface/src/raypick/LaserPointerScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/raypick/LaserPointerScriptingInterface.cpp+1−41
@@ -20,16 +20,6 @@ · 19 unmodified lines
2020 uint32_t LaserPointerScriptingInterface::createLaserPointer(const QVariant& properties) {
2121 QVariantMap propertyMap = properties.toMap();
2222
23− uint16_t filter = 0;
24− if (propertyMap["filter"].isValid()) {
25− filter = propertyMap["filter"].toUInt();
26− }
27−
28− float maxDistance = 0.0f;
29− if (propertyMap["maxDistance"].isValid()) {
30− maxDistance = propertyMap["maxDistance"].toFloat();
31− }
32−
3323 bool faceAvatar = false;
3424 if (propertyMap["faceAvatar"].isValid()) {
3525 faceAvatar = propertyMap["faceAvatar"].toBool();
@@ -64,37 +54,7 @@ uint32_t LaserPointerScriptingInterface::createLaserPointer(const QVariant& prop · 28 unmodified lines
6454 }
6555 }
6656
67− if (propertyMap["joint"].isValid()) {
68− QString jointName = propertyMap["joint"].toString();
69−
70− if (jointName != "Mouse") {
71− // x = upward, y = forward, z = lateral
72− glm::vec3 posOffset = Vectors::ZERO;
73− if (propertyMap["posOffset"].isValid()) {
74− posOffset = vec3FromVariant(propertyMap["posOffset"]);
75− }
76−
77− glm::vec3 dirOffset = Vectors::UP;
78− if (propertyMap["dirOffset"].isValid()) {
79− dirOffset = vec3FromVariant(propertyMap["dirOffset"]);
80− }
81−
82− return DependencyManager::get<LaserPointerManager>()->createLaserPointer(jointName, posOffset, dirOffset, filter, maxDistance, renderStates, faceAvatar, centerEndY, lockEnd, enabled);
83− } else {
84− return DependencyManager::get<LaserPointerManager>()->createLaserPointer(filter, maxDistance, renderStates, faceAvatar, centerEndY, lockEnd, enabled);
85− }
86− } else if (propertyMap["position"].isValid()) {
87− glm::vec3 position = vec3FromVariant(propertyMap["position"]);
88−
89− glm::vec3 direction = -Vectors::UP;
90− if (propertyMap["direction"].isValid()) {
91− direction = vec3FromVariant(propertyMap["direction"]);
92− }
93−
94− return DependencyManager::get<LaserPointerManager>()->createLaserPointer(position, direction, filter, maxDistance, renderStates, faceAvatar, centerEndY, lockEnd, enabled);
95− }
96−
97− return 0;
57+ return DependencyManager::get<LaserPointerManager>()->createLaserPointer(propertyMap, renderStates, faceAvatar, centerEndY, lockEnd, enabled);
9858 }
9959
10060 void LaserPointerScriptingInterface::editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) {

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