Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Hubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ar-noc
Hubs
Commits
375bae1d
Commit
375bae1d
authored
7 years ago
by
Robert Long
Browse files
Options
Downloads
Patches
Plain Diff
Added hand-controls-child-visibility component and network schema.
parent
e06bcc73
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
public/index.html
+3
-3
3 additions, 3 deletions
public/index.html
src/components/hand-controls-child-visibility.js
+21
-0
21 additions, 0 deletions
src/components/hand-controls-child-visibility.js
src/index.js
+6
-0
6 additions, 0 deletions
src/index.js
with
30 additions
and
3 deletions
public/index.html
+
3
−
3
View file @
375bae1d
...
...
@@ -2,7 +2,7 @@
<head>
<title>
A-Frame Social VR Demo
</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>
</head>
...
...
@@ -58,7 +58,7 @@
<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"
visible=
"false"
hand-controls-child-visibility
axis-dpad=
"centerZone: 1"
teleport-controls=
"cameraRig: #player-rig; teleportOrigin: #head; button: action_teleport_"
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-circle
mute-state-indicator
scale-audio-feedback=
"analyserSrc: #head; minScale: 0.035; maxScale: 0.08;"
position=
"0 0.023 0"
...
...
@@ -67,7 +67,7 @@
</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"
visible=
"false"
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>
</a-entity>
...
...
This diff is collapsed.
Click to expand it.
src/components/hand-controls-child-visibility.js
0 → 100644
+
21
−
0
View file @
375bae1d
AFRAME
.
registerComponent
(
"
hand-controls-child-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
);
}
});
This diff is collapsed.
Click to expand it.
src/index.js
+
6
−
0
View file @
375bae1d
...
...
@@ -10,6 +10,7 @@ import "./components/audio-feedback";
import
"
./components/nametag-transform
"
;
import
"
./components/avatar-customization
"
;
import
"
./components/mute-state-indicator
"
;
import
"
./components/hand-controls-child-visibility
"
;
import
{
generateName
}
from
"
./utils
"
;
...
...
@@ -24,6 +25,11 @@ NAF.schemas.add({
]
});
NAF
.
schemas
.
add
({
template
:
"
#hand-template
"
,
components
:
[
"
position
"
,
"
rotation
"
,
"
visible
"
]
});
AFRAME
.
registerInputMappings
({
default
:
{
common
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment