Skip to content
Snippets Groups Projects
Commit c4921eab authored by Greg Fodor's avatar Greg Fodor
Browse files

Always autolock camera and pen, increase threshold for locking

parent 8486a535
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ AFRAME.registerComponent("sticky-object", { ...@@ -5,7 +5,7 @@ AFRAME.registerComponent("sticky-object", {
schema: { schema: {
autoLockOnLoad: { default: false }, autoLockOnLoad: { default: false },
autoLockOnRelease: { default: false }, autoLockOnRelease: { default: false },
autoLockSpeedLimit: { default: 0.25 } autoLockSpeedLimit: { default: 0.5 }
}, },
init() { init() {
...@@ -52,7 +52,8 @@ AFRAME.registerComponent("sticky-object", { ...@@ -52,7 +52,8 @@ AFRAME.registerComponent("sticky-object", {
if ( if (
this.data.autoLockOnRelease && 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); this.setLocked(true);
} }
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
super-networked-interactable="counter: #pen-counter;" super-networked-interactable="counter: #pen-counter;"
body="type: dynamic; shape: none; mass: 1;" body="type: dynamic; shape: none; mass: 1;"
grabbable="maxGrabbers: 1" grabbable="maxGrabbers: 1"
sticky-object="autoLockOnRelease: true; autoLockOnLoad: true;" sticky-object="autoLockOnRelease: true; autoLockOnLoad: true; autoLockSpeedLimit: 0;"
hoverable hoverable
scale="0.5 0.5 0.5" scale="0.5 0.5 0.5"
> >
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
camera-tool camera-tool
body="type: dynamic; shape: none; mass: 1;" body="type: dynamic; shape: none; mass: 1;"
shape="shape: box; halfExtents: 0.22 0.145 0.1; offset: 0 0.02 0" 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;" super-networked-interactable="counter: #camera-counter;"
position-at-box-shape-border="target:.delete-button" position-at-box-shape-border="target:.delete-button"
rotation rotation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment