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
154 * @property {Vec3} [direction=-Vec3.FRONT] Only for Static Parabola Picks. The world-space direction of the parabola segment.154 * @property {Vec3} [direction=-Vec3.FRONT] Only for Static Parabola Picks. The world-space direction of the parabola segment.
155 * @property {number} [speed=1] The initial speed of the parabola, i.e. the initial speed of the projectile whose trajectory defines the parabola.155 * @property {number} [speed=1] The initial speed of the parabola, i.e. the initial speed of the projectile whose trajectory defines the parabola.
156 * @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.156 * @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.
158 */159 */
159unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properties) {160unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properties) {
160 QVariantMap propMap = properties.toMap();161 QVariantMap propMap = properties.toMap();
@@ -189,6 +190,11 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 28 unmodified lines
189 rotateAccelerationWithAvatar = propMap["rotateAccelerationWithAvatar"].toBool();190 rotateAccelerationWithAvatar = propMap["rotateAccelerationWithAvatar"].toBool();
190 }191 }
191 192
193 bool scaleWithAvatar = false;
194 if (propMap["scaleWithAvatar"].isValid()) {
195 scaleWithAvatar = propMap["scaleWithAvatar"].toBool();
196 }
197
192 if (propMap["joint"].isValid()) {198 if (propMap["joint"].isValid()) {
193 std::string jointName = propMap["joint"].toString().toStdString();199 std::string jointName = propMap["joint"].toString().toStdString();
194 200
@@ -205,10 +211,12 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 10 unmodified lines
205 }211 }
206 212
207 return DependencyManager::get<PickManager>()->addPick(PickQuery::Parabola, std::make_shared<JointParabolaPick>(jointName, posOffset, dirOffset,213 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));
209 216
210 } else {217 } 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));
212 }220 }
213 } else if (propMap["position"].isValid()) {221 } else if (propMap["position"].isValid()) {
214 glm::vec3 position = vec3FromVariant(propMap["position"]);222 glm::vec3 position = vec3FromVariant(propMap["position"]);
@@ -218,7 +226,9 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 3 unmodified lines
218 direction = vec3FromVariant(propMap["direction"]);226 direction = vec3FromVariant(propMap["direction"]);
219 }227 }
220 228
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));
222 }232 }
223 233
224 return PickManager::INVALID_PICK_ID;234 return PickManager::INVALID_PICK_ID;