Jump to content

getDeltaTime weirdness


monkeyface
 Share

Recommended Posts

Calling beginFrame() or endFrame() for me doesn't help... I had to override the function completely.

 

I'm not doing anything special. The only thing perhaps is that I'm using Typescript... maybe that's changing the order or accessibility of something? I don't really know enough about the engine internals to know where to look though.

It seems to happen with both the stable and beta versions of babylon.

document.addEventListener("DOMContentLoaded", function () {    if (BABYLON.Engine.isSupported()) {    canvas = <HTMLCanvasElement>document.getElementById("renderCanvas");    engine = new BABYLON.Engine(canvas, true);    divFps = <HTMLElement>document.getElementById("fps");    scene = createScene();    // Resize    window.addEventListener("resize", function () {        engine.resize();    });    camera.attachControl(canvas, false);    engine.runRenderLoop(function () {        if (divFps) {            divFps.innerHTML = engine.getFps().toFixed() + " fps";        }        scene.render();        // Animations        skybox.rotation.y += 0.0001 * scene.getAnimationRatio();    });    }}, false);
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...