Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 8 files). Show all
Unified · Split
| @@ -96,6 +96,8 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) · 95 unmodified lines | ||
| 96 | 96 | * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance. |
| 97 | 97 | * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale. |
| 98 | 98 | * @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface. |
| 99 | + * @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. <code>0-1</code>. If 0 or 1, | |
| 100 | + * the normal will follow exactly. | |
| 99 | 101 | * @property {boolean} [enabled=false] |
| 100 | 102 | * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between. |
| 101 | 103 | * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection. |
| @@ -134,6 +136,10 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 32 unmodified lines | ||
| 134 | 136 | if (propertyMap["followNormal"].isValid()) { |
| 135 | 137 | followNormal = propertyMap["followNormal"].toBool(); |
| 136 | 138 | } |
| 139 | + float followNormalStrength = 0.0f; | |
| 140 | + if (propertyMap["followNormalStrength"].isValid()) { | |
| 141 | + followNormalStrength = propertyMap["followNormalStrength"].toFloat(); | |
| 142 | + } | |
| 137 | 143 | |
| 138 | 144 | bool enabled = false; |
| 139 | 145 | if (propertyMap["enabled"].isValid()) { |
| @@ -193,8 +199,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 53 unmodified lines | ||
| 193 | 199 | } |
| 194 | 200 | |
| 195 | 201 | return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<LaserPointer>(properties, renderStates, defaultRenderStates, hover, triggers, |
| 196 | − faceAvatar, followNormal, centerEndY, lockEnd, distanceScaleEnd, | |
| 197 | − scaleWithAvatar, enabled)); | |
| 202 | + faceAvatar, followNormal, followNormalStrength, centerEndY, lockEnd, | |
| 203 | + distanceScaleEnd, scaleWithAvatar, enabled)); | |
| 198 | 204 | } |
| 199 | 205 | |
| 200 | 206 | /**jsdoc |
| @@ -233,6 +239,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 32 unmodified lines | ||
| 233 | 239 | * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance. |
| 234 | 240 | * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale. |
| 235 | 241 | * @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface. |
| 242 | +* @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. <code>0-1</code>. If 0 or 1, | |
| 243 | +* the normal will follow exactly. | |
| 236 | 244 | * @property {boolean} [enabled=false] |
| 237 | 245 | * @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between. |
| 238 | 246 | * @property {Pointers.DefaultParabolaPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection. |
| @@ -271,6 +279,10 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr · 32 unmodified lines | ||
| 271 | 279 | if (propertyMap["followNormal"].isValid()) { |
| 272 | 280 | followNormal = propertyMap["followNormal"].toBool(); |
| 273 | 281 | } |
| 282 | + float followNormalStrength = 0.0f; | |
| 283 | + if (propertyMap["followNormalStrength"].isValid()) { | |
| 284 | + followNormalStrength = propertyMap["followNormalStrength"].toFloat(); | |
| 285 | + } | |
| 274 | 286 | |
| 275 | 287 | bool enabled = false; |
| 276 | 288 | if (propertyMap["enabled"].isValid()) { |
| @@ -330,7 +342,7 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr · 53 unmodified lines | ||
| 330 | 342 | } |
| 331 | 343 | |
| 332 | 344 | return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<ParabolaPointer>(properties, renderStates, defaultRenderStates, hover, triggers, |
| 333 | − faceAvatar, followNormal, centerEndY, lockEnd, distanceScaleEnd, | |
| 345 | + faceAvatar, followNormal, followNormalStrength, centerEndY, lockEnd, distanceScaleEnd, | |
| 334 | 346 | scaleWithAvatar, enabled)); |
| 335 | 347 | } |
| 336 | 348 | |