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
73659479
Commit
73659479
authored
7 years ago
by
Robert Long
Browse files
Options
Downloads
Patches
Plain Diff
Add rig-selector.
parent
5a0a6e7e
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
+41
-6
41 additions, 6 deletions
public/index.html
src/components/rig-selector.js
+59
-0
59 additions, 0 deletions
src/components/rig-selector.js
src/index.js
+1
-2
1 addition, 2 deletions
src/index.js
with
101 additions
and
8 deletions
public/index.html
+
41
−
6
View file @
73659479
...
@@ -24,14 +24,49 @@
...
@@ -24,14 +24,49 @@
<script
id=
"hand-template"
type=
"text/html"
>
<script
id=
"hand-template"
type=
"text/html"
>
<
a
-
box
scale
=
"
0.1 0.1 0.1
"
><
/a-box
>
<
a
-
box
scale
=
"
0.1 0.1 0.1
"
><
/a-box
>
</script>
</script>
</a-assets>
<a-entity
id=
"player"
networked=
"template:#player-template;showLocalTemplate:false;"
wasd-controls
>
<script
id=
"vive-rig"
type=
"text/html"
>
<a-entity
camera=
"userHeight: 1.6"
look-controls
networked=
"template:#head-template;showLocalTemplate:false;"
></a-entity>
<
a
-
entity
id
=
"
player
"
networked
=
"
template:#player-template;showLocalTemplate:false;
"
wasd
-
controls
>
<
a
-
entity
camera
=
"
userHeight: 1.6
"
look
-
controls
networked
=
"
template:#head-template;showLocalTemplate:false;
"
><
/a-entity
>
<
a
-
entity
hand
-
controls
=
"
left
"
teleport
-
controls
=
"
cameraRig: #player
"
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
a
-
entity
hand
-
controls
=
"
right
"
teleport
-
controls
=
"
cameraRig: #player
"
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
/a-entity
>
</script>
<script
id=
"oculus-rig"
type=
"text/html"
>
<
a
-
entity
id
=
"
player
"
networked
=
"
template:#player-template;showLocalTemplate:false;
"
wasd
-
controls
>
<
a
-
entity
camera
=
"
userHeight: 1.6
"
look
-
controls
networked
=
"
template:#head-template;showLocalTemplate:false;
"
><
/a-entity
>
<
a
-
entity
oculus
-
touch
-
controls
=
"
left
"
teleport
-
controls
=
"
cameraRig:#player;button:trigger;
"
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
a
-
entity
oculus
-
touch
-
controls
=
"
right
"
teleport
-
controls
=
"
cameraRig:#player;button:trigger;
"
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
/a-entity
>
</script>
<script
id=
"daydream-rig"
type=
"text/html"
>
<
a
-
entity
id
=
"
player
"
networked
=
"
template:#player-template;showLocalTemplate:false;
"
wasd
-
controls
>
<
a
-
entity
camera
=
"
userHeight: 1.6
"
look
-
controls
networked
=
"
template:#head-template;showLocalTemplate:false;
"
><
/a-entity
>
<
a
-
entity
daydream
-
controls
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
/a-entity
>
</script>
<script
id=
"gearvr-rig"
type=
"text/html"
>
<
a
-
entity
id
=
"
player
"
networked
=
"
template:#player-template;showLocalTemplate:false;
"
wasd
-
controls
>
<
a
-
entity
camera
=
"
userHeight: 1.6
"
look
-
controls
networked
=
"
template:#head-template;showLocalTemplate:false;
"
><
/a-entity
>
<
a
-
entity
gearvr
-
controls
networked
=
"
template:#hand-template;showLocalTemplate:true;
"
><
/a-entity
>
<
/a-entity
>
</script>
<script
id=
"dolly-rig"
type=
"text/html"
>
<
a
-
entity
id
=
"
player
"
networked
=
"
template:#player-template;showLocalTemplate:false;
"
wasd
-
controls
>
<
a
-
entity
camera
=
"
userHeight: 1.6
"
look
-
controls
networked
=
"
template:#head-template;showLocalTemplate:false;
"
><
/a-entity
>
<
/a-entity
>
</script>
</a-assets>
<a-entity
hand-controls=
"left"
networked=
"template:#hand-template;showLocalTemplate:true;"
></a-entity>
<a-entity
rig-selector=
"vive:#vive-rig;oculus:oculus-rig;daydream:#daydream-rig;desktop:#dolly-rig;mobile:dolly-rig;"
></a-entity>
<a-entity
hand-controls=
"right"
networked=
"template:#hand-template;showLocalTemplate:true;"
></a-entity>
</a-entity>
<a-plane
src=
"#ground"
color=
"#7BC8A4"
height=
"100"
width=
"100"
rotation=
"-90 0 0"
></a-plane>
<a-plane
src=
"#ground"
color=
"#7BC8A4"
height=
"100"
width=
"100"
rotation=
"-90 0 0"
></a-plane>
<a-sky
color=
"#ECECEC"
></a-sky>
<a-sky
color=
"#ECECEC"
></a-sky>
...
...
This diff is collapsed.
Click to expand it.
src/components/rig-selector.js
0 → 100644
+
59
−
0
View file @
73659479
AFRAME
.
registerComponent
(
"
rig-selector
"
,
{
schema
:
{
vive
:
{
default
:
""
},
oculus
:
{
default
:
""
},
daydream
:
{
default
:
""
},
gearvr
:
{
default
:
""
},
mobile
:
{
default
:
""
},
desktop
:
{
default
:
""
}
},
init
:
function
()
{
var
vrDevice
=
this
.
el
.
sceneEl
.
effect
.
getVRDisplay
();
var
rigEl
=
document
.
createElement
(
"
a-entity
"
);
if
(
vrDevice
!==
undefined
)
{
var
displayName
=
vrDevice
.
displayName
;
if
(
displayName
.
indexOf
(
"
Oculus
"
)
!==
-
1
)
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
oculus
||
this
.
data
.
desktop
);
}
else
if
(
displayName
.
indexOf
(
"
OpenVR
"
)
!==
-
1
)
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
vive
||
this
.
data
.
desktop
);
}
else
if
(
displayName
.
indexOf
(
"
Daydream
"
)
!==
-
1
)
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
daydream
||
this
.
data
.
mobile
);
}
else
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
desktop
||
this
.
data
.
mobile
);
}
}
else
{
if
(
AFRAME
.
utils
.
device
.
isGearVR
())
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
gearvr
||
this
.
data
.
mobile
);
}
else
if
(
AFRAME
.
utils
.
device
.
isMobile
())
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
mobile
||
this
.
data
.
desktop
);
}
else
{
rigEl
.
setAttribute
(
"
template
"
,
"
src:
"
+
this
.
data
.
desktop
||
this
.
data
.
mobile
);
}
}
this
.
el
.
appendChild
(
rigEl
);
}
});
This diff is collapsed.
Click to expand it.
src/index.js
+
1
−
2
View file @
73659479
require
(
"
networked-aframe
"
);
require
(
"
networked-aframe
"
);
require
(
"
./components/rig-selector
"
);
console
.
log
(
"
test2
"
);
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