Browse Source

Merge pull request #1272 from seanpaultaylor/next

Next
Sean Taylor 12 years ago
parent
commit
3c557f1570

+ 13 - 32
gameplay/CMakeLists.txt

@@ -187,10 +187,6 @@ set(GAMEPLAY_SRC
     src/Scene.h
     src/SceneLoader.cpp
     src/SceneLoader.h
-    src/SceneRenderer.cpp
-    src/SceneRenderer.h
-    src/SceneRendererForward.cpp
-    src/SceneRendererForward.h
     src/ScreenDisplayer.cpp
     src/ScreenDisplayer.h
     src/ScriptController.cpp
@@ -246,7 +242,6 @@ set(GAMEPLAY_SRC
     src/VertexFormat.h
     src/VerticalLayout.cpp
     src/VerticalLayout.h
-    src/VisibleSet.h
 )
 
 set(GAMEPLAY_LUA
@@ -533,10 +528,6 @@ set(GAMEPLAY_LUA
     src/lua/lua_RenderTarget.h
     src/lua/lua_Scene.cpp
     src/lua/lua_Scene.h
-    src/lua/lua_SceneRenderer.cpp
-    src/lua/lua_SceneRenderer.h
-    src/lua/lua_SceneRendererForward.cpp
-    src/lua/lua_SceneRendererForward.h
     src/lua/lua_ScreenDisplayer.cpp
     src/lua/lua_ScreenDisplayer.h
     src/lua/lua_ScriptController.cpp
@@ -605,8 +596,6 @@ set(GAMEPLAY_LUA
     src/lua/lua_VertexFormatUsage.h
     src/lua/lua_VerticalLayout.cpp
     src/lua/lua_VerticalLayout.h
-    src/lua/lua_VisibleSet.cpp
-    src/lua/lua_VisibleSet.h
 )
 
 set(GAMEPLAY_RES
@@ -617,30 +606,22 @@ set(GAMEPLAY_RES
 )
 
 set(GAMEPLAY_RES_SHADERS
-    res/shaders/colored-unlit.frag
-    res/shaders/colored-unlit.vert
     res/shaders/colored.frag
     res/shaders/colored.vert
-    res/shaders/textured-bumped.frag
-    res/shaders/textured-bumped.vert
-    res/shaders/textured-unlit.frag
-    res/shaders/textured-unlit.vert
-    res/shaders/textured.frag
-    res/shaders/textured.vert
+    res/shaders/font.frag
+    res/shaders/font.vert
+    res/shaders/form.frag
+    res/shaders/form.vert
+    res/shaders/lighting.frag
+    res/shaders/lighting.vert
+    res/shaders/skinning.vert
+    res/shaders/skinning-none.vert
+    res/shaders/sprite.frag
+    res/shaders/sprite.vert
     res/shaders/terrain.frag
     res/shaders/terrain.vert
-)
-
-set(GAMEPLAY_RES_SHADERS_LIB
-    res/shaders/lib/attributes-skinning.vert
-    res/shaders/lib/attributes.vert
-    res/shaders/lib/lighting-directional.frag
-    res/shaders/lib/lighting-directional.vert
-    res/shaders/lib/lighting-point.frag
-    res/shaders/lib/lighting-point.vert
-    res/shaders/lib/lighting-spot.frag
-    res/shaders/lib/lighting-spot.vert
-    res/shaders/lib/lighting.frag
+    res/shaders/textured.frag
+    res/shaders/textured.vert
 )
 
 include_directories( 
@@ -669,7 +650,7 @@ set_target_properties(gameplay PROPERTIES
 )
 
 source_group(lua FILES ${GAMEPLAY_LUA})
-source_group(res FILES ${GAMEPLAY_RES} ${GAMEPLAY_RES} ${GAMEPLAY_RES_SHADERS} ${GAMEPLAY_RES_SHADERS_LIB})
+source_group(res FILES ${GAMEPLAY_RES} ${GAMEPLAY_RES} ${GAMEPLAY_RES_SHADERS})
 source_group(src FILES ${GAMEPLAY_SRC})
 
 

+ 0 - 5
gameplay/android/jni/Android.mk

@@ -88,8 +88,6 @@ LOCAL_SRC_FILES := \
     RenderTarget.cpp \
     Scene.cpp \
     SceneLoader.cpp \
-    SceneRenderer.cpp \
-    SceneRendererForward.cpp \
     ScreenDisplayer.cpp \
     ScriptController.cpp \
     ScriptTarget.cpp \
@@ -257,8 +255,6 @@ LOCAL_SRC_FILES := \
     lua/lua_RenderStateStencilOperation.cpp \
     lua/lua_RenderTarget.cpp \
     lua/lua_Scene.cpp \
-    lua/lua_SceneRenderer.cpp \
-    lua/lua_SceneRendererForward.cpp \
     lua/lua_ScreenDisplayer.cpp \
     lua/lua_ScriptController.cpp \
     lua/lua_ScriptTarget.cpp \
@@ -293,7 +289,6 @@ LOCAL_SRC_FILES := \
     lua/lua_VertexFormatElement.cpp \
     lua/lua_VertexFormatUsage.cpp \
     lua/lua_VerticalLayout.cpp \
-    lua/lua_VisibleSet.cpp \
     social/GooglePlaySocialSession.cpp
 
     

+ 0 - 11
gameplay/gameplay.vcxproj

@@ -217,8 +217,6 @@
     <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp" />
     <ClCompile Include="src\lua\lua_RenderTarget.cpp" />
     <ClCompile Include="src\lua\lua_Scene.cpp" />
-    <ClCompile Include="src\lua\lua_SceneRenderer.cpp" />
-    <ClCompile Include="src\lua\lua_SceneRendererForward.cpp" />
     <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
     <ClCompile Include="src\lua\lua_ScriptController.cpp" />
     <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
@@ -253,7 +251,6 @@
     <ClCompile Include="src\lua\lua_VertexFormatElement.cpp" />
     <ClCompile Include="src\lua\lua_VertexFormatUsage.cpp" />
     <ClCompile Include="src\lua\lua_VerticalLayout.cpp" />
-    <ClCompile Include="src\lua\lua_VisibleSet.cpp" />
     <ClCompile Include="src\Material.cpp" />
     <ClCompile Include="src\MathUtil.cpp" />
     <ClCompile Include="src\MeshBatch.cpp" />
@@ -297,8 +294,6 @@
     <ClCompile Include="src\RenderTarget.cpp" />
     <ClCompile Include="src\Scene.cpp" />
     <ClCompile Include="src\SceneLoader.cpp" />
-    <ClCompile Include="src\SceneRenderer.cpp" />
-    <ClCompile Include="src\SceneRendererForward.cpp" />
     <ClCompile Include="src\ScreenDisplayer.cpp" />
     <ClCompile Include="src\ScriptController.cpp" />
     <ClCompile Include="src\ScriptTarget.cpp" />
@@ -518,8 +513,6 @@
     <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h" />
     <ClInclude Include="src\lua\lua_RenderTarget.h" />
     <ClInclude Include="src\lua\lua_Scene.h" />
-    <ClInclude Include="src\lua\lua_SceneRenderer.h" />
-    <ClInclude Include="src\lua\lua_SceneRendererForward.h" />
     <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
     <ClInclude Include="src\lua\lua_ScriptController.h" />
     <ClInclude Include="src\lua\lua_ScriptTarget.h" />
@@ -554,7 +547,6 @@
     <ClInclude Include="src\lua\lua_VertexFormatElement.h" />
     <ClInclude Include="src\lua\lua_VertexFormatUsage.h" />
     <ClInclude Include="src\lua\lua_VerticalLayout.h" />
-    <ClInclude Include="src\lua\lua_VisibleSet.h" />
     <ClInclude Include="src\Material.h" />
     <ClInclude Include="src\MathUtil.h" />
     <ClInclude Include="src\MeshBatch.h" />
@@ -595,8 +587,6 @@
     <ClInclude Include="src\RenderTarget.h" />
     <ClInclude Include="src\Scene.h" />
     <ClInclude Include="src\SceneLoader.h" />
-    <ClInclude Include="src\SceneRenderer.h" />
-    <ClInclude Include="src\SceneRendererForward.h" />
     <ClInclude Include="src\ScreenDisplayer.h" />
     <ClInclude Include="src\ScriptController.h" />
     <ClInclude Include="src\ScriptTarget.h" />
@@ -628,7 +618,6 @@
     <ClInclude Include="src\VertexAttributeBinding.h" />
     <ClInclude Include="src\VertexFormat.h" />
     <ClInclude Include="src\VerticalLayout.h" />
-    <ClInclude Include="src\VisibleSet.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="res\shaders\colored.frag" />

+ 0 - 33
gameplay/gameplay.vcxproj.filters

@@ -201,12 +201,6 @@
     <ClCompile Include="src\SocialSessionListener.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\SceneRenderer.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\SceneRendererForward.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
     <ClCompile Include="src\social\GooglePlaySocialSession.cpp">
       <Filter>src\social</Filter>
     </ClCompile>
@@ -801,12 +795,6 @@
     <ClCompile Include="src\lua\lua_Scene.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_SceneRenderer.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
-    <ClCompile Include="src\lua\lua_SceneRendererForward.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -906,9 +894,6 @@
     <ClCompile Include="src\lua\lua_VerticalLayout.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_VisibleSet.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_TerrainPatch.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -1100,15 +1085,6 @@
     <ClInclude Include="src\SocialChallenge.h">
       <Filter>src</Filter>
     </ClInclude>
-    <ClInclude Include="src\SceneRenderer.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\SceneRendererForward.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\VisibleSet.h">
-      <Filter>src</Filter>
-    </ClInclude>
     <ClInclude Include="src\social\GooglePlaySocialSession.h">
       <Filter>src\social</Filter>
     </ClInclude>
@@ -1706,12 +1682,6 @@
     <ClInclude Include="src\lua\lua_Scene.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_SceneRenderer.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
-    <ClInclude Include="src\lua\lua_SceneRendererForward.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_ScreenDisplayer.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1811,9 +1781,6 @@
     <ClInclude Include="src\lua\lua_VerticalLayout.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_VisibleSet.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_TerrainPatch.h">
       <Filter>src\lua</Filter>
     </ClInclude>

+ 369 - 370
gameplay/src/Scene.h

@@ -1,42 +1,41 @@
-#ifndef SCENE_H_
-#define SCENE_H_
-
-#include "Node.h"
-#include "MeshBatch.h"
-#include "ScriptController.h"
-#include "Light.h"
-#include "VisibleSet.h"
-
-namespace gameplay
-{
-
-/**
- * Represents the root container for a hierarchy of nodes.
- */
-class Scene : public Ref, public VisibleSet
-{
-public:
-
-    /**
-     * Creates a new empty scene.
-     *
-     * @param id ID of the new scene, or NULL to use an empty string for the ID (default).
-     *
-     * @return The newly created empty scene.
-     * @script{create}
-     */
-    static Scene* create(const char* id = NULL);
-
-    /**
-     * Loads a scene from the given '.scene' or '.gpb' file.
-     *
-     * @param filePath The path to the '.scene' or '.gpb' file to load from.
-     * @return The loaded scene or <code>NULL</code> if the scene
-     *      could not be loaded from the given file.
-     * @script{create}
-     */
-    static Scene* load(const char* filePath);
-
+#ifndef SCENE_H_
+#define SCENE_H_
+
+#include "Node.h"
+#include "MeshBatch.h"
+#include "ScriptController.h"
+#include "Light.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents the root container for a hierarchy of nodes.
+ */
+class Scene : public Ref
+{
+public:
+
+    /**
+     * Creates a new empty scene.
+     *
+     * @param id ID of the new scene, or NULL to use an empty string for the ID (default).
+     *
+     * @return The newly created empty scene.
+     * @script{create}
+     */
+    static Scene* create(const char* id = NULL);
+
+    /**
+     * Loads a scene from the given '.scene' or '.gpb' file.
+     *
+     * @param filePath The path to the '.scene' or '.gpb' file to load from.
+     * @return The loaded scene or <code>NULL</code> if the scene
+     *      could not be loaded from the given file.
+     * @script{create}
+     */
+    static Scene* load(const char* filePath);
+
     /**
      * Gets a currently active scene.
      *
@@ -46,334 +45,334 @@ public:
      *
      * @return The scene that matches the specified ID, or NULL if no matching scene could be found.
      */
-    static Scene* getScene(const char* id = NULL);
-
-    /**
-     * Gets the identifier for the scene.
-     *
-     * @return The scene identifier.
-     */
-    const char* getId() const;
-
-    /**
-     * Sets the identifier for the scene.
-     *
-     * @param id The identifier to set for the scene.
-     */
-    void setId(const char* id);
-
-    /**
-     * Returns the first node in the scene that matches the given ID.
-     *
-     * @param id The ID of the node to find.
-     * @param recursive true if a recursive search should be performed, false otherwise.
-     * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
-     *      or false if nodes that start with the given ID are returned.
-     *
-     * @return The first node found that matches the given ID.
-     */
-    Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const;
-
-    /**
-     * Returns all nodes in the scene that match the given ID.
-     *
-     * @param id The ID of the node to find.
-     * @param nodes Vector of nodes to be populated with matches.
-     * @param recursive true if a recursive search should be performed, false otherwise.
-     * @param exactMatch true if only nodes who's ID exactly matches the specified ID are returned,
-     *      or false if nodes that start with the given ID are returned.
-     *
-     * @return The number of matches found.
-     * @script{ignore}
-     */
-    unsigned int findNodes(const char* id, std::vector<Node*>& nodes, bool recursive = true, bool exactMatch = true) const;
-
-    /**
-     * Creates and adds a new node to the scene.
-     *
-     * @param id An optional node ID.
-     *
-     * @return The new node.
-     */
-    Node* addNode(const char* id = NULL);
-
-    /**
-     * Adds the specified node to the scene.
-     *
-     * @param node The node to be added to the scene.
-     */
-    void addNode(Node* node);
-
-    /**
-     * Removes the specified node from the scene.
-     *
-     * @param node The node to remove.
-     */
-    void removeNode(Node* node);
-
-    /**
-     * Removes all nodes from the scene.
-     */
-    void removeAllNodes();
-
-    /**
-     * Returns the number of nodes at the root level of the scene.
-     *
-     * @return The node count.
-     */
-    unsigned int getNodeCount() const;
-
-    /**
-     * Returns the first node in the scene.
-     *
-     * @return The first node in the scene.
-     */
-    Node* getFirstNode() const;
-
-    /**
-     * Gets the active camera for the scene.
-     *
-     * @return The active camera for the scene.
-     * @see VisibleSet#getActiveCamera
-     */
-    Camera* getActiveCamera();
-
-    /**
-     * Sets the active camera on the scene.
-     *
-     * @param camera The active camera to be set on the scene.
-     */
-    void setActiveCamera(Camera* camera);
-
-    /**
-     * Sets the audio listener to transform along with the active camera if set to true.
-     * If you have a 2D game that doesn't require it, then set to false.  This is on by default for the scene.
-     *
-     * @param bind true if you want to the audio listener to follow the active camera's transform.
-     */
-    void bindAudioListenerToCamera(bool bind);
-
-    /**
-     * Returns the ambient color of the scene.
-     *
-     * The default ambient light color is black (0,0,0).
-     *
-     * This value can be bound to materials using the SCENE_LIGHT_AMBIENT_COLOR auto binding.
-     *
-     * @return The scene's ambient color.
-     */
-    const Vector3& getAmbientColor() const;
-
-    /**
-     * Sets the ambient color of the scene.
-     *
-     * @param red The red channel between 0.0 and 1.0.
-     * @param green The green channel between 0.0 and 1.0.
-     * @param blue The blue channel between 0.0 and 1.0.
-     *
-     * @see getAmbientColor()
-     */
-    void setAmbientColor(float red, float green, float blue);
-
-    /**
-     * Visits each node in the scene and calls the specified method pointer.
-     *
-     * Calling this method invokes the specified method pointer for each node
-     * in the scene hierarchy.
-     *
-     * The visitMethod parameter must be a pointer to a method that has a bool
-     * return type and accepts a single parameter of type Node*.
-     *
-     * A depth-first traversal of the scene continues while the visit method
-     * returns true. Returning false will stop traversing further children for
-     * the given node and the traversal will continue at the next sibling.
-     *
-     * @param instance The pointer to an instance of the object that contains visitMethod.
-     * @param visitMethod The pointer to the class method to call for each node in the scene.
-     */
-    template <class T>
-    void visit(T* instance, bool (T::*visitMethod)(Node*));
-
-    /**
-     * Visits each node in the scene and calls the specified method pointer.
-     *
-     * Calling this method invokes the specified method pointer for each node
-     * in the scene hierarchy, passing the Node and the specified cookie value.
-     *
-     * The visitMethod parameter must be a pointer to a method that has a bool
-     * return type and accepts two parameters: a Node pointer and a cookie of a
-     * user-specified type.
-     *
-     * A depth-first traversal of the scene continues while the visit method
-     * returns true. Returning false will stop traversing further children for
-     * the given node and the traversal will continue at the next sibling.
-     *
-     * @param instance The pointer to an instance of the object that contains visitMethod.
-     * @param visitMethod The pointer to the class method to call for each node in the scene.
-     * @param cookie An optional user-defined parameter that will be passed to each invocation of visitMethod.
-     */
-    template <class T, class C>
-    void visit(T* instance, bool (T::*visitMethod)(Node*,C), C cookie);
-
-    /**
-     * Visits each node in the scene and calls the specified Lua function.
-     *
-     * Calling this method invokes the specified Lua function for each node
-     * in the scene hierarchy.
-     *
-     * The visitMethod parameter must be a string containing the name of a
-     * valid Lua function that has a boolean return type and accepts a
-     * single parameter of type Node*.
-     *
-     * A depth-first traversal of the scene continues while the visit method
-     * returns true. Returning false will stop traversing further children for
-     * the given node and the traversal will continue at the next sibling.
-     *
-     * @param visitMethod The name of the Lua function to call for each node in the scene.
-     */
-    inline void visit(const char* visitMethod);
-
-    /**
-     * Updates all the active nodes in the scene.
-     */
-    void update(float elapsedTime);
-
-    /**
-     * @see VisibleSet#getNext
-     */
-    Node* getNext();
-
-    /**
-     * @see VisibleSet#reset
-     */
-    void reset();
-
-private:
-
-    /**
-     * Constructor.
-     */
-    Scene();
-
-    /**
-     * Hidden copy constructor.
-     */
-    Scene(const Scene& copy);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Scene();
-
-    /**
-     * Hidden copy assignment operator.
-     */
-    Scene& operator=(const Scene&);
-
-    /**
-     * Visits the given node and all of its children recursively.
-     */
-    template <class T>
-    void visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*));
-
-    /**
-     * Visits the given node and all of its children recursively.
-     */
-    template <class T, class C>
-    void visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*,C), C cookie);
-
-    /**
-     * Visits the given node and all of its children recursively.
-     */
-    void visitNode(Node* node, const char* visitMethod);
-
-    Node* findNextVisibleSibling(Node* node);
-
-    bool isNodeVisible(Node* node);
-
-    std::string _id;
-    Camera* _activeCamera;
-    Node* _firstNode;
-    Node* _lastNode;
-    unsigned int _nodeCount;
-    Vector3 _ambientColor;
-    bool _bindAudioListenerToCamera;
-    Node* _nextItr;
-    bool _nextReset;
-};
-
-template <class T>
-void Scene::visit(T* instance, bool (T::*visitMethod)(Node*))
-{
-    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
-    {
-        visitNode(node, instance, visitMethod);
-    }
-}
-
-template <class T, class C>
-void Scene::visit(T* instance, bool (T::*visitMethod)(Node*,C), C cookie)
-{
-    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
-    {
-        visitNode(node, instance, visitMethod, cookie);
-    }
-}
-
-inline void Scene::visit(const char* visitMethod)
-{
-    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
-    {
-        visitNode(node, visitMethod);
-    }
-}
-
-template <class T>
-void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*))
-{
-    // Invoke the visit method for this node.
-    if (!(instance->*visitMethod)(node))
-        return;
-
-    // If this node has a model with a mesh skin, visit the joint hierarchy within it
-    // since we don't add joint hierarchies directly to the scene. If joints are never
-    // visited, it's possible that nodes embedded within the joint hierarchy that contain
-    // models will never get visited (and therefore never get drawn).
-    if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode)
-    {
-        visitNode(node->_model->_skin->_rootNode, instance, visitMethod);
-    }
-
-    // Recurse for all children.
-    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
-    {
-        visitNode(child, instance, visitMethod);
-    }
-}
-
-template <class T, class C>
-void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*,C), C cookie)
-{
-    // Invoke the visit method for this node.
-    if (!(instance->*visitMethod)(node, cookie))
-        return;
-
-    // If this node has a model with a mesh skin, visit the joint hierarchy within it
-    // since we don't add joint hierarchies directly to the scene. If joints are never
-    // visited, it's possible that nodes embedded within the joint hierarchy that contain
-    // models will never get visited (and therefore never get drawn).
-    if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode)
-    {
-        visitNode(node->_model->_skin->_rootNode, instance, visitMethod, cookie);
-    }
-
-    // Recurse for all children.
-    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
-    {
-        visitNode(child, instance, visitMethod, cookie);
-    }
-}
-
-}
-
-#endif
+    static Scene* getScene(const char* id = NULL);
+
+    /**
+     * Gets the identifier for the scene.
+     *
+     * @return The scene identifier.
+     */
+    const char* getId() const;
+
+    /**
+     * Sets the identifier for the scene.
+     *
+     * @param id The identifier to set for the scene.
+     */
+    void setId(const char* id);
+
+    /**
+     * Returns the first node in the scene that matches the given ID.
+     *
+     * @param id The ID of the node to find.
+     * @param recursive true if a recursive search should be performed, false otherwise.
+     * @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
+     *      or false if nodes that start with the given ID are returned.
+     *
+     * @return The first node found that matches the given ID.
+     */
+    Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const;
+
+    /**
+     * Returns all nodes in the scene that match the given ID.
+     *
+     * @param id The ID of the node to find.
+     * @param nodes Vector of nodes to be populated with matches.
+     * @param recursive true if a recursive search should be performed, false otherwise.
+     * @param exactMatch true if only nodes who's ID exactly matches the specified ID are returned,
+     *      or false if nodes that start with the given ID are returned.
+     *
+     * @return The number of matches found.
+     * @script{ignore}
+     */
+    unsigned int findNodes(const char* id, std::vector<Node*>& nodes, bool recursive = true, bool exactMatch = true) const;
+
+    /**
+     * Creates and adds a new node to the scene.
+     *
+     * @param id An optional node ID.
+     *
+     * @return The new node.
+     */
+    Node* addNode(const char* id = NULL);
+
+    /**
+     * Adds the specified node to the scene.
+     *
+     * @param node The node to be added to the scene.
+     */
+    void addNode(Node* node);
+
+    /**
+     * Removes the specified node from the scene.
+     *
+     * @param node The node to remove.
+     */
+    void removeNode(Node* node);
+
+    /**
+     * Removes all nodes from the scene.
+     */
+    void removeAllNodes();
+
+    /**
+     * Returns the number of nodes at the root level of the scene.
+     *
+     * @return The node count.
+     */
+    unsigned int getNodeCount() const;
+
+    /**
+     * Returns the first node in the scene.
+     *
+     * @return The first node in the scene.
+     */
+    Node* getFirstNode() const;
+
+    /**
+     * Gets the active camera for the scene.
+     *
+     * @return The active camera for the scene.
+     * @see VisibleSet#getActiveCamera
+     */
+    Camera* getActiveCamera();
+
+    /**
+     * Sets the active camera on the scene.
+     *
+     * @param camera The active camera to be set on the scene.
+     */
+    void setActiveCamera(Camera* camera);
+
+    /**
+     * Sets the audio listener to transform along with the active camera if set to true.
+     * If you have a 2D game that doesn't require it, then set to false.  This is on by default for the scene.
+     *
+     * @param bind true if you want to the audio listener to follow the active camera's transform.
+     */
+    void bindAudioListenerToCamera(bool bind);
+
+    /**
+     * Returns the ambient color of the scene.
+     *
+     * The default ambient light color is black (0,0,0).
+     *
+     * This value can be bound to materials using the SCENE_LIGHT_AMBIENT_COLOR auto binding.
+     *
+     * @return The scene's ambient color.
+     */
+    const Vector3& getAmbientColor() const;
+
+    /**
+     * Sets the ambient color of the scene.
+     *
+     * @param red The red channel between 0.0 and 1.0.
+     * @param green The green channel between 0.0 and 1.0.
+     * @param blue The blue channel between 0.0 and 1.0.
+     *
+     * @see getAmbientColor()
+     */
+    void setAmbientColor(float red, float green, float blue);
+
+    /**
+     * Visits each node in the scene and calls the specified method pointer.
+     *
+     * Calling this method invokes the specified method pointer for each node
+     * in the scene hierarchy.
+     *
+     * The visitMethod parameter must be a pointer to a method that has a bool
+     * return type and accepts a single parameter of type Node*.
+     *
+     * A depth-first traversal of the scene continues while the visit method
+     * returns true. Returning false will stop traversing further children for
+     * the given node and the traversal will continue at the next sibling.
+     *
+     * @param instance The pointer to an instance of the object that contains visitMethod.
+     * @param visitMethod The pointer to the class method to call for each node in the scene.
+     */
+    template <class T>
+    void visit(T* instance, bool (T::*visitMethod)(Node*));
+
+    /**
+     * Visits each node in the scene and calls the specified method pointer.
+     *
+     * Calling this method invokes the specified method pointer for each node
+     * in the scene hierarchy, passing the Node and the specified cookie value.
+     *
+     * The visitMethod parameter must be a pointer to a method that has a bool
+     * return type and accepts two parameters: a Node pointer and a cookie of a
+     * user-specified type.
+     *
+     * A depth-first traversal of the scene continues while the visit method
+     * returns true. Returning false will stop traversing further children for
+     * the given node and the traversal will continue at the next sibling.
+     *
+     * @param instance The pointer to an instance of the object that contains visitMethod.
+     * @param visitMethod The pointer to the class method to call for each node in the scene.
+     * @param cookie An optional user-defined parameter that will be passed to each invocation of visitMethod.
+     */
+    template <class T, class C>
+    void visit(T* instance, bool (T::*visitMethod)(Node*,C), C cookie);
+
+    /**
+     * Visits each node in the scene and calls the specified Lua function.
+     *
+     * Calling this method invokes the specified Lua function for each node
+     * in the scene hierarchy.
+     *
+     * The visitMethod parameter must be a string containing the name of a
+     * valid Lua function that has a boolean return type and accepts a
+     * single parameter of type Node*.
+     *
+     * A depth-first traversal of the scene continues while the visit method
+     * returns true. Returning false will stop traversing further children for
+     * the given node and the traversal will continue at the next sibling.
+     *
+     * @param visitMethod The name of the Lua function to call for each node in the scene.
+     */
+    inline void visit(const char* visitMethod);
+
+    /**
+     * Updates all the active nodes in the scene.
+     */
+    void update(float elapsedTime);
+
+    /**
+     * @see VisibleSet#getNext
+     */
+    Node* getNext();
+
+    /**
+     * @see VisibleSet#reset
+     */
+    void reset();
+
+private:
+
+    /**
+     * Constructor.
+     */
+    Scene();
+
+    /**
+     * Hidden copy constructor.
+     */
+    Scene(const Scene& copy);
+
+    /**
+     * Destructor.
+     */
+    virtual ~Scene();
+
+    /**
+     * Hidden copy assignment operator.
+     */
+    Scene& operator=(const Scene&);
+
+    /**
+     * Visits the given node and all of its children recursively.
+     */
+    template <class T>
+    void visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*));
+
+    /**
+     * Visits the given node and all of its children recursively.
+     */
+    template <class T, class C>
+    void visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*,C), C cookie);
+
+    /**
+     * Visits the given node and all of its children recursively.
+     */
+    void visitNode(Node* node, const char* visitMethod);
+
+    Node* findNextVisibleSibling(Node* node);
+
+    bool isNodeVisible(Node* node);
+
+    std::string _id;
+    Camera* _activeCamera;
+    Node* _firstNode;
+    Node* _lastNode;
+    unsigned int _nodeCount;
+    Vector3 _ambientColor;
+    bool _bindAudioListenerToCamera;
+    Node* _nextItr;
+    bool _nextReset;
+};
+
+template <class T>
+void Scene::visit(T* instance, bool (T::*visitMethod)(Node*))
+{
+    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
+    {
+        visitNode(node, instance, visitMethod);
+    }
+}
+
+template <class T, class C>
+void Scene::visit(T* instance, bool (T::*visitMethod)(Node*,C), C cookie)
+{
+    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
+    {
+        visitNode(node, instance, visitMethod, cookie);
+    }
+}
+
+inline void Scene::visit(const char* visitMethod)
+{
+    for (Node* node = getFirstNode(); node != NULL; node = node->getNextSibling())
+    {
+        visitNode(node, visitMethod);
+    }
+}
+
+template <class T>
+void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*))
+{
+    // Invoke the visit method for this node.
+    if (!(instance->*visitMethod)(node))
+        return;
+
+    // If this node has a model with a mesh skin, visit the joint hierarchy within it
+    // since we don't add joint hierarchies directly to the scene. If joints are never
+    // visited, it's possible that nodes embedded within the joint hierarchy that contain
+    // models will never get visited (and therefore never get drawn).
+    if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode)
+    {
+        visitNode(node->_model->_skin->_rootNode, instance, visitMethod);
+    }
+
+    // Recurse for all children.
+    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
+    {
+        visitNode(child, instance, visitMethod);
+    }
+}
+
+template <class T, class C>
+void Scene::visitNode(Node* node, T* instance, bool (T::*visitMethod)(Node*,C), C cookie)
+{
+    // Invoke the visit method for this node.
+    if (!(instance->*visitMethod)(node, cookie))
+        return;
+
+    // If this node has a model with a mesh skin, visit the joint hierarchy within it
+    // since we don't add joint hierarchies directly to the scene. If joints are never
+    // visited, it's possible that nodes embedded within the joint hierarchy that contain
+    // models will never get visited (and therefore never get drawn).
+    if (node->_model && node->_model->_skin && node->_model->_skin->_rootNode)
+    {
+        visitNode(node->_model->_skin->_rootNode, instance, visitMethod, cookie);
+    }
+
+    // Recurse for all children.
+    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
+    {
+        visitNode(child, instance, visitMethod, cookie);
+    }
+}
+
+}
+
+#endif

+ 0 - 15
gameplay/src/SceneRenderer.cpp

@@ -1,15 +0,0 @@
-#include "Base.h"
-#include "SceneRenderer.h"
-
-namespace gameplay
-{
-
-SceneRenderer::SceneRenderer()
-{
-}
-
-SceneRenderer::~SceneRenderer()
-{
-}
-
-}

+ 0 - 44
gameplay/src/SceneRenderer.h

@@ -1,44 +0,0 @@
-#ifndef SCENERENDERER_H_
-#define SCENERENDERER_H_
-
-#include "Scene.h"
-#include "VisibleSet.h"
-
-namespace gameplay
-{
-
-/**
- * Represents a class that support rendering of the active models in a scene 
- * and that are visible to the camera. 
- */
-class SceneRenderer
-{
-public:
-
-    /**
-     * Constructor.
-     *
-     * @param scene The scene to render.
-     * @param lighting The type of lighting system to use.
-     */
-    SceneRenderer();
-
-    /**
-     * Destructor.
-     */
-    virtual ~SceneRenderer();
-
-    /**
-     * Renders the scene with all the nodes visible from the active camera in the scene.
-     *
-     * @param set The visible set of node to render
-     * @param wireframe true to show the wireframe 
-     * @return The number of nodes visited.
-     */
-    virtual unsigned int render(VisibleSet* set, bool wireframe = false) = 0;
-
-};
-
-}
-
-#endif

+ 0 - 73
gameplay/src/SceneRendererForward.cpp

@@ -1,73 +0,0 @@
-#include "Base.h"
-#include "SceneRendererForward.h"
-#include "Terrain.h"
-#include "Model.h"
-#include "ParticleEmitter.h"
-#include "Form.h"
-
-namespace gameplay
-{
-
-SceneRendererForward::SceneRendererForward()
-    : SceneRenderer()
-{
-}
-
-SceneRendererForward::SceneRendererForward(const SceneRendererForward& copy)
-{
-}
-
-SceneRendererForward::~SceneRendererForward()
-{
-}
-
-SceneRendererForward* SceneRendererForward::create()
-{
-    return new SceneRendererForward();
-}
-
-unsigned int SceneRendererForward::render(VisibleSet* set, bool wireframe)
-{
-    set->reset();
-    unsigned int drawCalls = 0;
-    Node* next = set->getNext();
-    do
-    {
-        drawCalls += drawNode(next, wireframe);
-        next = set->getNext();
-
-    } while ( next != NULL);
-
-    return drawCalls;
-}
-
-unsigned int SceneRendererForward::drawNode(Node* node, bool wireframe)
-{
-    unsigned int drawCalls = 0;
-
-    // Draw Terrain
-    Terrain* terrain = node->getTerrain();
-    if (terrain)
-        drawCalls += terrain->draw(wireframe);
-
-    // Draw Models (Shadows) TODO:
-
-    // Draw Modes
-    Model* model = node->getModel();
-    if (model)
-        drawCalls += model->draw(wireframe);
-
-    // Draw particles
-    ParticleEmitter* emitter = node->getParticleEmitter();
-    if (emitter)
-        drawCalls += emitter->draw();
-
-    // Draw forms
-    Form* form = node->getForm();
-    if (form)
-        drawCalls += form->draw();
-
-    return drawCalls;
-}
-
-}

+ 0 - 49
gameplay/src/SceneRendererForward.h

@@ -1,49 +0,0 @@
-#ifndef SCENERENDERERFORWARD_H_
-#define SCENERENDERERFORWARD_H_
-
-#include "SceneRenderer.h"
-
-namespace gameplay
-{
-
-/**
- * Represents a class that support rendering of the active models in a scene 
- * and that are visible to the camera. 
- */
-class SceneRendererForward : public SceneRenderer
-{
-public:
-
-    /**
-     * Creates a forward scene renderer
-     */
-    static SceneRendererForward* create();
-
-    /**
-     * @see SceneRenderer#render
-     */
-    unsigned int render(VisibleSet* set, bool wireframe);
-
-private:
-
-    /**
-     * Constructor.
-     */
-    SceneRendererForward();
-
-    /**
-     * Constructor.
-     */
-    SceneRendererForward(const SceneRendererForward& copy);
-
-    /**
-     * Destructor.
-     */
-    ~SceneRendererForward();
-
-    unsigned int drawNode(Node* node, bool wireframe);
-};
-
-}
-
-#endif

+ 0 - 46
gameplay/src/VisibleSet.h

@@ -1,46 +0,0 @@
-#ifndef VISIBLESET_H_
-#define VISIBLESET_H_
-
-namespace gameplay
-{
-
-class Scene;
-
-/**
- * Represents a set of nodes that are visible from the
- * active camera. This provides an enumerator
- * to traverse the scene returning only visible nodes.
- */
-class VisibleSet
-{
-public:
-
-    /**
-     * Destructor.
-     */
-    virtual ~VisibleSet() { }
-
-    /**
-     * Gets the active camera being used to test the visibility.
-     *
-     * @return The active camera being used to test the visibility.
-     */
-    virtual Camera* getActiveCamera() = 0;
-
-    /**
-     * Resets the enumerator for enumerating the visible set.
-     */
-    virtual void reset() = 0;
-
-    /**
-     * Gets the next visible node in the set or NULL
-     * once you have reached the end of the set.
-     *
-     * @return The next visible node in the set or NULL at end of set.
-     */
-    virtual Node* getNext() = 0;
-};
-
-}
-
-#endif

+ 1 - 3
gameplay/src/gameplay.h

@@ -43,8 +43,6 @@
 #include "Node.h"
 #include "Joint.h"
 #include "Scene.h"
-#include "SceneRenderer.h"
-#include "SceneRendererForward.h"
 #include "Font.h"
 #include "SpriteBatch.h"
 #include "ParticleEmitter.h"
@@ -55,7 +53,7 @@
 #include "HeightField.h"
 #include "Terrain.h"
 #include "TerrainPatch.h"
-#include "VisibleSet.h"
+
 
 // Audio
 #include "AudioController.h"

+ 0 - 2
gameplay/src/lua/lua_Global.cpp

@@ -111,7 +111,6 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Material");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Pass");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Technique");
-    gameplay::ScriptUtil::setGlobalHierarchyPair("SceneRenderer", "SceneRendererForward");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIAgent");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIState");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Button");
@@ -139,7 +138,6 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsGhostObject");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsRigidBody");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Terrain");
-    gameplay::ScriptUtil::setGlobalHierarchyPair("VisibleSet", "Scene");
     gameplay::ScriptUtil::addStringFromEnumConversionFunction(&gameplay::lua_stringFromEnumGlobal);
 
     // Register enumeration AIMessage::ParameterType.

+ 0 - 144
gameplay/src/lua/lua_SceneRenderer.cpp

@@ -1,144 +0,0 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_SceneRenderer.h"
-#include "Base.h"
-#include "SceneRenderer.h"
-
-namespace gameplay
-{
-
-void luaRegister_SceneRenderer()
-{
-    const luaL_Reg lua_members[] = 
-    {
-        {"render", lua_SceneRenderer_render},
-        {NULL, NULL}
-    };
-    const luaL_Reg* lua_statics = NULL;
-    std::vector<std::string> scopePath;
-
-    gameplay::ScriptUtil::registerClass("SceneRenderer", lua_members, NULL, lua_SceneRenderer__gc, lua_statics, scopePath);
-}
-
-static SceneRenderer* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
-    luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
-    return (SceneRenderer*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_SceneRenderer__gc(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
-                luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    SceneRenderer* instance = (SceneRenderer*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_SceneRenderer__gc - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_SceneRenderer_render(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
-                    lua_error(state);
-                }
-
-                SceneRenderer* instance = getInstance(state);
-                unsigned int result = instance->render(param1);
-
-                // Push the return value onto the stack.
-                lua_pushunsigned(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_SceneRenderer_render - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
-                    lua_error(state);
-                }
-
-                // Get parameter 2 off the stack.
-                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
-
-                SceneRenderer* instance = getInstance(state);
-                unsigned int result = instance->render(param1, param2);
-
-                // Push the return value onto the stack.
-                lua_pushunsigned(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_SceneRenderer_render - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-}

+ 0 - 15
gameplay/src/lua/lua_SceneRenderer.h

@@ -1,15 +0,0 @@
-#ifndef LUA_SCENERENDERER_H_
-#define LUA_SCENERENDERER_H_
-
-namespace gameplay
-{
-
-// Lua bindings for SceneRenderer.
-int lua_SceneRenderer__gc(lua_State* state);
-int lua_SceneRenderer_render(lua_State* state);
-
-void luaRegister_SceneRenderer();
-
-}
-
-#endif

+ 0 - 125
gameplay/src/lua/lua_SceneRendererForward.cpp

@@ -1,125 +0,0 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_SceneRendererForward.h"
-#include "Base.h"
-#include "Form.h"
-#include "Model.h"
-#include "ParticleEmitter.h"
-#include "SceneRenderer.h"
-#include "SceneRendererForward.h"
-#include "Terrain.h"
-
-namespace gameplay
-{
-
-void luaRegister_SceneRendererForward()
-{
-    const luaL_Reg lua_members[] = 
-    {
-        {"render", lua_SceneRendererForward_render},
-        {NULL, NULL}
-    };
-    const luaL_Reg lua_statics[] = 
-    {
-        {"create", lua_SceneRendererForward_static_create},
-        {NULL, NULL}
-    };
-    std::vector<std::string> scopePath;
-
-    gameplay::ScriptUtil::registerClass("SceneRendererForward", lua_members, NULL, NULL, lua_statics, scopePath);
-}
-
-static SceneRendererForward* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "SceneRendererForward");
-    luaL_argcheck(state, userdata != NULL, 1, "'SceneRendererForward' expected.");
-    return (SceneRendererForward*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_SceneRendererForward_render(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
-                    lua_error(state);
-                }
-
-                // Get parameter 2 off the stack.
-                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
-
-                SceneRendererForward* instance = getInstance(state);
-                unsigned int result = instance->render(param1, param2);
-
-                // Push the return value onto the stack.
-                lua_pushunsigned(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_SceneRendererForward_render - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_SceneRendererForward_static_create(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 0:
-        {
-            void* returnPtr = (void*)SceneRendererForward::create();
-            if (returnPtr)
-            {
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                object->instance = returnPtr;
-                object->owns = false;
-                luaL_getmetatable(state, "SceneRendererForward");
-                lua_setmetatable(state, -2);
-            }
-            else
-            {
-                lua_pushnil(state);
-            }
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-}

+ 0 - 15
gameplay/src/lua/lua_SceneRendererForward.h

@@ -1,15 +0,0 @@
-#ifndef LUA_SCENERENDERERFORWARD_H_
-#define LUA_SCENERENDERERFORWARD_H_
-
-namespace gameplay
-{
-
-// Lua bindings for SceneRendererForward.
-int lua_SceneRendererForward_render(lua_State* state);
-int lua_SceneRendererForward_static_create(lua_State* state);
-
-void luaRegister_SceneRendererForward();
-
-}
-
-#endif

+ 0 - 189
gameplay/src/lua/lua_VisibleSet.cpp

@@ -1,189 +0,0 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_VisibleSet.h"
-#include "VisibleSet.h"
-
-namespace gameplay
-{
-
-void luaRegister_VisibleSet()
-{
-    const luaL_Reg lua_members[] = 
-    {
-        {"getActiveCamera", lua_VisibleSet_getActiveCamera},
-        {"getNext", lua_VisibleSet_getNext},
-        {"reset", lua_VisibleSet_reset},
-        {NULL, NULL}
-    };
-    const luaL_Reg* lua_statics = NULL;
-    std::vector<std::string> scopePath;
-
-    gameplay::ScriptUtil::registerClass("VisibleSet", lua_members, NULL, lua_VisibleSet__gc, lua_statics, scopePath);
-}
-
-static VisibleSet* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "VisibleSet");
-    luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
-    return (VisibleSet*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_VisibleSet__gc(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                void* userdata = luaL_checkudata(state, 1, "VisibleSet");
-                luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    VisibleSet* instance = (VisibleSet*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_VisibleSet__gc - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_VisibleSet_getActiveCamera(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                VisibleSet* instance = getInstance(state);
-                void* returnPtr = (void*)instance->getActiveCamera();
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Camera");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_VisibleSet_getActiveCamera - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_VisibleSet_getNext(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                VisibleSet* instance = getInstance(state);
-                void* returnPtr = (void*)instance->getNext();
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "Node");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_VisibleSet_getNext - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_VisibleSet_reset(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                VisibleSet* instance = getInstance(state);
-                instance->reset();
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_VisibleSet_reset - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-}

+ 0 - 17
gameplay/src/lua/lua_VisibleSet.h

@@ -1,17 +0,0 @@
-#ifndef LUA_VISIBLESET_H_
-#define LUA_VISIBLESET_H_
-
-namespace gameplay
-{
-
-// Lua bindings for VisibleSet.
-int lua_VisibleSet__gc(lua_State* state);
-int lua_VisibleSet_getActiveCamera(lua_State* state);
-int lua_VisibleSet_getNext(lua_State* state);
-int lua_VisibleSet_reset(lua_State* state);
-
-void luaRegister_VisibleSet();
-
-}
-
-#endif

+ 0 - 3
gameplay/src/lua/lua_all_bindings.cpp

@@ -104,8 +104,6 @@ void lua_RegisterAllBindings()
     luaRegister_RenderStateStateBlock();
     luaRegister_RenderTarget();
     luaRegister_Scene();
-    luaRegister_SceneRenderer();
-    luaRegister_SceneRendererForward();
     luaRegister_ScreenDisplayer();
     luaRegister_ScriptController();
     luaRegister_ScriptTarget();
@@ -133,7 +131,6 @@ void lua_RegisterAllBindings()
     luaRegister_VertexFormat();
     luaRegister_VertexFormatElement();
     luaRegister_VerticalLayout();
-    luaRegister_VisibleSet();
     luaRegister_lua_Global();
 }
 

+ 0 - 3
gameplay/src/lua/lua_all_bindings.h

@@ -99,8 +99,6 @@
 #include "lua_RenderStateStateBlock.h"
 #include "lua_RenderTarget.h"
 #include "lua_Scene.h"
-#include "lua_SceneRenderer.h"
-#include "lua_SceneRendererForward.h"
 #include "lua_ScreenDisplayer.h"
 #include "lua_ScriptController.h"
 #include "lua_ScriptTarget.h"
@@ -128,7 +126,6 @@
 #include "lua_VertexFormat.h"
 #include "lua_VertexFormatElement.h"
 #include "lua_VerticalLayout.h"
-#include "lua_VisibleSet.h"
 #include "lua_Global.h"
 
 namespace gameplay

+ 0 - 2
samples/browser/sample-browser.vcxproj

@@ -416,7 +416,6 @@ copy ..\..\gameplay\res\logo_powered_white.png res</Command>
     <ClCompile Include="src\GestureSample.cpp" />
     <ClCompile Include="src\LightSample.cpp" />
     <ClCompile Include="src\PostProcessSample.cpp" />
-    <ClCompile Include="src\SceneRendererSample.cpp" />
     <ClCompile Include="src\TerrainSample.cpp" />
     <ClCompile Include="src\TriangleSample.cpp" />
     <ClCompile Include="src\FirstPersonCamera.cpp" />
@@ -441,7 +440,6 @@ copy ..\..\gameplay\res\logo_powered_white.png res</Command>
     <ClInclude Include="src\GestureSample.h" />
     <ClInclude Include="src\LightSample.h" />
     <ClInclude Include="src\PostProcessSample.h" />
-    <ClInclude Include="src\SceneRendererSample.h" />
     <ClInclude Include="src\TerrainSample.h" />
     <ClInclude Include="src\TriangleSample.h" />
     <ClInclude Include="src\FirstPersonCamera.h" />

+ 0 - 6
samples/browser/sample-browser.vcxproj.filters

@@ -316,9 +316,6 @@
     <ClInclude Include="src\TerrainSample.h">
       <Filter>src</Filter>
     </ClInclude>
-    <ClInclude Include="src\SceneRendererSample.h">
-      <Filter>src</Filter>
-    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="src\MeshPrimitiveSample.cpp">
@@ -387,9 +384,6 @@
     <ClCompile Include="src\TerrainSample.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\SceneRendererSample.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="res\common\terrain\dirt.dds">