Search Unity

(Suggestion for ECS) Allow TransformSystem to account for generic use of only "Position".

Discussion in 'Entity Component System' started by Mr-Mechanical, Nov 9, 2018.

  1. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    Here's what I mean by a "generic" use of "Position"...

    Normally TransformSystem will add LocalToWorld matrix to any entity with Position or Rotation or Scale. This makes sense. However, there are use cases when users will use just "Position" alone to describe something and it doesn't require a hierarchy transformation matrix. The problem is you'll have an extra 4x4 float matrix per entity.

    Obviously, this is just a minor thing. I really like what Unity is doing with ECS. Seriously amazing how easy it is to get performant code with ECS.

    For more details, I mention this somewhere in this thread: https://forum.unity.com/threads/how...d-for-meshinstacerenderer-in-pure-ecs.579268/
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,684
    I don’t understand your problem, just not use it, if you don’t want TransformSystem, write your own MyPosition and use it, or create your World and use Position on entities in your world (which not be used in default world thus TS not use it).
     
    Mr-Mechanical likes this.
  3. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    It's a good option and I had mentioned it in the thread. But yeah, I just like the idea of reusing unity's Position (this is definitely a bit nit-picky).