Skip to content
Snippets Groups Projects
Unverified Commit c7d6469f authored by Robert Long's avatar Robert Long Committed by GitHub
Browse files

Merge pull request #4 from mozilla/feature/hand-visibility

Added hand-controls-child-visibility component and network schema.
parents faef5a0c d9c8aa06
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<head> <head>
<title>Mozilla Mixed Reality Social Client</title> <title>Mozilla Mixed Reality Social Client</title>
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script> <script src="https://aframe.io/releases/0.7.0/aframe.js"></script>
<script src="./app.bundle.js"></script> <script src="./app.bundle.js"></script>
</head> </head>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<a-entity id="nametag" networked="template:#nametag-template;showLocalTemplate:false;"></a-entity> <a-entity id="nametag" networked="template:#nametag-template;showLocalTemplate:false;"></a-entity>
<a-entity id="left-hand" hand-controls="left" axis-dpad="centerZone: 1" teleport-controls="cameraRig: #player-rig; teleportOrigin: #head; button: action_teleport_" <a-entity id="left-hand" hand-controls="left" hand-controls-visibility axis-dpad="centerZone: 1" teleport-controls="cameraRig: #player-rig; teleportOrigin: #head; button: action_teleport_"
networked="template:#hand-template;showLocalTemplate:false;"> networked="template:#hand-template;showLocalTemplate:false;">
<a-entity id="watch" gltf-model="assets/hud/watch.gltf" position="0 0.0015 0.147" rotation="3.5 0 0"> <a-entity id="watch" gltf-model="assets/hud/watch.gltf" position="0 0.0015 0.147" rotation="3.5 0 0">
<a-circle mute-state-indicator scale-audio-feedback="analyserSrc: #head; minScale: 0.035; maxScale: 0.08;" position="0 0.023 0" <a-circle mute-state-indicator scale-audio-feedback="analyserSrc: #head; minScale: 0.035; maxScale: 0.08;" position="0 0.023 0"
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</a-entity> </a-entity>
</a-entity> </a-entity>
<a-entity id="right-hand" hand-controls="right" axis-dpad teleport-controls="cameraRig: #player-rig; teleportOrigin: #head; hitEntity: #telepor-indicator; button: action_teleport_;" <a-entity id="right-hand" hand-controls="right" hand-controls-child-visibility axis-dpad teleport-controls="cameraRig: #player-rig; teleportOrigin: #head; hitEntity: #telepor-indicator; button: action_teleport_;"
networked="template:#hand-template;showLocalTemplate:false;"></a-entity> networked="template:#hand-template;showLocalTemplate:false;"></a-entity>
</a-entity> </a-entity>
......
AFRAME.registerComponent("hand-controls-visibility", {
init() {
this.onControllerConnected = this.onControllerConnected.bind(this);
this.onControllerDisconnected = this.onControllerDisconnected.bind(this);
this.el.addEventListener("controllerconnected", this.onControllerConnected);
this.el.addEventListener(
"controllerdisconnected",
this.onControllerDisconnected
);
this.el.setAttribute("visible", false);
},
onControllerConnected() {
this.el.setAttribute("visible", true);
},
onControllerDisconnected() {
this.el.setAttribute("visible", false);
}
});
...@@ -12,6 +12,7 @@ import "./components/audio-feedback"; ...@@ -12,6 +12,7 @@ import "./components/audio-feedback";
import "./components/nametag-transform"; import "./components/nametag-transform";
import "./components/avatar-customization"; import "./components/avatar-customization";
import "./components/mute-state-indicator"; import "./components/mute-state-indicator";
import "./components/hand-controls-visibility";
import "./systems/personal-space-bubble"; import "./systems/personal-space-bubble";
...@@ -28,6 +29,11 @@ NAF.schemas.add({ ...@@ -28,6 +29,11 @@ NAF.schemas.add({
] ]
}); });
NAF.schemas.add({
template: "#hand-template",
components: ["position", "rotation", "visible"]
});
AFRAME.registerInputMappings({ AFRAME.registerInputMappings({
default: { default: {
common: { common: {
......
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