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
a80ff965
Commit
a80ff965
authored
7 years ago
by
Greg Fodor
Browse files
Options
Downloads
Patches
Plain Diff
Feedback from PR
parent
df0d12e9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hub.js
+4
-11
4 additions, 11 deletions
src/hub.js
src/react-components/home-root.js
+7
-9
7 additions, 9 deletions
src/react-components/home-root.js
src/react-components/hub-create-panel.js
+1
-2
1 addition, 2 deletions
src/react-components/hub-create-panel.js
with
12 additions
and
22 deletions
src/hub.js
+
4
−
11
View file @
a80ff965
...
...
@@ -133,7 +133,6 @@ async function exitScene() {
}
function
updatePlayerInfoFromStore
()
{
const
qs
=
queryString
.
parse
(
location
.
search
);
const
playerRig
=
document
.
querySelector
(
"
#player-rig
"
);
playerRig
.
setAttribute
(
"
player-info
"
,
{
displayName
:
store
.
state
.
profile
.
display_name
,
...
...
@@ -144,7 +143,6 @@ function updatePlayerInfoFromStore() {
async
function
enterScene
(
mediaStream
,
enterInVR
,
janusRoomId
)
{
const
scene
=
document
.
querySelector
(
"
a-scene
"
);
const
playerRig
=
document
.
querySelector
(
"
#player-rig
"
);
const
qs
=
queryString
.
parse
(
location
.
search
);
document
.
querySelector
(
"
a-scene canvas
"
).
classList
.
remove
(
"
blurred
"
);
registerNetworkSchemas
();
...
...
@@ -155,9 +153,7 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
AFRAME
.
registerInputActions
(
inGameActions
,
"
default
"
);
document
.
querySelector
(
"
#player-camera
"
).
setAttribute
(
"
look-controls
"
,
"
pointerLockEnabled: true;
"
);
const
qs
=
queryString
.
parse
(
location
.
search
);
document
.
querySelector
(
"
#player-camera
"
).
setAttribute
(
"
look-controls
"
);
scene
.
setAttribute
(
"
networked-scene
"
,
{
adapter
:
"
janus
"
,
...
...
@@ -228,7 +224,6 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
function
onConnect
()
{}
function
mountUI
(
scene
)
{
const
qs
=
queryString
.
parse
(
location
.
search
);
const
disableAutoExitOnConcurrentLoad
=
qs
.
allow_multi
===
"
true
"
;
let
forcedVREntryType
=
null
;
...
...
@@ -285,11 +280,9 @@ const onReady = async () => {
const
res
=
await
fetch
(
`/api/v1/hubs/
${
hubId
}
`
);
const
data
=
await
res
.
json
();
const
hub
=
data
.
hubs
[
0
];
const
defaultSpaceChannel
=
hub
.
channels
.
find
(
c
=>
c
.
attributes
.
find
(
a
=>
a
.
length
===
1
&&
a
[
0
]
===
"
default-space
"
)
);
const
gltfBundleUrl
=
defaultSpaceChannel
.
assets
.
find
(
a
=>
a
.
asset_type
===
"
gltf_bundle
"
).
src
;
uiRoot
.
setState
({
janusRoomId
:
defaultSpaceChannel
.
janus_room_id
});
const
defaultSpaceTopic
=
hub
.
topics
[
0
];
const
gltfBundleUrl
=
defaultSpaceTopic
.
assets
.
find
(
a
=>
a
.
asset_type
===
"
gltf_bundle
"
).
src
;
uiRoot
.
setState
({
janusRoomId
:
defaultSpaceTopic
.
janus_room_id
});
initialEnvironmentEl
.
setAttribute
(
"
gltf-bundle
"
,
`src:
${
gltfBundleUrl
}
`
);
};
...
...
This diff is collapsed.
Click to expand it.
src/react-components/home-root.js
+
7
−
9
View file @
a80ff965
...
...
@@ -36,15 +36,13 @@ class HomeRoot extends Component {
loadEnvironments
=
()
=>
{
const
environments
=
[];
const
environmentLoads
=
ENVIRONMENT_URLS
.
map
(
src
=>
new
Promise
(
async
resolve
=>
{
const
res
=
await
fetch
(
src
);
const
data
=
await
res
.
json
();
data
.
bundle_url
=
src
;
environments
.
push
(
data
);
resolve
();
})
const
environmentLoads
=
ENVIRONMENT_URLS
.
map
(
src
=>
(
async
()
=>
{
const
res
=
await
fetch
(
src
);
const
data
=
await
res
.
json
();
data
.
bundle_url
=
src
;
environments
.
push
(
data
);
})()
);
Promise
.
all
(
environmentLoads
).
then
(()
=>
this
.
setState
({
environments
}));
...
...
This diff is collapsed.
Click to expand it.
src/react-components/hub-create-panel.js
+
1
−
2
View file @
a80ff965
import
React
,
{
Component
}
from
"
react
"
;
import
PropTypes
from
"
prop-types
"
;
import
{
injectIntl
,
FormattedMessage
}
from
"
react-intl
"
;
import
{
SCHEMA
}
from
"
../storage/store
"
;
import
{
generateHubName
}
from
"
../utils/name-generation
"
;
class
HubCreatePanel
extends
Component
{
...
...
@@ -15,7 +14,7 @@ class HubCreatePanel extends Component {
environmentBundleUrl
:
""
};
co
mponentDidMount
()
{
co
nstructor
()
{
this
.
setState
({
environmentBundleUrl
:
this
.
props
.
environments
[
0
].
bundle_url
});
}
...
...
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