Skip to content

Commit

Permalink
Replace rotation icon
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshaughnessy committed Jan 28, 2019
1 parent 3a98079 commit 1ca2150
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Binary file modified src/assets/rotation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/components/cursor-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { paths } from "../systems/userinput/paths";
import { sets } from "../systems/userinput/sets";
import { getLastWorldPosition } from "../utils/three-utils";

// Color code from https://codepen.io/njmcode/pen/axoyD/
Expand Down Expand Up @@ -82,8 +83,8 @@ const _interpolateHSL = function(color1, color2, factor) {
function rotatingColor(t) {
const STEP_LENGTH = 0.05;
const color = _interpolateHSL(
[205, 136, 175],
[44, 0, 27],
[47, 255, 200],
[23, 64, 118],
0.5 + 0.5 * Math.floor(Math.sin(t / 1000.0) / STEP_LENGTH) * STEP_LENGTH
);
return r2h(color);
Expand Down Expand Up @@ -223,7 +224,7 @@ AFRAME.registerComponent("cursor-controller", {
const { cursor, near, far, camera, cursorColorHovered, cursorColorUnhovered } = this.data;

const cursorModDelta = userinput.get(paths.actions.cursor.modDelta);
if (isGrabbing && cursorModDelta) {
if (isGrabbing && !userinput.activeSets.has(sets.cursorHoldingUI) && cursorModDelta) {
this.distance = THREE.Math.clamp(this.distance - cursorModDelta, near, far);
}
cursor.object3D.position.copy(cursorPose.position).addScaledVector(cursorPose.direction, this.distance);
Expand Down
2 changes: 1 addition & 1 deletion src/components/media-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ AFRAME.registerComponent("media-video", {
}
}

if (this.hoverMenu.object3D.visible && !this.videoIsLive) {
if (this.hoverMenu && this.hoverMenu.object3D.visible && !this.videoIsLive) {
this.timeLabel.setAttribute(
"text",
"value",
Expand Down
2 changes: 1 addition & 1 deletion src/hub.html
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
<a-image
icon-button="image: #rotation-symbol"
scale="0.1 0.1 0.1"
position="0.0 0 0.001"
position="0.0 0 0"
class="hud"
visible-if-rotating
></a-image>
Expand Down

0 comments on commit 1ca2150

Please sign in to comment.