Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Transform Processor #53

Closed
ghost opened this issue May 11, 2016 · 7 comments
Closed

Transform Processor #53

ghost opened this issue May 11, 2016 · 7 comments
Assignees
Labels
diff: easy Achievable by a single junior developer with a bit of guidance. pri: important Something other teams are relying on, or a low-level, critical piece of functionality. type: feature A request for a new feature.
Milestone

Comments

@ghost
Copy link

ghost commented May 11, 2016

A transform system is a pretty common way to handle the scene graph. Basically it takes a Local Transform and a Parent entity and calculates the Global Transform. This allows objects that are attacked to the parent entity to follow it around. An object without a parent global transform is it's local transform, but it is stored as a separate value.

The Parent systems might be ok to handle separately as they can be used to do neat things like handle deletes in a clean way. Deleting the parent entity should delete all child entities.

@ghost ghost added diff: easy Achievable by a single junior developer with a bit of guidance. type: feature A request for a new feature. note: help wanted labels May 11, 2016
@kvark
Copy link
Member

kvark commented May 11, 2016

it also can be done by the system that updates transformations: if it finds an entity parent alive, it updates the current entity model matrix. If the parent is dead, it removes the current entity.

@kvark
Copy link
Member

kvark commented May 11, 2016

Possible approaches to making sure the parent transform is up to date when processing a child:

  1. ignore that. Worst thing is 1 frame latency within the transformation
  2. enforce the children entities always having higher indices from the parents, so just iterating them as usual gives you proper results
  3. do recursive walk over the tree - this may be slow, and not canonical to ECS

@lukebitts
Copy link

Is the engine going to use some kind of spatial structure? I ask this because in my own entity/component project I wanted to do frustrum culling and it was really annoying to keep the spatial tree in sync with creation and destruction of entities.

@kvark
Copy link
Member

kvark commented May 19, 2016

@lukebitts we can start with simple parent-child relationships and culling on per-entity level. If we get a spatial structure, it's going to be its own component storage, so part of the syncing headache is going to be addressed automatically by the ECS. It's not completely clear as to how exactly this will work in the long-term, but short-term we are all set.

@OvermindDL1
Copy link

The Spatial Structures in mine were just other Systems that listened to and worked with position and other components. Many often did add another specific component to the entities for meta-data (octree and such).

@ebkalderon ebkalderon added the pri: important Something other teams are relying on, or a low-level, critical piece of functionality. label Sep 9, 2016
@LucioFranco LucioFranco changed the title Transform System Transform Processor Sep 11, 2016
@ebkalderon ebkalderon added this to the 1.0 milestone Sep 14, 2016
@fHachenberg
Copy link

Can such a "transform processor" be understood as a very simple kinematic simulator? In which cases does one use the transform processor and in which cases does one for example let the physics engine solve rigid body joint constraints instead? What kind of scene graph functionality do you have in mind for amethyst?

@kvark
Copy link
Member

kvark commented Sep 16, 2016

I see the Transform Processor role to simply resolve hierarchical parent-child links and keep the world transformation per entity up to date.

Doing any sort of physics integration should be left out to a different processor. That, in theory. Problem would be that the physics would need to work on those world positions, may be modify them, and then we'd need to propagate the changes back to the local positions...

So, I guess we can't have both at the same time, and it's fine.

On Sep 16, 2016, at 5:13, Fabian Hachenberg notifications@github.com wrote:

Can such a "transform processor" be understood as a very simple kinematic simulator? In which cases does one use the transform processor and in which cases does one for example let the physics engine solve rigid body joint constraints instead? What kind of scene graph functionality do you have in mind for amethyst?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diff: easy Achievable by a single junior developer with a bit of guidance. pri: important Something other teams are relying on, or a low-level, critical piece of functionality. type: feature A request for a new feature.
Projects
None yet
Development

No branches or pull requests

6 participants