Showing the changes to interface/src/raypick/PickScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -254,6 +254,7 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 253 unmodified lines | |||
| 254 | * @property {Uuid} parentID - The ID of the parent, either an avatar, an entity, or an overlay. | 254 | * @property {Uuid} parentID - The ID of the parent, either an avatar, an entity, or an overlay. |
| 255 | * @property {number} parentJointIndex - The joint of the parent to parent to, for example, the joints on the model of an avatar. (default = 0, no joint) | 255 | * @property {number} parentJointIndex - The joint of the parent to parent to, for example, the joints on the model of an avatar. (default = 0, no joint) |
| 256 | * @property {string} joint - If "Mouse," parents the pick to the mouse. If "Avatar," parents the pick to MyAvatar's head. Otherwise, parents to the joint of the given name on MyAvatar. | 256 | * @property {string} joint - If "Mouse," parents the pick to the mouse. If "Avatar," parents the pick to MyAvatar's head. Otherwise, parents to the joint of the given name on MyAvatar. |
| 257 | * @property {boolean} [scaleWithParent=true] If true, the collision pick's dimensions and threshold will adjust according to the scale of the parent. | ||
| 257 | */ | 258 | */ |
| 258 | unsigned int PickScriptingInterface::createCollisionPick(const QVariant& properties) { | 259 | unsigned int PickScriptingInterface::createCollisionPick(const QVariant& properties) { |
| 259 | QVariantMap propMap = properties.toMap(); | 260 | QVariantMap propMap = properties.toMap(); |
| @@ -273,8 +274,13 @@ unsigned int PickScriptingInterface::createCollisionPick(const QVariant& propert · 13 unmodified lines | |||
| 273 | maxDistance = propMap["maxDistance"].toFloat(); | 274 | maxDistance = propMap["maxDistance"].toFloat(); |
| 274 | } | 275 | } |
| 275 | 276 | ||
| 277 | bool scaleWithParent = true; | ||
| 278 | if (propMap["scaleWithParent"].isValid()) { | ||
| 279 | scaleWithParent = propMap["scaleWithParent"].toBool(); | ||
| 280 | } | ||
| 281 | |||
| 276 | CollisionRegion collisionRegion(propMap); | 282 | CollisionRegion collisionRegion(propMap); |
| 277 | auto collisionPick = std::make_shared<CollisionPick>(filter, maxDistance, enabled, collisionRegion, qApp->getPhysicsEngine()); | 283 | auto collisionPick = std::make_shared<CollisionPick>(filter, maxDistance, enabled, scaleWithParent, collisionRegion, qApp->getPhysicsEngine()); |
| 278 | setParentTransform(collisionPick, propMap); | 284 | setParentTransform(collisionPick, propMap); |
| 279 | 285 | ||
| 280 | return DependencyManager::get<PickManager>()->addPick(PickQuery::Collision, collisionPick); | 286 | return DependencyManager::get<PickManager>()->addPick(PickQuery::Collision, collisionPick); |