pex-renderer icon indicating copy to clipboard operation
pex-renderer copied to clipboard

Port to ECS

Open vorg opened this issue 3 years ago • 2 comments

Log of outstanding issues and roadblocks

  • [x] assumption that every entity has transform, entity was adding transform in it's constructor -> removed that assumption in line with ECS in Nodes
    • transform.enabled could enable/disable whole entity
  • [ ] in pex-renderer camera was updating it's own matrices, in nodes it's the ecs.Camera node via pex-cam, i we add "just data" camera in ecs, we need proper camera system?
  • [x] it is assumed that all entities are children of root entity and entities array is rebuilt every frame by traversing transform tree -> removed, call renderer.add to push entities to an array, might remove that indirection in the future as well and access entities directly
  • [ ] how system can find other systems if systems is array of plain objects with update function. Do we need "type" property on them? Why not Classes then?
  • [x] who is responsible for passing ctx to systems and when? -> currently done in renderer.createSystem
  • [ ] default component properties are exploited quite a lot e.g. in renderer cullFace: material.cullFaceMode assumes that cullFaceMode is well defined

Open Questions

  • [ ] factory functions vs objects
  • [ ] system naming systems/geometry-system ugh

vorg avatar Jun 06 '22 16:06 vorg

The tags and parent params were switched in createEntity factory function

return createEntity(components, tags, this);
export default function createEntity(components, parent, tags) {
constructor(components, tags, renderer) {

vorg avatar Jun 06 '22 16:06 vorg

  • [ ] can't pan with the current orbiter implementation in camera-system

vorg avatar Jun 07 '22 21:06 vorg