Skip to content

collide() response does not work #12

@tancak

Description

@tancak

When I collide 2 polygons and check the response for the overlap the response is not modified. I have attached a short piece of code to show what I mean.

from collision import *
from collision import Vector as v

p1 = Concave_Poly(v(0,0), [v(0,0), v(10,10), v(10,0)])
p2 = Concave_Poly(v(0,0), [v(0,0), v(0,5), v(5,5), v(5,0)])

r = Response()
r.reset()
c = collide(p1, p2, response = r)

if c:
    print(r)

The two polygons clearly overlap but the response is:

Response [
        a = None

        b = None

        overlap = inf
        overlap_n = Vector [0, 0]
        overlap_v = Vector [0, 0]
        a_in_b = True
        b_in_a = True
]

I'm running this with Python 3.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions