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
96 * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.96 * @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.
97 * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.97 * @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.
98 * @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface.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 * @property {boolean} [enabled=false]101 * @property {boolean} [enabled=false]
100 * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between.102 * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between.
101 * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection.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 if (propertyMap["followNormal"].isValid()) {136 if (propertyMap["followNormal"].isValid()) {
135 followNormal = propertyMap["followNormal"].toBool();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 bool enabled = false;144 bool enabled = false;
139 if (propertyMap["enabled"].isValid()) {145 if (propertyMap["enabled"].isValid()) {
@@ -193,8 +199,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 53 unmodified lines
193 }199 }
194 200
195 return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<LaserPointer>(properties, renderStates, defaultRenderStates, hover, triggers,201 return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<LaserPointer>(properties, renderStates, defaultRenderStates, hover, triggers,
196 faceAvatar, followNormal, centerEndY, lockEnd, distanceScaleEnd,202 faceAvatar, followNormal, followNormalStrength, centerEndY, lockEnd,
197 scaleWithAvatar, enabled));203 distanceScaleEnd, scaleWithAvatar, enabled));
198}204}
199 205
200/**jsdoc206/**jsdoc
@@ -233,6 +239,8 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 32 unmodified lines
233* @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.239* @property {boolean} [distanceScaleEnd=false] If true, the dimensions of the end of the Pointer will scale linearly with distance.
234* @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.240* @property {boolean} [scaleWithAvatar=false] If true, the width of the Pointer's path will scale linearly with your avatar's scale.
235* @property {boolean} [followNormal=false] If true, the end of the Pointer will rotate to follow the normal of the intersected surface.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* @property {boolean} [enabled=false]244* @property {boolean} [enabled=false]
237* @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between.245* @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between.
238* @property {Pointers.DefaultParabolaPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection.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 if (propertyMap["followNormal"].isValid()) {279 if (propertyMap["followNormal"].isValid()) {
272 followNormal = propertyMap["followNormal"].toBool();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 bool enabled = false;287 bool enabled = false;
276 if (propertyMap["enabled"].isValid()) {288 if (propertyMap["enabled"].isValid()) {
@@ -330,7 +342,7 @@ unsigned int PointerScriptingInterface::createParabolaPointer(const QVariant& pr · 53 unmodified lines
330 }342 }
331 343
332 return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<ParabolaPointer>(properties, renderStates, defaultRenderStates, hover, triggers,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 scaleWithAvatar, enabled));346 scaleWithAvatar, enabled));
335}347}
336 348