From c4921eab1b46955942d7abf071c00f61c30fb499 Mon Sep 17 00:00:00 2001 From: Greg Fodor <gfodor@gmail.com> Date: Mon, 5 Nov 2018 04:41:11 +0000 Subject: [PATCH] Always autolock camera and pen, increase threshold for locking --- src/components/sticky-object.js | 5 +++-- src/hub.html | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/sticky-object.js b/src/components/sticky-object.js index 61d04814a..4d05f0f53 100644 --- a/src/components/sticky-object.js +++ b/src/components/sticky-object.js @@ -5,7 +5,7 @@ AFRAME.registerComponent("sticky-object", { schema: { autoLockOnLoad: { default: false }, autoLockOnRelease: { default: false }, - autoLockSpeedLimit: { default: 0.25 } + autoLockSpeedLimit: { default: 0.5 } }, init() { @@ -52,7 +52,8 @@ AFRAME.registerComponent("sticky-object", { if ( this.data.autoLockOnRelease && - this.el.body.velocity.lengthSquared() < this.data.autoLockSpeedLimit * this.data.autoLockSpeedLimit + (this.data.autoLockSpeedLimit === 0 || + this.el.body.velocity.lengthSquared() < this.data.autoLockSpeedLimit * this.data.autoLockSpeedLimit) ) { this.setLocked(true); } diff --git a/src/hub.html b/src/hub.html index e9533ed12..69c250d25 100644 --- a/src/hub.html +++ b/src/hub.html @@ -167,7 +167,7 @@ super-networked-interactable="counter: #pen-counter;" body="type: dynamic; shape: none; mass: 1;" grabbable="maxGrabbers: 1" - sticky-object="autoLockOnRelease: true; autoLockOnLoad: true;" + sticky-object="autoLockOnRelease: true; autoLockOnLoad: true; autoLockSpeedLimit: 0;" hoverable scale="0.5 0.5 0.5" > @@ -197,7 +197,7 @@ camera-tool body="type: dynamic; shape: none; mass: 1;" shape="shape: box; halfExtents: 0.22 0.145 0.1; offset: 0 0.02 0" - sticky-object="autoLockOnRelease: true; autoLockOnLoad: true;" + sticky-object="autoLockOnRelease: true; autoLockOnLoad: true; autoLockSpeedLimit: 0;" super-networked-interactable="counter: #camera-counter;" position-at-box-shape-border="target:.delete-button" rotation -- GitLab