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

PhysicsAggregate does not update mesh with setAngularVelocity and setLinearVelocity after 7.2.1 update #14986

Closed
miradontsoa opened this issue Apr 16, 2024 · 5 comments

Comments

@miradontsoa
Copy link

miradontsoa commented Apr 16, 2024

Hello,
After updating from 7.2.0 to 7.2.1, in the following code, the cube does not rotate and does not move anymore:


// Moving cube
  const movingCube = BABYLON.MeshBuilder.CreateBox(
    'moving_cube',
    { height: 1, width: 1, depth: 1 },
    scene
  )

  const movingCubePhysicsAggregate = new BABYLON.PhysicsAggregate(
    movingCube,
    BABYLON.PhysicsShapeType.BOX,
    {
      mass: 1,
      restitution: 0.1,
      friction: 0.4,
      startAsleep: false
    },
    scene
  )
  movingCubePhysicsAggregate.body.setMotionType(BABYLON.PhysicsMotionType.ANIMATED) // PhysicsMotionType is ANIMATED
  movingCubePhysicsAggregate.body.setAngularVelocity(new BABYLON.Vector3(0, 1, 0))
  movingCubePhysicsAggregate.body.setLinearVelocity(new BABYLON.Vector3(0, 1, 0))

I do not know if this is related ot the following pull request:
#14972

@RaananW
Copy link
Member

RaananW commented Apr 16, 2024

Thanks for reporting!
We use github issues to track existing issues in code, and prefer discussions on the forum (like the bug template has suggested). cc @CedricGuillemet.
Would be great if you could ping us on the forum with the code.

@CedricGuillemet - please reopen if needed.

@RaananW RaananW closed this as completed Apr 16, 2024
@CedricGuillemet
Copy link
Contributor

#14990

@CedricGuillemet
Copy link
Contributor

as a work around, until next release, you can toggle the disableSync flag

https://playground.babylonjs.com/#3KHPED

@miradontsoa
Copy link
Author

Thanks for reporting! We use github issues to track existing issues in code, and prefer discussions on the forum (like the bug template has suggested). cc @CedricGuillemet. Would be great if you could ping us on the forum with the code.

@CedricGuillemet - please reopen if needed.

OK, I will do so for next one

@miradontsoa
Copy link
Author

Fixed in 7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants