Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Scene-graph into separate subsystems #21

Open
GoogleCodeExporter opened this issue Apr 15, 2016 · 0 comments
Open

Refactor Scene-graph into separate subsystems #21

GoogleCodeExporter opened this issue Apr 15, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Right now Yngine Scene-graph implements nodes with loose attributes. Attributes 
represent node states, like transformation, render geometry, etc. This has a 
big disadvantage: An engine subsystem has to query for attributes of known 
type, e.g. renderer queries for TransformationAttribute and GeometryAttribute 
to draw the primitives. As a result, all data in Scene-graph structure merge 
together and become hard to distinguish.

This should be changed. Scene-graph will define structure of the world and keep 
a list of active world-subsystems. Every subsystem will register specific 
attributes for each node. At Scene-graph traversal, each subsystem receives the 
corresponding attributes automatically at invocation time.

Example:
The world will activate OpenGL renderer, custom world logic (currently 
implemented as GLRenderers "Strategy" classes) and JBullet physics sub-systems. 
We add a camera, lights and a few objects into the Scene-graph as abstract 
nodes.

For OpenGL renderer we register a CameraAttribute for the camera node, 
LightAttribute for the lights and GeometryAttributes for the world objects. For 
JBullet subsystem we register only RigidBodyAttributes for the world objects 
and connect MotionState to the OpenGLRenderer's TransformAttributes.

The custom world logic subsystem will get a "StrategyAttribute" registered for 
every logic-controlled world object. These strategies will get applied based on 
a given conditions, e.g.: Time-based invocation.

This example shows, how complex this refactoring can become. Attributes become 
assigned to specific parts of the engine, while comunicating together. They 
start having inputs and outputs. The update/render pipeline has to invoke every 
subsystem for specific nodes, or for the whole Scene-graph at a correct time 
durring the main loop. Physics subsystem has to dispatch events, like 
touch-event, so the whole world can react.

End of example.

This is just the basic idea. Think about the best way of doing such separation 
and describe the best solution in this issue before implementation.

Original issue reported on code.google.com by yinotaurus on 28 Mar 2011 at 2:02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant