Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 21 files). Show all
Unified · Split
| @@ -43,19 +43,19 @@ unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType& · 42 unmodified lines | ||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) const { |
| 46 | − bilateral::Side side = bilateral::Side::Invalid; | |
| 47 | − { | |
| 48 | − QVariant handVar = properties.toMap()["hand"]; | |
| 49 | − if (handVar.isValid()) { | |
| 50 | − side = bilateral::side(handVar.toInt()); | |
| 51 | − } | |
| 46 | + QVariantMap propertyMap = properties.toMap(); | |
| 47 | + | |
| 48 | + bool hover = false; | |
| 49 | + if (propertyMap["hover"].isValid()) { | |
| 50 | + hover = propertyMap["hover"].toBool(); | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | − if (bilateral::Side::Invalid == side) { | |
| 55 | − return PointerEvent::INVALID_POINTER_ID; | |
| 53 | + bool enabled = false; | |
| 54 | + if (propertyMap["enabled"].isValid()) { | |
| 55 | + enabled = propertyMap["enabled"].toBool(); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | − return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<StylusPointer>(side)); | |
| 58 | + return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<StylusPointer>(properties, StylusPointer::buildStylusOverlay(propertyMap), hover, enabled)); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& properties) const { |