Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
任建锋
yt
Commits
11660e37
Commit
11660e37
authored
Jul 10, 2018
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rjf
parent
3466b741
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
4 deletions
+150
-4
package_20180710145442.json
.history/package_20180710145442.json
+14
-0
SceneManager_20180710145442.ts
.history/src/manager/SceneManager_20180710145442.ts
+134
-0
SceneManager.js
dist/manager/SceneManager.js
+0
-1
SceneManager.js.map
dist/manager/SceneManager.js.map
+1
-1
package.json
package.json
+1
-1
SceneManager.ts
src/manager/SceneManager.ts
+0
-1
No files found.
.history/package_20180710145442.json
0 → 100644
View file @
11660e37
{
"name"
:
"yt"
,
"version"
:
"1.0.13"
,
"description"
:
"基于Babylonjs的3D框架"
,
"main"
:
"./dist/index.js"
,
"types"
:
"./types/index.d.ts"
,
"scripts"
:
{
},
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"tc"
:
"git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
}
}
\ No newline at end of file
.history/src/manager/SceneManager_20180710145442.ts
0 → 100644
View file @
11660e37
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
dist/manager/SceneManager.js
View file @
11660e37
...
@@ -33,7 +33,6 @@ var SceneManager = /** @class */ (function () {
...
@@ -33,7 +33,6 @@ var SceneManager = /** @class */ (function () {
window
.
addEventListener
(
a
+
"up"
,
scene
.
_onPointerUp
,
!
1
);
window
.
addEventListener
(
a
+
"up"
,
scene
.
_onPointerUp
,
!
1
);
//下面的代码是为了设置微信上面的touch事件兼容
//下面的代码是为了设置微信上面的touch事件兼容
var
camera
=
new
BABYLON
.
FreeCamera
(
"baseCamera"
,
new
BABYLON
.
Vector3
(
0
,
0
,
0
),
scene
);
var
camera
=
new
BABYLON
.
FreeCamera
(
"baseCamera"
,
new
BABYLON
.
Vector3
(
0
,
0
,
0
),
scene
);
this
.
engine
.
setHardwareScalingLevel
(
0.6
);
return
scene
;
return
scene
;
}
}
}.
bind
(
this
);
}.
bind
(
this
);
...
...
dist/manager/SceneManager.js.map
View file @
11660e37
{"version":3,"file":"SceneManager.js","sourceRoot":"","sources":["../../src/manager/SceneManager.ts"],"names":[],"mappings":";;AACA;IAgBI;QAEA,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAA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AAI,CAAC,CAAC,CAAC;IAClB,CAAC;IAhED,sBAAkB,mBAAG;aAArB;YACI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;aACtC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IA6DF;;QAEI;IAEL;;;;;;;;;;UAUM;IAEG,6BAAM,GAAb,UAAc,OAAO;QAClB;;;;YAII;QAEJ;;aAEK;QAEJ,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAC,EAAE,CAAA;QAEhC;;;;;;;;;;;;;WAaG;QACH,YAAY,CAAC,GAAG,CAAC,KAAK,GAAC,OAAO,CAAC;IACnC,CAAC;IAaL,mBAAC;AAAD,CAAC,AApID,IAoIC;AApIY,oCAAY"}
\ No newline at end of file
\ No newline at end of file
package.json
View file @
11660e37
{
{
"name"
:
"yt"
,
"name"
:
"yt"
,
"version"
:
"1.0.1
2
"
,
"version"
:
"1.0.1
3
"
,
"description"
:
"基于Babylonjs的3D框架"
,
"description"
:
"基于Babylonjs的3D框架"
,
"main"
:
"./dist/index.js"
,
"main"
:
"./dist/index.js"
,
"types"
:
"./types/index.d.ts"
,
"types"
:
"./types/index.d.ts"
,
...
...
src/manager/SceneManager.ts
View file @
11660e37
...
@@ -57,7 +57,6 @@ export class SceneManager{
...
@@ -57,7 +57,6 @@ export class SceneManager{
//下面的代码是为了设置微信上面的touch事件兼容
//下面的代码是为了设置微信上面的touch事件兼容
var
camera
=
new
BABYLON
.
FreeCamera
(
"baseCamera"
,
new
BABYLON
.
Vector3
(
0
,
0
,
0
),
scene
);
var
camera
=
new
BABYLON
.
FreeCamera
(
"baseCamera"
,
new
BABYLON
.
Vector3
(
0
,
0
,
0
),
scene
);
this
.
engine
.
setHardwareScalingLevel
(
0.6
)
return
scene
;
return
scene
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment