PhysicsAggregate does not update mesh with setAngularVelocity and setLinearVelocity after 7.2.1 update
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: https://github.com/BabylonJS/Babylon.js/pull/14972
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.
https://github.com/BabylonJS/Babylon.js/pull/14990
as a work around, until next release, you can toggle the disableSync flag
https://playground.babylonjs.com/#3KHPED
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
Fixed in 7.3