From 2dd8140158435dde4efe6e02e870d974f71438a9 Mon Sep 17 00:00:00 2001 From: sabrina-shanman Date: Thu, 27 Sep 2018 16:37:40 -0700 Subject: [PATCH] Make scaleWithAvatar an alias for scaleWithParent in PointerScriptingInterface and make true the default for parabola pointers --- .../src/raypick/PointerScriptingInterface.cpp | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/interface/src/raypick/PointerScriptingInterface.cpp b/interface/src/raypick/PointerScriptingInterface.cpp index 7209e402a1..1f1bf76d21 100644 --- a/interface/src/raypick/PointerScriptingInterface.cpp +++ b/interface/src/raypick/PointerScriptingInterface.cpp @@ -97,7 +97,8 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) * @property {boolean} [centerEndY=true] If false, the end of the Pointer will be moved up by half of its height. * @property {boolean} [lockEnd=false] If true, the end of the Pointer will lock on to the center of the object at which the pointer is pointing. * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance. - * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale. + * @property {boolean} [scaleWithParent=false] If true, the width of the Pointer's path will scale linearly with the pick parent's scale. + * @property {boolean} [scaleWithAvatar] Alias for scaleWithParent * @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface. * @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. 0-1. If 0 or 1, * the normal will follow exactly. @@ -134,9 +135,11 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope distanceScaleEnd = propertyMap["distanceScaleEnd"].toBool(); } - bool scaleWithAvatar = false; - if (propertyMap["scaleWithAvatar"].isValid()) { - scaleWithAvatar = propertyMap["scaleWithAvatar"].toBool(); + bool scaleWithParent = false; + if (propertyMap["scaleWithParent"].isValid()) { + scaleWithParent = propertyMap["scaleWithParent"].toBool(); + } else if (propertyMap["scaleWithAvatar"].isValid()) { + scaleWithParent = propertyMap["scaleWithAvatar"].toBool(); } bool followNormal = false; @@ -207,7 +210,7 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope return DependencyManager::get()->addPointer(std::make_shared(properties, renderStates, defaultRenderStates, hover, triggers, faceAvatar, followNormal, followNormalStrength, centerEndY, lockEnd, - distanceScaleEnd, scaleWithAvatar, enabled)); + distanceScaleEnd, scaleWithParent, enabled)); } /**jsdoc @@ -248,7 +251,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope * @property {boolean} [centerEndY=true] If false, the end of the Pointer will be moved up by half of its height. * @property {boolean} [lockEnd=false] If true, the end of the Pointer will lock on to the center of the object at which the pointer is pointing. * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance. -* @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale. +* @property {boolean} [scaleWithParent=true] If true, the width of the Pointer's path will scale linearly with the pick parent's scale. +* @property {boolean} [scaleWithAvatar] Alias for scaleWithParent * @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface. * @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. 0-1. If 0 or 1, * the normal will follow exactly. @@ -285,9 +289,11 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr distanceScaleEnd = propertyMap["distanceScaleEnd"].toBool(); } - bool scaleWithAvatar = false; - if (propertyMap["scaleWithAvatar"].isValid()) { - scaleWithAvatar = propertyMap["scaleWithAvatar"].toBool(); + bool scaleWithParent = true; + if (propertyMap["scaleWithParent"].isValid()) { + scaleWithParent = propertyMap["scaleWithParent"].toBool(); + } else if (propertyMap["scaleWithAvatar"].isValid()) { + scaleWithParent = propertyMap["scaleWithAvatar"].toBool(); } bool followNormal = false; @@ -358,7 +364,7 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr return DependencyManager::get()->addPointer(std::make_shared(properties, renderStates, defaultRenderStates, hover, triggers, faceAvatar, followNormal, followNormalStrength, centerEndY, lockEnd, distanceScaleEnd, - scaleWithAvatar, enabled)); + scaleWithParent, enabled)); } void PointerScriptingInterface::editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) const {