|
#ifndef _NODE_H
#define _NODE_H
#include "NodeBase.h"
//Node class template////////////////////////////////////////////////////////
// This class uses the Decorator design pattern to add Node functionality
// to any Object type. Node functionality means the containment
// of a vector of Objects and the methods needed to add new Objects
// to the vector, and to iterate through all of them to update their transforms.
// This makes it possible to create a tree of Nodes each representing an Object.
// Leaves in the tree can be simple Objects instead of Nodes. This is made
// possible with a function template, addChild where the actual type of the new
// child can be specified as a template parameter.
template< class OBJECT >
class Node : public OBJECT, public NodeBase
{
public:
void updateWorldTransform( ObjectBase *parent )
{
OBJECT::updateWorldTransform( parent );
updateAllObjects( this );
}
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.