Commit 49da8c9d authored by 任建锋's avatar 任建锋

封版提交

parent ac017249
Pipeline #73374 failed with stages
in 0 seconds
import { getImgURL } from 'duiba-tc';
export class YtAssetsManager {
private _resourceData;
private _resourceObject:object;
private static instance: YtAssetsManager;
public static get ins(): YtAssetsManager {
if (!this.instance) {
this.instance = new YtAssetsManager();
}
return this.instance;
}
constructor(){
//this._resourceData=ResourceCon.ins.resource;
this._resourceObject={
binarys:{},
images:{},
models:{},
textures:{},
cubeTextures:{}
}
}
public set resourceData(resource){
this._resourceData=resource;
}
public loadFile(sceneNames:Array<string>,scene,callback,progress){
let assetsManager = new BABYLON.AssetsManager(scene);
assetsManager.useDefaultLoadingScreen = false;
sceneNames.forEach(function(sceneName){
//加载模型
var _thisModel={}
this._resourceData[sceneName].models.forEach(function(model){
let meshTask = assetsManager.addMeshTask(
"skull task",
"",
model.filePath,
model.fileName
);
meshTask.onSuccess = function (task) {
console.log("meshTask")
console.log(task)
/* task.loadedMeshes.forEach(function(mesh){
mesh.isVisible=false;
mesh.name="noneisVisible_"+mesh;
}) */
let _thisMesh=task;
_thisModel[model.name]=_thisMesh
this._resourceObject.models[sceneName]=_thisModel;
}.bind(this)
}.bind(this))
//加载图片
var _thisImage={}
this._resourceData[sceneName].images.forEach(function(image){
// getImgURL(image.filePath+image.fileName,(url)=>{
let imageTask = assetsManager.addImageTask(
"image task",
image.filePath+image.fileName,
);
imageTask.onSuccess = function (task) {
_thisImage[image.name]=task.image
this._resourceObject.images[sceneName]=_thisImage;
}.bind(this)
// })
}.bind(this))
//加载贴图
var _thisTexture={}
this._resourceData[sceneName].textures.forEach(function(texture){
// getImgURL(texture.filePath+texture.fileName,(url)=>{
let textureTask = assetsManager.addTextureTask(
"texture task",
texture.filePath+texture.fileName,
);
textureTask.onSuccess = function (task) {
_thisTexture[texture.name]=task.texture
this._resourceObject.textures[sceneName]=_thisTexture;
}.bind(this)
// })
}.bind(this))
//加载二进制文件
var _thisBinary={}
this._resourceData[sceneName].binarys.forEach(function(binary){
let binaryTask = assetsManager.addBinaryFileTask(
"binary task",
binary.filePath+binary.fileName,
);
binaryTask.onSuccess = function (task) {
console.log(6666677)
console.log(task.data)
_thisBinary[binary.name]=task.data
_thisBinary[binary.name]["url"]=task.url
this._resourceObject.binarys[sceneName]=_thisBinary;
}.bind(this)
}.bind(this))
//加载天空盒子/环境贴图
var _thisCubeTexture={}
this._resourceData[sceneName].cubeTextures.forEach(function(cubeTexture){
let cubeTextureTask = assetsManager.addCubeTextureTask(
"cubeTexture task",
cubeTexture.filePath+cubeTexture.fileName,
);
cubeTextureTask.onSuccess = function (task) {
_thisCubeTexture[cubeTexture.name]=task.texture
this._resourceObject.cubeTextures[sceneName]=_thisCubeTexture;
}.bind(this)
}.bind(this))
}.bind(this))
assetsManager.load();
//加载成功一个子元素调用
assetsManager.onProgress=function(task) {
var _this={
totalTasksCount:assetsManager._totalTasksCount,
waitingTasksCount:assetsManager._waitingTasksCount,
loadCount:(assetsManager._totalTasksCount-assetsManager._waitingTasksCount)/assetsManager._totalTasksCount
}
progress(_this)
}.bind(this);
//全部加载成功调用
assetsManager.onFinish=function(task) {
callback()
}.bind(this);
}
public get resourceObject(){
return this._resourceObject;
}
}
\ No newline at end of file
export class SceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: SceneManager;
public static get ins(): SceneManager {
if (!this.instance) {
this.instance = new SceneManager();
}
return this.instance;
}
constructor(){
this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
this.engine = new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
var createScene=function(){
{
var scene = new BABYLON.Scene(this.engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
}.bind(this)
this.scene = createScene();
this.engine.runRenderLoop(function () {
this.scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function() {
this.engine.resize();
}.bind(this));
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
SceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
SceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
this.engine = new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
var createScene=function(){
{
var scene = new BABYLON.Scene(this.engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
}.bind(this)
this.scene = createScene();
this.engine.runRenderLoop(function () {
this.scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function() {
this.engine.resize();
}.bind(this));
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas=document.querySelector("#renderCanvas");;
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
var createScene=function(){
{
var scene = new BABYLON.Scene(this.engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
}.bind(this)
this.scene = createScene();
this.engine.runRenderLoop(function () {
this.scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function() {
this.engine.resize();
}.bind(this));
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
this.engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
this.scene = this.createScene();
this.engine.runRenderLoop(function () {
this.scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function() {
this.engine.resize();
}.bind(this));
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas=document.querySelector("#renderCanvas");
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
this.engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.canvas = document.querySelector("#renderCanvas");
// this.engine = new BABYLON.Engine(this.canvas, true);
this.engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
// this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
/* var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1); */
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
/* var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1); */
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
/* var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1); */
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true);
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true);
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.getRenderingCanvas=function(){
return document.getElementById("_a2x_canvas")
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.getRenderingCanvas=()=>{
return document.getElementById("_a2x_canvas")
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this["engine.getRenderingCanvas"]=()=>{
return document.getElementById("_a2x_canvas")
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.getRenderingCanvas=()=>{
return document.getElementById("_a2x_canvas")
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.setAttribute("id","renderCanvas");
webglCanvas.setAttribute("touch-action","none");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createScene();
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:
public engine:any;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.setAttribute("id","renderCanvas");
webglCanvas.setAttribute("touch-action","none");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createScene();
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.setAttribute("id","renderCanvas");
webglCanvas.setAttribute("touch-action","none");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createScene();
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.setAttribute("id","renderCanvas");
webglCanvas.setAttribute("touch-action","none");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createScene(webglCanvas);
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(webglCanvas){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
webglCanvas.removeEventListener(a + "move", r),
webglCanvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
webglCanvas.addEventListener(a + "move", scene._onPointerMove, !1),
webglCanvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createScene(webglCanvas);
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(webglCanvas){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
webglCanvas.removeEventListener(a + "move", r),
webglCanvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
webglCanvas.addEventListener(a + "move", scene._onPointerMove, !1),
webglCanvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas;
public engine;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
var container = document.getElementById("annieEngine");
var w = document.documentElement.clientWidth || document.body.clientWidth;
var h = document.documentElement.clientHeight || document.body.clientHeight;
document.getElementById("_a2x_canvas").style.position = "absolute";
document.getElementById("_a2x_canvas").setAttribute("touch-action","none");
var webglCanvas = document.createElement("canvas");
webglCanvas.width = w;
webglCanvas.height = h;
container.appendChild(webglCanvas);
this.engine=new BABYLON.Engine(webglCanvas, true);
this.scene = this.createSceneBefore(webglCanvas);
var _canvas:any=document.getElementById("_a2x_canvas")
this.engine.getRenderingCanvas=()=>{
return _canvas;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createSceneBefore(webglCanvas){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
webglCanvas.removeEventListener(a + "move", r),
webglCanvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
webglCanvas.addEventListener(a + "move", scene._onPointerMove, !1),
webglCanvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine["getRenderingCanvas"]=()=>{
return document.getElementById("_a2x_canvas");
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine["getRenderingCanvas"]=()=>{
return document.getElementById("_a2x_canvas");
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this["engine.getRenderingCanvas"]=()=>{
return document.getElementById("_a2x_canvas");
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.querySelector("#_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.getRenderingCanvas=()=>{
return this.canvas2;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.querySelector("#_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
/* this.engine.getRenderingCanvas=()=>{
return this.canvas2;
}; */
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.getElementById("_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.getElementById("#_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.getElementById("#_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.engine
this.scene = this.createScene();
this.engine.getRenderingCanvas=()=>{
return this.canvas2;
};
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
export class YtSceneManager{
public stage;
public scene:BABYLON.Scene;
public canvas:any=document.querySelector("#renderCanvas");
public canvas2:any=document.getElementById("#_a2x_canvas");
public engine=new BABYLON.Engine(this.canvas, true, {
deterministicLockstep: true,
lockstepMaxSteps: 2
});;
private static instance: YtSceneManager;
public static get ins(): YtSceneManager {
if (!this.instance) {
this.instance = new YtSceneManager();
}
return this.instance;
}
constructor(){
this.init()
}
public init(){
this.engine.getRenderingCanvas=()=>{
return this.canvas2;
};
this.scene = this.createScene();
this.engine.runRenderLoop(()=>{
this.scene.render();
TWEEN.update();
});
window.addEventListener("resize", ()=> {
this.engine.resize();
});
}
public createScene(){
var scene = new BABYLON.Scene(this.engine);
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this.canvas.removeEventListener(a + "move", r),
this.canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = (e)=>{
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = (e)=> {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = (e)=> {
void 0 !== e.pointerId && r(e)
}
,
this.canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this.canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
return scene;
}
/* public get stage(): any {
return this._stage;
}*/
/* public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
} */
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
/* for(var l of SceneManager.ins.scene.meshes){
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
YtSceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
......@@ -92,7 +92,7 @@ export class YtSceneManager{
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
// YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
......@@ -108,7 +108,7 @@ export class YtSceneManager{
}
}
}*/
YtSceneManager.ins.stage=display;
// YtSceneManager.ins.stage=display;
}
/* public change(module){
......
......@@ -46,10 +46,10 @@ export class YtAssetsManager {
meshTask.onSuccess = function (task) {
console.log("meshTask")
console.log(task)
task.loadedMeshes.forEach(function(mesh){
/* task.loadedMeshes.forEach(function(mesh){
mesh.isVisible=false;
mesh.name="noneisVisible_"+mesh;
})
}) */
let _thisMesh=task;
_thisModel[model.name]=_thisMesh
this._resourceObject.models[sceneName]=_thisModel;
......
......@@ -92,7 +92,7 @@ export class YtSceneManager{
l.dispose()
} */
YtSceneManager.ins.scene.meshes=[]
// YtSceneManager.ins.scene.meshes=[]
/*var j;
for(j in SceneManager.ins.stage){
......@@ -108,7 +108,7 @@ export class YtSceneManager{
}
}
}*/
YtSceneManager.ins.stage=display;
// YtSceneManager.ins.stage=display;
}
/* public change(module){
......
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