app icon indicating copy to clipboard operation
app copied to clipboard

Fix addConvexGeometry not setting the transform properly.

Open cyberneticocult opened this issue 2 years ago • 2 comments

Meshes that were using convexMesh type would have their highlighted mesh in edit mode appear in the wrong location while the actual collision hull in the physics scene would be in the right location.

physicsManager.addConvexGeometry() uses the original mesh passed as a parameter to set the transform. It should be the physicsMesh built by convertMeshToPhysicsMesh() that's used to set the transform.

cyberneticocult avatar Sep 17 '22 17:09 cyberneticocult

ty for this, will review

lalalune avatar Sep 20 '22 14:09 lalalune

I do believe that this pr is necessary, as no other collider uses the base mesh position/scale/rotation. They are all using the physics mesh data, and it is indeed fixing when importing hull meshes. The closest example to look at would be addGeometry(mesh), and it is actually using physicsMesh data:

image

Also it will be necessary for the totum omi_collider pr support to work with hulls: https://github.com/webaverse/totum/pull/154

memelotsqui avatar Sep 21 '22 21:09 memelotsqui