Skip to content

Polygon-polygon minimum translation vector appears invalid #7

@Slaktus

Description

@Slaktus

Calling IntersectMTV with two rotated polygons leads to strange behaviour:

  • MTV is not normalized
  • MTV orientation may be incorrect depending on the orientation of the collision
  • Depending on orientation of intersection, the MTV only gets calculated if poly2 completely contains poly1, or at least it appears the center point of poly1 must be contained by poly2

https://imgur.com/a/CSnDjWi

Let me know what more information you need, if any. I'm using a modified version of 4ed1885 adapted to use Unity.Mathematics types and math functions. I'm also avoiding allocations by reusing cached objects rather than constructing new ones, but other than that, the code should be the same.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions