gohyperr / hecs

A high performance lightweight ECS with a plugin ecosystem!
MIT License
23 stars 1 forks source link

Object3DSystem order: move to "just before presentation"? #24

Closed canadaduane closed 3 years ago

canadaduane commented 4 years ago

Currently, the Object3DSystem order is set to Group.Initialization; however, I think it would make more sense to move to "just before Presentation", e.g. Group.Presentation - 10

Use case: Because the order is currently Group.Initialization, I'm unable to easily synchronize the movement of HTML with the 3D transform of an Object3D (I'm always one frame behind).

Intuitively, I think it would make sense to move Object3DSystem to Group.Presentation - 10 as well:

  1. LookAtSystem -> Group.Initialization (1000)

  2. Object3DSystem -> Group.Initialization (1000) At this point, there is no "new transform" from simulation, so we are always copying whatever happened in the "prior frame"

  3. WorldTransformSystem -> Group.Simulation - 10 (1990)

  4. RenderSystem -> Group.Presentation + 10 (3010)