Skip to content

Commit ed88f87

Browse files
author
Sascha Braun
committed
remove library debugging prints and logs
1 parent 2055f24 commit ed88f87

20 files changed

+39
-145
lines changed

samples/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import router from "./router";
66
Vue.config.productionTip = false;
77

88
new Vue({
9-
router,
10-
render: h => h(App)
9+
render: h => h(App),
10+
router
1111
}).$mount("#app");

samples/router.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ Vue.use(Router);
1010
export default new Router({
1111
routes: [
1212
{
13-
path: "/",
13+
component: Home,
1414
name: "home",
15-
component: Home
15+
path: "/"
1616
},
1717
{
18-
path: "/demo",
18+
component: Demo,
1919
name: "demo",
20-
// route level code-splitting
21-
// this generates a separate chunk (about.[hash].js) for this route
22-
// which is lazy-loaded when the route is visited.
23-
component: Demo
20+
path: "/demo"
2421
}
2522
]
2623
});

samples/views/MyBehaviour.ts

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export class MyBehaviour extends Mixins(Behaviour) {
2222
private camera!: THREE.PerspectiveCamera;
2323

2424
public created() {
25-
console.log("created my behaviour", this);
2625
if (!this.data) {
2726
throw new Error("Could not initialize MyBehaviour: data is missing");
2827
}
@@ -49,7 +48,6 @@ export class MyBehaviour extends Mixins(Behaviour) {
4948
}
5049

5150
public beforeDestroy() {
52-
console.log("before destroy mybehaviour");
5351
this.controls.dispose();
5452
}
5553

samples/views/OrbitControls.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable
12
import * as THREE from "three";
23

34
const STATE = {

src/components/Behaviour.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class Behaviour extends Mixins(
1515
}
1616

1717
public beforeDestroy() {
18-
console.log("before destroy behaviour");
1918
if ((this as any).update) {
2019
this.app().off("update", (this as any).update);
2120
}

src/components/Camera.tsx

+3-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ThreeComponent, ThreeSceneComponent } from "./base";
66

77
@Component
88
export class Camera extends Mixins(ThreeComponent, ThreeSceneComponent) {
9-
@Prop({ required: true })
9+
@Prop({ type: String, default: "" })
1010
private name!: string;
1111

1212
@Prop({ default: true, type: Boolean })
@@ -47,24 +47,20 @@ export class Camera extends Mixins(ThreeComponent, ThreeSceneComponent) {
4747
}
4848

4949
public onDeactivate() {
50-
console.log("deactivate camera", this.name);
51-
5250
const manager = this.app().cameraManager;
5351
if (this.m_camera === manager.main) {
5452
manager.main = undefined;
5553
}
5654
}
5755

5856
public async onActivate() {
59-
console.log("activate camera", this.name);
60-
6157
const manager = this.app().cameraManager;
6258
manager.main = this.m_camera;
6359
}
6460

6561
public async created() {
66-
console.log("camera created");
6762
this.m_camera = await this.factory(this.app().renderer.getSize());
63+
this.m_camera.name = this.name;
6864
this.onChangeMain();
6965

7066
this.m_created = true;
@@ -78,11 +74,6 @@ export class Camera extends Mixins(ThreeComponent, ThreeSceneComponent) {
7874
if (!this.main || !this.m_created) {
7975
return null;
8076
}
81-
return (
82-
<div className="camera">
83-
<span>Camera</span>
84-
<ul>{this.$slots.default}</ul>
85-
</div>
86-
);
77+
return <div>{this.$slots.default}</div>;
8778
}
8879
}

src/components/Fog.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export class Fog extends Mixins(ThreeComponent, ThreeSceneComponent) {
7878
}
7979

8080
public beforeDestroy() {
81-
console.log("fog beforeDestroy");
8281
const scene = this.scene();
8382
scene.fog = null;
8483
}
@@ -87,10 +86,6 @@ export class Fog extends Mixins(ThreeComponent, ThreeSceneComponent) {
8786
if (!this.m_created) {
8887
return null;
8988
}
90-
return (
91-
<div className="fog">
92-
<span>Fog</span>
93-
</div>
94-
);
89+
return <div />;
9590
}
9691
}

src/components/Geometry.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ export class Geometry extends Mixins(ThreeComponent, ThreeAssetComponent) {
1212
public factory!: GeometryFactory;
1313

1414
public async created() {
15-
console.log("created geometry", this.name);
1615
this.asset = this.factory();
1716
this.app().assets.add(this.name, AssetTypes.GEOMETRY, this.asset);
1817
}
1918

2019
public async beforeDestroy() {
21-
console.log("beforeDestroy geometry", this.name);
2220
this.app().assets.remove(this.name, AssetTypes.GEOMETRY);
2321
}
2422

2523
public render(h: any) {
26-
return <div className="geometry">Geometry {this.name}</div>;
24+
return <div />;
2725
}
2826
}

src/components/Group.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Group extends Mixins(
99
ThreeSceneComponent,
1010
ThreeObjectComponent
1111
) {
12-
@Prop({ required: true })
12+
@Prop({ type: String, default: "" })
1313
private name!: string;
1414

1515
@Provide("object")
@@ -30,14 +30,14 @@ export class Group extends Mixins(
3030
}
3131

3232
this.m_group = new THREE.Group();
33+
this.m_group.name = this.name;
3334
const parent = this.object ? this.object() : this.scene();
3435
parent.add(this.m_group);
3536

3637
this.m_created = true;
3738
}
3839

3940
public beforeDestroy() {
40-
console.log("group beforeDestroy");
4141
const parent = this.object ? this.object() : this.scene();
4242
parent.remove(this.m_group);
4343
}
@@ -46,11 +46,6 @@ export class Group extends Mixins(
4646
if (!this.m_created) {
4747
return null;
4848
}
49-
return (
50-
<div className="group">
51-
<span>Group {this.name}</span>
52-
<ul>{this.$slots.default}</ul>
53-
</div>
54-
);
49+
return <div>{this.$slots.default}</div>;
5550
}
5651
}

src/components/Light.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Light extends Mixins(
1010
ThreeSceneComponent,
1111
ThreeObjectComponent
1212
) {
13-
@Prop({ required: true })
13+
@Prop({ type: String, default: "" })
1414
private name!: string;
1515

1616
@Prop({ required: true, type: Function })
@@ -34,14 +34,14 @@ export class Light extends Mixins(
3434
}
3535

3636
this.m_light = await this.factory();
37+
this.m_light.name = this.name;
3738
const parent = this.object ? this.object() : this.scene();
3839
parent.add(this.m_light);
3940

4041
this.m_created = true;
4142
}
4243

4344
public beforeDestroy() {
44-
console.log("light beforeDestroy");
4545
const parent = this.object ? this.object() : this.scene();
4646
parent.remove(this.m_light);
4747
}
@@ -50,11 +50,6 @@ export class Light extends Mixins(
5050
if (!this.m_created) {
5151
return null;
5252
}
53-
return (
54-
<div className="light">
55-
<span>Light {this.name}</span>
56-
<ul>{this.$slots.default}</ul>
57-
</div>
58-
);
53+
return <div>{this.$slots.default}</div>;
5954
}
6055
}

src/components/Material.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ export class Material extends Mixins(ThreeComponent, ThreeAssetComponent) {
1212
private factory!: MaterialFactory;
1313

1414
public created() {
15-
console.log("created material", this.name);
1615
this.asset = this.factory();
1716
this.app().assets.add(this.name, AssetTypes.MATERIAL, this.asset);
1817
}
1918

2019
public async beforeDestroy() {
21-
console.log("beforeDestroy material", this.name);
2220
this.app().assets.remove(this.name, AssetTypes.MATERIAL);
2321
}
2422

2523
public render(h: any) {
26-
return <div className="material">Material {this.name}</div>;
24+
return <div />;
2725
}
2826
}

src/components/Mesh.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Mesh extends Mixins(
1010
ThreeSceneComponent,
1111
ThreeObjectComponent
1212
) {
13-
@Prop({ required: true, type: String })
13+
@Prop({ type: String, default: "" })
1414
private name!: string;
1515

1616
@Prop({ required: true, type: String })
@@ -68,6 +68,7 @@ export class Mesh extends Mixins(
6868
geometry as GeometryType,
6969
material as MaterialType
7070
);
71+
this.m_mesh.name = this.name;
7172

7273
const parent = this.object ? this.object() : this.scene();
7374
parent.add(this.m_mesh);
@@ -76,7 +77,6 @@ export class Mesh extends Mixins(
7677
}
7778

7879
public beforeDestroy() {
79-
console.log("mesh beforeDestroy");
8080
const parent = this.object ? this.object() : this.scene();
8181
parent.remove(this.m_mesh);
8282
}
@@ -85,11 +85,6 @@ export class Mesh extends Mixins(
8585
if (!this.m_created) {
8686
return null;
8787
}
88-
return (
89-
<div className="mesh">
90-
<span>Mesh {this.name}</span>
91-
<ul>{this.$slots.default}</ul>
92-
</div>
93-
);
88+
return <div>{this.$slots.default}</div>;
9489
}
9590
}

src/components/Scene.tsx

+5-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { isThreeAssetComponent, ThreeAssetComponent, ThreeComponent } from "./ba
77

88
@Component
99
export class Scene extends Mixins(ThreeComponent) {
10-
@Prop({ required: true, type: String })
10+
@Prop({ type: String, default: "" })
1111
public name!: string;
1212

1313
@Prop({ default: false, type: Boolean })
@@ -45,8 +45,6 @@ export class Scene extends Mixins(ThreeComponent) {
4545
}
4646

4747
public async onDeactivate() {
48-
console.log("deactivate scene", this.name);
49-
5048
const manager = this.app().sceneManager;
5149
if (this.m_scene === manager.active) {
5250
manager.active = undefined;
@@ -59,10 +57,9 @@ export class Scene extends Mixins(ThreeComponent) {
5957
}
6058

6159
public async onActivate() {
62-
console.log("activate scene", this.name);
63-
6460
const manager = this.app().sceneManager;
6561
this.m_scene = new THREE.Scene();
62+
this.m_scene.name = this.name;
6663
manager.active = this.m_scene;
6764

6865
await Vue.nextTick();
@@ -105,36 +102,22 @@ export class Scene extends Mixins(ThreeComponent) {
105102
}
106103

107104
public mounted() {
108-
console.log("scene mounted");
109105
this.onChangeActive();
110106
}
111107

112108
public beforeDestroy() {
113-
console.log("scene beforeDestroy");
114109
this.onDeactivate();
115110
}
116111

117112
public render(h: any) {
118-
console.log("scene render");
119113
if (!this.m_isActive) {
120114
return null;
121115
}
122116

123-
const whenReady = (
124-
<div>
125-
<h3>Scene ready</h3>
126-
{this.$slots.default}
127-
</div>
128-
);
129-
130117
return (
131-
<div class="scene">
132-
<h2>Scene {this.name}</h2>
133-
<div>
134-
<h3>Preload</h3>
135-
{this.$slots.preload}
136-
</div>
137-
{this.m_isReady ? whenReady : null}
118+
<div>
119+
<div>{this.$slots.preload}</div>
120+
<div>{this.m_isReady ? this.$slots.default : null}</div>
138121
</div>
139122
);
140123
}

src/components/Texture.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export class Texture extends Mixins(ThreeComponent, ThreeAssetComponent) {
1616
public src?: string;
1717

1818
public created() {
19-
console.log("created texture", this.name);
2019
if (this.factory) {
2120
this.asset = this.factory();
2221
} else if (this.src) {
@@ -37,11 +36,10 @@ export class Texture extends Mixins(ThreeComponent, ThreeAssetComponent) {
3736
}
3837

3938
public async beforeDestroy() {
40-
console.log("beforeDestroy texture", this.name);
4139
this.app().assets.remove(this.name, AssetTypes.TEXTURE);
4240
}
4341

4442
public render(h: any) {
45-
return <div className="texture">Texture {this.name}</div>;
43+
return <div />;
4644
}
4745
}

0 commit comments

Comments
 (0)