set default to 0.35, change steps

This commit is contained in:
HifiExperiments 2024-06-18 17:20:16 -07:00
parent a5b32a6406
commit d3111011d8
3 changed files with 6 additions and 5 deletions

View file

@ -186,9 +186,10 @@ void LaserPointer::RenderState::update(const glm::vec3& origin, const glm::vec3&
bool hasUnmodifiedEndPoint = false;
glm::vec3 unmodifiedEndPoint;
float directionLength = glm::length(endPoint);
auto rayPickResult = std::static_pointer_cast<RayPickResult>(pickResult);
if (rayPickResult && rayPickResult->pickVariant.contains("unmodifiedDirection")) {
unmodifiedEndPoint = glm::length(endPoint) * vec3FromVariant(rayPickResult->pickVariant["unmodifiedDirection"]);
unmodifiedEndPoint = directionLength * vec3FromVariant(rayPickResult->pickVariant["unmodifiedDirection"]);
hasUnmodifiedEndPoint = true;
}
@ -198,7 +199,7 @@ void LaserPointer::RenderState::update(const glm::vec3& origin, const glm::vec3&
if (!oldProperties.getVisible() || !_hasSetLinePoints || !hasUnmodifiedEndPoint) {
points.append(frac * endPoint);
} else {
points.append(frac * mix(unmodifiedEndPoint, endPoint, frac));
points.append(frac * directionLength * glm::normalize(glm::mix(unmodifiedEndPoint, endPoint, frac)));
}
}
_hasSetLinePoints = true;

View file

@ -488,7 +488,7 @@ protected:
static void setParentTransform(std::shared_ptr<PickQuery> pick, const QVariantMap& propMap);
private:
Setting::Handle<float> _handLaserDelaySetting { "handLaserDelay", 0.0f };
Setting::Handle<float> _handLaserDelaySetting { "handLaserDelay", 0.35f };
};
#endif // hifi_PickScriptingInterface_h

View file

@ -219,8 +219,8 @@ void setupPreferences() {
auto setter = [](float value) { DependencyManager::get<PickScriptingInterface>()->setHandLaserDelay(value); };
auto delaySlider = new SpinnerSliderPreference(UI_CATEGORY, "Laser Delay (seconds)", getter, setter);
delaySlider->setMin(0.0f);
delaySlider->setMax(2.0f);
delaySlider->setStep(0.02f);
delaySlider->setMax(0.7f);
delaySlider->setStep(0.05f);
delaySlider->setDecimals(2.0f);
preferences->addPreference(delaySlider);
}