Game Development Reference
In-Depth Information
render pass your scene node belongs to and should hold one value from the follow-
ing enumeration:
enum RenderPass
{
RenderPass_0,
// A constant to define the starting pass
RenderPass_Static = RenderPass_0,
// environments and level geometry
RenderPass_Actor,
// objects and things that can move
RenderPass_Sky,
// the background
'
behind
'
everything
RenderPass_NotRendered,
// objects that don
'
t render but exist
RenderPass_Last
// not used - a counter for for loops
};
Notice the member
RenderPass_NotRendered
? You might wonder why that is in
there at all, but there is a reason. Some objects in your scene graph need to be there
so they can be included in the scene, but they aren
'
t actually processed in any specific
render pass. A good example of these kinds of objects might be those that only show
up in your game editor, like trigger areas or spawn points.
—
It All Starts Here
SceneNode
That
ve seen the design for the
ISceneNode
interface and
what each scene node is supposed to implement. You
'
s it for the basics. You
'
ve also seen
SceneNodePro-
perties
and how it stores data that affects how the scene node draws. You
'
ve also
seen how the
RenderPass
setting groups renderable objects into broad categories of
renderability and render order.
Here
'
s the base implementation of
SceneNode
that inherits from the
ISceneNode
interface class:
'
typedef std::vector<shared_ptr<ISceneNode> > SceneNodeList;
class SceneNode : public ISceneNode
{
friend class Scene;
protected:
SceneNodeList
m_Children;
SceneNode
*m_pParent;
SceneNodeProperties
m_Props;
public:
SceneNode(ActorId actorId,
std::string name,
RenderPass renderPass,