Why does angular rotation not affect the `rotation` property of the transform node?

The mesh position changes as expected, but the rotation doesn’t, even though it’s visibly rotating. Why is that? How can we read the mesh’s current rotation?

The setAngularVelocity method is changing the rotationQuaternion property of the box rather than rotation property. You can refer to it by swapping

label.text = `pos: ${box.position.y.toFixed(3)}; rot: ${box.rotation.y.toFixed(3)}`

with

label.text = `pos: ${box.position.y.toFixed(3)}; rot: ${box.rotationQuaternion.y.toFixed(3)}`

More details about rotation quaternions here:

2 Likes