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
I'm trying to combine legion with rapier2d for physics calculation and 2d . So if I make a query in rapier2d and get a certain rigid body or collider I want to be able to get the legion entity.
For this reason rapier2d provides a u128 userdata linked to each collider, however, the internal legion entity id (NonZeroU64) is private and can therefore not be used.
Would it be possible to provide a way to get the internal entity id and create a new entity using a known id, like:
collider.set_userdata(entity.get_id());
...
let entity = World::get_entity(collider.get_userdata() as NonZeroU64).unwrap();
Or do you even know of a a better solution? The only possible alternative that comes to my mind is building a separate u128 id and mapping it to legions entities. However, this is a lot of boilerplate and effectively managing ids on ids...
Thanks in advance and thanks for this incredible ECS!
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to combine legion with rapier2d for physics calculation and 2d . So if I make a query in rapier2d and get a certain rigid body or collider I want to be able to get the legion entity.
For this reason rapier2d provides a u128 userdata linked to each collider, however, the internal legion entity id (NonZeroU64) is private and can therefore not be used.
Would it be possible to provide a way to get the internal entity id and create a new entity using a known id, like:
Or do you even know of a a better solution? The only possible alternative that comes to my mind is building a separate u128 id and mapping it to legions entities. However, this is a lot of boilerplate and effectively managing ids on ids...
Thanks in advance and thanks for this incredible ECS!
The text was updated successfully, but these errors were encountered: