Skip to content

ReferenceError: window is not defined when run AmmoPhysics in WebWorker #407

Description

@Lyoko-Jeremie

Describe the bug
i try to run enable3d in WebWorker.

create a AmmoPhysics with headless mode, and run in the WebWorker (use Comlink).

a error ReferenceError: window is not defined happend, it case from follow code :

webpack://PhantasySpatiotemporalSimulationStandaloneStarter/node_modules/@yandeu/tap/lib/eventMatrix.js
Image Image

i think that, if we not init control , we not need the Tap .

seems like it's a bug ?


BTW:

i want to run the ammo.js in webworker to offload heavy task to webworker. i try to create a AmmoPhysics and a Three.Scene in worker, and write a transfor layer to sync the Mesh state between main thread and worker.

i try to find a way to direct read Geometry from ammo.js, but no way to do that (right?). then i use the way that make 2 same Scene on worker and main to do that. (only different is that the worker side not create the renderer).

is any other way to do it ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions