Click here to Skip to main content
12,699,807 members (36,489 online)
Click here to Skip to main content


27 bookmarked

Using Quaternions Efficiently in Real-time Applications

, 10 Nov 2010 CPOL
Various methods for using quaternions in ways that maximize performance
#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
    void updateWorldTransform( ObjectBase *parent )
        OBJECT::updateWorldTransform( parent );

        updateAllObjects( this );


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 article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer Gameloft
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170118.1 | Last Updated 10 Nov 2010
Article Copyright 2010 by gtdelarosa
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid