Skip to content

Can't destroy the scene in order to create it again. "scene is not defined". #335

@SoulDesignerTom

Description

@SoulDesignerTom

Describe the bug
I'm trying to use xeogl for a website. The problem is that i have multiple scenes defined like:

var scene = new xeogl.Scene({ id: 'lcb', canvas: "lcbCanvas" });

Everything works very well - except i would like to make performance better and destroy scene every time it closes on click function.
I'm trying to use something like:

scene.destroy() each time i'm closing view of the scene. But i've got an error: Uncaught ReferenceError: scene is not defined.

I was also trying to manually remove <canvas> from HTML DOM - but then when i wanna create scene again it sais that scene already exists: xeogl.js:27978 [ERROR] Scene 'lcb' already exists.

I was even trying to make variable var scene = global like scene = but it still doesn't work.
It doesn't give an error again about scene is not defined but - i still cannot recreate it.

Expected behavior
It should work: scene.destroy(); to eliminate scene.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions