You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the slow response, I only see this now in my inbox...
As per the documentation for the Collider class, you can always reference the underlying SAT collider (Polygon or Circle) as collider.sat. Thus, collider.sat.rotate(angle) should work for you (though I haven't tested this myself).
As an addendum to my previous post:
After updating the underlying SAT collider object, two extra things need to be taken care of:
the AABB (axis-aligned bounding box) of the Collider needs to be updated. This is required for rbush to be able to do what is does. You can use the Collider.updateAABB() method for this.
the Collider must be added to the list of objects that have moved, in order to be checked for collisions in the next crash.check() call.
Note that both these actions are taken care of automatically when you use the Collider's built-in methods, like Polygon.rotate() for example. Isn't that the method you were looking for?
I see that the rotate function can be applied to Polygons but not Colliders. If I create a crash.Box, what's the best way to rotate it?
The text was updated successfully, but these errors were encountered: