Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization of BoxImpostor and CannonJSPlugin #7928

Closed
joergplewe opened this issue Mar 27, 2020 · 0 comments
Closed

Initialization of BoxImpostor and CannonJSPlugin #7928

joergplewe opened this issue Mar 27, 2020 · 0 comments
Assignees
Milestone

Comments

@joergplewe
Copy link
Contributor

see https://forum.babylonjs.com/t/initialization-of-boximpostor-and-cannonjsplugin/9515

Moving meshes (e.g. mesh.position.y = 3) AFTER creating a BoxImpostor during initialization phase (means before first physics update cycle) causes a big initial velocity.

This is only the case with the CannonJSPlugin.

Expected: Mesh is just positioned at the given place.
Found: Mesh erratically moves around.

const SHOW_BUG = true;
var box = BABYLON.MeshBuilder.CreateBox("box", {}, scene);
if (!SHOW_BUG) { box.position.y = 3; }
var impostor = new BABYLON.PhysicsImpostor( box, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 1}, scene);
if (SHOW_BUG) { box.position.y = 3; }

https://playground.babylonjs.com/#6HFBC4#1

@RaananW RaananW self-assigned this Mar 27, 2020
@RaananW RaananW added this to the 4.2 milestone Mar 27, 2020
@RaananW RaananW added the in progress Someone is currently working on this issue label May 13, 2020
@RaananW RaananW closed this as completed May 13, 2020
@RaananW RaananW removed the in progress Someone is currently working on this issue label May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants