Showing the changes to interface/src/raypick/PickScriptingInterface.cpp (1 of 18 files). Show all
Unified · Split
| @@ -154,7 +154,8 @@ unsigned int PickScriptingInterface::createStylusPick(const QVariant& properties · 153 unmodified lines | ||
| 154 | 154 | * @property {Vec3} [direction=-Vec3.FRONT] Only for Static Parabola Picks. The world-space direction of the parabola segment. |
| 155 | 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 | 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 | */ |
| 159 | 160 | unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properties) { |
| 160 | 161 | QVariantMap propMap = properties.toMap(); |
| @@ -189,6 +190,11 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 28 unmodified lines | ||
| 189 | 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 | 198 | if (propMap["joint"].isValid()) { |
| 193 | 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 | 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 | 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 | 221 | } else if (propMap["position"].isValid()) { |
| 214 | 222 | glm::vec3 position = vec3FromVariant(propMap["position"]); |
| @@ -218,7 +226,9 @@ unsigned int PickScriptingInterface::createParabolaPick(const QVariant& properti · 3 unmodified lines | ||
| 218 | 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 | 234 | return PickManager::INVALID_PICK_ID; |