Skip to content

Fix addConvexGeometry not setting the transform properly.#3717

Closed
cyberneticocult wants to merge 2 commits intowebaverse:masterfrom
cyberneticocult:fix-add-convex-geometry-transform
Closed

Fix addConvexGeometry not setting the transform properly.#3717
cyberneticocult wants to merge 2 commits intowebaverse:masterfrom
cyberneticocult:fix-add-convex-geometry-transform

Conversation

@cyberneticocult
Copy link

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.

@lalalune
Copy link
Contributor

ty for this, will review

@memelotsqui
Copy link
Contributor

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: webaverse/totum#154

@lalalune lalalune closed this Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants