Skip to content

Conversation

@ThierryBerger
Copy link
Owner

No description provided.

.map(|co| Entity::from_bits(co.user_data as u64))
.or_else(|| self.deleted_colliders.get(&handle).copied())
.expect("Internal error: entity not found for collision event.")
.get_unknown_gen(handle_index)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a possible fix: bypassing generational check. I'm not sure generation is very important for mapping colliders to entities 🤔 ; for a collider to change entity, we'd need either very cursed code, as from my understanding it would recreate a new collider within rapier (so another index).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my assumption is correct, we could simplify this mapping to map to index only rather than index + generation 💭 .

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems completely incorrect ; generation is updated when we remove an entry, so it's needed to be sure we're targeting the correct entity.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal error: entity not found for collision event with collider handle: ColliderHandle(Index { index: 0, generation: 0 }). is interesting:

There shouldn't be a generation 0 ; not after the first step 🤔 (maybe even not ever?) ; it seems to mean the arena grew unexpectedly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants