Commit 42260d51 authored by Rodrigo's avatar Rodrigo

primera carga

parents
Pipeline #166 failed with stages
node_modules/
\ No newline at end of file
Proyecto de ejecución con *nodehift* para su publicación en OCP
-Levanta un servidor en expressjs y publica en WebVR las oficinas del piso 3 en Agesic modeladas como una prueba tecnologia
**Pasos para levantar la solución**
**1** - Prerequisitos
NodeJS
**2** - Posicionarse en el directorio
cd /path/del/proyecto/
**3** - instalar las dependencia
npm install
**4** - Levantar el servidor de express
node ./server.js
**5** - Comprobar la solucion en localhost:8080
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"companyName": "Agesic",
"productName": "PaseoVirtualTEWebVR",
"dataUrl": "webvr-office-project.data.unityweb",
"wasmCodeUrl": "webvr-office-project.wasm.code.unityweb",
"wasmFrameworkUrl": "webvr-office-project.wasm.framework.unityweb",
"TOTAL_MEMORY": 268435456,
"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"],
"webglContextAttributes": {"preserveDrawingBuffer": false},
"splashScreenStyle": "Dark",
"backgroundColor": "#231F20",
"cacheControl": {"default": "must-revalidate"}
}
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- These tags are needed for enabling experimental Chrome APIs via Chrome's Origin-Trial program (Android, Windows): https://github.com/GoogleChrome/OriginTrials/blob/gh-pages/available-trials.md#current-experimental-features -->
<!-- Origin Trial Token, feature = Generic Sensors, origin = https://github.io, expires = 2018-04-10 -->
<meta http-equiv="origin-trial" data-feature="Generic Sensors" data-expires="2018-04-10" content="Aokv0ODVMUPIswIBi6DnpAIjhWefEd8gD8GpVgdYgETj0C5+/3kKMzZE/FOrBwHcpBO6LHuVRrIw3yOT8EMmJAYAAABQeyJvcmlnaW4iOiJodHRwczovL2dpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiR2VuZXJpY1NlbnNvciIsImV4cGlyeSI6MTUyMzMxODQwMH0=">
<!-- Origin Trial Token, feature = WebVR (For Chrome M62+), origin = https://github.io, expires = 2018-05-07 -->
<meta http-equiv="origin-trial" data-feature="WebVR (For Chrome M62+)" data-expires="2018-05-07" content="AgINztgDnjFV8da2D9SSzIITBRlHX8mduCR7DXfENxjr9ALduKOxBDdn2n66auQSlljVyhnRWWerxC0BWbE8pAoAAABOeyJvcmlnaW4iOiJodHRwczovL2dpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViVlIxLjFNNjIiLCJleHBpcnkiOjE1MjU3MjU4MDh9">
<title>VR Office | PaseoVirtualTEWebVR</title>
<meta name="description" content="Paseo Virtual Agesic">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="styles/webvr.css">
<script src="lib/telemetry.js"></script>
<script>
MozillaResearch.telemetry.start({
analytics: true,
errorLogging: true,
performance: true
});
MozillaResearch.telemetry.performance.mark('LoaderParsingStart');
</script>
<script src="Build/UnityLoader.js"></script>
<script>
/* global UnityLoader, MozillaResearch */
MozillaResearch.telemetry.performance.measure('LoaderParsing', 'LoaderParsingStart');
(function () {
UnityLoader.SystemInfo.mobile = false; // Workaround to force `UnityLoader` to actually load on mobile.
MozillaResearch.telemetry.performance.mark('LoadingStart');
window.gameInstance = UnityLoader.instantiate('gameContainer', 'Build/webvr-office-project.json', {
Module: {
// `preserveDrawingBuffer` is needed for WebVR content to be mirrored to the `<canvas>`.
webglContextAttributes: {
preserveDrawingBuffer: true
}
},
onProgress: unityProgress
});
function unityProgress (gameInstance, progress) {
if (!gameInstance.progress) {
gameInstance.loader = document.getElementById('loader');
gameInstance.progress = document.getElementById('progress');
gameInstance.loading = document.getElementById('loading');
document.dispatchEvent(new CustomEvent('UnityProgressStart'));
}
gameInstance.progress.style.width = (100 * progress) + '%';
if (progress === 1) {
document.dispatchEvent(new CustomEvent('UnityLoaded'));
}
}
})();
</script>
<link rel="manifest" href="manifest.webmanifest">
</head>
<body>
<div id="loader">
<div id="loading" class="loading">Loading</div>
<div id="progress" class="progress"></div>
</div>
<div id="game">
<div id="gameContainer"></div>
</div>
<div id="instruction">
<div id="novr" class="panel center">
<h3>You&rsquo;ll need a <a href="https://webvr.rocks/">WebVR-enabled browser</a> and VR headset to fully enjoy this experience.</h3>
<p><img src="mousedrag.png" width="70" alt="Click-and-drag your mouse"></p>
<p>In the meantime, <strong><em>click and drag</em></strong> to have a look around!</p>
<p>
<button class="confirm">Continue</button>
</p>
</div>
</div>
<button id="entervr" value="Enter VR"></button>
<div id="performance" data-enabled="false"></div>
<script src="vendor/gl-matrix-min.js"></script>
<script src="vendor/webvr-polyfill.min.js"></script>
<script src="webvr.js"></script>
</body>
</html>
/* global Raven */
(function (window) {
'use strict';
/*
* The main requirements when dealing with Do-Not-Track (DNT) are:
*
* 1. Prevent explicit collection, storage and sending data if DNT is enabled.
*
* 2. GA and Telemetry APIs should not throw or error if DNT is enabled,
* although they must ensure requirement #1.
*
* 3. If DNT is enabled in the middle of the gameplay, the API must ensure
* requirements #1 and #2. If DNT is disabled in the middle of the gameplay,
* resuming data collection is not mandatory.
*
* FOR MAINTAINERS: Some collection can happen implicitly when loading 3rd party
* libraries. Try to prevent loading external libraries if DNT is enabled and
* this does not conflict with requirement #2.
*/
var endsWith = function (str, suffix) {
if (typeof String.prototype.endsWith === 'function') {
return String.prototype.endsWith.call(str, suffix);
}
return str.indexOf(suffix, str.length - suffix.length) !== -1;
};
// Check if the origin looks like a non-public development host.
// Relevant reading: https://w3c.github.io/webappsec-secure-contexts/#localhost
var isDevOrigin = function (win) {
if (win.location.hostname === 'localhost' ||
endsWith(win.location.hostname, '.localhost') ||
win.location.hostname === '127.0.1' ||
win.location.hostname.indexOf('192.168.') === 0 ||
win.location.hostname === '0.0.0.0' ||
win.location.host.indexOf('::1') === 0 ||
endsWith(win.location.hostname, '.ngrok.io') ||
endsWith(win.location.hostname, '.localtunnel.me')) {
return true;
}
// A production URL can start with `http://` or `https://` (but not `file:///`).
if (win.location.protocol === 'http:') {
return false;
}
// Do not allow insecure-context origin (e.g., `file:///` paths).
if ('isSecureContext' in win && win.isSecureContext === true) {
return false;
}
return true;
};
var CURRENT_VERSION = '1.3.0';
var MOZILLA_RESEARCH_TRACKER = 'UA-77033033-6';
if (!('MozillaResearch' in window)) {
window.MozillaResearch = {};
}
if (!('telemetry' in window.MozillaResearch)) {
window.MozillaResearch.telemetry = {};
}
var navigator = window.navigator;
var telemetry = window.MozillaResearch.telemetry;
var NO_OP = function () {};
Object.defineProperty(telemetry, '_gtag', {
get: function () {
return window.gtag || NO_OP;
}
});
telemetry.performance = {
mark: NO_OP,
measure: NO_OP
};
telemetry.start = onlyOnce(function (config) {
config = config || {};
if (config.errorLogging) {
setupErrorLogging();
}
if (config.analytics) {
var researchAnalytics = startAnalytics();
if (config.performance) {
setupPerformanceAPI(researchAnalytics);
}
}
});
setupAnalytics();
function setupAnalytics() {
if (isTelemetryDisabled()) { return; }
window.dataLayer = window.dataLayer || [];
window.gtag = window.gtag || function () { dataLayer.push(arguments); };
window.gtag('js', new Date());
injectScript('https://www.googletagmanager.com/gtag/js?id=' + MOZILLA_RESEARCH_TRACKER, function (err) {
if (err) {
console.warn('Could not load Analytics.js script:', err);
return;
}
});
}
function setupErrorLogging() {
if (isTelemetryDisabled()) { return; }
injectScript('https://cdn.ravenjs.com/3.22.3/console/raven.min.js', function (err) {
if (err) {
console.warn('Could not load Raven.js script:', err);
return;
}
if (!('Raven' in window)) {
console.warn('Could not find `window.Raven` global');
return;
}
startRaven();
});
function startRaven () {
Raven.config('https://816fbc92b9e14534b3a8b6a04f075140@sentry.prod.mozaws.net/371')
.install();
}
};
function startAnalytics() {
var tracker = configureBoundTracker(MOZILLA_RESEARCH_TRACKER, {
'groups': 'MozillaResearch',
'custom_map': {
'dimension1': 'version'
}
});
tracker('event', 'using_webvr_template', { version: CURRENT_VERSION });
return tracker;
}
function setupPerformanceAPI(tracker) {
telemetry.performance = {
mark: function (name) {
if (isTelemetryDisabled()) { return; }
performance.mark(name);
},
measure: function (name, start, end) {
if (isTelemetryDisabled()) { return; }
performance.measure(name, start, end);
var performanceEntry = performance.getEntriesByName(name)[0];
var duration = performanceEntry.duration;
tracker('event', name, {
'event_category': 'Performance',
'value': Math.round(duration)
});
}
};
}
/**
* The function configures Google Analytics sending a `config` command [1] but
* also returns a function to use instead of `gtag` that respects `Do-Not-Track`
* and it's bound to the `groups` property of the `options` parameter to avoid
* adding the `send_to` key [2] to each command.
*
* [1] https://developers.google.com/analytics/devguides/collection/gtagjs/pages
* [2] https://developers.google.com/analytics/devguides/collection/gtagjs/sending-data#groups-and-properties
*
* @param {string} trackingId see `'config'` command signature [1]
* @param {object} options see `'config'` command signature [1]
* @returns {function} A tracker function to replace invocation of `gtag` that
* honours Do-Not-Track and automatically adds the `send_to` key to the
* commands [2].
*/
function configureBoundTracker(trackingId, options) {
if (isTelemetryDisabled()) { return NO_OP; }
options = options || {};
var groups = options.groups;
telemetry._gtag('config', trackingId, options);
return trackingFunction;
function trackingFunction(command, label, options) {
if (isTelemetryDisabled()) { return; }
options = options || {};
if (groups) {
options.send_to = groups;
}
telemetry._gtag(command, label, options);
};
}
function injectScript(src, callback) {
var script = document.createElement('script');
script.src = src;
script.crossorigin = 'anonymous';
script.addEventListener('load', function () {
if (callback) {
callback(null, true);
}
});
script.addEventListener('error', function (err) {
if (callback) {
callback(err);
}
});
document.head.appendChild(script);
return script;
}
function onlyOnce(fn) {
var called = false;
return function () {
if (called) { return; }
var returnValue = fn.apply(this, arguments);
called = true;
return returnValue;
};
}
// IE9/IE10 uses a prefixed version while MS Edge sets the property in
// `window` instead of `navigator`:
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack#Browser_compatibility
function doNotTrack () {
return navigator.doNotTrack === '1' ||
navigator.msDoNotTrack === '1' ||
window.doNotTrack === '1';
}
function isTelemetryDisabled () {
// Telemetry is disabled if DNT is enabled or if the origin appears to be for a development environment.
return doNotTrack() || isDevOrigin(window);
}
})(window);
{
"lang": "en",
"dir": "ltr",
"name": "Unity WebVR Game",
"short_name": "Unity WebVR",
"description": "WebVR Game exported from Unity.",
"start_url": "./?src=manifest",
"display": "standalone",
"background_color": "#111",
"theme_color": "#111",
"icons": [
{
"src": "vr.png",
"sizes": "200x200",
"type": "image/png"
},
{
"src": "favicon.ico",
"sizes": "16x16 32x32 48x48 64x64 256x256",
"type": "image/x-icon"
}
],
"screenshots": [
{
"src": "https://raw.githubusercontent.com/mozilla/unity-webvr-export/master/img/preview.gif",
"sizes": "640x360",
"type": "image/gif",
"purpose": "Animation of WebVR game exported from Unity"
}
],
"categories": [
"games",
"unity",
"webvr",
"unity-webvr"
],
"xr_available_platforms": [
{
"platform": "windows",
"browser": "firefox"
},
{
"platform": "windows",
"browser": "edge"
}
],
"xr_default_device": "htc_vive",
"xr_available_devices": [
"htc_vive",
"oculus_rift"
],
"unity_webvr_player_version": "1.3.0"
}
html, body {
background-color: #000;
font-size: 16px;
overflow: hidden;
/* NOTE: Don't use `-apple-system` at the head of a shorthand font declaration.
See https://booking.design/implementing-system-fonts-on-booking-com-a-lesson-learned-bdc984df627f for more info. */
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
html, body, #canvas, #loader {
height: 100%;
left: 0;
margin: 0;
padding: 0;
top: 0;
width: 100%;
}
a:link, a:visited {
color: #198EFB;
}
#loader {
background: #2C3146;
}
[data-unity-loaded='true'] #loader {
display: none;
}
#progress {
bottom: 0;
height: 80px;
position: absolute;
width: 0;
}
.loading {
align-items: center;
color: #fff;
display: flex;
font-size: 50px;
font-weight: light;
height: 100%;
justify-content: center;
}
/* loading dots */
.loading:after {
content: ' .';
animation: dots 2s steps(5, end) infinite;
}
@keyframes dots {
0%, 20% {
color: rgba(0,0,0,0);
text-shadow:
.25em 0 0 rgba(0,0,0,0),
.5em 0 0 rgba(0,0,0,0);
}
40% {
color: #fff;
text-shadow:
.25em 0 0 rgba(0,0,0,0),
.5em 0 0 rgba(0,0,0,0);
}
60% {
text-shadow:
.25em 0 0 #fff,
.5em 0 0 rgba(0,0,0,0);
}
80%, 100% {
text-shadow:
.25em 0 0 #fff,
.5em 0 0 #fff;
}
}
#canvas {
display: block;
position: absolute;
z-index: 0;
}
#status {
display: none;
background: #fff;
margin-right: 15px;
padding: 10px;
}
#performance[data-enabled='true'] {
display: block;
position: absolute;
left: 30px;
bottom: 30px;
color: #fff;
padding: 10px;
background: #000;
}
#performance[data-enabled='false'] {
display: none;
}
[data-unity-loaded='true'] #status[data-enabled='true'] {
display: block;
}
#vr button {
border: none;
}
#entervr {
display: none;
position: absolute;
height: 100px;
width: 100px;
right: 30px;
bottom: 30px;
background: #fff url(../vr.png) center no-repeat;
background-size: 80%;
border: none;
cursor: pointer;
}
[data-unity-loaded='true'] #entervr[data-enabled='true'] {
display: block;
}
#progress,
#entervr:hover,
#instruction button {
background-color: #198EFB;
}
#instruction {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
position: absolute;
top: 0;
width: 100%;
pointer-events: none;
}
#instruction button {
color: #fff;
cursor: pointer;
border: none;
font-size: 25px;
padding: 15px 20px;
}
#icons {
display: flex;
}
.panel {
background: #fff;
display: none;
max-width: 50%;
padding: 10px 30px;
pointer-events: all;
}
.panel[data-enabled='true'] {
display: block;
}
.center {
text-align: center;
}
// In order for Chrome to consider this site a PWA, it must register a service worker.
// We are working on adding cache capabilities [1] but right now, it is provided empty.
// [1] https://github.com/mozilla/unity-webvr-export/issues/98
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
app/vr.png

2.14 KB

This diff is collapsed.
This diff is collapsed.
{
"name": "webvroffice",
"version": "1.0.0",
"description": "Agesic - Oficina virtual",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://gitlab.paas.agesic.red.uy/Rodrigo.Capdevila/webvr-office-project.git"
},
"author": "Rodrigo Capdevila <rodrigo.capdevila@agesic.gub.uy>",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}
const express = require('express');
const app = express();
app.use(express.static(__dirname + '/app/'));
app.listen('8080', function(){
console.log('Server listening port 30000');
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment