History

test gradual normal interpolation

SamGondelman committed 8 years ago

Commit fbcddf11 parent 645f9058 files · +42 −11Browse files

Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/raypick/PointerScriptingInterface.cpp+15−3
@@ -96,6 +96,8 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) · 95 unmodified lines
9696 * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.
9797 * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.
9898 * @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.
99101 * @property {boolean} [enabled=false]
100102 * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between.
101103 * @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
134136 if (propertyMap["followNormal"].isValid()) {
135137 followNormal = propertyMap["followNormal"].toBool();
136138 }
139+ float followNormalStrength = 0.0f;
140+ if (propertyMap["followNormalStrength"].isValid()) {
141+ followNormalStrength = propertyMap["followNormalStrength"].toFloat();
142+ }
137143
138144 bool enabled = false;
139145 if (propertyMap["enabled"].isValid()) {
@@ -193,8 +199,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 53 unmodified lines
193199 }
194200
195201 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));
198204 }
199205
200206 /**jsdoc
@@ -233,6 +239,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 32 unmodified lines
233239 * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.
234240 * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.
235241 * @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.
236244 * @property {boolean} [enabled=false]
237245 * @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between.
238246 * @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
271279 if (propertyMap["followNormal"].isValid()) {
272280 followNormal = propertyMap["followNormal"].toBool();
273281 }
282+ float followNormalStrength = 0.0f;
283+ if (propertyMap["followNormalStrength"].isValid()) {
284+ followNormalStrength = propertyMap["followNormalStrength"].toFloat();
285+ }
274286
275287 bool enabled = false;
276288 if (propertyMap["enabled"].isValid()) {
@@ -330,7 +342,7 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr · 53 unmodified lines
330342 }
331343
332344 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,
334346 scaleWithAvatar, enabled));
335347 }
336348