History

improve model picking performance, scale parabola v/a with avatar, improve followNormal behavior, turn off followNormal on teleport, remove 1 m no teleport spot

SamGondelman committed 8 years ago

Commit 9b41cb51 parent fbcddf118 files · +94 −88Browse files

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

Unified · Split

interface/src/raypick/PickScriptingInterface.cpp+14−4
@@ -154,7 +154,8 @@ unsigned int PickScriptingInterface::createStylusPick(const QVariant& properties · 153 unmodified lines
154154 * @property {Vec3} [direction=-Vec3.FRONT] Only for Static Parabola Picks. The world-space direction of the parabola segment.
155155 * @property {number} [speed=1] The initial speed of the parabola, i.e. the initial speed of the projectile whose trajectory defines the parabola.
156156 * @property {Vec3} [accelerationAxis=-Vec3.UP] The acceleration of the parabola, i.e. the acceleration of the projectile whose trajectory defines the parabola, both magnitude and direction.
157− * @property {boolean} [rotateWithAvatar=true] Whether or not the acceleration axis should rotate with your avatar's local Y axis.
157+ * @property {boolean} [rotateAccelerationWithAvatar=true] Whether or not the acceleration axis should rotate with your avatar's local Y axis.
158+ * @property {boolean} [scaleWithAvatar=false] If true, the velocity and acceleration of the Pick will scale linearly with your avatar.
158159 */
159160 unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properties) {
160161 QVariantMap propMap = properties.toMap();
@@ -189,6 +190,11 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 28 unmodified lines
189190 rotateAccelerationWithAvatar = propMap["rotateAccelerationWithAvatar"].toBool();
190191 }
191192
193+ bool scaleWithAvatar = false;
194+ if (propMap["scaleWithAvatar"].isValid()) {
195+ scaleWithAvatar = propMap["scaleWithAvatar"].toBool();
196+ }
197+
192198 if (propMap["joint"].isValid()) {
193199 std::string jointName = propMap["joint"].toString().toStdString();
194200
@@ -205,10 +211,12 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 10 unmodified lines
205211 }
206212
207213 return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<JointParabolaPick>(jointName, posOffset, dirOffset,
208− speed, accelerationAxis, rotateAccelerationWithAvatar, filter, maxDistance, enabled));
214+ speed, accelerationAxis, rotateAccelerationWithAvatar,
215+ scaleWithAvatar, filter, maxDistance, enabled));
209216
210217 } else {
211− return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<MouseParabolaPick>(speed, accelerationAxis, rotateAccelerationWithAvatar, filter, maxDistance, enabled));
218+ return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<MouseParabolaPick>(speed, accelerationAxis, rotateAccelerationWithAvatar,
219+ scaleWithAvatar, filter, maxDistance, enabled));
212220 }
213221 } else if (propMap["position"].isValid()) {
214222 glm::vec3 position = vec3FromVariant(propMap["position"]);
@@ -218,7 +226,9 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 3 unmodified lines
218226 direction = vec3FromVariant(propMap["direction"]);
219227 }
220228
221− return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<StaticParabolaPick>(position, direction, speed, accelerationAxis, rotateAccelerationWithAvatar, filter, maxDistance, enabled));
229+ return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<StaticParabolaPick>(position, direction, speed, accelerationAxis,
230+ rotateAccelerationWithAvatar, scaleWithAvatar,
231+ filter, maxDistance, enabled));
222232 }
223233
224234 return PickManager::INVALID_PICK_ID;