You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calling Phaser.Physics.Matter.Sprite.setScale(...) also resets the rotational inertia
Version
Phaser Version: Phaser v3.60.0-beta.18
Operating system: Windows 10
Browser: N/A, tested on chrome and firefox
Description
calling Phaser.Physics.Matter.Sprite.setScale(...) also resets the rotational inertia
When setting up matter bodies, we have to first set scale and then call setFixedRotation, otherwise setFixedRotation has no effect
Example Test Code
To demonstrate, open this example: https://labs.phaser.io/edit.html?src=src/physics/matterjs/fixed%20rotation.js
and add this to line 34: block.setFixedRotation(); block.setScale(0.7); Notice how the box rotates
if you instead switch the sequence block.setScale(0.7); block.setFixedRotation(); Notice how the box does not rotate as expected
The text was updated successfully, but these errors were encountered:
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
calling
Phaser.Physics.Matter.Sprite.setScale(...)
also resets the rotational inertiaVersion
Description
calling
Phaser.Physics.Matter.Sprite.setScale(...)
also resets the rotational inertiaWhen setting up matter bodies, we have to first set scale and then call setFixedRotation, otherwise setFixedRotation has no effect
Example Test Code
To demonstrate, open this example: https://labs.phaser.io/edit.html?src=src/physics/matterjs/fixed%20rotation.js
and add this to line 34:
block.setFixedRotation(); block.setScale(0.7);
Notice how the box rotatesif you instead switch the sequence
block.setScale(0.7); block.setFixedRotation();
Notice how the box does not rotate as expectedThe text was updated successfully, but these errors were encountered: