1 #include "../math/math.aidl"
2 #include "animation.aih"
3 #include "geometry.aih"
4 #include "material.aih"
6 namespace awful { namespace scenegraph
8 // A rendering context. This represent one rendering into one pixmap (either the screen
9 // or a texture). A pointer to a rendering context is passed to the Renderables at evaluation time.
10 // A renderable can choose to create a new rendering context and evaluate a sub-scene into it.
11 // For instance a portal could render its target to a texture, and then append a geometry with just
12 // one quad with this texture into the rendering context it's been given.
14 // There is a global list of contexts. Each new context is inserted in front of the list, and they
15 // are rendered in order. In effect, it means that any sub context created when evaluating a renderable
16 // will be rendered first (as they are dependencies of the original context)
20 RenderContext( Pointer< ViewPort > pViewPort );
22 static void RenderAll();
23 static void ClearAll();
26 Pointer< ViewPort > pViewPort;
30 // A high-level renderable object. This is an interface.
31 // It can be a simple mesh, a composite mesh, a character, a world sector,
32 // a terrain, a culling object, a portal etc.
33 // The root object for the world is a Renderable.
37 void evaluate( Pointer< RenderContext > pContext );
41 // A spatial transformation node. It may have a parent, and a number of children.
42 // The transformation tree represented by those live independently of the tree of
43 // renderable objects, which points to Frames to define their positions.
44 // Object outside of the renderable tree (camera, collision entities, physics objects,
45 // game code objects, lights) will also point to and interact with those.
48 Pointer< Frame > pParent;
51 math::Matrix44f LocalToParent;
54 // An elementary renderable object. It points to a material, some geometric data, and
55 // some state data (like its position, or the position of all the bones it refers to)
56 // It can be anything from a billboard to a bunch of textured polygons to
57 // a particle system or a piece of terrain, depending on the shaders in the material
58 // and what kind of geometry is actually described.
59 class Drawable : Renderable
61 Pointer< Geometry > pGeometry;
62 Pointer< Material > pMaterial;
63 Pointer< Frame > pFrame;
65 //vector< Input > Uniforms;
70 Camera( Pointer< Frame > pFrame );
71 Pointer< Frame > pFrame;
77 ViewPort( Pointer< Camera > pCamera );
78 Pointer< Camera > pCamera;