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.
Reactions are currently unavailable
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.