Note 1: Although the initial forum post states that cannon is working fine, it was found that cannon has the same problem when the rotation is not a multiple of 90 degrees. The playground was updated to demonstrate the problem on cannon.
Note 2: As mentioned in the forum, a suggested solution is to change physicsImposter.ts, line 613:
let size = boundingInfo.boundingBox.extendSizeWorld.scale(2);
…into…
let size = boundingInfo.boundingBox.extendSize.scale(2);
This has been tested on a local copy and confirmed to fix the problem on both cannon and ammo. Oimo's problem seem more severe (...mesh not rotated, impostor rotated incorrectly and does not match mesh) and is not fixed by the above, but is improved (...mesh still not rotated, but impostor correctly match mesh).
Note 3: While I would like to offer a PR. I did not setup build for a local copy of babylon. I tested the above by simply doing a search and replace on a minified local copy. Sorry.
The text was updated successfully, but these errors were encountered:
I see that getObjectExtendSize sets the rotationQuaternion to IDENTITY_QUATERNION before getting extendSizeWorld. If I'm not understanding this wrong, this means that if the mesh isn't a child, then extendSize and extendSizeWorld should be identical.
Repro
Screenshots
See Playground.
Desktop (please complete the following information):
NA.
Smartphone (please complete the following information):
NA.
Additional context
See forum post: https://forum.babylonjs.com/t/child-in-physics-compound-body-not-rotated-properly-under-ammo-js-and-oimo/13291
Note 1: Although the initial forum post states that cannon is working fine, it was found that cannon has the same problem when the rotation is not a multiple of 90 degrees. The playground was updated to demonstrate the problem on cannon.
Note 2: As mentioned in the forum, a suggested solution is to change physicsImposter.ts, line 613:
let size = boundingInfo.boundingBox.extendSizeWorld.scale(2);
…into…
let size = boundingInfo.boundingBox.extendSize.scale(2);
This has been tested on a local copy and confirmed to fix the problem on both cannon and ammo. Oimo's problem seem more severe (...mesh not rotated, impostor rotated incorrectly and does not match mesh) and is not fixed by the above, but is improved (...mesh still not rotated, but impostor correctly match mesh).
Note 3: While I would like to offer a PR. I did not setup build for a local copy of babylon. I tested the above by simply doing a search and replace on a minified local copy. Sorry.
The text was updated successfully, but these errors were encountered: