Monday night: Joint add or set


So I need to add or set the `PhysicsJoint` component data depending whether one is already present.  However I'm not working with the `EntityManager`, I'm working with an `EntityCommandBuffer` which doesn't have the `EntityManager.HasComponent<T>(Entity)` that I need.  _(There's an `AddComponent)_

Can I have a query facility that I can use?  (e.g. a read-only `EntityManager`)  Or I see there's a `EntityQueryCommand`, `EntityQueryComponentCommand` and a `EntityQuerySharedComponentCommand`.

I guess the alternative is not trying to solve this in some magical ECS way but approach it the usual programming way: Have a data-structure that maps joints to entities.  I supposed this would have to be a struct-based one -- maybe that NativeHashMap or NativeMultiHashMap ?

Investigated `EntityQuery` -- array of entities with joints!  Inefficient but viable for testing. 

It's too  late for me to get any sort of entry together so guess I'll call this a night and finish this as a private experiment.  Has been fun and *very* educational.

<-PREV | NEXT->

Leave a comment

Log in with itch.io to leave a comment.