FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TriMesh physics offset issues · Issue #62 · enable3d/enable3d · GitHub

TriMesh physics offset issues #62

Description

I've just started playing with enable3d, and I really like it. When going through the Fantasy Book example, I noticed the comments and code regarding "unexpected offset" in the physics concave meshes. I did a little research and I found that the offset is exactly the mesh's parent object location ;)

The problem as far as I can see, is the code in _iterateGeometries which builds the transform assuming the "root" has the identity matrix as transform, since the body will get the local position/rotation of the "root".

However, this is not correct. If any of its parents has any transform (e.g. position/rotation set) these will not be taken into account in calculating the world transform for the physics mesh, resulting in offset/rotated physics.

My matrix math sucks, so I haven't come up with a fix for it yet, but I thought I'd share, for any other people running into weird positioning issues with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL