Skip to content

Collision detection for "solid" shapes #1847

Answered by spydon
Toshik asked this question in Q&A
Discussion options

You must be logged in to vote

The hitboxes are indeed hollow, and we don't have any out of the box support for checking those type of collisions.
What you can do is to check if the aabb of the hitbox is completely contained within the other hitbox's aabb with containsAabb2, this will only give a rough estimation of whether there is a collision though, but it would work for most cases.
https://api.flutter.dev/flutter/vector_math/Aabb2/containsAabb2.html

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@spydon
Comment options

@st-pasha
Comment options

@spydon
Comment options

@st-pasha
Comment options

@spydon
Comment options

Answer selected by spydon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants