Es6 Havok display physics bodies grid abnormal

example: Babylon.js Playground (babylonjs.com)

In Playground online cases, the Physics Bodies grid display is normal.

But in my local development environment, I use ES6 to introduce the BABYLON library to get it. The grid display is abnormal.

Except for the different ways to import the bag, other code is exactly the same. I don’t know why this is like this.


image

import * as BABYLON from "@babylonjs/core";
import "@babylonjs/loaders/glTF";
import "@babylonjs/core/Rendering/outlineRenderer";
// import "@babylonjs/core/Debug/debugLayer";
import "@babylonjs/inspector";
// import "@babylonjs/core/Debug/debugLayer";
import HavokPhysics from "@babylonjs/havok";
import '@babylonjs/loaders';

...
code in codesanbox

I tried to make an ES6 case with Codesanbox, but it reported WASM errors.


It is normal to import a package to this

image

Adding @RaananW the master of all build things

1 Like

Yes, this looks right. But not if you have the @babylonjs/core package as dependency. You should import the classes you need from @babylonjs/docs (and leave the “babylonjs” out of the project).
It will also work better with Havok.

In general, try working with the es6 packages (the ones beginning with “@babylonjs”) and less with the umd packages

It is precisely because of the problem with @babylonjs/core,
Then there is no @babylonjs/docs in npmjs.

sorry, that was a typo on my end. i meant @babylonjs/core

You can see how it works in this template - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. . (github.com)
it’s just an example/template. you don’t have to use it, but you can learn from it for sure :slight_smile:

This is not a problem with ES6 use,
I think i has use it correct.


and
image

These two usages are theoretically correct.

But the rendering result is abnormal.

Forget it, don’t entangle this, I still use UMD

Using the warehouse you provided, I test it correct, but the @babylonjs/core version is different. I will try the same version and try

i @babylonjs/core 6.3.1
warehouse @babylonjs/core 6.0.0

It could be for the same reason as this
Install version 6.6.1 or later

1 Like

Yes,Updated to version 6.9.0, it is normal.

It is indeed a problem with version 6.3.1.

My local UMD version is also 6.9.0, so it is normal.

Thanks very much.

2 Likes