add platform to mesh app
This commit is contained in:
parent
302931bfaf
commit
af49add2b9
4 changed files with 45 additions and 8 deletions
2
app.js
2
app.js
|
|
@ -466,7 +466,7 @@ const script = {
|
|||
// "kiri/do",
|
||||
// "kiri/lang",
|
||||
// "kiri/lang-en",
|
||||
"kiri/catalog",
|
||||
// "kiri/catalog",
|
||||
// "kiri/slice",
|
||||
// "kiri/layers",
|
||||
// "kiri/client",
|
||||
|
|
|
|||
|
|
@ -9,11 +9,13 @@
|
|||
if (typeof(module) === 'object') {
|
||||
module.exports = terms;
|
||||
}
|
||||
if (typeof(self) !== 'undefined' && self.kiri) {
|
||||
// self.exports = terms;
|
||||
self.kiri.license = terms.LICENSE;
|
||||
self.kiri.version = terms.VERSION;
|
||||
self.kiri.copyright = terms.COPYRIGHT;
|
||||
|
||||
if (typeof(self) !== 'undefined' && self.gapp) {
|
||||
let app = self.gapp;
|
||||
app.license = terms.LICENSE;
|
||||
app.version = terms.VERSION;
|
||||
app.copyright = terms.COPYRIGHT;
|
||||
// for earcut and other modules
|
||||
self.module = { exports: terms };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
(function () {
|
||||
|
||||
if (!self.kiri) {
|
||||
let kiri = self.kiri = {
|
||||
let kiri = self.gapp = self.kiri = {
|
||||
beta: 3110,
|
||||
driver: {}, // driver modules
|
||||
loader: [], // module loading: array of functions
|
||||
|
|
|
|||
|
|
@ -1 +1,36 @@
|
|||
console.log('mesh loaded');
|
||||
// required for license and other grid app dependencies
|
||||
self.gapp = {};
|
||||
|
||||
function $(id) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
function init() {
|
||||
let container = $('container'),
|
||||
moto = self.moto,
|
||||
sky = false;
|
||||
dark = false,
|
||||
ortho = false,
|
||||
zoomrev = true;
|
||||
zoomspd = 1,
|
||||
Space = moto.Space;
|
||||
|
||||
Space.showSkyGrid(sky);
|
||||
Space.setSkyColor(dark ? 0 : 0xffffff);
|
||||
Space.init(container, delta => { }, ortho);
|
||||
Space.platform.onMove(delta => { } );
|
||||
Space.platform.setRound(false);
|
||||
Space.platform.setZOff(0.2);
|
||||
Space.platform.setSize(500,500,2.5);
|
||||
Space.platform.setGrid(25,5);
|
||||
Space.view.setZoom(zoomrev, zoomspd);
|
||||
Space.useDefaultKeys(true);
|
||||
|
||||
$('curtain').style.display = 'none';
|
||||
}
|
||||
|
||||
document.onreadystatechange = function() {
|
||||
if (document.readyState === 'complete') {
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue