Showing the changes to interface/src/raypick/LaserPointerScriptingInterface.cpp (1 of 8 files). Show all
Unified · Split
| @@ -20,16 +20,6 @@ · 19 unmodified lines | |||
| 20 | uint32_t LaserPointerScriptingInterface::createLaserPointer(const QVariant& properties) { | 20 | uint32_t LaserPointerScriptingInterface::createLaserPointer(const QVariant& properties) { |
| 21 | QVariantMap propertyMap = properties.toMap(); | 21 | QVariantMap propertyMap = properties.toMap(); |
| 22 | 22 | ||
| 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 | |||
| 33 | bool faceAvatar = false; | 23 | bool faceAvatar = false; |
| 34 | if (propertyMap["faceAvatar"].isValid()) { | 24 | if (propertyMap["faceAvatar"].isValid()) { |
| 35 | faceAvatar = propertyMap["faceAvatar"].toBool(); | 25 | faceAvatar = propertyMap["faceAvatar"].toBool(); |
| @@ -64,37 +54,7 @@ uint32_t LaserPointerScriptingInterface::createLaserPointer(const QVariant& prop · 28 unmodified lines | |||
| 64 | } | 54 | } |
| 65 | } | 55 | } |
| 66 | 56 | ||
| 67 | if (propertyMap["joint"].isValid()) { | 57 | return DependencyManager::get<LaserPointerManager>()->createLaserPointer(propertyMap, renderStates, faceAvatar, centerEndY, lockEnd, enabled); |
| 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; | ||
| 98 | } | 58 | } |
| 99 | 59 | ||
| 100 | void LaserPointerScriptingInterface::editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) { | 60 | void LaserPointerScriptingInterface::editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) { |