Skip to content

Entt and collision detection #677

Answered by skypjack
Adoro asked this question in Q&A
Mar 14, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Using a component based design doesn't mean that you've to do everything in terms of entities and components. In this case you want to perform a spatial lookup and a linear array in which things are moved to optimize linear accesses isn't the best choice. EnTT allows to create custom pools with which you can structure your data to easy the job, but that's an implementation detail and something pretty advanced.
In general, I'd suggest to still use something like a grid based lookup, a quad tree or any other approach suitable for a broad phase and the algorithm that fits best with your requirements (AABB or whatever) for the narrow phase. You can put entities in these data structures and us…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@hugoc7
Comment options

@skypjack
Comment options

Answer selected by Adoro
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants