Moved loggers out of global module scope.
This commit is contained in:
parent
2f29b0a2de
commit
e27a77d674
@ -4,7 +4,6 @@ import log from "loglevel";
|
|||||||
|
|
||||||
|
|
||||||
export function beforeRenderObserver() {
|
export function beforeRenderObserver() {
|
||||||
const logger = log.getLogger('beforeRenderObserver');
|
|
||||||
if (this?.grabbedMesh?.physicsBody) {
|
if (this?.grabbedMesh?.physicsBody) {
|
||||||
const scene = DefaultScene.Scene;
|
const scene = DefaultScene.Scene;
|
||||||
const hk = (scene.getPhysicsEngine().getPhysicsPlugin() as HavokPlugin);
|
const hk = (scene.getPhysicsEngine().getPhysicsPlugin() as HavokPlugin);
|
||||||
@ -15,11 +14,11 @@ export function beforeRenderObserver() {
|
|||||||
hk.setPhysicsBodyTransformation(this.grabbedMesh.physicsBody, parent);
|
hk.setPhysicsBodyTransformation(this.grabbedMesh.physicsBody, parent);
|
||||||
hk.sync(this.grabbedMesh.physicsBody);
|
hk.sync(this.grabbedMesh.physicsBody);
|
||||||
} else {
|
} else {
|
||||||
logger.error("parent not found for " + this.grabbedMeshParentId);
|
log.getLogger('beforeRenderObserver').error("parent not found for " + this.grabbedMeshParentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.warn("no parent id");
|
log.getLogger('beforeRenderObserver').warn("no parent id");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,7 +152,8 @@ export class DiagramConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private beforeRender = () => {
|
private beforeRender = () => {
|
||||||
if (this.tick % 5 == 0) {
|
if (this.tick++ % 10 == 0) {
|
||||||
|
this.logger.trace('recalculating', this.tick);
|
||||||
this.recalculate();
|
this.recalculate();
|
||||||
this.setPoints();
|
this.setPoints();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {Introduction} from "./tutorial/introduction";
|
|||||||
|
|
||||||
const webGpu = false;
|
const webGpu = false;
|
||||||
|
|
||||||
//log.setLevel('debug', false);
|
log.setLevel('debug', false);
|
||||||
export class VrApp {
|
export class VrApp {
|
||||||
|
|
||||||
private engine: WebGPUEngine | Engine;
|
private engine: WebGPUEngine | Engine;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user