Parcourir la source

(Mostly) updated verve implementation.

Areloch il y a 6 ans
Parent
commit
87ee749801
100 fichiers modifiés avec 11591 ajouts et 0 suppressions
  1. 76 0
      Engine/modules/Verve/Core/ITreeNode.h
  2. 137 0
      Engine/modules/Verve/Core/Persistence/VPersistence.cpp
  3. 286 0
      Engine/modules/Verve/Core/Persistence/VPersistence.h
  4. 31 0
      Engine/modules/Verve/Core/Util/VSharedEnum.cpp
  5. 49 0
      Engine/modules/Verve/Core/Util/VSharedEnum.h
  6. 1160 0
      Engine/modules/Verve/Core/VController.cpp
  7. 246 0
      Engine/modules/Verve/Core/VController.h
  8. 254 0
      Engine/modules/Verve/Core/VDataTable.cpp
  9. 118 0
      Engine/modules/Verve/Core/VDataTable.h
  10. 406 0
      Engine/modules/Verve/Core/VEvent.cpp
  11. 109 0
      Engine/modules/Verve/Core/VEvent.h
  12. 32 0
      Engine/modules/Verve/Core/VGroup.cpp
  13. 47 0
      Engine/modules/Verve/Core/VGroup.h
  14. 483 0
      Engine/modules/Verve/Core/VObject.cpp
  15. 126 0
      Engine/modules/Verve/Core/VObject.h
  16. 448 0
      Engine/modules/Verve/Core/VTrack.cpp
  17. 123 0
      Engine/modules/Verve/Core/VTrack.h
  18. 471 0
      Engine/modules/Verve/Core/VTreeNode.cpp
  19. 73 0
      Engine/modules/Verve/Core/VTreeNode.h
  20. 154 0
      Engine/modules/Verve/Extension/Animation/VShapeAnimationEvent.cpp
  21. 69 0
      Engine/modules/Verve/Extension/Animation/VShapeAnimationEvent.h
  22. 185 0
      Engine/modules/Verve/Extension/Animation/VShapeAnimationTrack.cpp
  23. 64 0
      Engine/modules/Verve/Extension/Animation/VShapeAnimationTrack.h
  24. 224 0
      Engine/modules/Verve/Extension/Camera/VCameraGroup.cpp
  25. 97 0
      Engine/modules/Verve/Extension/Camera/VCameraGroup.h
  26. 83 0
      Engine/modules/Verve/Extension/Camera/VCameraShakeEvent.cpp
  27. 59 0
      Engine/modules/Verve/Extension/Camera/VCameraShakeEvent.h
  28. 114 0
      Engine/modules/Verve/Extension/Camera/VCameraShakeTrack.cpp
  29. 55 0
      Engine/modules/Verve/Extension/Camera/VCameraShakeTrack.h
  30. 108 0
      Engine/modules/Verve/Extension/Camera/VCameraTrack.cpp
  31. 60 0
      Engine/modules/Verve/Extension/Camera/VCameraTrack.h
  32. 75 0
      Engine/modules/Verve/Extension/Director/VDirectorEvent.cpp
  33. 61 0
      Engine/modules/Verve/Extension/Director/VDirectorEvent.h
  34. 57 0
      Engine/modules/Verve/Extension/Director/VDirectorGroup.cpp
  35. 59 0
      Engine/modules/Verve/Extension/Director/VDirectorGroup.h
  36. 63 0
      Engine/modules/Verve/Extension/Director/VDirectorTrack.cpp
  37. 47 0
      Engine/modules/Verve/Extension/Director/VDirectorTrack.h
  38. 82 0
      Engine/modules/Verve/Extension/Director/VSceneJumpEvent.cpp
  39. 57 0
      Engine/modules/Verve/Extension/Director/VSceneJumpEvent.h
  40. 32 0
      Engine/modules/Verve/Extension/Director/VSceneJumpTrack.cpp
  41. 47 0
      Engine/modules/Verve/Extension/Director/VSceneJumpTrack.h
  42. 130 0
      Engine/modules/Verve/Extension/Director/VSlowMoEvent.cpp
  43. 60 0
      Engine/modules/Verve/Extension/Director/VSlowMoEvent.h
  44. 93 0
      Engine/modules/Verve/Extension/Director/VSlowMoTrack.cpp
  45. 52 0
      Engine/modules/Verve/Extension/Director/VSlowMoTrack.h
  46. 111 0
      Engine/modules/Verve/Extension/GUI/VFadeEvent.cpp
  47. 60 0
      Engine/modules/Verve/Extension/GUI/VFadeEvent.h
  48. 139 0
      Engine/modules/Verve/Extension/GUI/VFadeTrack.cpp
  49. 52 0
      Engine/modules/Verve/Extension/GUI/VFadeTrack.h
  50. 32 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereGroup.cpp
  51. 47 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereGroup.h
  52. 68 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetEvent.cpp
  53. 56 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetEvent.h
  54. 155 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp
  55. 69 0
      Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.h
  56. 92 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationEvent.cpp
  57. 62 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationEvent.h
  58. 118 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationTrack.cpp
  59. 56 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationTrack.h
  60. 32 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectGroup.cpp
  61. 47 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectGroup.h
  62. 70 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectToggleEvent.cpp
  63. 65 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectToggleEvent.h
  64. 63 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectToggleTrack.cpp
  65. 55 0
      Engine/modules/Verve/Extension/LightObject/VLightObjectToggleTrack.h
  66. 212 0
      Engine/modules/Verve/Extension/Motion/VMotionEvent.cpp
  67. 61 0
      Engine/modules/Verve/Extension/Motion/VMotionEvent.h
  68. 442 0
      Engine/modules/Verve/Extension/Motion/VMotionTrack.cpp
  69. 85 0
      Engine/modules/Verve/Extension/Motion/VMotionTrack.h
  70. 32 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectGroup.cpp
  71. 47 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectGroup.h
  72. 70 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.cpp
  73. 65 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.h
  74. 63 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleTrack.cpp
  75. 55 0
      Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleTrack.h
  76. 77 0
      Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleEvent.cpp
  77. 65 0
      Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleEvent.h
  78. 103 0
      Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleTrack.cpp
  79. 65 0
      Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleTrack.h
  80. 77 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectEvent.cpp
  81. 63 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectEvent.h
  82. 104 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectGroup.cpp
  83. 72 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectGroup.h
  84. 77 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectTrack.cpp
  85. 63 0
      Engine/modules/Verve/Extension/SceneObject/VSceneObjectTrack.h
  86. 101 0
      Engine/modules/Verve/Extension/Script/VScriptEvent.cpp
  87. 74 0
      Engine/modules/Verve/Extension/Script/VScriptEvent.h
  88. 32 0
      Engine/modules/Verve/Extension/Script/VScriptEventTrack.cpp
  89. 47 0
      Engine/modules/Verve/Extension/Script/VScriptEventTrack.h
  90. 131 0
      Engine/modules/Verve/Extension/SoundEffect/VSoundEffectEvent.cpp
  91. 74 0
      Engine/modules/Verve/Extension/SoundEffect/VSoundEffectEvent.h
  92. 111 0
      Engine/modules/Verve/Extension/SoundEffect/VSoundEffectTrack.cpp
  93. 60 0
      Engine/modules/Verve/Extension/SoundEffect/VSoundEffectTrack.h
  94. 216 0
      Engine/modules/Verve/GUI/VEditorButton.cpp
  95. 62 0
      Engine/modules/Verve/GUI/VEditorButton.h
  96. 97 0
      Engine/modules/Verve/GUI/VEditorScrollControl.cpp
  97. 56 0
      Engine/modules/Verve/GUI/VEditorScrollControl.h
  98. 158 0
      Engine/modules/Verve/GUI/VEditorWindow.cpp
  99. 49 0
      Engine/modules/Verve/GUI/VEditorWindow.h
  100. 114 0
      Engine/modules/Verve/GUI/VFadeControl.cpp

+ 76 - 0
Engine/modules/Verve/Core/ITreeNode.h

@@ -0,0 +1,76 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_ITREENODE_H_
+#define _VT_ITREENODE_H_
+
+//-----------------------------------------------------------------------------
+
+class ITreeNode
+{
+public:
+
+    ITreeNode   *mParentNode;
+    ITreeNode   *mChildNode;
+
+    ITreeNode   *mSiblingPrevNode;
+    ITreeNode   *mSiblingNextNode;
+
+public:
+
+    ITreeNode( void ) :
+            mParentNode( 0 ),
+            mChildNode( 0 ),
+            mSiblingPrevNode( 0 ),
+            mSiblingNextNode( 0 )
+    {
+        // Void.
+    };
+
+    virtual ~ITreeNode( void )
+    {
+        // Void.
+    };
+
+    virtual void               clear( void ) = 0;                              // Clear the Node.
+
+    virtual ITreeNode         *getRoot( void ) = 0;                            // Get Root Node.
+    virtual ITreeNode         *getParent( void ) = 0;                          // Get Parent Node.
+    virtual ITreeNode         *getChild( void ) = 0;                           // Get Child Node.
+    virtual ITreeNode         *getLastChild( void ) = 0;                       // Get Last Child Node.
+
+    virtual ITreeNode         *getPrevSibling( void ) = 0;                     // Get Previous Sibling Node.
+    virtual ITreeNode         *getNextSibling( void ) = 0;                     // Get Next Sibling Node.
+
+    virtual void               addTo( ITreeNode *pNode ) = 0;                  // Add Node to target node.
+    virtual void               remove( void ) = 0;                             // Remove this Node from the tree.
+    virtual void               moveTo( ITreeNode* node ) = 0;                  // Move to specified Node.
+
+    virtual void               onAttach( void ) = 0;                           // Attach Callback.
+    virtual void               onDetach( void ) = 0;                           // Detach Callback.
+
+    virtual bool               inTree( void ) = 0;                             // Is Node in a tree?
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_ITREENODE_H_

+ 137 - 0
Engine/modules/Verve/Core/Persistence/VPersistence.cpp

@@ -0,0 +1,137 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/Persistence/VPersistence.h"
+
+#include "Verve/Core/VController.h"
+#include "Verve/Core/VObject.h"
+
+namespace VPersistence
+{
+    //-----------------------------------------------------------------------------
+    //
+    // VController
+    //
+    //-----------------------------------------------------------------------------
+
+    template <>
+    bool write( TiXmlElement *pElement, VController *pObject )
+    {
+        // Write Properties.
+        if ( !writeProperties( pElement, pObject ) )
+        {
+            return false;
+        }
+
+        // Write Data Table.
+        if ( !pObject->writeDataTable( pElement ) )
+        {
+            return false;
+        }
+
+        // Write Objects.
+        return writeObjects( pElement, pObject );
+    }
+
+    template <>
+    bool read( TiXmlElement *pElement, VController *pObject )
+    {
+        // Read Properties.
+        if ( !readProperties( pElement, pObject ) )
+        {
+            // Invalid Properties.
+            return false;
+        }
+
+        // Read Data Table.
+        if ( !pObject->readDataTable( pElement ) )
+        {
+            // Invalid Data Table.
+            return false;
+        }
+
+        // Read Objects.
+        if ( !readObjects( pElement, pObject ) )
+        {
+            // Invalid Read.
+            return false;
+        }
+
+        // Valid Read.
+        return true;
+    }
+
+    //-----------------------------------------------------------------------------
+    //
+    // VObject
+    //
+    //-----------------------------------------------------------------------------
+
+    template <>
+    bool write( TiXmlElement *pElement, VObject *pObject )
+    {
+        // Create Element.
+        TiXmlElement *objectElement = new TiXmlElement( "VObject" );
+        pElement->LinkEndChild( objectElement );
+
+        // Attributes.
+        objectElement->SetAttribute( "Type", pObject->getClassName() );
+
+        // Write Properties.
+        if ( !writeProperties( objectElement, pObject ) )
+        {
+            return false;
+        }
+
+        // Write Objects.
+        return writeObjects( objectElement, pObject );
+    }
+
+    template <>
+    bool read( TiXmlElement *pElement, VObject *pObject )
+    {
+        // Read Properties.
+        if ( !readProperties( pElement, pObject ) )
+        {
+            // Invalid Properties.
+            return false;
+        }
+
+        // Set Name Unique.
+        pObject->setLabelUnique( pObject->getLabel() );
+
+        // Read Objects.
+        if ( !readObjects( pElement, pObject ) )
+        {
+            // Invalid Objects.
+            return false;
+        }
+
+#ifdef VT_EDITOR
+        // Callback.
+        Con::executef( pObject, "onRead" );
+#endif
+
+        // Valid Read.
+        return true;
+    }
+}

+ 286 - 0
Engine/modules/Verve/Core/Persistence/VPersistence.h

@@ -0,0 +1,286 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPERSISTENCE_H_
+#define _VT_VPERSISTENCE_H_
+
+#ifndef TINYXML_INCLUDED
+#include "tinyxml/tinyxml.h"
+#endif
+
+#ifndef _SIMOBJECT_H_
+#include "console/simObject.h"
+#endif
+
+#ifndef _VT_VOBJECT_H_
+#include "Verve/Core/VObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+namespace VPersistence
+{
+    static const char *VSFVersionString = "0.0.0a";
+
+    // This object is used to filter fields which belong to SimObject's.
+    // There is no need to serialize these fields, so they are skipped
+    // entirely.
+    static SimObject DummySimObject;
+
+    //-------------------------------------------------------------------------
+
+    template <class T> bool writeFile( const char* pFileName, T *pObject )
+    {
+        // Create Doc.
+        TiXmlDocument xmlDocument;
+        TiXmlDeclaration *xmlDeclaration = new TiXmlDeclaration( "1.0", "", "" );
+        xmlDocument.LinkEndChild( xmlDeclaration );
+
+        // Create Root.
+        TiXmlElement *xmlRoot = new TiXmlElement( "VerveControllerSequence" );
+        xmlDocument.LinkEndChild( xmlRoot );
+
+        // Write Version.
+        xmlRoot->SetAttribute( "Version", VSFVersionString );
+
+        // Write Object.
+        if ( !write( xmlRoot, pObject ) )
+        {
+            Con::errorf( "VPersistence::writeFile() - Unable to Write Object." );
+            return false;
+        }
+
+        // Save File.
+        return xmlDocument.SaveFile( pFileName );
+    };
+
+    template <class T> bool write( TiXmlElement *pElement, T *pObject );
+    
+    template <class T> bool writeProperties( TiXmlElement *pElement, T *pObject )
+    {
+        const AbstractClassRep::FieldList &fieldList = pObject->getFieldList();
+        const AbstractClassRep::Field     *field     = NULL;
+
+        // Create Property Root.
+        TiXmlElement *propertyRoot = new TiXmlElement( "Properties" );
+        pElement->LinkEndChild( propertyRoot );
+
+        const S32 fieldCount = fieldList.size();
+        for ( S32 i = 0; i < fieldCount; i++ )
+        {
+            field = &fieldList[i];
+            
+            if ( field->type >= AbstractClassRep::ARCFirstCustomField )
+            {
+                // Ignore Special Fields.
+                continue;
+            }
+
+            // Fetch the Field Name.
+            const char *fieldName = field->pFieldname;
+            // SimObject Field?
+            if ( DummySimObject.findField( fieldName ) != NULL )
+            {
+                // Skip SimObject Fields.
+                continue;
+            }
+
+            // Fetch the Field Value.
+            const char *fieldValue = ( *field->getDataFn )( pObject, Con::getData( field->type, ( void * ) ( ( ( const char * )pObject ) + field->offset ), 0, field->table, field->flag ) );
+
+            if ( fieldValue )
+            {
+                // Create Element.
+                TiXmlElement *propertyElement = new TiXmlElement( fieldName );  
+
+                // Apply Value.
+                propertyElement->InsertEndChild( TiXmlText( fieldValue ) );
+
+                // Add.
+                propertyRoot->LinkEndChild( propertyElement );
+            }
+        }
+
+        // Valid Write.
+        return true;
+    };
+
+    template <class T> bool writeObjects( TiXmlElement *pElement, T *pObject )
+    {
+        for ( ITreeNode *node = pObject->mChildNode; node != NULL; node = node->mSiblingNextNode )
+        {
+            // Write Group.
+            if ( !write( pElement, ( VObject* )node ) )
+            {
+                // Invalid Write.
+                return false;
+            }
+        }
+
+        // Valid Write.
+        return true;
+    }
+
+    //-------------------------------------------------------------------------
+
+    template <class T> bool readFile( const char* pFileName, T *pObject )
+    {
+        TiXmlDocument xmlDocument;
+        if ( !xmlDocument.LoadFile( pFileName ) )
+        {
+            Con::errorf( "VPersistence::readFile() - Unable to load file '%s'.", pFileName );
+            return false;
+        }
+
+        TiXmlElement *rootElement = xmlDocument.RootElement();
+        if ( !rootElement )
+        {
+            Con::errorf( "VPersistence::readFile() - Invalid Document '%s'.", pFileName );
+            return false;
+        }
+
+        const char *docVersion = rootElement->Attribute( "Version" );
+        if ( !docVersion || dStrcmp( VSFVersionString, docVersion ) != 0 )
+        {
+            Con::errorf( "VPersistence::readFile() - Invalid file version." );
+            return false;
+        }
+
+        // Read Object.
+        if ( !read( rootElement, pObject ) )
+        {
+            // Invalid Read.
+            return false;
+        }
+
+        // Valid.
+        return true;
+    };
+
+    template <class T> bool read( TiXmlElement *pElement, T *pObject );
+
+    template <class T> bool readProperties( TiXmlElement *pElement, T *pObject )
+    {
+        TiXmlElement *propertyRoot = pElement->FirstChildElement( "Properties" );
+        if ( propertyRoot )
+        {
+            for ( TiXmlElement *child = propertyRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
+            {
+                // Get Field Data.
+                const char *fieldName  = child->Value();
+                const char *fieldValue = child->GetText();
+
+                if ( !fieldValue )
+                {
+                    // Clear Value.
+                    pObject->setField( fieldName, "" );
+                }
+                else
+                {
+                    // Apply Field Value.
+                    if ( !pObject->setField( fieldName, fieldValue ) )
+                    {
+                        // Invalid.
+                        Con::warnf( "VPersistence::readProperties() - Invalid property '%s'", fieldName );
+                    }
+                }
+            }
+        }
+        
+        // Valid Read.
+        return true;
+    };
+
+    template <class T> bool readObjects( TiXmlElement *pElement, T *pObject )
+    {
+        for ( TiXmlElement *child = pElement->FirstChildElement( "VObject" ); child != NULL; child = child->NextSiblingElement( "VObject" ) )
+        {
+            // Get Object Type.
+            const char *type = child->Attribute( "Type" );
+            if ( !type || !AbstractClassRep::findClassRep( type ) )
+            {
+                // Invalid Type.
+                Con::errorf( "VController::readObjects() - Invalid object type specified '%s'.", ( ( type ) ? type : "NULL" ) );
+
+                // Invalid Read.
+                return false;
+            }
+
+            // Create Object.
+            VObject *object = dynamic_cast<VObject*>( ConsoleObject::create( type ) );
+
+#ifdef VT_EDITOR
+            // Register SimObject.
+            if ( !object->registerObject() )
+            {
+                // Delete.
+                delete object;
+
+                // Invalid Read.
+                return false;
+            }
+#endif
+
+            // Add Reference.
+            object->addTo( pObject );
+
+#ifdef VT_EDITOR
+            // Valid Method?
+            if ( object->isMethod( "onAdd" ) )
+            {
+                // Callback.
+                const char *retValue = Con::executef( object, "onAdd" );
+                if ( !dAtob( retValue ) )
+                {
+                    // Delete.
+                    object->deleteObject();
+
+                    // Invalid Read.
+                    return false;
+                }
+            }
+#endif
+
+            // Read Object.
+            if ( !read( child, object ) )
+            {
+#ifdef VT_EDITOR
+                // Delete.
+                object->deleteObject();
+#else
+                // Delete.
+                delete object;
+#endif
+
+                // Invalid Read.
+                return false;
+            }
+        }
+
+        // Valid Read.
+        return true;
+    };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPERSISTENCE_H_

+ 31 - 0
Engine/modules/Verve/Core/Util/VSharedEnum.cpp

@@ -0,0 +1,31 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "VSharedEnum.h"
+
+//-----------------------------------------------------------------------------
+
+// Implement the Action enum list.
+ImplementEnumType( VActionToggle, "" )
+    { VSharedEnum::k_ActionTurnOn,  "ON"  },
+    { VSharedEnum::k_ActionTurnOff, "OFF" },
+EndImplementEnumType;

+ 49 - 0
Engine/modules/Verve/Core/Util/VSharedEnum.h

@@ -0,0 +1,49 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSHAREDENUM_H_
+#define _VT_VSHAREDENUM_H_
+
+#ifndef _DYNAMIC_CONSOLETYPES_H_
+#include "console/dynamicTypes.h"
+#endif
+
+namespace VSharedEnum
+{
+    enum eActionToggle
+    {
+        k_ActionTurnOn,
+        k_ActionTurnOff,
+    };
+};
+
+//-----------------------------------------------------------------------------
+
+// Define Types.
+typedef VSharedEnum::eActionToggle VActionToggle;
+
+// Declare Enum Types.
+DefineEnumType( VActionToggle );
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSHAREDENUM_H_

+ 1160 - 0
Engine/modules/Verve/Core/VController.cpp

@@ -0,0 +1,1160 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VController.h"
+#include "Verve/Core/VObject.h"
+#include "Verve/Core/VGroup.h"
+#include "Verve/Core/VTrack.h"
+
+#include "Verve/Extension/Director/VDirectorGroup.h"
+
+#include "console/consoleObject.h"
+#include "console/consoleTypes.h"
+#include "math/mMathFn.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VController );
+//-----------------------------------------------------------------------------
+
+VController::VController( void ) :
+        mStatus( ( k_StatusInit | k_StatusStopped ) ),
+        mTime( 0 ),
+        mLastTime( 0 ),
+        mTimeScale( 1.f ),
+        mDuration( 5000 ),
+        mLoop( false ),
+        mLoopBackwards( false ),
+        mLoopCount( -1 ),
+        mLoopIndex( 0 ),
+        mLoopDelay( 0 ),
+        mLoopDelayTime( 0 ),
+        mJump( k_JumpInvalid ),
+        mJumpTime( 0 ),
+        mResetOnCompletion( true )
+{
+    // Don't Process Ticks.
+    setProcessTicks( false );
+}
+
+VController::~VController( void )
+{
+    // Void.
+}
+
+void VController::initPersistFields( void )
+{
+    addGroup( "Controller" );
+        addProtectedField( "Time",      TypeS32,  Offset( mTime,              VController ), &setTime,      &defaultProtectedGetFn, "Current position of the Controller (in milliseconds)." );
+        addProtectedField( "Duration",  TypeS32,  Offset( mDuration,          VController ), &setDuration,  &defaultProtectedGetFn, "Total length of the sequence (in milliseconds)." );
+        addProtectedField( "TimeScale", TypeF32,  Offset( mTimeScale,         VController ), &setTimeScale, &defaultProtectedGetFn, "Speed of playback. A value > 0.0 will enable the Controller to play forwards, while a value < 0.0 will play backwards. If |TimeScale| > 1.0, then playback will be faster than normal, while |TimeScale| < 1.0 will be slower." );
+
+        addField( "Loop",               TypeBool, Offset( mLoop,              VController ), "Instead of stopping once playback is complete, the Controller will reset and resume play." );
+        addField( "LoopBackwards",      TypeBool, Offset( mLoopBackwards,     VController ), "When the sequence loops, reverse the direction of play." );
+        addField( "LoopCount",          TypeS32,  Offset( mLoopCount,         VController ), "The number of times the sequence loops before stopping. -1 will cause the sequence to loop indefinitely." );
+        addField( "LoopDelay",          TypeS32,  Offset( mLoopDelay,         VController ), "When the sequence loops, delay playback by this value (in milliseconds)." );
+
+        addField( "ResetOnCompletion",  TypeBool, Offset( mResetOnCompletion, VController ), "When the sequence is completed, reset the state of the Controller." );
+    endGroup( "Controller" );
+
+    // Parent Call.
+    Parent::initPersistFields();
+}
+
+//-----------------------------------------------------------------------------
+//
+// ITickable Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::processTick();
+// 
+// This method controls the playback of the entire sequence. It integrates all
+// of the groups and handles sequence looping and jumping.
+// 
+//-----------------------------------------------------------------------------
+void VController::processTick( void )
+{
+    if ( mTimeScale == 0.f )
+    {
+        // Pause.
+        pause();
+
+        // Exit.
+        return;
+    }
+
+    // Calculate Delta.
+    const S32 time  = Sim::getCurrentTime();
+    S32 delta = ( time - mLastTime );
+    mLastTime = time;
+
+    // Reverse?
+    if ( mTimeScale < 0.f )
+    {
+        // Negative Delta.
+        delta *= -1;
+    }
+
+    if ( mLoopDelayTime > 0 )
+    {
+        // Update Delay Time.
+        mLoopDelayTime -= getMin( mAbs( delta ), mLoopDelayTime );
+
+        // Exit.
+        return;
+    }
+
+    // Jump Delta?
+    if ( mJump == k_JumpDelta )
+    {
+        // Jump.
+        delta = mJumpTime;
+
+        // Clear.
+        mJump     = k_JumpInvalid;
+        mJumpTime = 0;
+    }
+
+    if ( ( isPlayingForward()  && ( mTime + delta ) > mDuration )
+         || ( !isPlayingForward() && ( mTime + delta ) < 0 ) )
+    {
+        // Clamp Delta.
+        delta = ( ( mTimeScale > 0.f ) * mDuration ) - mTime;
+
+        // Note: If we are playing forwards, we're at the end of the
+        //       sequence and we want to loop/reset the Controller, then we
+        //       need to handle that now.
+        if ( delta == 0 )
+        {
+            onPostTick();
+        }
+    }
+
+    // Valid Delta?
+    if ( delta == 0 )
+    {
+        // Exit.
+        return;
+    }
+
+    // Trigger Update.
+    mControllerUpdateSignal.trigger( mTime, delta );
+
+    // Update Time.
+    mTime += delta;
+
+    // Perform Post Tick.
+    onPostTick();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::onPostTick();
+// 
+// This method is called onces a tick has been processed. It will perform the
+// the right checks to see if the Controller has finished playing. It also 
+// handles special cases like Looping or Resetting the Controller.
+// 
+//-----------------------------------------------------------------------------
+void VController::onPostTick( void )
+{
+    // Jump Time?
+    if ( mJump == k_JumpTime )
+    {
+        // Jump Post Update.
+        reset( mJumpTime );
+
+        // Clear.
+        mJump     = k_JumpInvalid;
+        mJumpTime = 0;
+    }
+
+    // Sequence Completed?
+    if ( isPlayingForward() && mTime >= mDuration 
+        || !isPlayingForward() && mTime <= 0 )
+    {
+        bool stopPlaying = true;
+        if ( mLoop )
+        {
+            // Don't Stop.
+            stopPlaying = false;
+
+            if ( mLoopBackwards )
+            {
+                // Change Direction.
+                setTimeScale( -1.f * mTimeScale );
+            }
+            else
+            {
+                // Reset Time.
+                reset();
+            }
+
+            if ( mLoopDelay > 0 )
+            {
+                // Resume After Delay.
+                mLoopDelayTime = mLoopDelay;
+            }
+
+            // At the Start of the Sequence?
+            if ( mTime <= 0 && mLoopCount >= 0 )
+            {
+                // Stop Looping?
+                stopPlaying = ( ++mLoopIndex >= mLoopCount );
+            }
+
+            // Callback.
+            Con::executef( this, "onLoop" );
+
+            // Loop Signal.
+            postEvent( k_EventLoop );
+        }
+
+        // Stop?
+        if ( stopPlaying )
+        {
+            // Stop Only.
+            stop( mResetOnCompletion );
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::reset();
+// 
+// Reset the Controller to the start of the sequence.
+// 
+//-----------------------------------------------------------------------------
+void VController::reset( void )
+{
+    // Reset.
+    reset( ( isPlayingForward() ) ? 0 : mDuration );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::reset( pTime );
+// 
+// Reset the Controller to the target time. This is a very important method as
+// it allows tracks and events to reset their state as well as prepare
+// themselves for playback.
+// 
+//-----------------------------------------------------------------------------
+void VController::reset( const S32 &pTime )
+{
+    // Reset Time.
+    mTime     = pTime;
+    mLastTime = Sim::getCurrentTime();
+
+    // Reset Delay Time.
+    mLoopDelayTime = 0;
+
+    // Post Event.
+    postEvent( k_EventReset );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::play();
+// 
+// Start playing the sequence from the current time and execute a number of
+// callbacks.
+// 
+//-----------------------------------------------------------------------------
+void VController::play( void )
+{
+    if ( isPlaying() || mTime < 0 || mTime > mDuration )
+    {
+        // Sanity!
+        return;
+    }
+
+    // Reset Time.
+    mLastTime = Sim::getCurrentTime();
+
+    // Start Updating.
+    setProcessTicks( true );
+
+    if ( mStatus & k_StatusInit )
+    {
+        // Init Signal.
+        postEvent( k_EventInit );
+
+        // Clear Init Status.
+        mStatus &= ~k_StatusInit;
+    }
+
+    // Update Status.
+    updateStatus( k_StatusPlaying );
+
+    // Play Signal.
+    postEvent( k_EventPlay );
+
+    // Callback.
+    Con::executef( this, "onPlay" );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::play( pTime );
+// 
+// Start playing the sequence from the desired time.
+// 
+//-----------------------------------------------------------------------------
+void VController::play( const S32 &pTime )
+{
+    // Reset.
+    reset( pTime );
+
+    // Play.
+    play();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::pause();
+// 
+// Cease playback of the sequence, but maintain the current time.
+// 
+//-----------------------------------------------------------------------------
+void VController::pause( void )
+{
+    // Stop Updating.
+    setProcessTicks( false );
+
+    // Update Status.
+    updateStatus( k_StatusPaused );
+
+    // Pause Signal.
+    postEvent( k_EventPause );
+
+    // Callback.
+    Con::executef( this, "onPause" );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::stop( pReset );
+// 
+// Stop playback altogether and reset the Controller to the start of the
+// sequence.
+// 
+//-----------------------------------------------------------------------------
+void VController::stop( const bool &pReset )
+{
+    // Stop Updating.
+    setProcessTicks( false );
+
+    // Reset Loop Index.
+    mLoopIndex = 0;
+
+    // Update Status.
+    updateStatus( ( k_StatusInit | k_StatusStopped ) );
+
+    // Reset?
+    if ( pReset )
+    {
+        // Reset.
+        reset();
+    }
+
+    // Stop Signal.
+    postEvent( k_EventStop );
+
+    // Callback.
+    Con::executef( this, "onStop" );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::jump();
+// 
+// Jump the Controller time forward 1 tick (32ms).
+// 
+//-----------------------------------------------------------------------------
+void VController::jump( void )
+{
+    // Jump 1 tick.
+    jump( k_JumpDelta, ( isPlayingForward() ) ? TickMs : -TickMs );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::jump( pType, pDelta );
+// 
+// Jump the Controller time by the target Delta.
+// 
+//-----------------------------------------------------------------------------
+void VController::jump( const eControllerJumpType &pType, const S32 &pDelta )
+{
+    // Jump.
+    mJump     = pType;
+    mJumpTime = pDelta;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::updateStatus( pStatus );
+// 
+// Clear the regular playback states and add the updated state.
+// 
+//-----------------------------------------------------------------------------
+void VController::updateStatus( const S32 &pStatus )
+{
+    // Clear Playback Status.
+    mStatus &= ~( k_StatusPlaying | k_StatusPaused | k_StatusStopped );
+
+    // Add New Status.
+    mStatus |= pStatus;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::getObject( pLabel );
+// 
+// Returns the group with the given name. If no group belongs to the Controller
+// with that name, then a NULL value is returned.
+// 
+//-----------------------------------------------------------------------------
+VGroup *VController::getObject( const String &pLabel )
+{
+    VGroup *node = ( VGroup* )mChildNode;
+    while ( node )
+    {
+        // Compare Names.
+        if ( node->getLabel().equal( pLabel, String::NoCase ) )
+        {
+            // Valid.
+            return node;
+        }
+
+        // Next Sibling.
+        node = ( VGroup* )node->mSiblingNextNode;
+    }
+
+    // Invalid.
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::getDirectorGroup();
+// 
+// Returns the DirectorGroup reference if the Controller has a one.
+// 
+//-----------------------------------------------------------------------------
+VDirectorGroup *VController::getDirectorGroup( void )
+{
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        if ( VDirectorGroup *group = dynamic_cast<VDirectorGroup*>( node ) )
+        {
+            // Return Group.
+            return group;
+        }
+    }
+
+    // Invalid Group.
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::getDirectorTrack();
+// 
+// Returns the DirectorTrack reference if the DirectorGroup has one.
+// 
+//-----------------------------------------------------------------------------
+VDirectorTrack *VController::getDirectorTrack( void )
+{
+    VDirectorGroup *group = getDirectorGroup();
+    if ( !group )
+    {
+        // Invalid Track.
+        return NULL;
+    }
+
+    // Return Track.
+    return group->getDirectorTrack();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::getDataValue( pFieldName, *pValue );
+// 
+// Returns true if the field is a DataTable member and can be correctly
+// evaluated. If this is the case, then pValue will contain the result.
+// 
+//-----------------------------------------------------------------------------
+bool VController::getDataValue( const String &pFieldName, String &pValue )
+{
+    return mDataTable.getValue( this, pFieldName, pValue );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::clearData();
+// 
+// Clear the contents of the DataTable entirely.
+// 
+//-----------------------------------------------------------------------------
+void VController::clearData( void )
+{
+    while ( mDataTable.getCount() > 0 )
+    {
+        // Clear Item.
+        clearData( 0 );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::clearData( pIndex );
+// 
+// Clear the DataTable entry with the given index.
+// 
+//-----------------------------------------------------------------------------
+void VController::clearData( const S32 &pIndex )
+{
+    VDataTable::sDataItem data;
+    if ( mDataTable.getItem( pIndex, &data ) )
+    {
+        // Clear Data.
+        clearData( data.FieldName );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::clearData( pIndex );
+// 
+// Clear the DataTable entry with the given field name.
+// 
+//-----------------------------------------------------------------------------
+void VController::clearData( const String &pFieldName )
+{
+    // Clear Dynamic Field.
+    setDataField( pFieldName, NULL, "" );
+
+    // Clear Item.
+    mDataTable.clear( pFieldName );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::sort();
+// 
+// Sort each track in each of the child groups.
+// 
+//-----------------------------------------------------------------------------
+void VController::sort( void )
+{
+    for ( ITreeNode *group = mChildNode; group != NULL; group = group->mSiblingNextNode )
+    {
+        for ( ITreeNode *track = group->mChildNode; track != NULL; track = track->mSiblingNextNode )
+        {
+            // Sort Track.
+            ( ( VTrack* )track )->sort();
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Write Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::writeDataTable( pElement );
+// 
+// Write the DataTable out to a TinyXML document.
+// 
+//-----------------------------------------------------------------------------
+bool VController::writeDataTable( TiXmlElement *pElement )
+{
+    // Create Data Table Root.
+    TiXmlElement *dataTableRoot = new TiXmlElement( "DataTable" );
+    pElement->LinkEndChild( dataTableRoot );
+
+    for ( VDataTable::VDataMap::Iterator itr = mDataTable.mDataMap.begin(); itr != mDataTable.mDataMap.end(); ++itr )
+    {
+        // Fetch Data.
+        VDataTable::sDataItem *data = &itr->value;
+
+        // Create Element.
+        TiXmlElement *dataElement = new TiXmlElement( "DataItem" );  
+
+        // Apply Attributes.
+        dataElement->SetAttribute( "Type",  VDataTable::getDataTypeDescription( data->Type ) );
+        dataElement->SetAttribute( "Name",  data->FieldName );
+        dataElement->SetAttribute( "Value", getDataField( StringTable->insert( data->FieldName.c_str() ), NULL ) );
+
+        // Add.
+        dataTableRoot->LinkEndChild( dataElement );
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Read Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::readDataTable( pElement );
+// 
+// Read the DataTable from a TinyXML document.
+// 
+//-----------------------------------------------------------------------------
+bool VController::readDataTable( TiXmlElement *pElement )
+{
+    TiXmlElement *dataTableRoot = pElement->FirstChildElement( "DataTable" );
+    if ( dataTableRoot )
+    {
+        for ( TiXmlElement *child = dataTableRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
+        {
+            // Get Field Data.
+            const char *fieldType  = child->Attribute( "Type" );
+            const char *fieldName  = child->Attribute( "Name" );
+            const char *fieldValue = child->Attribute( "Value" );
+
+            // Add Data Item.
+            mDataTable.insert( VDataTable::getDataTypeEnum( fieldType ), fieldName );
+
+            // Set Field Value.
+            setDataField( StringTable->insert( fieldName ), NULL, fieldValue );
+        }
+    }
+    
+    // Valid Read.
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VController::postEvent( pEvent );
+// 
+// Process an event signal to all event subscribers. This method is used to
+// signal changes in the Controller's status.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+void VController::postEvent( const eControllerEventType &pEvent )
+{
+    // Signal Event.
+    mControllerEventSignal.trigger( pEvent );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VController::setTimeScale( pTimeScale );
+// 
+// Set the speed of playback. In effect, a value of 0.5 will double the real
+// time taken to complete the playback of the sequence, while a value of 2.0
+// will halve the time needed.
+// 
+//-----------------------------------------------------------------------------
+void VController::setTimeScale( const F32 &pTimeScale )
+{
+    // Need an Update?
+    const bool update = ( pTimeScale != 0.f && ( mTimeScale == 0.f || ( ( mTimeScale > 0.f ) != ( pTimeScale > 0.f ) ) ) );
+
+    // Store.
+    mTimeScale = pTimeScale;
+
+    // Update $timeScale Variable.
+    Con::setFloatVariable( "timeScale", mFabs( mTimeScale ) );
+
+    if ( update )
+    {
+        // Reset.
+        reset( mTime );
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Console Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VController, readFile, bool, 3, 3, "( string pFileName ) - Clears the object and loads the new data from the given filename.\n"
+                                                  "@param pFileName The target file to read from.\n"
+                                                  "@return Returns true if the read was successful." )
+{
+    // Buffer the FileName.
+    // Note: This is done because the arg variables can be altered during any
+    //       Callbacks or Console Methods called while clearing the Controller.
+    char fileName[1024];
+    dStrcpy( fileName, argv[2] );
+
+    // Clear Sequence Lists.
+    object->clear();
+
+    // Clear Data Table.
+    object->clearData();
+
+    // Read Target File.
+    if ( !VPersistence::readFile( fileName, object ) )
+    {
+        // Re-Clear.
+        object->clear();
+
+        // Invalid Read.
+        return false;
+    }
+
+    // Initial Sort.
+    object->sort();
+
+    // Reset.
+    object->reset();
+
+    // Valid Read.
+    return true;
+}
+
+ConsoleMethod( VController, clear, void, 2, 2, "( void ) - Detaches and deletes all of the child objects.\n"
+                                               "@return No return value." )
+{
+    // Clear Sequence Lists.
+    object->clear();
+
+    // Clear Data Table.
+    object->clearData();
+}
+
+ConsoleMethod( VController, reset, void, 2, 3, "( [int pTime] ) - Reset the Controller's and child object's state.\n"
+                                               "@param pTime The target time to reset to.\n"
+                                               "@return No return value." )
+{
+    if ( argc >= 3 )
+    {
+        // Reset Sequence.
+        object->reset( dAtoi( argv[2] ) );
+        return;
+    }
+
+    // Default Reset.
+    object->reset();
+}
+
+ConsoleMethod( VController, isPlaying, bool, 2, 2, "( void ) - Is the sequence currently playing?\n"
+                                                   "@return Returns true if the Controller is playing." )
+{
+    // Is Playing?
+    return ( object->isPlaying() );
+}
+
+ConsoleMethod( VController, play, void, 2, 3, "( [int pTime] ) - Play the sequence. If a value for pTime is specified, the Controller is reset and played from that time.\n"
+                                              "@param pTime The time to start playing the sequence from.\n"
+                                              "@return No return value." )
+{
+    S32 startTime = object->getTime();
+    if ( argc >= 3 )
+    {
+        startTime = dAtoi( argv[2] );
+    }
+
+    // Play From Specified Time.
+    object->play( startTime );
+}
+
+ConsoleMethod( VController, step, void, 2, 2, "( void ) - Step forward one frame.\n"
+                                              "@return No return value." )
+{
+    if ( object->isPlaying() )
+    {
+        // Sanity!
+        return;
+    }
+
+    // Play.
+    object->play( object->getTime() );
+
+    // Jump.
+    object->jump();
+
+    // Step Forward One Frame.
+    object->processTick();
+
+    // Stop.
+    object->stop( false );
+}
+
+ConsoleMethod( VController, isPaused, bool, 2, 2, "( void ) - Is the sequence currently paused?\n"
+                                                  "@return Returns true if the Controller is paused." )
+{
+    // Is Paused?
+    return ( object->isPaused() );
+}
+
+ConsoleMethod( VController, pause, void, 2, 2, "( void ) - Pause the sequence. Playback can resume by calling VController::play().\n"
+                                               "@return No return value." )
+{
+    // Pause Sequence.
+    object->pause();
+}
+
+ConsoleMethod( VController, isStopped, bool, 2, 2, "( void ) - Is the sequence currently stopped?\n"
+                                                   "@return Returns true if the Controller is stopped." )
+{
+    // Is Stopped?
+    return ( object->isStopped() );
+}
+
+ConsoleMethod( VController, stop, void, 2, 3, "( [bool pReset] ) - Stop the sequence and optionally reset it.\n"
+                                              "@param pReset Reset the Controller after stopping.\n"
+                                              "@return No return value." )
+{
+    // Stop Sequence.
+    object->stop( ( argc == 3 ) ? dAtob( argv[2] ) : true );
+}
+
+ConsoleMethod( VController, getTimeScale, F32, 2, 2, "( void ) - Get the playback speed. A value > 0.0 will enable the Controller to play forwards, while a value < 0.0 will play backwards.\n"
+                                                     "@return Playback Speed." )
+{
+    // Get Time Scale.
+    return object->getTimeScale();
+}
+
+ConsoleMethod( VController, setTimeScale, void, 3, 3, "( float pTimeScale ) - Set the playback speed. A value > 0.0 will enable the Controller to play forwards, while a value < 0.0 will play backwards. If |pTimeScale| > 1.0, then playback will be faster than normal, while |pTimeScale| < 1.0 will be slower.\n"
+                                                      "@param pTimeScale Playback speed.\n"
+                                                      "@return No return value." )
+{
+    // Set Time Scale.
+    object->setTimeScale( dAtof( argv[2] ) );
+}
+
+ConsoleMethod( VController, isDataField, bool, 3, 3, "( string pFieldName ) - Is the field a member of the Data Table?\n"
+                                                     "@param pFieldName The name of the dynamic field you wish to check.\n"
+                                                     "@return Returns true if the field is a member of the Data Table." )
+{
+    if ( argv[2][0] == '\0' )
+    {
+        return false;
+    }
+
+    // Is Field.
+    return object->getDataTable().getItem( argv[2] );
+}
+
+ConsoleMethod( VController, getDataFieldCount, S32, 2, 2, "( void ) - Get the number of data elements in the Data Table.\n"
+                                                          "@return Returns the size of the Data Table." )
+{
+    // Return Count.
+    return object->getDataTable().getCount();
+}
+
+ConsoleMethod( VController, getDataFieldName, const char *, 3, 3, "( int pIndex ) - Get the name of the field given by the passed index.\n"
+                                                                  "@param pIndex The index of the data field you wish to check.\n"
+                                                                  "@return Returns the name of the field corresponding to the given index." )
+{
+    VDataTable::sDataItem data;
+    if ( !object->getDataTable().getItem( dAtoi( argv[2] ), &data ) || data.Type == VDataTable::k_TypeInvalid )
+    {
+        // Invalid Field.
+        return "";
+    }
+
+    // Return Field Name.
+    return data.FieldName;
+}
+
+ConsoleMethod( VController, getDataFieldValue, const char *, 3, 3, "( string pFieldName ) - Get the evaluated data from the data field.\n"
+                                                                   "@param pFieldName The name of the field you wish to evaluate.\n"
+                                                                   "@return Returns the evaluated data from the field." )
+{
+    String fieldValue;
+    if ( object->getDataValue( argv[2], fieldValue ) )
+    {
+        // Create Buffer.
+        char *buffer = Con::getReturnBuffer( 256 );
+        dStrcpy( buffer, fieldValue.c_str() );
+
+        // Return Value.
+        return buffer;
+    }
+
+    // Return NULL.
+    return "0";
+}
+
+ConsoleMethod( VController, getDataFieldType, const char *, 3, 3, "( string pFieldName ) - Get the type of data for the given field.\n"
+                                                                  "@param pFieldName The name of the field you wish to check.\n"
+                                                                  "@return Returns the data type." )
+{
+    VDataTable::sDataItem data;
+    if ( !object->getDataTable().getItem( argv[2], &data ) || data.Type == VDataTable::k_TypeInvalid )
+    {
+        // Invalid Field.
+        return "";
+    }
+
+    // Return Field Type.
+    return VDataTable::getDataTypeDescription( data.Type );
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VController, writeFile, bool, 3, 3, "( string pFileName ) - Save to a given filename.\n"
+                                                   "@param pFileName The target file to write to.\n"
+                                                   "@return Returns true if the write was successful." )
+{
+    // Write Target File.
+    return VPersistence::writeFile( argv[2], object );
+}
+
+ConsoleMethod( VController, readTemplate, bool, 3, 3, "( string pFileName ) - Load data from given filename.\n"
+                                                      "@param pFileName The target file to read from.\n"
+                                                      "@return Returns true if the read was successful." )
+{
+    // Read Target File.
+    return VPersistence::readFile( argv[2], object );
+}
+
+ConsoleMethod( VController, getCount, S32, 2, 2, "( void ) - Get the number of child objects.\n"
+                                                 "@return Returns the number of child objects." )
+{
+    // Size.
+    return object->size();
+}
+
+ConsoleMethod( VController, getObject, S32, 3, 3, "( int pIndex ) - Get the object corresponding to the given index.\n"
+                                                  "@param pIndex The index of the object you wish to retrieve.\n"
+                                                  "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Object.
+    VObject *objectRef  = ( VObject* )object->at( dAtoi( argv[2] ) );
+
+    // Return Group ID.
+    return ( objectRef ) ? objectRef->getId() : 0;
+}
+
+ConsoleMethod( VController, addObject, void, 3, 3, "( SimObject pObject ) - Add a child object to this node.\n"
+                                                   "@param pObject The SimObjectID of the object to be added to this node.\n"
+                                                   "@return No return value." )
+{
+    VObject *child = dynamic_cast<VObject*>( Sim::findObject( argv[2] ) );
+    if ( child )
+    {
+        // Add Child.
+        child->addTo( object );
+    }
+}
+
+ConsoleMethod( VController, removeObject, void, 3, 3, "( SimObject pObject ) - Remove the target object from this node.\n"
+                                                      "@param pObject The SimObjectID of the object to be removed from this node.\n"
+                                                      "@return No return value." )
+{
+    VObject *child = dynamic_cast<VObject*>( Sim::findObject( argv[2] ) );
+    if ( child && child->getParent() == object )
+    {
+        child->remove();
+    }
+}
+
+ConsoleMethod( VController, sortGroups, void, 2, 2, "( void ) - Sort Groups by their Labels.\n"
+                                                    "@return No return value." )
+{
+    // Ensure that the Director Group is the First Group.
+    VDirectorGroup *directorGroup = object->getDirectorGroup();
+    if ( directorGroup && directorGroup != object->mChildNode )
+    {
+        // Detach.
+        directorGroup->remove();
+
+        // Add to the Front of the Controller.
+        directorGroup->addToFront( object );
+    }
+
+    const S32 count = object->size();
+    for ( S32 j = 0; j < count; j++ )
+    {
+        ITreeNode *node = object->mChildNode;
+        if ( dynamic_cast<VDirectorGroup*>( node ) != NULL )
+        {
+            // Skip Director Group.
+            node = node->mSiblingNextNode;
+        }
+
+        for ( ; node != NULL; node = node->mSiblingNextNode )
+        {
+            VGroup *groupA = ( VGroup* )node;
+            VGroup *groupB = ( VGroup* )node->mSiblingNextNode;
+            if ( !groupB )
+            {
+                // No Node.
+                break;
+            }
+
+            // Swap?
+            if ( dStrcmp( groupA->getLabel(), groupB->getLabel() ) > 0 )
+            {
+                // Get Outer Siblings.
+                ITreeNode *prevNode = groupA->mSiblingPrevNode;
+                ITreeNode *nextNode = groupB->mSiblingNextNode;
+                
+                if ( groupA->mParentNode && groupA->mParentNode->mChildNode == groupA )
+                {
+                    // New Child Node.
+                    groupA->mParentNode->mChildNode = groupB;
+                }
+
+                //
+                // Move A.
+
+                groupA->mSiblingPrevNode = groupB;
+                groupA->mSiblingNextNode = nextNode;
+
+                if ( nextNode )
+                {
+                    // Update Outer Sibling.
+                    nextNode->mSiblingPrevNode = groupA;
+                }
+
+                //
+                // Move B.
+
+                groupB->mSiblingPrevNode = prevNode;
+                groupB->mSiblingNextNode = groupA;
+
+                if ( prevNode )
+                {
+                    // Update Outer Sibling.
+                    prevNode->mSiblingNextNode = groupB;
+                }
+            }
+        }
+    }
+}
+
+ConsoleMethod( VController, sortTracks, void, 2, 2, "( void ) - Sort Tracks by their Labels.\n"
+                                                    "@return No return value." )
+{
+    for ( ITreeNode *group = object->mChildNode; group != NULL; group = group->mSiblingNextNode )
+    {
+        const S32 count = ( ( VGroup* )group )->size();
+        for ( S32 j = 0; j < count; j++ )
+        {
+            for ( ITreeNode *node = group->mChildNode; node != NULL; node = node->mSiblingNextNode )
+            {
+                VTrack *trackA = ( VTrack* )node;
+                VTrack *trackB = ( VTrack* )node->mSiblingNextNode;
+                if ( !trackB )
+                {
+                    // No Node.
+                    break;
+                }
+
+                // Swap?
+                if ( dStrcmp( trackA->getLabel(), trackB->getLabel() ) > 0 )
+                {
+                    // Get Outer Siblings.
+                    ITreeNode *prevNode = trackA->mSiblingPrevNode;
+                    ITreeNode *nextNode = trackB->mSiblingNextNode;
+                    
+                    if ( trackA->mParentNode && trackA->mParentNode->mChildNode == trackA )
+                    {
+                        // New Child Node.
+                        trackA->mParentNode->mChildNode = trackB;
+                    }
+
+                    //
+                    // Move A.
+
+                    trackA->mSiblingPrevNode = trackB;
+                    trackA->mSiblingNextNode = nextNode;
+
+                    if ( nextNode )
+                    {
+                        // Update Outer Sibling.
+                        nextNode->mSiblingPrevNode = trackA;
+                    }
+
+                    //
+                    // Move B.
+
+                    trackB->mSiblingPrevNode = prevNode;
+                    trackB->mSiblingNextNode = trackA;
+
+                    if ( prevNode )
+                    {
+                        // Update Outer Sibling.
+                        prevNode->mSiblingNextNode = trackB;
+                    }
+                }
+            }
+        }
+    }
+}
+
+ConsoleMethod( VController, addDataField, void, 4, 4, "( string pFieldType, string pFieldName ) - Add a new data entry to the Data Table.\n"
+                                                      "@param pFieldType The method of evaluating the field's data.\n"
+                                                      "@param pFieldName The name of the field to be added to the Data Table.\n"
+                                                      "@return No return value." )
+{
+    // Insert Data.
+    object->getDataTable().insert( VDataTable::getDataTypeEnum( argv[2] ), argv[3] );
+}
+
+ConsoleMethod( VController, removeDataField, void, 3, 3, "( string pFieldName ) - Remove a data entry from the Data Table.\n"
+                                                         "@param pFieldName The name of the field to be removed from the Data Table.\n"
+                                                         "@return No return value." )
+{
+    // Clear Data Item.
+    object->clearData( argv[2] );
+}
+#endif

+ 246 - 0
Engine/modules/Verve/Core/VController.h

@@ -0,0 +1,246 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VCONTROLLER_H_
+#define _VT_VCONTROLLER_H_
+
+#ifndef _VT_VERVECONFIG_H_
+#include "Verve/VerveConfig.h"
+#endif
+
+#ifndef _PLATFORM_H_
+#include "platform/platform.h"
+#endif
+
+#ifndef _PROCESSLIST_H_
+#include "T3D/gameBase/processList.h"
+#endif
+
+#ifndef _ITICKABLE_H_
+#include "core/iTickable.h"
+#endif
+
+#ifndef _VT_VPERSISTENCE_H_
+#include "Verve/Core/Persistence/VPersistence.h"
+#endif
+
+#ifndef _VT_VTREENODE_H_
+#include "Verve/Core/VTreeNode.h"
+#endif
+
+#ifndef _VT_VDATATABLE_H_
+#include "Verve/Core/VDataTable.h"
+#endif
+
+#ifndef _VT_TORQUE_CAMERA_H_
+#include "Verve/Torque/TCamera.h"
+#endif
+
+//-----------------------------------------------------------------------------
+class VObject;
+
+class VTrack;
+class VEvent;
+class VGroup;
+
+class VDirectorGroup;
+class VDirectorTrack;
+
+typedef VectorPtr<VTrack*>        VTrackVector;
+typedef VTrackVector::iterator    VTrackIterator;
+
+typedef VectorPtr<VEvent*>        VEventVector;
+typedef VEventVector::iterator    VEventIterator;
+
+typedef VectorPtr<VGroup*>        VGroupVector;
+typedef VGroupVector::iterator    VGroupIterator;
+//-----------------------------------------------------------------------------
+
+class VController : public SimObject,
+                    public virtual ITickable,
+                    public VTreeNode
+{
+    typedef SimObject Parent;
+
+public:
+
+    enum eControllerStatus
+    {
+        k_StatusInit    = BIT( 0 ),
+
+        k_StatusPlaying = BIT( 1 ),
+        k_StatusPaused  = BIT( 2 ),
+        k_StatusStopped = BIT( 3 ),
+    };
+
+    enum eControllerEventType
+    {
+        k_EventInit,
+        k_EventReset,
+
+        k_EventPlay,
+        k_EventPause,
+        k_EventStop,
+
+        k_EventLoop,
+    };
+
+    enum eControllerJumpType
+    {
+        k_JumpTime,
+        k_JumpDelta,
+
+        k_JumpInvalid,
+    };
+
+    typedef Signal<void( const S32 &pTime, const S32 &pDelta )> ControllerUpdateSignal;
+    typedef Signal<bool( eControllerEventType )> ControllerEventSignal;
+
+private:
+
+    // Data.
+
+    VDataTable                mDataTable;
+
+    // Event Signal.
+
+    ControllerUpdateSignal    mControllerUpdateSignal;
+    ControllerEventSignal     mControllerEventSignal;
+
+    // Properties.
+
+    S32                       mStatus;
+
+    S32                       mTime;
+    U32                       mLastTime;
+    S32                       mDuration;
+    F32                       mTimeScale;
+
+    bool                      mLoop;
+    bool                      mLoopBackwards;
+    S32                       mLoopCount;
+    S32                       mLoopIndex;
+    S32                       mLoopDelay;
+    S32                       mLoopDelayTime;
+
+    eControllerJumpType       mJump;
+    S32                       mJumpTime;
+
+    bool                      mResetOnCompletion;
+
+public:
+
+    VController();
+    ~VController();
+
+    static  void    initPersistFields( void );
+
+    // ITickable.
+
+    void            interpolateTick( F32 pDelta ) { };
+    void            advanceTime( F32 pDelta ) { };
+    void            processTick( void );
+    void            onPostTick( void );
+
+    // Controller.
+
+    void            reset( void );
+    void            reset( const S32 &pTime );
+
+    void            play( void );
+    void            play( const S32 &pTime );
+
+    void            pause( void );
+    void            stop( const bool &pReset = true );
+
+    void            jump( void );
+    void            jump( const eControllerJumpType &pType, const S32 &pDelta );
+
+    void            updateStatus( const S32 &pStatus );
+
+    // Reference.
+
+    VGroup *getObject( const String &pLabel );
+    template <class T> inline bool getObject( const String &pLabel, T *&pObject )
+    {
+        // Reference Group.
+        pObject = dynamic_cast<T*>( getObject( pLabel ) );
+
+        // Valid?
+        return ( pObject != NULL );
+    }
+
+    bool            getDataValue( const String &pFieldName, String &pValue );
+    void            clearData( void );
+    void            clearData( const S32 &pIndex );
+    void            clearData( const String &pFieldName );
+
+    void            sort( void );
+
+    // Saving.
+
+    bool            writeDataTable( TiXmlElement *pElement );
+
+    // Reading.
+
+    bool            readDataTable( TiXmlElement *pElement );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VController );
+
+public:
+
+    inline VDataTable               &getDataTable( void )                   { return mDataTable;                     };
+
+    inline ControllerUpdateSignal   &getControllerUpdateSignal( void )      { return mControllerUpdateSignal;        };
+    inline ControllerEventSignal    &getControllerEventSignal( void )       { return mControllerEventSignal;         };
+    void                             postEvent( const eControllerEventType &pEvent );
+
+    VDirectorGroup                  *getDirectorGroup( void );
+    VDirectorTrack                  *getDirectorTrack( void );
+
+    inline void                      setTime( const S32 &pTime )            { mTime = pTime;                         };
+    inline void                      setDuration( const S32 &pDuration )    { mDuration = pDuration;                 };
+    void                             setTimeScale( const F32 &pTimeScale );
+
+    inline bool                      isLooping( void )                      { return mLoop;                          };
+    inline bool                      isPlaying( void )                      { return ( mStatus & k_StatusPlaying );  };
+    inline bool                      isPaused( void )                       { return ( mStatus & k_StatusPaused );   };
+    inline bool                      isStopped( void )                      { return ( mStatus & k_StatusStopped );  };
+    inline bool                      isPlayingForward( void )               { return ( mTimeScale > 0.f );           };
+
+    inline S32                       getTime( void )                        { return mTime;                          };
+    inline S32                       getDuration( void )                    { return mDuration;                      };
+    inline F32                       getTimeScale( void )                   { return mTimeScale;                     };
+    inline S32                       getLoopDelayTime( void )               { return mLoopDelayTime;                 };
+
+protected:
+
+    static bool     setTime( void *pObject, const char *pArray, const char *pData )      { static_cast<VController*>( pObject )->setTime( dAtoi( pData ) );      return false; };
+    static bool     setDuration( void *pObject, const char *pArray, const char *pData )  { static_cast<VController*>( pObject )->setDuration( dAtoi( pData ) );  return false; };
+    static bool     setTimeScale( void *pObject, const char *pArray, const char *pData ) { static_cast<VController*>( pObject )->setTimeScale( dAtof( pData ) ); return false; };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VCONTROLLER_H_

+ 254 - 0
Engine/modules/Verve/Core/VDataTable.cpp

@@ -0,0 +1,254 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VDataTable.h"
+
+#include "console/simObject.h"
+
+//-----------------------------------------------------------------------------
+
+// Implement the DataType enum list.
+ImplementEnumType( VDataTableDataType, "" )
+    { VDataTable::k_TypeExpression, "EXPRESSION" },
+    { VDataTable::k_TypeStatic,     "STATIC"     },
+    { VDataTable::k_TypeVariable,   "VARIABLE"   },
+EndImplementEnumType;
+
+VDataTable::eDataType VDataTable::getDataTypeEnum( const char *pLabel )
+{
+    VDataTable::eDataType out;
+    if ( !castConsoleTypeFromString( out, pLabel ) )
+    {
+        // Bah!
+        return VDataTable::k_TypeInvalid;
+    }
+
+    // Return.
+    return out;
+}
+
+const char *VDataTable::getDataTypeDescription( const VDataTable::eDataType pEnum )
+{
+    // Return.
+    return castConsoleTypeToString( pEnum );
+}
+
+//-----------------------------------------------------------------------------
+
+VDataTable::VDataTable( void )
+{
+    mDataMap.clear();
+}
+
+VDataTable::~VDataTable( void )
+{
+    mDataMap.clear();
+}
+
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::insert( pType, pFieldName );
+// 
+// Add a DataTable entry, referencing the field name and assign it the given
+// data type.
+// 
+// For a full list of possible data types, see the 'eDataType' declaration in
+// VDataTable.h.
+// 
+//-----------------------------------------------------------------------------
+void VDataTable::insert( eDataType pType, const String &pFieldName )
+{
+    if ( mDataMap.contains( pFieldName ) )
+    {
+        // Change Field Type.
+        mDataMap.find( pFieldName )->value.Type = pType;
+
+        // Return.
+        return;
+    }
+
+    // Insert Item.
+    mDataMap.insert( pFieldName, sDataItem( pType, pFieldName ) );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::clear( pFieldName );
+// 
+// Clear the DataTable entry with the given field name.
+// 
+//-----------------------------------------------------------------------------
+void VDataTable::clear( const String &pFieldName )
+{
+    // Clear Item.
+    mDataMap.erase( pFieldName );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::clear();
+// 
+// Clear the contents of the DataTable entirely.
+// 
+//-----------------------------------------------------------------------------
+void VDataTable::clear( void )
+{
+    // Clear.
+    mDataMap.clear();
+}
+
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::getCount();
+// 
+// Return the number of DataTable entries.
+// 
+//-----------------------------------------------------------------------------
+S32 VDataTable::getCount( void )
+{
+    return mDataMap.size();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::getItem( pIndex, *pDataItem );
+// 
+// Return the item with the given index. This method will return false if there
+// is no valid data entry with that index.
+// 
+//-----------------------------------------------------------------------------
+bool VDataTable::getItem( const S32 &pIndex, sDataItem *pDataItem )
+{
+    if ( pIndex < 0 || pIndex >= mDataMap.size() )
+    {
+        // Invalid Field.
+        return false;
+    }
+
+    S32 index = 0;
+    for ( VDataMap::Iterator itr = mDataMap.begin(); itr != mDataMap.end(); ++itr )
+    {
+        if ( index == pIndex )
+        {
+            if ( pDataItem )
+            {
+                // Store Reference.
+                *pDataItem = ( itr->value );
+            }
+
+            // Valid Field.
+            return true;
+        }
+
+        // Increment.
+        ++index;
+    }
+
+    // Invalid Field.
+    return false;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::getItem( pFieldName, *pDataItem );
+// 
+// Return the item with the given field name. This method will return false if
+// there is no valid data entry with that name.
+// 
+//-----------------------------------------------------------------------------
+bool VDataTable::getItem( const String &pFieldName, sDataItem *pDataItem )
+{
+    if ( mDataMap.contains( pFieldName ) )
+    {
+        if ( pDataItem )
+        {
+            // Fetch Item
+            *pDataItem = mDataMap.find( pFieldName )->value;
+        }
+
+        // Valid Field.
+        return true;
+    }
+
+    // Invalid Field.
+    return false;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VDataTable::getValue( pObject, pFieldName, *pValue );
+// 
+// Evaluate and return the expression provided in the data field.
+// 
+//-----------------------------------------------------------------------------
+bool VDataTable::getValue( SimObject *pObject, const String &pFieldName, String &pValue )
+{
+    if ( !pObject || pFieldName.isEmpty() )
+    {
+        // Sanity!
+        return false;
+    }
+
+    // Fetch Data.
+    sDataItem *data = &( mDataMap.find( pFieldName )->value );
+    if ( !data )
+    {
+        // No Field.
+        return false;
+    }
+
+    // Field Value.
+    const char *fieldValue = pObject->getDataField( StringTable->insert( data->FieldName ), NULL );
+
+    switch ( data->Type )
+    {
+        case VDataTable::k_TypeExpression :
+            {
+
+                // Evaluate.
+                pValue = Con::evaluate( fieldValue, false );
+
+            } break;
+
+        case VDataTable::k_TypeStatic :
+            {
+                // Use Value.    
+                pValue = fieldValue;
+
+            } break;
+
+        case VDataTable::k_TypeVariable :
+            {
+
+                // Fetch Variable.
+                pValue = Con::getVariable( fieldValue );
+
+            } break;
+    }
+
+    // Valid Field.
+    return true;
+}

+ 118 - 0
Engine/modules/Verve/Core/VDataTable.h

@@ -0,0 +1,118 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VDATATABLE_H_
+#define _VT_VDATATABLE_H_
+
+#ifndef CORE_TDICTIONARY_H
+#include "core/util/tDictionary.h"
+#endif
+
+#ifndef _CONSOLE_H_
+#include "console/console.h"
+#endif
+
+#ifndef _DYNAMIC_CONSOLETYPES_H_
+#include "console/dynamicTypes.h"
+#endif
+
+#ifndef _STRINGTABLE_H_
+#include "core/stringTable.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VDataTable
+{
+public:
+
+    enum eDataType
+    {
+        k_TypeExpression,
+        k_TypeStatic,
+        k_TypeVariable,
+
+        k_TypeInvalid,
+    };
+
+    struct sDataItem
+    {
+        eDataType    Type;
+        String       FieldName;
+
+        sDataItem( void ) :
+                Type( k_TypeInvalid ),
+                FieldName( String::EmptyString )
+        {
+            // Void.
+        };
+
+        sDataItem( eDataType pType, const String &pFieldName ) :
+                Type( pType ),
+                FieldName( pFieldName )
+        {
+            // Void.
+        };
+    };
+
+    // Enum Lookup.
+    static VDataTable::eDataType    getDataTypeEnum( const char *pLabel );
+    static const char              *getDataTypeDescription( const VDataTable::eDataType pEnum );
+
+    // Map Type.
+    typedef Map<String, sDataItem> VDataMap;
+
+public:
+
+    VDataMap    mDataMap;
+
+public:
+
+    VDataTable( void );
+    ~VDataTable( void );
+
+    // Data.
+
+    void        insert( eDataType pType, const String &pFieldName );
+    void        clear( const String &pFieldName );
+    void        clear( void );
+
+    // Reference.
+
+    S32         getCount( void );
+    bool        getItem( const S32 &pIndex, sDataItem *pDataItem = NULL );
+    bool        getItem( const String &pFieldName, sDataItem *pDataItem = NULL );
+
+    bool        getValue( SimObject *pObject, const String &pFieldName, String &pValue );
+};
+
+//-----------------------------------------------------------------------------
+
+// Define Types.
+typedef VDataTable::eDataType VDataTableDataType;
+
+// Declare Enum Types.
+DefineEnumType( VDataTableDataType );
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VDATATABLE_H_

+ 406 - 0
Engine/modules/Verve/Core/VEvent.cpp

@@ -0,0 +1,406 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VEvent.h"
+#include "Verve/Core/VGroup.h"
+#include "Verve/Core/VTrack.h"
+
+#include "console/consoleTypes.h"
+#include "math/mMathFn.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VEvent );
+//-----------------------------------------------------------------------------
+
+VEvent::VEvent( void ) : 
+        mIsPlaying( false ),
+        mTriggered( false ),
+        mTriggerTime( 0 ),
+        mDuration( 0 )
+{
+    setLabel( "DefaultEvent" );
+}
+
+void VEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addProtectedField( "TriggerTime", TypeS32, Offset( mTriggerTime, VEvent ), &setTriggerTime, &defaultProtectedGetFn, "The time that this event is triggered." );
+    addProtectedField( "Duration",    TypeS32, Offset( mDuration,    VEvent ), &setDuration,    &defaultProtectedGetFn, "The total duration that this event plays for." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::onControllerReset( pTime, pForward );
+// 
+// Reset the status of the event. If the given time is between the event's
+// start and finish times, then the isPlaying flag will be true. This means
+// that the event is free to be triggered upon playback.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Reset Status.
+    mIsPlaying = ( pTime > mTriggerTime && pTime < ( mTriggerTime + mDuration ) );
+    mTriggered = false;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::onControllerUpdate( pTime, pDelta )
+// 
+// Integrate is only called when this event is the Next Event for the parent
+// track. For each track, there is only ever *one* event being integrated - the
+// event that needs to be triggered next.
+//
+// If the event has a duration greater than 0, then this event will continue to
+// integrate until its time is up, or the controller finishes playing
+// (whichever happens first).
+// 
+// If a value of true is returned, then this event will continue to integrate
+// until a value of false is returned to the parent track. When this happens,
+// this event ceases to be the track's Next Event and will not continue
+// updating.
+// 
+//-----------------------------------------------------------------------------
+bool VEvent::onControllerUpdate( const S32 &pTime, const S32 &pDelta )
+{
+    if ( !isEnabled() )
+    {
+        return false;
+    }
+
+    const S32  newTime    = ( pTime + pDelta );
+    const S32 &startTime  = getStartTime();
+    const S32 &finishTime = getFinishTime();
+
+    if ( !mIsPlaying || !mTriggered )
+    {
+        if ( !mIsPlaying )
+        {
+            if ( ( pDelta > 0 && newTime < startTime )
+                 || ( pDelta < 0 && newTime > startTime ) )
+            {
+                // Not Time to Trigger.
+                return true;
+            }
+
+            if ( ( pDelta > 0 && pTime > startTime )
+                 || ( pDelta < 0 && pTime < startTime ) )
+            {
+                //AssertFatal( false, "VEvent::onControllerUpdate() - Event has been skipped." );
+                return false;
+            }
+        }
+
+        if ( !mTriggered )
+        {
+            // Play and Trigger.
+            mIsPlaying = ( mDuration > 0 );
+            mTriggered = true;
+
+            // Callback.
+            onTrigger( pTime, pDelta );
+
+            if ( mDuration == 0 )
+            {
+                // Stop Integrating.
+                return false;
+            }
+
+            // Return Here.
+            // Note: If Duration is non-zero this event will continue to update
+            //       so that VEvent:: onUpdate is processed for the full event
+            //       duration.
+            return ( mDuration != 0 );
+        }
+    }
+
+    // Complete?
+    const bool isComplete = ( ( pDelta > 0 && newTime > finishTime )
+                               || ( pDelta < 0 && newTime < finishTime ) );
+
+    if ( !isComplete )
+    {
+        // Callback.
+        onUpdate( pTime, pDelta );
+    }
+    else
+    {
+        // Complete.
+        mIsPlaying = false;
+
+        // Callback.
+        onComplete( pTime, pDelta );
+    }
+
+    // Continue?
+    return !isComplete;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::onTrigger( pTime, pDelta );
+// 
+// This method is called when an event is due to be triggered. This method is
+// meant to be overloaded by derived classes.
+// 
+// For examples of what an event might do, please refer to some of the included
+// events with Verve.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    // Void.
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::onUpdate( pTime, pDelta );
+// 
+// This method is called each tick once an event has been triggered and ceases
+// to be called when it is completed. This method is meant to be overloaded by
+// derived classes.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::onUpdate( const S32 &pTime, const S32 &pDelta )
+{
+    // Void.
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::onComplete( pTime, pDelta );
+// 
+// This method is called once an event has finished being updated. It is not
+// called on events that have a duration of 0. This method is meant to be
+// overloaded by derived classes.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::onComplete( const S32 &pTime, const S32 &pDelta )
+{
+    // Void.
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getGroup();
+// 
+// Returns the parent group.
+// 
+//-----------------------------------------------------------------------------
+VGroup *VEvent::getGroup( void )
+{
+    VTrack *track = getTrack();
+    if ( track )
+    {
+        return track->getGroup();
+    }
+
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getTrack();
+// 
+// Returns the parent track.
+// 
+//-----------------------------------------------------------------------------
+VTrack *VEvent::getTrack( void )
+{
+    return dynamic_cast<VTrack*>( mParentNode );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getNextEvent();
+// 
+// Returns the next event.
+// 
+//-----------------------------------------------------------------------------
+VEvent *VEvent::getNextEvent( void )
+{
+    if ( !isControllerPlayingForward() )
+    {
+        return dynamic_cast<VEvent*>( mSiblingPrevNode );
+    }
+
+    return dynamic_cast<VEvent*>( mSiblingNextNode );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getPreviousEvent();
+// 
+// Returns the previous event.
+// 
+//-----------------------------------------------------------------------------
+VEvent *VEvent::getPreviousEvent( void )
+{
+    if ( !isControllerPlayingForward() )
+    {
+        return dynamic_cast<VEvent*>( mSiblingNextNode );
+    }
+
+    return dynamic_cast<VEvent*>( mSiblingPrevNode );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getStartTime();
+// 
+// Returns the time, in milliseconds, that the event is due to trigger.
+// 
+//-----------------------------------------------------------------------------
+S32 VEvent::getStartTime( void )
+{
+    return ( mTriggerTime + ( !isControllerPlayingForward() * mDuration ) );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::getFinishTime();
+// 
+// Returns the time, in milliseconds, that the event will cease updating.
+// 
+//-----------------------------------------------------------------------------
+S32 VEvent::getFinishTime( void )
+{
+    return ( mTriggerTime + ( isControllerPlayingForward() * mDuration ) );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::setTriggerTime( pTime );
+// 
+// Apply the given trigger time to the object.
+// 
+// If the project was built using the VT_EDITOR preprocessor argument, then
+// the validity of the passed value is verified. It also cannot be changed
+// while the controller is playing.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::setTriggerTime( const S32 &pTime )
+{
+#ifdef VT_EDITOR
+
+    VTrack *track = getTrack();
+    if ( !track )
+    {
+        // Apply Time.
+        mTriggerTime = pTime;
+
+        return;
+    }
+
+    if ( track->isControllerPlaying() )
+    {
+        // Don't Change While Playing.
+        return;
+    }
+
+    /*
+    // Check For Overlap.
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        VEvent *event = ( VEvent* )node;
+        if ( event == this )
+        {
+            // Skip.
+            continue;
+        }
+
+        const U32 startTime  = getStartTime();
+        const U32 finishTime = getFinishTime();
+
+        if ( ( pTime > startTime && pTime < finishTime )
+             || ( ( pTime + mDuration ) > startTime && ( pTime + mDuration ) < finishTime )
+             || ( pTime < startTime && ( pTime + mDuration ) > finishTime ) )
+        {
+            // Overlap!
+            return;
+        }
+    }
+    */
+
+    // Apply Time.
+    mTriggerTime = mClamp( pTime, 0, getControllerDuration() );
+
+    // Sort Events.
+    track->sort();
+
+    // Reset Track.
+    track->onControllerReset( getControllerTime(), isControllerPlayingForward() );
+
+#else
+
+    // Apply Time.
+    mTriggerTime = pTime;
+
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VEvent::setDuration( pDuration );
+// 
+// Apply the given duration time to the object.
+// 
+// If the project was built using the VT_EDITOR preprocessor argument, then
+// the validity of the passed value is verified. It also cannot be changed
+// while the controller is playing.
+// 
+//-----------------------------------------------------------------------------
+void VEvent::setDuration( const S32 &pDuration )
+{
+#ifdef VT_EDITOR
+
+    if ( isControllerPlaying() )
+    {
+        // Don't Change While Playing.
+        return;
+    }
+
+#endif
+
+    // Apply Duration.
+    mDuration = pDuration;
+}

+ 109 - 0
Engine/modules/Verve/Core/VEvent.h

@@ -0,0 +1,109 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VEVENT_H_
+#define _VT_VEVENT_H_
+
+#ifndef _VT_VOBJECT_H_
+#include "Verve/Core/VObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+class VGroup;
+class VTrack;
+//-----------------------------------------------------------------------------
+
+class VEvent : public VObject
+{
+    typedef VObject Parent;
+
+protected:
+
+    bool            mIsPlaying;
+    bool            mTriggered;
+
+    S32             mTriggerTime;
+    S32             mDuration;
+    
+public:
+
+    VEvent( void );
+
+    static  void    initPersistFields( void );
+
+    // Controller Methods.
+
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+    virtual bool    onControllerUpdate( const S32 &pTime, const S32 &pDelta );
+
+    // Callback Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+    virtual void    onUpdate( const S32 &pTime, const S32 &pDelta );
+    virtual void    onComplete( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VEvent );
+
+public:
+
+    // Property Methods.
+
+    VGroup         *getGroup( void );
+    template <class T> inline bool getGroup( T *&pGroup )
+    {
+        // Reference Group.
+        pGroup = dynamic_cast<T*>( getGroup() );
+        // Validate.
+        return ( pGroup != NULL );
+    }
+
+    VTrack         *getTrack( void );
+    template <class T> inline bool getTrack( T *&pTrack )
+    {
+        // Reference Track.
+        pTrack = dynamic_cast<T*>( getTrack() );
+        // Validate.
+        return ( pTrack != NULL );
+    }
+
+    VEvent         *getNextEvent( void );
+    VEvent         *getPreviousEvent( void );
+
+    inline bool     isPlaying( void )      { return mIsPlaying;   };
+    inline S32      getTriggerTime( void ) { return mTriggerTime; };
+    inline S32      getDuration( void )    { return mDuration;    };
+
+    virtual S32     getStartTime( void );
+    virtual S32     getFinishTime( void );
+
+    virtual void    setTriggerTime( const S32 &pTime );
+    virtual void    setDuration( const S32 &pDuration );
+
+    static  bool    setTriggerTime( void *obj, const char *pArray, const char *data ) { static_cast<VEvent*>( obj )->setTriggerTime( dAtoi( data ) ); return false; };
+    static  bool    setDuration( void *obj, const char *pArray, const char *data )    { static_cast<VEvent*>( obj )->setDuration( dAtoi( data ) );    return false; };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VEVENT_H_

+ 32 - 0
Engine/modules/Verve/Core/VGroup.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VGroup );
+//-----------------------------------------------------------------------------
+
+VGroup::VGroup( void )
+{
+    setLabel( "DefaultGroup" );
+};

+ 47 - 0
Engine/modules/Verve/Core/VGroup.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VGROUP_H_
+#define _VT_VGROUP_H_
+
+#ifndef _VT_VOBJECT_H_
+#include "Verve/Core/VObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VGroup : public VObject
+{
+    typedef VObject Parent;
+
+public:
+
+    VGroup( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VGROUP_H_

+ 483 - 0
Engine/modules/Verve/Core/VObject.cpp

@@ -0,0 +1,483 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VObject.h"
+#include "Verve/Core/VController.h"
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VObject );
+//-----------------------------------------------------------------------------
+
+VObject::VObject( void ) : 
+        mController( NULL ),
+        mLabel( String::EmptyString ),
+        mEnabled( true )
+{
+    // Void.
+};
+
+VObject::~VObject( void )
+{
+    // Remove.
+    remove();
+}
+
+void VObject::initPersistFields( void )
+{
+    // Don't Use Parent Fields.
+    // Parent::initPersistFields();
+
+    addProtectedField( "Enabled", TypeBool,       Offset( mEnabled, VObject ), &setEnabled, &defaultProtectedGetFn, "Enable or Disable the object from playback." );
+    addProtectedField( "Label",   TypeRealString, Offset( mLabel,   VObject ), &setLabel,   &defaultProtectedGetFn, "The label this object is referenced by." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::getObject( pLabel );
+// 
+// Returns the object with the given label. If no object belongs to this object
+// with that label, then a NULL value is returned.
+// 
+//-----------------------------------------------------------------------------
+VObject *VObject::getObject( const String &pLabel )
+{
+    VObject *node = ( VObject* )mChildNode;
+    while ( node )
+    {
+        // Compare Names.
+        if ( node->getLabel().equal( pLabel, String::NoCase ) )
+        {
+            // Valid.
+            return node;
+        }
+
+        // Next Sibling.
+        node = ( VObject* )node->mSiblingNextNode;
+    }
+
+    // Invalid.
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isEnabled();
+// 
+// Returns whether this object is enabled.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isEnabled( void )
+{
+    VObject *parent = dynamic_cast<VObject*>( getParent() );
+    if ( parent && !parent->isEnabled() )
+    {
+        return false;
+    }
+
+    return mEnabled;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isControllerPlaying();
+// 
+// Returns whether the root controller is currently playing.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isControllerPlaying( void )
+{
+    if ( getController() )
+    {
+        return getController()->isPlaying();
+    }
+
+    return false;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isControllerPaused();
+// 
+// Returns whether the root controller is currently paused.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isControllerPaused( void )
+{
+    if ( getController() )
+    {
+        return getController()->isPaused();
+    }
+
+    return false;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isControllerStopped();
+// 
+// Returns whether the root controller is currently stopped.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isControllerStopped( void )
+{
+    if ( getController() )
+    {
+        return getController()->isStopped();
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isControllerPlayingForward();
+// 
+// Returns whether the root controller is currently playing forward.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isControllerPlayingForward( void )
+{
+    if ( getController() )
+    {
+        return getController()->isPlayingForward();
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::isControllerLooping();
+// 
+// Returns whether the root controller is looping the sequence.
+// 
+//-----------------------------------------------------------------------------
+bool VObject::isControllerLooping( void )
+{
+    if ( getController() )
+    {
+        return getController()->isLooping();
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::getControllerTime();
+// 
+// Returns the current time of the root controller.
+// 
+//-----------------------------------------------------------------------------
+S32 VObject::getControllerTime( void )
+{
+    if ( getController() )
+    {
+        return getController()->getTime();
+    }
+
+    return 0;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::getControllerTimeScale();
+// 
+// Returns the current timescale of the root controller.
+// 
+//-----------------------------------------------------------------------------
+F32 VObject::getControllerTimeScale( void )
+{
+    if ( getController() )
+    {
+        return getController()->getTimeScale();
+    }
+
+    return 1.f;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::getControllerDuration();
+// 
+// Returns the duration of the root controller.
+// 
+//-----------------------------------------------------------------------------
+S32 VObject::getControllerDuration( void )
+{
+    if ( getController() )
+    {
+        return getController()->getDuration();
+    }
+
+    return 0;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::setLabel( pLabel );
+// 
+// Set the label property.
+// 
+// If the project was built using the VT_EDITOR preprocessor argument, then the
+// label will not be changed if the target name is already used in the parent
+// object.
+// 
+//-----------------------------------------------------------------------------
+void VObject::setLabel( const String &pLabel )
+{
+#ifdef VT_EDITOR
+    if ( mParentNode )
+    {
+        // Empty Label?
+        if ( mLabel.isEmpty() )
+        {
+            // Set Uniqu Label.
+            setLabelUnique( pLabel );
+            return;
+        }
+
+        for ( VObject *walk = ( VObject* )mChildNode; walk != NULL; walk = ( VObject* )walk->mSiblingNextNode )
+        {
+            if ( walk != this )
+            {
+                if ( pLabel == walk->getLabel() )
+                {
+                    // Exit.
+                    return;
+                }
+            }
+        }
+    }
+#endif
+
+    // Set Label.
+    mLabel = pLabel;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::setLabelUnique( pLabel );
+// 
+// If the label that has been passed is already in use, then a new label will
+// be generated by appending an index to the label. For example: MyLabel
+// becomes MyLabel0 ... MyLabelN
+//
+//-----------------------------------------------------------------------------
+void VObject::setLabelUnique( const String &pLabel )
+{
+    if ( mParentNode && pLabel.isNotEmpty() )
+    {
+        for ( VObject *walk = ( VObject* )mChildNode; walk != NULL; walk = ( VObject* )walk->mSiblingNextNode )
+        {
+            if ( walk != this )
+            {
+                if ( pLabel == walk->getLabel() )
+                {
+                    // Strip Trailing Number.
+                    S32 i = -1;
+                    String labelBase( String::GetTrailingNumber( pLabel, i ) );
+                    i++;
+
+                    // Construct New Name.
+                    String labelBuffer = String::ToString( "%s%d", labelBase.c_str(), i );
+
+                    // Set Name.
+                    setLabelUnique( labelBuffer );
+
+                    // Exit.
+                    return;
+                }
+            }
+        }
+    }
+
+    // Set Name.
+    mLabel = pLabel;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::onAttach();
+// 
+// Callback made when this object is attached to another node.
+// 
+//-----------------------------------------------------------------------------
+void VObject::onAttach( void )
+{
+    VTreeNode::onAttach();
+
+    // Store Controller.
+    mController = dynamic_cast<VController*>( getRoot() );
+
+#ifdef VT_EDITOR
+    if ( isProperlyAdded() )
+    {
+        Con::executef( this, "onAttach" );
+    }
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VObject::onDetach();
+// 
+// Callback made when this object is detached from a parent node.
+// 
+//-----------------------------------------------------------------------------
+void VObject::onDetach( void )
+{
+    VTreeNode::onDetach();
+
+    // Clear Controller.
+    mController = NULL;
+
+#ifdef VT_EDITOR
+    if ( isProperlyAdded() )
+    {
+        Con::executef( this, "onDetach" );
+    }
+#endif
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VObject, writeFile, bool, 3, 3, "( string pFileName ) - Save to a given filename.\n"
+                                               "@param pFileName The target file to write to.\n"
+                                               "@return Returns true if the write was successful." )
+{
+    // Write Target File.
+    return VPersistence::writeFile( argv[2], object );
+}
+
+ConsoleMethod( VObject, readFile, bool, 3, 3, "( string pFileName ) - Clears the object and loads the new data from the given filename.\n"
+                                              "@param pFileName The target file to read from.\n"
+                                              "@return Returns true if the read was successful." )
+{
+    // Read Target File.
+    return VPersistence::readFile( argv[2], object );
+}
+
+ConsoleMethod( VObject, getRoot, S32, 2, 2, "( void ) - Get the root object.\n"
+                                            "@return Returns the SimObjectId for the root object."  )
+{
+    // Fetch Object.
+    VObject *objectRef = ( VObject* )object->getRoot();
+
+    // Return Object ID.
+    return ( objectRef ) ? objectRef->getId() : 0;
+}
+
+ConsoleMethod( VObject, getParent, S32, 2, 2, "( void ) - Get the parent object.\n"
+                                              "@return Returns the SimObjectId for the parent object." )
+{
+    // Fetch Object.
+    VObject *objectRef = ( VObject* )object->mParentNode;
+
+    // Return Object ID.
+    return ( objectRef ) ? objectRef->getId() : 0;
+}
+
+ConsoleMethod( VObject, getIndex, S32, 2, 2, "( void ) - Get the index of this object relative to its siblings.\n"
+                                             "@return Returns the index of this object." )
+{
+    return object->getIndex();
+}
+
+ConsoleMethod( VObject, getCount, S32, 2, 2, "( void ) - Get the number of child objects.\n"
+                                             "@return Returns the number of child objects." )
+{
+    return object->size();
+}
+
+ConsoleMethod( VObject, getObject, S32, 3, 3, "( int pIndex ) - Get the object corresponding to the given index.\n"
+                                              "@param pIndex The index of the object you wish to retrieve.\n"
+                                              "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Object.
+    VObject *objectRef = ( VObject* )object->at( dAtoi( argv[2] ) );
+
+    // Return Object ID.
+    return ( objectRef ) ? objectRef->getId() : 0;
+}
+
+ConsoleMethod( VObject, clear, void, 2, 2, "( void ) - Detaches and deletes all of the child objects.\n"
+                                           "@return No return value." )
+{
+    // Clear Sequence Lists.
+    object->clear();
+}
+
+ConsoleMethod( VObject, addObject, void, 3, 3, "( SimObject pObject ) - Add a child object to this node.\n"
+                                               "@param pObject The SimObjectID of the object to be added to this node.\n"
+                                               "@return No return value." )
+{
+    VObject *child = dynamic_cast<VObject*>( Sim::findObject( argv[2] ) );
+    if ( child )
+    {
+        child->addTo( object );
+    }
+}
+
+ConsoleMethod( VObject, removeObject, void, 3, 3, "( SimObject pObject ) - Remove the target object from this node.\n"
+                                                  "@param pObject The SimObjectID of the object to be removed from this node.\n"
+                                                  "@return No return value." )
+{
+    VObject *child = dynamic_cast<VObject*>( Sim::findObject( argv[2] ) );
+    if ( child && child->getParent() == object )
+    {
+        child->remove();
+    }
+}
+
+ConsoleMethod( VObject, setLabelUnique, void, 3, 3, "( string pLabel ) - Force this label to be unique.\n"
+                                                    "@param pLabel The name you wish to reference this object by.\n"
+                                                    "@return No return value." )
+{
+    // Set Label.
+    object->setLabelUnique( argv[2] );
+}
+#endif

+ 126 - 0
Engine/modules/Verve/Core/VObject.h

@@ -0,0 +1,126 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VOBJECT_H_
+#define _VT_VOBJECT_H_
+
+#ifndef _VT_VERVECONFIG_H_
+#include "Verve/VerveConfig.h"
+#endif
+
+#ifdef VT_EDITOR
+    #ifndef _SIMOBJECT_H_
+    #include "console/simObject.h"
+    #endif
+
+    #define VObjectRep    SimObject
+#else
+    #ifndef _CONSOLEOBJECT_H_
+    #include "console/consoleObject.h"
+    #endif
+
+    #define VObjectRep    ConsoleObject
+#endif
+
+#ifndef _VT_VTREENODE_H_
+#include "Verve/Core/VTreeNode.h"
+#endif
+
+#ifndef TINYXML_INCLUDED
+#include "tinyxml/tinyxml.h"
+#endif
+
+//-----------------------------------------------------------------------------
+class VController;
+//-----------------------------------------------------------------------------
+
+class VObject : public VObjectRep,
+                public VTreeNode
+{
+    typedef VObjectRep Parent;
+
+protected:
+
+    VController           *mController;
+
+    String                 mLabel;
+    bool                   mEnabled;
+    
+public:
+
+    VObject( void );
+    virtual ~VObject( void );
+
+    static  void           initPersistFields( void );
+
+    // Reference Methods.
+
+    VObject *getObject( const String &pLabel );
+    template <class T> inline bool getObject( const String &pLabel, T *&pObject )
+    {
+        // Reference Object.
+        pObject = dynamic_cast<T*>( getObject( pLabel ) );
+
+        // Valid?
+        return ( pObject != NULL );
+    }
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VObject );
+
+public:
+
+    // Property Methods.
+
+    inline VController        *getController( void ) { return mController; };
+
+    inline const String       &getLabel( void ) const { return mLabel; };
+    bool                       isEnabled( void );
+
+    bool                       isControllerPlaying( void );
+    bool                       isControllerPaused( void );
+    bool                       isControllerStopped( void );
+    bool                       isControllerPlayingForward( void );
+    bool                       isControllerLooping( void );
+    S32                        getControllerTime( void );
+    F32                        getControllerTimeScale( void );
+    S32                        getControllerDuration( void );
+
+    virtual void               setLabel( const String &pLabel );
+    void                       setLabelUnique( const String &pLabel );
+    inline void                setEnabled( const bool &pEnabled ) { mEnabled = pEnabled; };
+
+    // Callback Methods.
+
+    virtual void               onAttach( void );
+    virtual void               onDetach( void );
+
+    // Static Methods.
+
+    static  bool               setEnabled( void *pObject, const char *pArray, const char *pData ) { static_cast<VObject*>( pObject )->setEnabled( dAtob( pData ) ); return false; };
+    static  bool               setLabel( void *pObject, const char *pArray, const char *pData )   { static_cast<VObject*>( pObject )->setLabel( pData );            return false; };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VOBJECT_H_

+ 448 - 0
Engine/modules/Verve/Core/VTrack.cpp

@@ -0,0 +1,448 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VTrack.h"
+#include "Verve/Core/VGroup.h"
+#include "Verve/Core/VController.h"
+#include "math/mMath.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VTrack );
+//-----------------------------------------------------------------------------
+
+VTrack::VTrack( void ) :
+        mNextEvent( NULL )
+{
+    setLabel( "DefaultTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Tree Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::onAttach();
+// 
+// This callback subscribes this object to the controller's event signal.
+// 
+//-----------------------------------------------------------------------------
+void VTrack::onAttach( void )
+{
+    Parent::onAttach();
+
+    // Valid Controller?
+    if ( getController() )
+    {
+        // Subscribe to Updates.
+        getController()->getControllerUpdateSignal().notify( this, &VTrack::onControllerUpdate );
+
+        // Subscribe to Events.
+        getController()->getControllerEventSignal().notify( this, &VTrack::onControllerEvent );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::onAttach();
+// 
+// This callback removes this object from the controller's event signal
+// notification list.
+// 
+//-----------------------------------------------------------------------------
+void VTrack::onDetach( void )
+{
+    // Valid Controller?
+    if ( getController() )
+    {
+        // Remove Update Notification.
+        getController()->getControllerUpdateSignal().remove( this, &VTrack::onControllerUpdate );
+
+        // Remove Event Notification.
+        getController()->getControllerEventSignal().remove( this, &VTrack::onControllerEvent );
+    }
+
+    Parent::onDetach();
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::onControllerUpdate( pTime, pDelta );
+// 
+// The Next Event is integrated until has finished its execution. Once it has
+// finished, the next event to be triggered becomes the Current Event. Doing
+// this means that only one event is ever checked to see if it should be
+// triggered.
+// 
+//-----------------------------------------------------------------------------
+void VTrack::onControllerUpdate( const S32 &pTime, const S32 &pDelta )
+{
+    if ( !isEnabled() || !mNextEvent )
+    {
+        // Don't Update.
+        return;
+    }
+
+    // Update Next Event.
+    while ( !mNextEvent->onControllerUpdate( pTime, pDelta ) )
+    {
+        // Next Event?
+        if ( !updateNextEvent() )
+        {
+            // No Valid Events.
+            mNextEvent = NULL;
+            break;
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::onControllerEvent( pEvent );
+// 
+// When the controller's state changes, this method is called. If the
+// controller is reset the virtual method, onControllerReset is called.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !getController() )
+    {
+        AssertFatal( false, "VTrack::onControllerEvent() - Invalid Controller." );
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch( pEvent )
+    {
+        case VController::k_EventReset :
+            {
+
+                // Reset.
+                onControllerReset( getControllerTime(), isControllerPlayingForward() );
+
+            } break;
+    }
+
+    // Continue Processing Events.
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::onControllerReset( pTime, pForward );
+// 
+// Reset the status of the track. The Next Event is allocated here.
+// 
+//-----------------------------------------------------------------------------
+void VTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Clear Next Event.
+    mNextEvent = NULL;
+
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        VEvent *event = ( VEvent* )node;
+
+        // Reset Event.
+        event->onControllerReset( pTime, pForward );
+
+        if ( ( event->isPlaying() )
+             || ( pForward && event->getTriggerTime() >= pTime ) )
+        {
+            if ( !mNextEvent )
+            {
+                // Use as Next Event.
+                mNextEvent = event;
+            }
+        }
+        else if ( !pForward && pTime >= event->getTriggerTime() )
+        {
+            VEvent *nextEvent = ( VEvent* )node->mSiblingNextNode;
+            if ( !nextEvent || pTime < nextEvent->getTriggerTime() )
+            {
+                // Use as Next Event.
+                mNextEvent = event;
+            }
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::sort();
+// 
+// Sort the track's events by the event's trigger time.
+// 
+//-----------------------------------------------------------------------------
+void VTrack::sort( void )
+{
+    const S32 count = size();
+    for ( S32 j = 0; j < count; j++ )
+    {
+        for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+        {
+            VEvent *eventA = ( VEvent* )node;
+            VEvent *eventB = ( VEvent* )node->mSiblingNextNode;
+            if ( !eventB )
+            {
+                // No Node.
+                break;
+            }
+
+            // Swap?
+            if ( eventA->getTriggerTime() > eventB->getTriggerTime() )
+            {
+                // Get Outer Siblings.
+                ITreeNode *prevNode = eventA->mSiblingPrevNode;
+                ITreeNode *nextNode = eventB->mSiblingNextNode;
+                
+                if ( eventA->mParentNode && eventA->mParentNode->mChildNode == eventA )
+                {
+                    // New Child Node.
+                    eventA->mParentNode->mChildNode = eventB;
+                }
+
+                //
+                // Move A.
+                eventA->mSiblingPrevNode = eventB;
+                eventA->mSiblingNextNode = nextNode;
+
+                if ( nextNode )
+                {
+                    // Update Outer Sibling.
+                    nextNode->mSiblingPrevNode = eventA;
+                }
+
+                //
+                // Move B.
+
+                eventB->mSiblingPrevNode = prevNode;
+                eventB->mSiblingNextNode = eventA;
+
+                if ( prevNode )
+                {
+                    // Update Outer Sibling.
+                    prevNode->mSiblingNextNode = eventB;
+                }
+            }
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::updateNextEvent( pForward );
+// 
+// Point mNextEvent to the next valid event in the track's sequence.
+// 
+//-----------------------------------------------------------------------------
+bool VTrack::updateNextEvent( void )
+{
+    if ( !mNextEvent )
+    {
+        // Invalid Event.
+        return false;
+    }
+
+    while ( ( mNextEvent = mNextEvent->getNextEvent() ) != NULL )
+    {
+        if ( mNextEvent->isEnabled() )
+        {
+            // Valid Event.
+            return true;
+        }
+    }
+
+    // Invalid Event.
+    return false;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::getGroup();
+// 
+// Returns the Track's parent group.
+// 
+//-----------------------------------------------------------------------------
+VGroup *VTrack::getGroup( void )
+{
+    return dynamic_cast<VGroup*>( mParentNode );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::getNextEvent();
+// 
+// Returns the Event that the Track is currently observing.
+// 
+//-----------------------------------------------------------------------------
+VEvent *VTrack::getNextEvent( void )
+{
+    return mNextEvent;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::getCurrentEvent();
+// 
+// Returns the Event that the Track is currently observing and playing. This
+// will only ever be non-null when the track is observing an Event that has a
+// non-zero duration and has been triggered.
+// 
+//-----------------------------------------------------------------------------
+VEvent *VTrack::getCurrentEvent( void )
+{
+    if ( mNextEvent && mNextEvent->isPlaying() )
+    {
+        return mNextEvent;
+    }
+
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::getPreviousEvent();
+// 
+// Returns the Event that the Track was last intergrating.
+// 
+//-----------------------------------------------------------------------------
+VEvent *VTrack::getPreviousEvent( void )
+{
+    if ( mNextEvent )
+    {
+        return mNextEvent->getPreviousEvent();
+    }
+
+    if ( !isControllerPlayingForward() )
+    {
+        return dynamic_cast<VEvent*>( getChild() );
+    }
+
+    return dynamic_cast<VEvent*>( getLastChild() );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTrack::calclateInterp( pTime );
+// 
+// This method returns the interp time between or within events. If the given
+// time is between two events, the return time is:
+//
+//     ( pTime - last_event_finish_time )
+//                         / ( next_event_start_time - last_event_finish_time )
+// 
+// If the given time is within an event, the return time is:
+//
+//     ( pTime - event_start_time ) / ( event_duration )
+//
+// The value returned here is between 0.0 and 1.0.
+// 
+//-----------------------------------------------------------------------------
+F32 VTrack::calculateInterp( S32 pTime )
+{
+    if ( !isControllerPlayingForward() )
+    {
+        return ( 1.f - _calculateInterp( pTime ) );
+    }
+
+    return _calculateInterp( pTime );
+}
+
+F32 VTrack::_calculateInterp( S32 pTime )
+{
+    // Fetch Duration.
+    const S32 sequenceDuration = getControllerDuration();
+    if ( sequenceDuration == 0 || pTime == sequenceDuration )
+    {
+        // Sanity!
+        return 1.f;
+    }
+
+    if ( !mChildNode )
+    {
+        // Quick Interp.
+        return F32( pTime / sequenceDuration );
+    }
+
+    // Last Time.
+    S32 lastTime = 0;
+
+    VEvent *walk = ( VEvent* )mChildNode;
+    while ( walk )
+    {
+        const S32 startTime  = walk->getStartTime();
+        const S32 finishTime = walk->getFinishTime();
+
+        if ( pTime < startTime )
+        {
+            return ( F32( pTime - lastTime ) / F32( startTime - lastTime ) );
+        }
+
+        // Update Last Time.
+        lastTime = startTime;
+
+        if ( pTime < finishTime )
+        {
+            return ( F32( pTime - lastTime ) / F32( finishTime - lastTime ) );
+        }
+
+        // Update Last Time.
+        lastTime = finishTime;
+
+        // Fetch Next Node.
+        walk = ( VEvent* )walk->mSiblingNextNode;
+    }
+
+    // Return.
+    return ( F32( pTime - lastTime ) / F32( sequenceDuration - lastTime ) );
+}

+ 123 - 0
Engine/modules/Verve/Core/VTrack.h

@@ -0,0 +1,123 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VTRACK_H_
+#define _VT_VTRACK_H_
+
+#ifndef _VT_VCONTROLLER_H_
+#include "Verve/Core/VController.h"
+#endif
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_SCENEOBJECT_H_
+#include "Verve/Torque/TSceneObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+class VGroup;
+//-----------------------------------------------------------------------------
+
+class VTrack : public VObject
+{
+    typedef VObject Parent;
+
+public:
+
+    // Controller Members.
+
+    VEvent         *mNextEvent;
+
+public:
+
+    VTrack();
+
+    // Tree Methods.
+
+    virtual void    onAttach( void );
+    virtual void    onDetach( void );
+
+    // Controller Methods.
+
+    virtual void    onControllerUpdate( const S32 &pTime, const S32 &pDelta );
+    virtual bool    onControllerEvent( VController::eControllerEventType pEvent );
+
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Reference Methods.
+
+    void            sort( void );
+    bool            updateNextEvent( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VTrack );
+
+public:
+
+    // Property Methods.
+
+    VGroup   *getGroup( void );
+    template <class T> inline bool getGroup( T *&pGroup )
+    {
+        // Reference Group.
+        pGroup = dynamic_cast<T*>( getGroup() );
+        // Validate.
+        return ( pGroup != NULL );
+    }
+
+    VEvent   *getNextEvent( void );
+    template <class T> inline bool getNextEvent( T *&pEvent )
+    {
+        // Reference Object.
+        pEvent = dynamic_cast<T*>( getNextEvent() );
+        // Validate.
+        return ( pEvent != NULL );
+    }
+
+    VEvent   *getCurrentEvent( void );
+    template <class T> inline bool getCurrentEvent( T *&pEvent )
+    {
+        // Reference Object.
+        pEvent = dynamic_cast<T*>( getCurrentEvent() );
+        // Validate.
+        return ( pEvent != NULL );
+    }
+
+    VEvent   *getPreviousEvent( void );
+    template <class T> inline bool getPreviousEvent( T *&pEvent )
+    {
+        // Reference Object.
+        pEvent = dynamic_cast<T*>( getPreviousEvent() );
+        // Validate.
+        return ( pEvent != NULL );
+    }
+
+    F32             calculateInterp( S32 pTime );
+    F32            _calculateInterp( S32 pTime );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VTRACK_H_

+ 471 - 0
Engine/modules/Verve/Core/VTreeNode.cpp

@@ -0,0 +1,471 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VTreeNode.h"
+#include "console/simObject.h"
+#include "platform/platform.h"
+
+//-----------------------------------------------------------------------------
+
+VTreeNode::VTreeNode( void )
+{
+    mParentNode      = NULL;
+    mChildNode       = NULL;
+    mSiblingPrevNode = NULL;
+    mSiblingNextNode = NULL;
+}
+
+VTreeNode::~VTreeNode( void )
+{
+    // Delete Children.
+    clear();
+
+    // Detach.
+    remove();
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::clear();
+// 
+// Delete all child nodes.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::clear( void )
+{
+    if ( !mChildNode )
+    {
+        return;
+    }
+
+    while ( mChildNode )
+    {
+        // Fetch Child Node.
+        ITreeNode *node = mChildNode;
+
+        // Clear It.
+        node->clear();
+
+        // Detach It.
+        node->remove();
+
+        // Delete It.
+        SimObject *object = dynamic_cast<SimObject*>( node );
+        if ( object )
+        {
+            object->deleteObject();
+        }
+        else
+        {
+            delete node;
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// ITreeNode Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getRoot();
+// 
+// Returns the root object.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getRoot( void )
+{
+    ITreeNode *parent = this;
+    while ( parent->mParentNode )
+    {
+        parent = parent->mParentNode;
+    }
+
+    return parent;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getParent();
+// 
+// Returns the parent object.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getParent( void )
+{
+    return mParentNode;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getChild();
+// 
+// Returns the first child object.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getChild( void )
+{
+    return mChildNode;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getChild();
+// 
+// Returns the first child object.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getLastChild( void )
+{
+    // Any Nodes?
+    if ( !mChildNode )
+    {
+        // Null.
+        return NULL;
+    }
+
+    // Front Node.
+    ITreeNode *lastNode = mChildNode;
+
+    // Fetch Last Node.
+    while ( lastNode->mSiblingNextNode )
+    {
+        lastNode = lastNode->mSiblingNextNode;
+    }
+
+    // Return.
+    return lastNode;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getPrevSibling();
+// 
+// Returns the previous object in the linked list.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getPrevSibling( void )
+{
+    return mSiblingPrevNode;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getNextSibling();
+// 
+// Returns the next object in the linked list.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::getNextSibling( void )
+{
+    return mSiblingNextNode;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::size();
+// 
+// Returns the number of child objects. Only includes top level.
+// 
+//-----------------------------------------------------------------------------
+int VTreeNode::size( void )
+{
+    int size = 0;
+
+    ITreeNode *node = mChildNode;
+    while ( node )
+    {
+        size++;
+
+        node = node->mSiblingNextNode;
+    }
+
+    return size;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::at( pIndex );
+// 
+// Returns the object at the given index.
+// 
+//-----------------------------------------------------------------------------
+ITreeNode *VTreeNode::at( const int pIndex )
+{
+    int index = 0;
+
+    ITreeNode *node = mChildNode;
+    while ( node )
+    {
+        if ( index++ == pIndex )
+        {
+            return node;
+        }
+
+        node = node->mSiblingNextNode;
+    }
+
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::getIndex();
+// 
+// Returns the index of the object in relation to the sibling nodes.
+// 
+//-----------------------------------------------------------------------------
+int VTreeNode::getIndex( void )
+{
+    if ( !inTree() )
+    {
+        // No Index.
+        return 0;
+    }
+
+    ITreeNode *walk = NULL;
+    if ( mParentNode )
+    {
+        walk = mParentNode->mChildNode;
+    }
+    else
+    {
+        walk = this;
+        while ( walk->mSiblingPrevNode )
+        {
+            // Walk Up.
+            walk = walk->mSiblingPrevNode;
+        }
+    }
+
+    for ( int i = 0; walk; walk = walk->mSiblingNextNode, i++ )
+    {
+        if ( walk == this )
+        {
+            return i;
+        }
+    }
+
+    AssertFatal( false, "VTreeNode::getIndex() - Node List Broken?" );
+
+    return 0;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::addTo( pNode );
+// 
+// Attach this node to the back of the target node.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::addTo( ITreeNode *pNode )
+{
+    if ( inTree() )
+    {
+        // Already In Tree.
+        return;
+    }
+
+    // Set Parent.
+    mParentNode = pNode;
+
+    if ( !pNode->mChildNode )
+    {
+        // Store Child Node.
+        pNode->mChildNode = this;
+    }
+    else
+    {
+        // Front Node.
+        ITreeNode *headNode = pNode->mChildNode;
+
+        // Fetch Head Node.
+        while ( headNode->mSiblingNextNode )
+        {
+            headNode = headNode->mSiblingNextNode;
+        }
+
+        // Reference Next Node.
+        headNode->mSiblingNextNode = this;
+
+        // Reference Previous Node.
+        mSiblingPrevNode = headNode;
+    }
+
+    // Callback.
+    onAttach();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::addToFront( pNode );
+// 
+// Attach this node to the front of the target node.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::addToFront( ITreeNode *pNode )
+{
+    if ( inTree() )
+    {
+        // Already In Tree.
+        return;
+    }
+
+    // Set Parent.
+    mParentNode = pNode;
+
+    if ( !pNode->mChildNode )
+    {
+        // Store Child Node.
+        pNode->mChildNode = this;
+    }
+    else
+    {
+        // First Node.
+        ITreeNode *childNode = pNode->mChildNode;
+
+        // Reference Previous Node.
+        childNode->mSiblingPrevNode = this;
+
+        // Reference Next Node.
+        mSiblingNextNode = childNode;
+
+        // Store Child Node.
+        pNode->mChildNode = this;
+    }
+
+    // Callback.
+    onAttach();
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::remove();
+// 
+// Detach this node from the current parent node.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::remove( void )
+{
+    if ( !inTree() )
+    {
+        return;
+    }
+
+    // Callback.
+    onDetach();
+
+    if ( mParentNode && mParentNode->mChildNode == this )
+    {
+        // Update Parent Reference.
+        mParentNode->mChildNode = mSiblingNextNode;
+    }
+
+    if ( mSiblingNextNode )
+    {
+        // Update Previous Node.
+        mSiblingNextNode->mSiblingPrevNode = mSiblingPrevNode;
+    }
+
+    if ( mSiblingPrevNode )
+    {
+        // Update Next Node.
+        mSiblingPrevNode->mSiblingNextNode = mSiblingNextNode;
+    }
+
+    // Remove References.
+    mParentNode = mSiblingPrevNode = mSiblingNextNode = NULL;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::moveTo( pNode );
+// 
+// Detach this node and attach it to the target node.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::moveTo( ITreeNode *pNode )
+{
+    if ( inTree() )
+    {
+        // Remove from Tree.
+        remove();
+    }
+
+    // Add to tree.
+    addTo( pNode );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::onAttach();
+// 
+// This method will be called when this node, or a parent node, is attached to
+// a node.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::onAttach( void )
+{
+    // Notify Children.
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        node->onAttach();
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::onDetach();
+// 
+// This method will be called when this node, or a parent node, is detached.
+// 
+//-----------------------------------------------------------------------------
+void VTreeNode::onDetach( void )
+{
+    // Notify Children.
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        node->onDetach();
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VTreeNode::inTree();
+// 
+// Returns true if the node is the a member of a node tree.
+// 
+//-----------------------------------------------------------------------------
+bool VTreeNode::inTree( void )
+{
+    return !( mParentNode == NULL &&
+              mSiblingPrevNode == NULL &&
+              mSiblingNextNode == NULL );
+}

+ 73 - 0
Engine/modules/Verve/Core/VTreeNode.h

@@ -0,0 +1,73 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VTREENODE_H_
+#define _VT_VTREENODE_H_
+
+#ifndef _VT_ITREENODE_H_
+#include "Verve/Core/ITreeNode.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VTreeNode : public ITreeNode
+{
+    typedef ITreeNode Parent;
+
+public:
+
+    VTreeNode( void );
+    ~VTreeNode( void );
+
+    // Reference Methods.
+
+    virtual void               clear( void );
+
+    // ITreeNode Methods.
+
+    virtual ITreeNode         *getRoot( void );
+    virtual ITreeNode         *getParent( void );
+    virtual ITreeNode         *getChild( void );
+    virtual ITreeNode         *getLastChild( void );
+
+    virtual ITreeNode         *getPrevSibling( void );
+    virtual ITreeNode         *getNextSibling( void );
+
+    virtual ITreeNode         *at( const int pIndex );
+    virtual int                size( void );
+
+    virtual int                getIndex( void );
+
+    virtual void               addTo( ITreeNode *pNode );
+    virtual void               addToFront( ITreeNode *pNode );
+    virtual void               remove( void );
+    virtual void               moveTo( ITreeNode *pNode );
+
+    virtual void               onAttach( void );
+    virtual void               onDetach( void );
+
+    virtual bool               inTree( void );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VTREENODE_H_

+ 154 - 0
Engine/modules/Verve/Extension/Animation/VShapeAnimationEvent.cpp

@@ -0,0 +1,154 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Animation/VShapeAnimationEvent.h"
+#include "Verve/Extension/Animation/VShapeAnimationTrack.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VShapeAnimationEvent );
+//-----------------------------------------------------------------------------
+
+VShapeAnimationEvent::VShapeAnimationEvent( void ) : 
+        mAnimationData( String::EmptyString ),
+        mAutoDuration( true )
+{
+    setLabel( "AnimationEvent" );
+}
+
+//-----------------------------------------------------------------------------
+
+void VShapeAnimationEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "AnimationData", TypeRealString, Offset( mAnimationData, VShapeAnimationEvent ), "The name of the Animation Sequence to play upon triggering." );
+    addField( "AutoDuration",  TypeBool,       Offset( mAutoDuration,  VShapeAnimationEvent ), "Force the Event's Duration to match the length of the Animation." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VShapeAnimationEvent::onTrigger( pTime, pDelta );
+// 
+// Play the desired animation. Also account for any offet in playtime, and
+// timescale.
+// 
+//-----------------------------------------------------------------------------
+void VShapeAnimationEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    VTorque::SceneObjectType *object = getSceneObject();
+    VShapeAnimationTrack *track;
+    if ( !object || !getTrack( track ) )
+    {
+        // Sanity!
+        return;
+    }
+
+    // Play Animation.
+    VTorque::playAnimation( object, track->getThreadIndex(), mAnimationData );
+
+    // Set Position.
+    VTorque::setAnimationPosition( object, track->getThreadIndex(), getAnimationPosition( pTime + pDelta ) );
+
+    // Set Time Scale.
+    VTorque::setAnimationTimeScale( object, track->getThreadIndex(), ( ( pDelta > 0 ) ? 1.f : -1.f ) );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VShapeAnimationEvent::onComplete( pTime, pDelta );
+// 
+// If the animation is cyclic, then it needs to be paused once the event has
+// finished playing.
+// 
+//-----------------------------------------------------------------------------
+void VShapeAnimationEvent::onComplete( const S32 &pTime, const S32 &pDelta )
+{
+    // Fetch Object.
+    VTorque::SceneObjectType *object = getSceneObject();
+    VShapeAnimationTrack *track;
+    if ( object && VTorque::isAnimationLooping( object, mAnimationData ) && getTrack( track ) )
+    {
+        // Pause Animation.
+        VTorque::pauseAnimation( object, track->getThreadIndex() );
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VShapeAnimationEvent::getAnimationPosition( pTime );
+// 
+// Returns the time that the animation should be positioned at, at the given
+// time. This method considers whether the animation is cyclic or not and will
+// return the appropriate time regardless. Time is expressed in seconds and not
+// milliseconds.
+// 
+//-----------------------------------------------------------------------------
+F32 VShapeAnimationEvent::getAnimationPosition( const S32 &pTime )
+{
+    // Fetch Object.
+    VSceneObjectTrack        *track;
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !getTrack( track ) || !object )
+    {
+        // Null.
+        return 0.f;
+    }
+
+    // Fetch Interp.
+    F32 interp = track->calculateInterp( pTime );
+    if ( !isControllerPlayingForward() )
+    {
+        // Flip.
+        interp = ( 1.f - interp );
+    }
+
+    // Not Looping?
+    if ( !VTorque::isAnimationLooping( object, mAnimationData ) )
+    {
+        // Return Interp.
+        return interp;
+    }
+
+    // Fetch Sequence Duration.
+    const S32 duration = ( S32 )( 1000 * VTorque::getAnimationDuration( object, mAnimationData ) );
+
+    // Fetch Loop Interp.
+    const S32 loopInterp = S32( mDuration * interp ) % duration;
+
+    return ( F32 )loopInterp / ( F32 )duration;
+}

+ 69 - 0
Engine/modules/Verve/Extension/Animation/VShapeAnimationEvent.h

@@ -0,0 +1,69 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSHAPEANIMATIONEVENT_H_
+#define _VT_VSHAPEANIMATIONEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_ANIMATION_H_
+#include "Verve/Torque/TAnimation.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VShapeAnimationEvent : public VSceneObjectEvent
+{
+    typedef VSceneObjectEvent Parent;
+
+public:
+
+    bool            mAutoDuration;
+    String          mAnimationData;
+    
+public:
+
+    VShapeAnimationEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Callback Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+    virtual void    onComplete( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VShapeAnimationEvent );
+
+public:
+
+    // Property Methods.
+
+    F32             getAnimationPosition( const S32 &pTime );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSHAPEANIMATIONEVENT_H_

+ 185 - 0
Engine/modules/Verve/Extension/Animation/VShapeAnimationTrack.cpp

@@ -0,0 +1,185 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Animation/VShapeAnimationTrack.h"
+#include "Verve/Extension/Animation/VShapeAnimationEvent.h"
+#include "Verve/Core/VGroup.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VShapeAnimationTrack );
+//-----------------------------------------------------------------------------
+
+VShapeAnimationTrack::VShapeAnimationTrack( void ) :
+        mThreadIndex( 0 )
+{
+    setLabel( "AnimationTrack" );
+}
+
+//-----------------------------------------------------------------------------
+
+void VShapeAnimationTrack::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "ThreadIndex", TypeS32, Offset( mThreadIndex, VShapeAnimationTrack ), "The index of the Animation Thread to play." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VShapeAnimationTrack::onControllerEvent( pEvent );
+// 
+// When the controller's state changes, this method is called. If the
+// controller is paused, or stops playing, then the animation will cease to
+// play. If the controller resumes play, the animation will continue.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VShapeAnimationTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventPlay :
+            {
+
+                // Play Animation.
+                VTorque::setAnimationTimeScale( getSceneObject(), mThreadIndex, ( ( isControllerPlayingForward() ) ? 1.f : -1.f ) );
+
+            } break;
+
+        case VController::k_EventPause :
+        case VController::k_EventStop :
+            {
+
+                // Stop Animation.
+                VTorque::setAnimationTimeScale( getSceneObject(), mThreadIndex, 0.f );
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VShapeAnimationTrack::onControllerReset( pTime, pForward );
+// 
+// Reset the animation state of the target object. If there is a Next Event,
+// then the animation is positioned accordingly.
+// 
+//-----------------------------------------------------------------------------
+void VShapeAnimationTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !object )
+    {
+        // Parent Call.
+        Parent::onControllerReset( pTime, pForward );
+        return;
+    }
+
+    VShapeAnimationEvent *event;
+    if ( getCurrentEvent( event ) )
+    {
+        // Stop Animation.
+        VTorque::stopAnimation( object, mThreadIndex );
+    }
+
+    // Parent Call.
+    Parent::onControllerReset( pTime, pForward );
+
+    if ( getCurrentEvent( event ) )
+    {
+        // Play Animation.
+        VTorque::playAnimation( object, mThreadIndex, event->mAnimationData );
+
+        // Set Position.
+        VTorque::setAnimationPosition( object, mThreadIndex, event->getAnimationPosition( pTime ) );
+
+        // Stop Animation.
+        VTorque::setAnimationTimeScale( object, mThreadIndex, 0.f );
+    }
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VShapeAnimationTrack, updateTrack, void, 2, 2, "( void ) - Update the Track.\n"
+                                                              "@return No return value." )
+{
+    for ( ITreeNode *node = object->mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        VShapeAnimationEvent *currEvent = ( VShapeAnimationEvent* )node;
+        VShapeAnimationEvent *nextEvent = ( VShapeAnimationEvent* )node->mSiblingNextNode;
+        if ( !currEvent->mAutoDuration )
+        {
+            // Skip.
+            continue;
+        }
+
+        if ( VTorque::isAnimationLooping( object->getSceneObject(), currEvent->mAnimationData ) )
+        {
+            if ( !nextEvent )
+            {
+                // Update Duration.
+                currEvent->setDuration( object->getControllerDuration() - currEvent->getTriggerTime() );
+            }
+            else
+            {
+                // Update Duration.
+                currEvent->setDuration( mAbs( nextEvent->getTriggerTime() - currEvent->getTriggerTime() ) );
+            }
+        }
+        else
+        {
+            // Update Duration.
+            currEvent->setDuration( ( S32 )( 1000 * VTorque::getAnimationDuration( object->getSceneObject(), currEvent->mAnimationData ) ) );
+        }
+    }
+}
+#endif

+ 64 - 0
Engine/modules/Verve/Extension/Animation/VShapeAnimationTrack.h

@@ -0,0 +1,64 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSHAPEANIMATIONTRACK_H_
+#define _VT_VSHAPEANIMATIONTRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_ANIMATION_H_
+#include "Verve/Torque/TAnimation.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VShapeAnimationTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+    U32             mThreadIndex;
+
+public:
+
+    VShapeAnimationTrack( void );
+
+    static void     initPersistFields( void );
+
+    // Controller Methods.
+
+    virtual bool    onControllerEvent( VController::eControllerEventType pEvent );
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VShapeAnimationTrack );
+
+public:
+
+    inline U32     &getThreadIndex( void ) { return mThreadIndex; };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSHAPEANIMATIONTRACK_H_

+ 224 - 0
Engine/modules/Verve/Extension/Camera/VCameraGroup.cpp

@@ -0,0 +1,224 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Camera/VCameraGroup.h"
+#include "Verve/Extension/Camera/VCameraTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VCameraGroup );
+//-----------------------------------------------------------------------------
+
+VCameraGroup *VCameraGroup::mActiveGroup = NULL;
+VCameraGroup::CameraChangeSignal VCameraGroup::mCameraChangeSignal;
+
+//-----------------------------------------------------------------------------
+
+VCameraGroup::VCameraGroup( void )
+{
+    setLabel( "CameraGroup" );
+};
+
+//-----------------------------------------------------------------------------
+//
+// Tree Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::onAttach();
+// 
+// This callback subscribes this object to the controller's event signal.
+// 
+//-----------------------------------------------------------------------------
+void VCameraGroup::onAttach( void )
+{
+    Parent::onAttach();
+
+    // Valid Controller?
+    if ( getController() )
+    {
+        // Subscribe to Events.
+        getController()->getControllerEventSignal().notify( this, &VCameraGroup::onControllerEvent );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::onAttach();
+// 
+// This callback removes this object from the controller's event signal
+// notification list.
+// 
+//-----------------------------------------------------------------------------
+void VCameraGroup::onDetach( void )
+{
+    // Valid Controller?
+    if ( getController() )
+    {
+        // Remove Event Notification.
+        getController()->getControllerEventSignal().remove( this, &VCameraGroup::onControllerEvent );
+    }
+
+    Parent::onDetach();
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::onControllerEvent( pEvent );
+// 
+// When the controller's state changes, this method is called.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VCameraGroup::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !getController() )
+    {
+        AssertFatal( false, "VCameraGroup::onControllerEvent() - Invalid Controller." );
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch( pEvent )
+    {
+#ifdef VT_EDITOR
+        case VController::k_EventPause :
+#endif
+        case VController::k_EventStop :
+            {
+
+                // Clear the Camera.
+                clearActiveGroup();
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Camera Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::setActive();
+// 
+// Set this Group to Active.
+// 
+//-----------------------------------------------------------------------------
+void VCameraGroup::setActive( void )
+{
+    // Set Active.
+    setActiveGroup( this );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::clearActiveGroup();
+// 
+// Clear the Active Camera.
+// 
+//-----------------------------------------------------------------------------
+void VCameraGroup::clearActiveGroup( void )
+{
+    if ( mActiveGroup )
+    {
+        // Deactivate Signal.
+        mActiveGroup->getCameraEventSignal().trigger( k_EventDeactivate );
+    }
+
+    // Store.
+    mActiveGroup = NULL;
+
+    // Clear Camera Object.
+    VTorque::setCamera( NULL );
+
+    // Change Signal.
+    getCameraChangeSignal().trigger( NULL );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraGroup::setActiveGroup( pCameraGroup );
+// 
+// Change the current camera group. The actual camera object is the object that
+// the group references.
+// 
+// A NULL value of pCameraGroup will clear the active camera, which generally
+// reverts to the connection's control object. The camera is also cleared when
+// the Controller stops playing.
+// 
+//-----------------------------------------------------------------------------
+void VCameraGroup::setActiveGroup( VCameraGroup *pCameraGroup )
+{
+    // Change Camera?
+    if ( pCameraGroup == mActiveGroup ||
+         pCameraGroup && !pCameraGroup->isEnabled() )
+    {
+        // Invalid Target.
+        return;
+    }
+
+    if ( mActiveGroup )
+    {
+        // Deactivate Signal.
+        mActiveGroup->getCameraEventSignal().trigger( k_EventDeactivate );
+    }
+
+    // Store.
+    mActiveGroup = pCameraGroup;
+
+    if ( mActiveGroup )
+    {
+        // Set Camera Object.
+        VTorque::setCamera( mActiveGroup->getSceneObject() );
+
+        // Activate Signal.
+        mActiveGroup->getCameraEventSignal().trigger( k_EventActivate );
+    }
+    else
+    {
+        // Clear Camera Object.
+        VTorque::setCamera( NULL );
+    }
+
+    // Change Signal.
+    getCameraChangeSignal().trigger( mActiveGroup );
+}

+ 97 - 0
Engine/modules/Verve/Extension/Camera/VCameraGroup.h

@@ -0,0 +1,97 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VCAMERAGROUP_H_
+#define _VT_VCAMERAGROUP_H_
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+#ifndef _VT_VCONTROLLER_H
+#include "Verve/Core/VController.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VCameraGroup;
+
+//-----------------------------------------------------------------------------
+
+class VCameraGroup : public VSceneObjectGroup
+{
+    typedef VSceneObjectGroup Parent;
+
+public:
+
+    enum eCameraEventType
+    {
+        k_EventActivate,
+        k_EventDeactivate,
+    };
+
+    typedef Signal<bool( const eCameraEventType & )> CameraEventSignal;
+    typedef Signal<void( VCameraGroup* )>            CameraChangeSignal;
+
+protected:
+
+    static VCameraGroup         *mActiveGroup;
+    static CameraChangeSignal    mCameraChangeSignal;
+
+    CameraEventSignal            mCameraEventSignal;
+
+public:
+
+    VCameraGroup( void );
+
+    // Tree Methods.
+
+    void                   onAttach( void );
+    void                   onDetach( void );
+
+    // Controller Methods.
+
+    bool                   onControllerEvent( VController::eControllerEventType pEvent );
+
+    // Camera Methods.
+
+    inline bool            isActive( void ) { return ( bool )( this == getActiveGroup() ); };
+    inline VCameraGroup   *getActiveGroup( void ) { return mActiveGroup; };
+
+    void                   setActive( void );
+
+    static void            clearActiveGroup( void );
+    static void            setActiveGroup( VCameraGroup *pCameraGroup );
+
+    // Signal Methods.
+
+    static inline CameraChangeSignal   &getCameraChangeSignal( void ) { return mCameraChangeSignal; };
+    inline CameraEventSignal           &getCameraEventSignal( void ) { return mCameraEventSignal; };
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VCameraGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VCAMERAGROUP_H_

+ 83 - 0
Engine/modules/Verve/Extension/Camera/VCameraShakeEvent.cpp

@@ -0,0 +1,83 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+#include "Verve/Extension/Camera/VCameraGroup.h"
+#include "Verve/Extension/Camera/VCameraShakeEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VCameraShakeEvent );
+//-----------------------------------------------------------------------------
+
+VCameraShakeEvent::VCameraShakeEvent( void ) : 
+        mAmplitude( Point3F::Zero ),
+        mFalloff( 10.f ),
+        mFrequency( Point3F::Zero )
+{
+    // Clear Label.
+    setLabel( "CameraShakeEvent" );
+}
+
+void VCameraShakeEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Amplitude", TypePoint3F, Offset( mAmplitude, VCameraShakeEvent ), "Amplitude of the Camera Shake event." );
+    addField( "Falloff",   TypeF32,     Offset( mFalloff,   VCameraShakeEvent ), "Falloff of the Camera Shake event." );
+    addField( "Frequency", TypePoint3F, Offset( mFrequency, VCameraShakeEvent ), "Frequency of the Camera Shake event." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraShakeEvent::onTrigger( pTime, pDelta );
+// 
+// Start shaking the camera. Also account for any offet in playtime, and
+// timescale.
+// 
+//-----------------------------------------------------------------------------
+void VCameraShakeEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Group.
+    VCameraGroup *group;
+    if ( !getGroup( group ) || !group->isActive() )
+    {
+        // Inactive.
+        return;
+    }
+
+    // Duration.
+    //const F32 duration  = ( mDuration - mAbs( pTime - getStartTime() ) ) / ( 1000.f * mFabs( getControllerTimeScale() ) );
+    const F32 duration  = ( mDuration - mAbs( pTime - getStartTime() ) ) / 1000.f;
+
+    // Shake Camera.
+    VTorque::startCameraShake( duration, mFalloff, mAmplitude, mFrequency );
+}

+ 59 - 0
Engine/modules/Verve/Extension/Camera/VCameraShakeEvent.h

@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VCAMERASHAKEEVENT_H_
+#define _VT_VCAMERASHAKEEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VCameraShakeEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VectorF         mAmplitude;
+    F32             mFalloff;
+    VectorF         mFrequency;
+    
+public:
+
+    VCameraShakeEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VCameraShakeEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VCAMERASHAKEEVENT_H_

+ 114 - 0
Engine/modules/Verve/Extension/Camera/VCameraShakeTrack.cpp

@@ -0,0 +1,114 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Camera/VCameraShakeTrack.h"
+#include "Verve/Extension/Camera/VCameraShakeEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VCameraShakeTrack );
+//-----------------------------------------------------------------------------
+
+VCameraShakeTrack::VCameraShakeTrack( void )
+{
+    setLabel( "CameraShakeTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Camera Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraShakeTrack::onCameraEvent( pEvent );
+// 
+// When the Camera changes, this method is called on both the outgoing and
+// incoming Camera Groups.
+// 
+// For a full list of possible events, see the 'eCameraEventType' declaration
+// in VCameraGroup.h.
+// 
+//-----------------------------------------------------------------------------
+bool VCameraShakeTrack::onCameraEvent( const VCameraGroup::eCameraEventType &pEvent )
+{
+    // Parent Call.
+    if ( !Parent::onCameraEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch( pEvent )
+    {
+        case VCameraGroup::k_EventActivate :
+            {
+
+                VCameraShakeEvent *event;
+                if ( getCurrentEvent( event ) )
+                {
+                    // Re-Trigger Event.
+                    event->onTrigger( getControllerTime(), 0 );
+                }
+
+            } break;
+
+        case VCameraGroup::k_EventDeactivate :
+            {
+
+                // Stop Camera Shake.
+                VTorque::stopCameraShake();
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraShakeTrack::onControllerReset( pTime, pForward );
+// 
+// Stop all camera shake events.
+// 
+//-----------------------------------------------------------------------------
+void VCameraShakeTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Default Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    // Stop Camera Shake.
+    VTorque::stopCameraShake();
+}

+ 55 - 0
Engine/modules/Verve/Extension/Camera/VCameraShakeTrack.h

@@ -0,0 +1,55 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VCAMERASHAKETRACK_H_
+#define _VT_VCAMERASHAKETRACK_H_
+
+#ifndef _VT_VCAMERATRACK_H_
+#include "Verve/Extension/Camera/VCameraTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VCameraShakeTrack : public VCameraTrack
+{
+    typedef VCameraTrack Parent;
+
+public:
+
+    VCameraShakeTrack( void );
+
+    // Camera Methods.
+
+    bool            onCameraEvent( const VCameraGroup::eCameraEventType &pEvent );
+
+    // Controller Methods.
+
+    void            onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VCameraShakeTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VCAMERASHAKETRACK_H_

+ 108 - 0
Engine/modules/Verve/Extension/Camera/VCameraTrack.cpp

@@ -0,0 +1,108 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Camera/VCameraTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VCameraTrack );
+//-----------------------------------------------------------------------------
+
+VCameraTrack::VCameraTrack( void )
+{
+    setLabel( "CameraTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Tree Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraTrack::onAttach();
+// 
+// This callback subscribes this object to the Camera Group's event signal.
+// 
+//-----------------------------------------------------------------------------
+void VCameraTrack::onAttach( void )
+{
+    Parent::onAttach();
+
+    // Valid Controller & Group?
+    VCameraGroup *group;
+    if ( getController() && getGroup( group ) )
+    {
+        // Add Event Notification.
+        group->getCameraEventSignal().notify( this, &VCameraTrack::onCameraEvent );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraTrack::onAttach();
+// 
+// This callback removes this object from the Camera Group's event signal
+// notification list.
+// 
+//-----------------------------------------------------------------------------
+void VCameraTrack::onDetach( void )
+{
+    // Valid Controller & Group?
+    VCameraGroup *group;
+    if ( getController() && getGroup( group ) )
+    {
+        // Clear Event Notification.
+        group->getCameraEventSignal().remove( this, &VCameraTrack::onCameraEvent );
+    }
+
+    Parent::onDetach();
+}
+
+//-----------------------------------------------------------------------------
+//
+// Camera Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VCameraTrack::onCameraEvent( pEvent );
+// 
+// When the Camera changes, this method is called on both the outgoing and
+// incomming Camera Groups.
+// 
+// For a full list of possible events, see the 'eCameraEventType' declaration
+// in VCameraGroup.h.
+// 
+//-----------------------------------------------------------------------------
+bool VCameraTrack::onCameraEvent( const VCameraGroup::eCameraEventType &pEvent )
+{
+    if ( !getController() )
+    {
+        AssertFatal( false, "VCameraTrack::onControllerEvent() - Invalid Controller." );
+        return false;
+    }
+
+    // Ok.
+    return true;
+}

+ 60 - 0
Engine/modules/Verve/Extension/Camera/VCameraTrack.h

@@ -0,0 +1,60 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VCAMERATRACK_H_
+#define _VT_VCAMERATRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_VCAMERAGROUP_H_
+#include "Verve/Extension/Camera/VCameraGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VCameraTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+public:
+
+    VCameraTrack( void );
+
+    // Tree Methods.
+
+    void            onAttach( void );
+    void            onDetach( void );
+
+    // Camera Methods.
+
+    virtual bool    onCameraEvent( const VCameraGroup::eCameraEventType &pEvent );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VCameraTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VCAMERATRACK_H_

+ 75 - 0
Engine/modules/Verve/Extension/Director/VDirectorEvent.cpp

@@ -0,0 +1,75 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+#include "Verve/Extension/Director/VDirectorEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VDirectorEvent );
+//-----------------------------------------------------------------------------
+
+VDirectorEvent::VDirectorEvent( void ) : 
+        mTarget( String::EmptyString )
+{
+    // Void.
+}
+
+void VDirectorEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Target", TypeRealString, Offset( mTarget, VDirectorEvent ), "The name of the CameraGroup that will be activated upon triggering." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VDirectorEvent::onTrigger( pTime, pDelta );
+// 
+// Cut the camera to the target group.
+// 
+//-----------------------------------------------------------------------------
+void VDirectorEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Controller.
+    VController *controller = getController();
+
+    // Valid Target?
+    VCameraGroup *targetGroup = NULL;
+    if ( !controller->getObject( mTarget, targetGroup ) )
+    {
+        Con::warnf( "VDirectorEvent::onTrigger() - Invalid Target Group specified." );
+        return;
+    }
+
+    // Change Camera.
+    targetGroup->setActive();
+}

+ 61 - 0
Engine/modules/Verve/Extension/Director/VDirectorEvent.h

@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VDIRECTOREVENT_H_
+#define _VT_VDIRECTOREVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+#ifndef _VT_VCAMERAGROUP_H_
+#include "Verve/Extension/Camera/VCameraGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VDirectorEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    String          mTarget;
+    
+public:
+
+    VDirectorEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VDirectorEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VDIRECTOREVENT_H_

+ 57 - 0
Engine/modules/Verve/Extension/Director/VDirectorGroup.cpp

@@ -0,0 +1,57 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Director/VDirectorGroup.h"
+#include "Verve/Extension/Director/VDirectorTrack.h"
+#include "Verve/Extension/Camera/VCameraGroup.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VDirectorGroup );
+//-----------------------------------------------------------------------------
+
+VDirectorGroup::VDirectorGroup( void ) :
+        mActiveCamera( NULL )
+{
+    setLabel( "DirectorGroup" );
+};
+
+//-----------------------------------------------------------------------------
+// 
+// VDirectorGroup::getDirectorTrack();
+// 
+// Returns the DirectorTrack reference.
+// 
+//-----------------------------------------------------------------------------
+VDirectorTrack *VDirectorGroup::getDirectorTrack( void )
+{
+    for ( ITreeNode *node = mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        if ( VDirectorTrack *track = dynamic_cast<VDirectorTrack*>( node ) )
+        {
+            // Return Track.
+            return track;
+        }
+    }
+
+    // Invalid Track.
+    return NULL;
+}

+ 59 - 0
Engine/modules/Verve/Extension/Director/VDirectorGroup.h

@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VDIRECTORGROUP_H_
+#define _VT_VDIRECTORGROUP_H_
+
+#ifndef _VT_VGROUP_H_
+#include "Verve/Core/VGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VDirectorTrack;
+class VCameraGroup;
+
+//-----------------------------------------------------------------------------
+
+class VDirectorGroup : public VGroup
+{
+    typedef VGroup Parent;
+
+protected:
+
+    // Camera.
+    VCameraGroup             *mActiveCamera;
+
+public:
+
+    VDirectorGroup( void );
+
+    VDirectorTrack        *getDirectorTrack( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VDirectorGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VDIRECTORGROUP_H_

+ 63 - 0
Engine/modules/Verve/Extension/Director/VDirectorTrack.cpp

@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Director/VDirectorTrack.h"
+
+#include "math/mMathFn.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VDirectorTrack );
+//-----------------------------------------------------------------------------
+
+VDirectorTrack::VDirectorTrack( void )
+{
+    setLabel( "DirectorTrack" );
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VDirectorTrack, updateTrack, void, 2, 2, "( void ) - Update the Track.\n"
+                                                        "@return No return value."  )
+{
+    for ( ITreeNode *node = object->mChildNode; node != NULL; node = node->mSiblingNextNode )
+    {
+        VEvent *currEvent = ( VEvent* )node;
+        VEvent *nextEvent = ( VEvent* )node->mSiblingNextNode;
+
+        if ( !nextEvent )
+        {
+            // Update Duration.
+            currEvent->setDuration( object->getControllerDuration() - currEvent->getTriggerTime() );
+        }
+        else
+        {
+            // Update Duration.
+            currEvent->setDuration( mAbs( nextEvent->getTriggerTime() - currEvent->getTriggerTime() ) );
+        }
+    }
+}
+#endif

+ 47 - 0
Engine/modules/Verve/Extension/Director/VDirectorTrack.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VDIRECTORTRACK_H_
+#define _VT_VDIRECTORTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VDirectorTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VDirectorTrack( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VDirectorTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VDIRECTORTRACK_H_

+ 82 - 0
Engine/modules/Verve/Extension/Director/VSceneJumpEvent.cpp

@@ -0,0 +1,82 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VController.h"
+#include "Verve/Extension/Director/VSceneJumpEvent.h"
+#include "Verve/Extension/Director/VDirectorGroup.h"
+#include "Verve/Extension/Director/VDirectorTrack.h"
+#include "Verve/Extension/Director/VDirectorEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSceneJumpEvent );
+//-----------------------------------------------------------------------------
+
+VSceneJumpEvent::VSceneJumpEvent( void ) :
+        mTarget( String::EmptyString )
+{
+    setLabel( "SceneJumpEvent" );
+}
+
+void VSceneJumpEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Target", TypeRealString, Offset( mTarget, VSceneJumpEvent ), "The name of the Scene that the controller will jump to upon triggering." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSceneJumpEvent::onTrigger( pTime, pDelta );
+// 
+// Tell the controller to jump to a new scene.
+// 
+//-----------------------------------------------------------------------------
+void VSceneJumpEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    VDirectorTrack *track = getController()->getDirectorTrack();
+    if ( !track )
+    {
+        // Invalid Track.
+        return;
+    }
+
+    // Get Event.
+    VDirectorEvent *event;
+    if ( !track->getObject( mTarget, event ) )
+    {
+        // Can't Jump.
+        return;
+    }
+
+    // Go To Scene.
+    getController()->jump( VController::k_JumpTime, event->getTriggerTime() );
+}

+ 57 - 0
Engine/modules/Verve/Extension/Director/VSceneJumpEvent.h

@@ -0,0 +1,57 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCENEJUMPEVENT_H_
+#define _VT_VSCENEJUMPEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSceneJumpEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    String          mTarget;
+    
+public:
+
+    VSceneJumpEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSceneJumpEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCENEJUMPEVENT_H_

+ 32 - 0
Engine/modules/Verve/Extension/Director/VSceneJumpTrack.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Director/VSceneJumpTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSceneJumpTrack );
+//-----------------------------------------------------------------------------
+
+VSceneJumpTrack::VSceneJumpTrack( void )
+{
+    setLabel( "SceneJumpTrack" );
+}

+ 47 - 0
Engine/modules/Verve/Extension/Director/VSceneJumpTrack.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCENEJUMPTRACK_H_
+#define _VT_VSCENEJUMPTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSceneJumpTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VSceneJumpTrack( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSceneJumpTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCENEJUMPTRACK_H_

+ 130 - 0
Engine/modules/Verve/Extension/Director/VSlowMoEvent.cpp

@@ -0,0 +1,130 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VController.h"
+#include "Verve/Extension/Director/VSlowMoEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSlowMoEvent );
+//-----------------------------------------------------------------------------
+
+VSlowMoEvent::VSlowMoEvent( void ) : 
+        mTimeScale( 1.f ),
+        mTimeScaleTickDelta( 0.f )
+{
+    setLabel( "SlowMoEvent" );
+}
+
+void VSlowMoEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "TimeScale", TypeF32, Offset( mTimeScale, VSlowMoEvent ), "The Time Scale to be applied to the Root Controller." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSlowMoEvent::onTrigger( pTime, pDelta );
+// 
+// 
+// 
+//-----------------------------------------------------------------------------
+void VSlowMoEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    VController *controller = getController();
+    if ( !controller )
+    {
+        // Invalid Controller.
+        return;
+    }
+
+    // Instant Update?
+    if ( getDuration() == 0 )
+    {
+        // Apply & Return.
+        controller->setTimeScale( mTimeScale );
+        return;
+    }
+
+    // Determine the Number of Ticks.
+    const F32 tickCount = ( ( F32 )getDuration() ) / TickMs;
+
+    // Determine the Tick Delta.
+    mTimeScaleTickDelta = ( mTimeScale - controller->getTimeScale() ) / tickCount;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VSlowMoEvent::onUpdate( pTime, pDelta );
+// 
+// 
+// 
+//-----------------------------------------------------------------------------
+void VSlowMoEvent::onUpdate( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onUpdate( pTime, pDelta );
+
+    VController *controller = getController();
+    if ( !controller )
+    {
+        // Invalid Controller.
+        return;
+    }
+
+    // Fetch Current Time Scale.
+    const F32 timeScale = controller->getTimeScale();
+
+    // Apply Update.
+    controller->setTimeScale( timeScale + mTimeScaleTickDelta );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VSlowMoEvent::onComplete( pTime, pDelta );
+// 
+// 
+// 
+//-----------------------------------------------------------------------------
+void VSlowMoEvent::onComplete( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onComplete( pTime, pDelta );
+
+    VController *controller = getController();
+    if ( !controller )
+    {
+        // Invalid Controller.
+        return;
+    }
+
+    // Tidy Up.
+    controller->setTimeScale( mTimeScale );
+}

+ 60 - 0
Engine/modules/Verve/Extension/Director/VSlowMoEvent.h

@@ -0,0 +1,60 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSLOWMOEVENT_H_
+#define _VT_VSLOWMOEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSlowMoEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    F32    mTimeScale;
+    F32    mTimeScaleTickDelta;
+    
+public:
+
+    VSlowMoEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+    virtual void    onUpdate( const S32 &pTime, const S32 &pDelta );
+    virtual void    onComplete( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSlowMoEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSLOWMOEVENT_H_

+ 93 - 0
Engine/modules/Verve/Extension/Director/VSlowMoTrack.cpp

@@ -0,0 +1,93 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Director/VSlowMoTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSlowMoTrack );
+//-----------------------------------------------------------------------------
+
+VSlowMoTrack::VSlowMoTrack( void )
+{
+    setLabel( "SlowMoTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSlowMoTrack::onControllerEvent( pEvent );
+// 
+// ...
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VSlowMoTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventStop :
+            {
+
+                // Reset Time Scale.
+                getController()->setTimeScale( ( isControllerPlayingForward() ) ? 1.f : -1.f );
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VSlowMoTrack::onControllerReset( pTime, pForward );
+// 
+// ...
+// 
+//-----------------------------------------------------------------------------
+void VSlowMoTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Parent Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    // Reset Time Scale.
+    getController()->setTimeScale( ( pForward ) ? 1.f : -1.f );
+}

+ 52 - 0
Engine/modules/Verve/Extension/Director/VSlowMoTrack.h

@@ -0,0 +1,52 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSLOWMOTRACK_H_
+#define _VT_VSLOWMOTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSlowMoTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VSlowMoTrack( void );
+
+    // Controller Methods.
+
+    bool            onControllerEvent( VController::eControllerEventType pEvent );
+    void            onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSlowMoTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSLOWMOTRACK_H_

+ 111 - 0
Engine/modules/Verve/Extension/GUI/VFadeEvent.cpp

@@ -0,0 +1,111 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/GUI/VFadeEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VFadeEvent );
+//-----------------------------------------------------------------------------
+
+VFadeEvent::VFadeEvent( void )
+{
+    setLabel( "FadeEvent" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VFadeEvent::onTrigger( pTime, pDelta );
+// 
+// Start the fade sequence if a valid fade control can be found.
+// 
+//-----------------------------------------------------------------------------
+void VFadeEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch GUI Control.
+    VFadeControl *fadeControl;
+    if ( !Sim::findObject( "VFadeControlGUI", fadeControl ) )
+    {
+        // Invalid.
+        return;
+    }
+
+    // Start Fade.
+    fadeControl->start( getFadeType(), mDuration );
+
+    // Set Elapsed Time.
+    fadeControl->mElapsedTime = mAbs( pTime - getStartTime() );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VFadeEvent::onComplete( pTime, pDelta );
+// 
+// Tidy up the fade control once the event has finished.
+// 
+//-----------------------------------------------------------------------------
+void VFadeEvent::onComplete( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch GUI Control.
+    VFadeControl *fadeControl;
+    if ( !Sim::findObject( "VFadeControlGUI", fadeControl ) )
+    {
+        // Invalid.
+        return;
+    }
+
+    // Set Elapsed Time.
+    fadeControl->mElapsedTime = mDuration;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VFadeEvent::getFadeType();
+// 
+// Returns the type of fade (in or out) that this event will use. Zero and Even
+// indices will Fade Out, while Odd numbers will Fade In.
+// 
+//-----------------------------------------------------------------------------
+VFadeControl::eFadeType VFadeEvent::getFadeType( void )
+{
+    if ( !isControllerPlayingForward() )
+    {
+        return ( getIndex() % 2 == 0 ) ? VFadeControl::k_TypeOut : VFadeControl::k_TypeIn;
+    }
+
+    return ( getIndex() % 2 == 0 ) ? VFadeControl::k_TypeIn : VFadeControl::k_TypeOut;
+}

+ 60 - 0
Engine/modules/Verve/Extension/GUI/VFadeEvent.h

@@ -0,0 +1,60 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VFADEEVENT_H_
+#define _VT_VFADEEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+#ifndef _VT_VFADECONTROL_H_
+#include "Verve/GUI/VFadeControl.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VFadeEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VFadeEvent( void );
+
+    // Callback Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+    virtual void    onComplete( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VFadeEvent );
+
+public:
+
+    VFadeControl::eFadeType    getFadeType( void );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VFADEEVENT_H_

+ 139 - 0
Engine/modules/Verve/Extension/GUI/VFadeTrack.cpp

@@ -0,0 +1,139 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/GUI/VFadeTrack.h"
+#include "Verve/Extension/GUI/VFadeEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VFadeTrack );
+//-----------------------------------------------------------------------------
+
+VFadeTrack::VFadeTrack( void )
+{
+    setLabel( "FadeTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VFadeTrack::onControllerEvent( pEvent );
+// 
+// When the controller's state changes, this method is called. If the
+// controller is paused, or stops playing, then the fade control will cease
+// playing. If the controller resumes play, the fade control will continue.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VFadeTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    // Fetch the next Event.
+    VFadeEvent *event;
+    if ( !getNextEvent( event ) )
+    {
+        // No Event.
+        return true;
+    }
+
+    // Fetch GUI Control.
+    VFadeControl *fadeControl = dynamic_cast<VFadeControl*>( Sim::findObject( "VFadeControlGui" ) );
+    if ( !fadeControl )
+    {
+        // No Control.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventPlay:
+            {
+                // Play?
+                const S32 &time = getControllerTime();
+                fadeControl->mActive = ( time > event->getTriggerTime()
+                                         && time < event->getFinishTime() ) ;
+
+            } break;
+
+        case VController::k_EventPause :
+        case VController::k_EventStop :
+            {
+
+                // Pause.
+                fadeControl->mActive = false;
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VFadeTrack::onControllerReset( pTime, pForward );
+// 
+// Reset the fade state of the fade control.
+// 
+//-----------------------------------------------------------------------------
+void VFadeTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    Parent::onControllerReset( pTime, pForward );
+
+    // Fetch GUI Control.
+    VFadeControl *fadeControl;
+    if ( !Sim::findObject( "VFadeControlGUI", fadeControl ) )
+    {
+        // Invalid.
+        return;
+    }
+
+    VFadeEvent *event;
+    if ( !getNextEvent( event ) )
+    {
+        // No Events.
+        return;
+    }
+
+    // Apply Settings.
+    fadeControl->mActive      = false;
+    fadeControl->mFadeType    = event->getFadeType();
+    fadeControl->mDuration    = event->getDuration();
+    fadeControl->mElapsedTime = getMax( pTime - event->getTriggerTime(), 0 );
+}

+ 52 - 0
Engine/modules/Verve/Extension/GUI/VFadeTrack.h

@@ -0,0 +1,52 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VFADETRACK_H_
+#define _VT_VFADETRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VFadeTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VFadeTrack( void );
+
+    // Controller Methods.
+
+    virtual bool    onControllerEvent( VController::eControllerEventType pEvent );
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VFadeTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VFADETRACK_H_

+ 32 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereGroup.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Game/VSpawnSphereGroup.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSpawnSphereGroup );
+//-----------------------------------------------------------------------------
+
+VSpawnSphereGroup::VSpawnSphereGroup( void )
+{
+    setLabel( "SpawnSphereGroup" );
+};

+ 47 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereGroup.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSPAWNSPHEREGROUP_H_
+#define _VT_VSPAWNSPHEREGROUP_H_
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSpawnSphereGroup : public VSceneObjectGroup
+{
+    typedef VSceneObjectGroup Parent;
+
+public:
+
+    VSpawnSphereGroup( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSpawnSphereGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSPAWNSPHEREGROUP_H_

+ 68 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetEvent.cpp

@@ -0,0 +1,68 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Game/VSpawnSphereSpawnTargetEvent.h"
+#include "Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSpawnSphereSpawnTargetEvent );
+//-----------------------------------------------------------------------------
+
+VSpawnSphereSpawnTargetEvent::VSpawnSphereSpawnTargetEvent( void )
+{
+    setLabel( "SpawnTargetEvent" );
+}
+
+void VSpawnSphereSpawnTargetEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSpawnSphereSpawnTargetEvent::onTrigger( pTime, pDelta );
+// 
+// Spawn the Target.
+// 
+//-----------------------------------------------------------------------------
+void VSpawnSphereSpawnTargetEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Track.
+    VSpawnSphereSpawnTargetTrack *track;
+    if ( !getTrack( track ) )
+    {
+        return;
+    }
+
+    // Spawn the Target.
+    track->spawnTarget();
+}

+ 56 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetEvent.h

@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSPAWNSPHERESPAWNTARGETEVENT_H_
+#define _VT_VSPAWNSPHERESPAWNTARGETEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_SPAWNSPHERE_H_
+#include "Verve/Torque/TSpawnSphere.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSpawnSphereSpawnTargetEvent : public VSceneObjectEvent
+{
+    typedef VEvent Parent;
+public:
+
+    VSpawnSphereSpawnTargetEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSpawnSphereSpawnTargetEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSPAWNSPHERESPAWNTARGETEVENT_H_

+ 155 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp

@@ -0,0 +1,155 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.h"
+#include "Verve/Torque/TSpawnSphere.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSpawnSphereSpawnTargetTrack );
+//-----------------------------------------------------------------------------
+
+VSpawnSphereSpawnTargetTrack::VSpawnSphereSpawnTargetTrack( void )
+{
+    setLabel( "SpawnTargetTrack" );
+}
+
+void VSpawnSphereSpawnTargetTrack::initPersistFields( void )
+{
+    // Parent Call.
+    Parent::initPersistFields();
+
+    addField( "DespawnOnLoop", TypeBool, Offset( mDespawnOnLoop, VSpawnSphereSpawnTargetTrack ), "Despawn all targets when the Controller loops?" );
+    addField( "DespawnOnStop", TypeBool, Offset( mDespawnOnStop, VSpawnSphereSpawnTargetTrack ), "Despawn all targets when the Controller stops playing?" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSpawnSphereSpawnTargetTrack::onControllerEvent( pEvent );
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VSpawnSphereSpawnTargetTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventLoop :
+            {
+                if ( mDespawnOnLoop )
+                {
+                    despawnTargets();
+                }
+
+            } break;
+
+        case VController::k_EventStop :
+            {
+                if ( mDespawnOnStop )
+                {
+                    despawnTargets();
+                }
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Spawn Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSpawnSphereSpawnTargetTrack::spawnTarget( pTime, pForward );
+// 
+// Spawn an Object.
+// 
+//-----------------------------------------------------------------------------
+void VSpawnSphereSpawnTargetTrack::spawnTarget( void )
+{
+    VTorque::SpawnSphereType *object;
+    if ( !getSceneObject( object ) )
+    {
+        return;
+    }
+
+    // Spawn the Object.
+    SimObject *spawnedObject = object->spawnObject();
+
+    // Scene Object?
+    VTorque::SceneObjectType *sceneObject = dynamic_cast<VTorque::SceneObjectType*>( spawnedObject );
+    if ( sceneObject )
+    {
+        sceneObject->setPosition( object->getPosition() );
+    }
+
+    // Valid?
+    if ( spawnedObject )
+    {
+        // Add Reference.
+        mSpawnList.addObject( spawnedObject );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VSpawnSphereSpawnTargetTrack::despawnTargets();
+// 
+// Despawn all of the objects spawned by this track.
+// 
+//-----------------------------------------------------------------------------
+void VSpawnSphereSpawnTargetTrack::despawnTargets( void )
+{
+    while( mSpawnList.size() > 0 )
+    {
+        // Fetch the Last Object
+        SimObject *object = mSpawnList.last();
+        // Remove it.
+        mSpawnList.popObject();
+
+        // Delete the Object.
+        object->deleteObject();
+    }
+}

+ 69 - 0
Engine/modules/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.h

@@ -0,0 +1,69 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSPAWNSPHERESPAWNTARGETTRACK_H_
+#define _VT_VSPAWNSPHERESPAWNTARGETTRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_LIGHTOBJECT_H_
+#include "Verve/Torque/TLightObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSpawnSphereSpawnTargetTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+protected:
+
+    SimSet mSpawnList;
+
+    bool mDespawnOnStop;
+    bool mDespawnOnLoop;
+
+public:
+
+    VSpawnSphereSpawnTargetTrack( void );
+
+    static void initPersistFields( void );
+
+    // Controller Methods.
+
+    virtual bool      onControllerEvent( VController::eControllerEventType pEvent );
+
+    // Spawn Methods.
+
+    virtual void      spawnTarget( void );
+    virtual void      despawnTargets( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSpawnSphereSpawnTargetTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSPAWNSPHERESPAWNTARGETTRACK_H_

+ 92 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationEvent.cpp

@@ -0,0 +1,92 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/LightObject/VLightObjectAnimationEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VLightObjectAnimationEvent );
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+
+VLightObjectAnimationEvent::VLightObjectAnimationEvent( void ) : 
+        mAnimationData( NULL )
+{
+    setLabel( "AnimationEvent" );
+}
+
+void VLightObjectAnimationEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "AnimationData", TYPEID<VTorque::LightAnimationDataType>(), Offset( mAnimationData, VLightObjectAnimationEvent ) );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectAnimationEvent::onTrigger( pTime, pDelta );
+// 
+// When this Event is triggered the light object will begin to play the target
+// animation.
+// 
+//-----------------------------------------------------------------------------
+void VLightObjectAnimationEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch the Light Object.
+    VTorque::LightObjectType *lightObject;
+    if ( getSceneObject( lightObject ) )
+    {
+        // Play the Animation.
+        VTorque::playAnimation( lightObject, mAnimationData );
+    }
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectAnimationEvent::onComplete( pTime, pDelta );
+// 
+// The current animation played by the light object will be paused when this
+// Event completes its updates.
+// 
+//-----------------------------------------------------------------------------
+void VLightObjectAnimationEvent::onComplete( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch the Light Object.
+    VTorque::LightObjectType *lightObject;
+    if ( getSceneObject( lightObject ) )
+    {
+        // Pause the Animation.
+        VTorque::pauseAnimation( lightObject );
+    }
+}

+ 62 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationEvent.h

@@ -0,0 +1,62 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VLIGHTOBJECTANIMATIONEVENT_H_
+#define _VT_VLIGHTOBJECTANIMATIONEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_LIGHTOBJECT_H_
+#include "Verve/Torque/TLightObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VLightObjectAnimationEvent : public VSceneObjectEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    SimObjectPtr<VTorque::LightAnimationDataType>    mAnimationData;
+
+public:
+
+    VLightObjectAnimationEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+    virtual void    onComplete( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VLightObjectAnimationEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VLIGHTOBJECTANIMATIONEVENT_H_

+ 118 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationTrack.cpp

@@ -0,0 +1,118 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/LightObject/VLightObjectAnimationTrack.h"
+#include "Verve/Extension/LightObject/VLightObjectAnimationEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VLightObjectAnimationTrack );
+//-----------------------------------------------------------------------------
+
+VLightObjectAnimationTrack::VLightObjectAnimationTrack( void )
+{
+    setLabel( "AnimationTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectAnimationTrack::onControllerEvent( pEvent );
+// 
+// 
+// 
+//-----------------------------------------------------------------------------
+bool VLightObjectAnimationTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    // Fetch the Light Object.
+    VTorque::LightObjectType *lightObject;
+    if ( !getSceneObject( lightObject ) )
+    {
+        // Skip.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventPlay :
+            {
+
+                // Play Animation?
+                VLightObjectAnimationEvent *event;
+                if ( getCurrentEvent( event ) )
+                {
+                    // Play.
+                    VTorque::playAnimation( lightObject );
+                }
+
+            } break;
+
+        case VController::k_EventPause :
+        case VController::k_EventStop :
+            {
+
+                // Stop the Animation.
+                VTorque::pauseAnimation( lightObject );
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectAnimationTrack::onControllerReset( pTime, pForward );
+// 
+// 
+// 
+//-----------------------------------------------------------------------------
+void VLightObjectAnimationTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Default Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    // Fetch the Light Object.
+    VTorque::LightObjectType *lightObject;
+    if ( getSceneObject( lightObject ) )
+    {
+        // Stop the Animation.
+        VTorque::pauseAnimation( lightObject );
+    }
+}

+ 56 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectAnimationTrack.h

@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VLIGHTOBJECTANIMATIONTRACK_H_
+#define _VT_VLIGHTOBJECTANIMATIONTRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_LIGHTOBJECT_H_
+#include "Verve/Torque/TLightObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VLightObjectAnimationTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+public:
+
+    VLightObjectAnimationTrack( void );
+
+    // Controller Methods.
+
+    virtual bool    onControllerEvent( VController::eControllerEventType pEvent );
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VLightObjectAnimationTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VLIGHTOBJECTANIMATIONTRACK_H_

+ 32 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectGroup.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/LightObject/VLightObjectGroup.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VLightObjectGroup );
+//-----------------------------------------------------------------------------
+
+VLightObjectGroup::VLightObjectGroup( void )
+{
+    setLabel( "LightObjectGroup" );
+};

+ 47 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectGroup.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VLIGHTOBJECTGROUP_H_
+#define _VT_VLIGHTOBJECTGROUP_H_
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VLightObjectGroup : public VSceneObjectGroup
+{
+    typedef VSceneObjectGroup Parent;
+
+public:
+
+    VLightObjectGroup( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VLightObjectGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VLIGHTOBJECTGROUP_H_

+ 70 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectToggleEvent.cpp

@@ -0,0 +1,70 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/LightObject/VLightObjectToggleEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VLightObjectToggleEvent );
+//-----------------------------------------------------------------------------
+
+VLightObjectToggleEvent::VLightObjectToggleEvent( void ) : 
+        mEventType( VSharedEnum::k_ActionTurnOn )
+{
+    setLabel( "ToggleEvent" );
+}
+
+void VLightObjectToggleEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Action", TYPEID<VActionToggle>(), Offset( mEventType, VLightObjectToggleEvent ) );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectToggleEvent::onTrigger( pTime, pDelta );
+// 
+// Toggle the Light Object.
+// 
+//-----------------------------------------------------------------------------
+void VLightObjectToggleEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    VTorque::LightObjectType *lightObject;
+    if ( getSceneObject( lightObject ) )
+    {
+        // Turn On?
+        const bool turnOn = ( mEventType == VSharedEnum::k_ActionTurnOn );
+
+        // Toggle Light.
+        VTorque::setLightObjectOn( lightObject, turnOn );
+    }
+}

+ 65 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectToggleEvent.h

@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VLIGHTOBJECTTOGGLEEVENT_H_
+#define _VT_VLIGHTOBJECTTOGGLEEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_LIGHTOBJECT_H_
+#include "Verve/Torque/TLightObject.h"
+#endif
+
+#ifndef _VT_VSHAREDENUM_H_
+#include "Verve/Core/Util/VSharedEnum.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VLightObjectToggleEvent : public VSceneObjectEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VSharedEnum::eActionToggle    mEventType;
+
+public:
+
+    VLightObjectToggleEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VLightObjectToggleEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VLIGHTOBJECTTOGGLEEVENT_H_

+ 63 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectToggleTrack.cpp

@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/LightObject/VLightObjectToggleTrack.h"
+#include "Verve/Extension/LightObject/VLightObjectToggleEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VLightObjectToggleTrack );
+//-----------------------------------------------------------------------------
+
+VLightObjectToggleTrack::VLightObjectToggleTrack( void )
+{
+    setLabel( "ToggleTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VLightObjectToggleTrack::onControllerReset( pTime, pForward );
+// 
+// Enable or Disable the light object after a reset.
+// 
+//-----------------------------------------------------------------------------
+void VLightObjectToggleTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Default Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    VLightObjectToggleEvent  *event;
+    VTorque::LightObjectType *lightObject;
+    if ( getSceneObject( lightObject ) && getPreviousEvent( event ) )
+    {
+        // Turn On?
+        const bool turnOn = ( event->mEventType == VSharedEnum::k_ActionTurnOn );
+
+        // Toggle the Light.
+        VTorque::setLightObjectOn( lightObject, turnOn );
+    }
+}

+ 55 - 0
Engine/modules/Verve/Extension/LightObject/VLightObjectToggleTrack.h

@@ -0,0 +1,55 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VLIGHTOBJECTTOGGLETRACK_H_
+#define _VT_VLIGHTOBJECTTOGGLETRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_LIGHTOBJECT_H_
+#include "Verve/Torque/TLightObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VLightObjectToggleTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+public:
+
+    VLightObjectToggleTrack( void );
+
+    // Controller Methods.
+
+    virtual void      onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VLightObjectToggleTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VLIGHTOBJECTTOGGLETRACK_H_

+ 212 - 0
Engine/modules/Verve/Extension/Motion/VMotionEvent.cpp

@@ -0,0 +1,212 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VController.h"
+#include "Verve/Core/VGroup.h"
+#include "Verve/Extension/Motion/VMotionEvent.h"
+#include "Verve/Extension/Motion/VMotionTrack.h"
+
+#include "console/consoleTypes.h"
+#include "math/mMathFn.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VMotionEvent );
+//-----------------------------------------------------------------------------
+
+VMotionEvent::VMotionEvent( void )
+{
+    setLabel( "MotionEvent" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VMotionEvent::onTrigger( pDelta, pDelta );
+// 
+// The path object is told to move to the next node. If this event corresponds
+// to Node 0, the object will move to Node 1. If the object reaches the node
+// before the next event is triggered, then the object will stop moving.
+// 
+// The object's position is only reset when the track is reset and not when an
+// event is triggered.
+// 
+//-----------------------------------------------------------------------------
+void VMotionEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Parent Track.
+    VMotionTrack *track;
+    if ( !getTrack( track ) )
+    {
+        // Invalid Track.
+        return;
+    }
+
+    // Fetch Path & Reference Object.
+    VTorque::PathObjectType  *path   = track->getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object )
+    {
+        // Invalid.
+        return;
+    }
+
+    // Valid Destination Node?
+    if ( !isControllerLooping() && !getNextEvent() )
+    {
+        // Clear Active.
+        VTorque::setPathObjectActive( path, object, false );
+        // Quit.
+        return;
+    }
+
+    // Set Active.
+    VTorque::setPathObjectActive( path, object, true );
+
+    // Apply Speed.
+    VTorque::setPathObjectSpeed( path, object, getObjectSpeed() );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::getPath();
+// 
+// Returns the path that this track is referencing.
+//
+//-----------------------------------------------------------------------------
+VTorque::PathObjectType *VMotionEvent::getPath( void )
+{
+    // Fetch Track.
+    VMotionTrack *track;
+    if ( !getTrack( track ) )
+    {
+        // Invalid.
+        return NULL;
+    }
+
+    // Return Path.
+    return track->getPath();
+}
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::getObjectSpeed();
+// 
+// Determine the Speed that an object must move at to travel over the segment
+// length of the Path.
+//
+//-----------------------------------------------------------------------------
+F32 VMotionEvent::getObjectSpeed( void )
+{
+    // Fetch Parent Track.
+    VMotionTrack *track;
+    if ( !getTrack( track ) )
+    {
+        // Invalid Track.
+        return 0.f;
+    }
+
+    // Fetch Path & Reference Object.
+    VTorque::PathObjectType  *path   = track->getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object )
+    {
+        // Invalid Object(s).
+        return 0.f;
+    }
+
+    // Fetch Node Index.
+    const S32 &srcNodeIndex = getNodeIndex( ( isControllerPlayingForward() ) ? 0 : -1 );
+
+    // Fetch the Next Event.
+    VEvent *nextEvent = getNextEvent();
+
+    // Valid Destination Node?
+    if ( !isControllerLooping() && !nextEvent )
+    {
+        // No Next Node.
+        return 0.f;
+    }
+
+    // Valid Next Node?
+    if ( nextEvent )
+    {
+        // Fetch Segment Length & Duration.
+        const F32 &length   = VTorque::getPathNodeLength( path, srcNodeIndex );
+        const F32 &duration = mAbs( getTriggerTime() - nextEvent->getTriggerTime() );
+
+        // Speed = Distance / Duration.
+        return ( length / ( duration / 1000.f ) );
+    }
+
+    // Playing Forwards?
+    if ( isControllerPlayingForward() )
+    {
+        // Fetch the First Event.
+        VEvent *firstEvent = dynamic_cast<VEvent*>( track->getChild() );
+
+        // Fetch Segment Length & Duration.
+        const F32 &length   = VTorque::getPathNodeLength( path, srcNodeIndex );
+        const F32 &duration = ( getControllerDuration() - getTriggerTime() ) + firstEvent->getTriggerTime();
+
+        // Speed = Distance / Duration.
+        return ( length / ( duration / 1000.f ) );
+    }
+
+    // Fetch the Last Event.
+    VEvent *lastEvent = dynamic_cast<VEvent*>( track->getLastChild() );
+
+    // Fetch Segment Length & Duration.
+    const F32 &length   = VTorque::getPathNodeLength( path, srcNodeIndex );
+    const F32 &duration = ( getControllerDuration() - lastEvent->getTriggerTime() ) + getTriggerTime();
+
+    // Speed = Distance / Duration.
+    return ( length / ( duration / 1000.f ) );
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VMotionEvent::getNodeIndex( pDelta );
+// 
+// Returns the index of the path node associated with this event object.
+// 
+//-----------------------------------------------------------------------------
+S32 VMotionEvent::getNodeIndex( const S32 &pDelta )
+{
+    // Fetch Event Count.
+    const S32 eventCount = ( ( VTreeNode* )getParent() )->size();
+
+    // Return Index.
+    return ( getIndex() + pDelta ) % eventCount;
+}

+ 61 - 0
Engine/modules/Verve/Extension/Motion/VMotionEvent.h

@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VMOTIONEVENT_H_
+#define _VT_VMOTIONEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_MOTION_H_
+#include "Verve/Torque/TMotion.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VMotionEvent : public VSceneObjectEvent
+{
+    typedef VSceneObjectEvent Parent;
+
+public:
+
+    VMotionEvent( void );
+
+    // Event Methods.
+
+    virtual void                       onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Reference Methods.
+
+    virtual VTorque::PathObjectType   *getPath( void );
+    F32                                getObjectSpeed( void );
+    S32                                getNodeIndex( const S32 &pDelta = 0 );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VMotionEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VMOTIONEVENT_H_

+ 442 - 0
Engine/modules/Verve/Extension/Motion/VMotionTrack.cpp

@@ -0,0 +1,442 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+#include "Verve/Extension/Motion/VMotionTrack.h"
+#include "Verve/Extension/Motion/VMotionEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VMotionTrack );
+//-----------------------------------------------------------------------------
+
+VMotionTrack::VMotionTrack( void ) : 
+        mDataReference( String::EmptyString ),
+        mOrientationMode( "FREE" ),
+        mOrientationData( String::EmptyString ),
+        mRelative( false )
+{
+    setLabel( "MotionTrack" );
+}
+
+void VMotionTrack::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Reference", TypeRealString, Offset( mDataReference, VMotionTrack ), "The name of the data field referencing the object to be attached to the path." );
+
+    addProtectedField( "OrientationMode", TypeRealString, Offset( mOrientationMode, VMotionTrack ), &setOrientationMode, &defaultProtectedGetFn, "The orientation mode of the object attached to the path." );
+    addProtectedField( "OrientationData", TypeRealString, Offset( mOrientationData, VMotionTrack ), &setOrientationData, &defaultProtectedGetFn, "The name of the data field holding the orientation data (used for Orientation Modes, ToObject & ToPoint)." );
+    addField( "Relative",                 TypeBool,       Offset( mRelative,        VMotionTrack ), "Attach the object with an offset based on its initial position." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VMotionTrack::onControllerEvent( pEvent );
+// 
+// When the controller's state changes, this method is called. If the
+// controller is paused, then the path object will cease to move. If the
+// controller resumes play, the object will continue on its path.
+// 
+// For a full list of possible events, see the 'eControllerEventType'
+// declaration in VController.h.
+// 
+//-----------------------------------------------------------------------------
+bool VMotionTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    // Fetch Path & Reference Object.
+    VTorque::PathObjectType  *path   = getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object || !VTorque::isPathObjectAttached( path, object ) )
+    {
+        // Invalid.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventPlay :
+            {
+
+                // Continue Advancing.
+                VTorque::setPathObjectActive( path, object, true );
+
+            } break;
+
+        case VController::k_EventPause :
+            {
+
+                // Stop Advancing.
+                VTorque::setPathObjectActive( path, object, false );
+
+            } break;
+
+        case VController::k_EventStop :
+            {
+
+                // Detach the Object.
+                detachObject();
+
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VMotionTrack::onControllerReset( pTime, pForward );
+// 
+// Reposition the path object on the path appropriately. The position is
+// interpolated between two nodes, the last node and the next node. These
+// correspond to the last and current events.
+// 
+//-----------------------------------------------------------------------------
+void VMotionTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Parent Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    // Valid Track?
+    // Note: We must have at least 2 Events/Nodes to path.
+    if ( size() < 2 )
+    {
+        // Invalid.
+        return;
+    }
+
+    // Get Object References.
+    VController              *controller = getController();
+    VTorque::PathObjectType  *path       = getPath();
+    VTorque::SceneObjectType *object     = getSceneObject();
+    if ( !controller || !path || !object )
+    {
+        // Invalid Object(s).
+        return;
+    }
+
+    // Attached?
+    if ( !VTorque::isPathObjectAttached( path, object ) )
+    {
+        // No, Attach Now.
+        attachObject();
+    }
+
+    // Reset Object.
+    resetObject( pTime );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::getPath();
+// 
+// Returns the path that this track is referencing.
+//
+//-----------------------------------------------------------------------------
+VTorque::PathObjectType *VMotionTrack::getPath( void )
+{
+    // Fetch the Controller.
+    VController *controller = getController();
+    if ( !controller )
+    {
+        // Invalid Controller.
+        return NULL;
+    }
+
+    // Evalulate the Data Field.
+    String fieldValue;
+    if ( controller->getDataValue( mDataReference, fieldValue ) )
+    {
+        // Return Object.
+        return dynamic_cast<VTorque::PathObjectType*>( Sim::findObject( fieldValue ) );
+    }
+
+    // No Data!
+    return NULL;
+}
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::attachObject();
+// 
+// Attach the underlying Scene Object to the target Path at the first Node.
+// Default settings are applied and must be updated after the object is
+// attached.
+//
+//-----------------------------------------------------------------------------
+void VMotionTrack::attachObject( void )
+{
+    // Get Object References.
+    VTorque::PathObjectType  *path   = getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object )
+    {
+        // Invalid Object(s).
+        return;
+    }
+
+    // Object Attached?
+    if ( VTorque::isPathObjectAttached( path, object ) )
+    {
+        // Already Attached.
+        return;
+    }
+
+    // Fetch Forwards.
+    const bool &forward = isControllerPlayingForward();
+    // Select the Node.
+    const S32 node = ( forward ) ? 0 : ( size() - 1 );
+
+    // Fetch the value from the controller data table.
+    String orientationDataValue = String::EmptyString;
+    if ( mOrientationData != String::EmptyString
+         && !getController()->getDataValue( mOrientationData, orientationDataValue ) )
+    {
+        // Sanity!
+        Con::warnf( "Unable to located the value for the given orientation data key, '%s'", mOrientationData );
+        // Clear.
+        orientationDataValue = String::EmptyString;
+    }
+
+    // Attach Object.
+    VTorque::attachPathObject( path, object, forward, mRelative, node, -1, mOrientationMode, orientationDataValue );
+}
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::detachObject( void );
+// 
+// 
+//
+//-----------------------------------------------------------------------------
+void VMotionTrack::detachObject( void )
+{
+    // Get Object References.
+    VTorque::PathObjectType  *path   = getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object )
+    {
+        // Invalid Object(s).
+        return;
+    }
+
+    // Object Attached?
+    if ( !VTorque::isPathObjectAttached( path, object ) )
+    {
+        // Not Attached.
+        return;
+    }
+
+    // Detach.
+    VTorque::detachPathObject( path, object );
+}
+
+//-----------------------------------------------------------------------------
+//
+// VMotionTrack::resetObject( pTime );
+// 
+// 
+//
+//-----------------------------------------------------------------------------
+void VMotionTrack::resetObject( const S32 &pTime )
+{
+    // Get Object References.
+    VTorque::PathObjectType  *path   = getPath();
+    VTorque::SceneObjectType *object = getSceneObject();
+    if ( !path || !object )
+    {
+        // Invalid Object(s).
+        return;
+    }
+
+    // Fetch Controller Info.
+    const bool &isPlaying        = isControllerPlaying();
+    const bool &isPlayingForward = isControllerPlayingForward();
+    const bool &isLooping        = isControllerLooping();
+
+    // Init Variables.
+    bool objectActive = false;
+    F32  objectInterp = 0.f;
+    F32  objectSpeed  = 0.f;
+    S32  srcNodeIndex = 0;
+    S32  dstNodeIndex = 0;
+
+    VMotionEvent *event;
+    if ( !getNextEvent( event ) || event->getTriggerTime() == pTime )
+    {
+        // Note: This case deals with a target time that is greater than the
+        //       trigger time of the Last Event on this track. It will clamp
+        //       the position of the object to the corresponding node of the
+        //       Last Event.
+
+        // Note: If pTime is exactly equal to the Next Event's trigger time,
+        //       then it will set the Source Node to the Last Node and
+        //       set its Interp to 0.f - which is incorrect!
+        if ( !event || event->getTriggerTime() != pTime  )
+        {
+            // Fetch the Last Event.
+            getPreviousEvent( event );
+        }
+
+        // Set the Info.
+        objectInterp = 0.f;
+        objectSpeed  = event->getObjectSpeed();
+        srcNodeIndex = event->getNodeIndex();
+        dstNodeIndex = srcNodeIndex;
+    }
+    else if ( !event->getPreviousEvent() )
+    {
+        // Note: This case deals with a target time that is less than the
+        //       trigger time of the First Event on this track. It will clamp
+        //       the position of the object to the corresponding node of the
+        //       First Event.
+
+        // Set the Info.
+        objectInterp = 0.f;
+        objectSpeed  = event->getObjectSpeed();
+        srcNodeIndex = event->getNodeIndex();
+        dstNodeIndex = srcNodeIndex;
+    }
+    else
+    {
+        // Note: This case deals with a target time that is between two Events
+        //       on this track. It will position the object on the path,
+        //       between the two nodes corresponding to the Events.
+
+        // Fetch the Last Event.
+        VMotionEvent *lastEvent;
+        getPreviousEvent( lastEvent );
+
+        // Set the Info.
+        objectActive = isPlaying;
+        objectInterp = calculateInterp( pTime );
+        objectSpeed  = lastEvent->getObjectSpeed();
+        srcNodeIndex = event->getNodeIndex( ( isPlayingForward ) ? -1 : 1 );
+        dstNodeIndex = event->getNodeIndex();
+    }
+
+    // Set Active.
+    VTorque::setPathObjectActive( path, object, objectActive );
+
+    // Set Forward.
+    VTorque::setPathObjectForward( path, object, isPlayingForward );
+
+    // Set Speed.
+    VTorque::setPathObjectSpeed( path, object, objectSpeed );
+
+    // Set Current Node.
+    VTorque::setPathObjectNode( path, object, srcNodeIndex );
+
+    // Set End Node.
+    VTorque::setPathObjectEndNode( path, object, ( ( isLooping ) ? -1 : ( size() - 1 ) ) );
+
+    // Set Interp.
+    VTorque::setPathObjectInterp( path, object, objectInterp );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Static Field Methods.
+//
+//-----------------------------------------------------------------------------
+
+bool VMotionTrack::setOrientationMode( void *pObject, const char *pArray, const char *pData )
+{
+    // Fetch Track.
+    VMotionTrack *track = static_cast<VMotionTrack*>( pObject );
+
+    // Store Data.
+    track->mOrientationMode = pData;
+
+    VTorque::PathObjectType  *path   = track->getPath();
+    VTorque::SceneObjectType *object = track->getSceneObject();
+    if ( VTorque::isPathObjectAttached( path, object ) )
+    {
+        // Set Orientation Mode.
+        VTorque::setPathObjectOrientation( path, object, track->mOrientationMode, track->mOrientationData );
+    }
+
+    return false;
+}
+
+bool VMotionTrack::setOrientationData( void *pObject, const char *pArray, const char *pData )
+{
+    // Fetch Track.
+    VMotionTrack *track = static_cast<VMotionTrack*>( pObject );
+
+    // Store Data.
+    track->mOrientationData = pData;
+
+    VTorque::PathObjectType  *path   = track->getPath();
+    VTorque::SceneObjectType *object = track->getSceneObject();
+    if ( VTorque::isPathObjectAttached( path, object ) )
+    {
+        // Set Orientation Mode.
+        VTorque::setPathObjectOrientation( path, object, track->mOrientationMode, track->mOrientationData );
+    }
+
+    return false;
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VMotionTrack, getPath, S32, 2, 2, "( void ) - Get the path object this track references.\n"
+                                                 "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Path.
+    SimObject *pathReference = object->getPath();
+
+    // Return.
+    return ( pathReference ) ? pathReference->getId() : 0;
+}
+#endif

+ 85 - 0
Engine/modules/Verve/Extension/Motion/VMotionTrack.h

@@ -0,0 +1,85 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VMOTIONTRACK_H_
+#define _VT_VMOTIONTRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_MOTION_H_
+#include "Verve/Torque/TMotion.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VMotionTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+public:
+
+    // Reference Members.
+
+    String          mDataReference;
+
+    // Path Members.
+
+    String         mOrientationMode;
+    String         mOrientationData;
+    bool           mRelative;
+
+public:
+
+    VMotionTrack( void );
+
+    static void                        initPersistFields( void );
+
+    // Controller Methods.
+
+    virtual bool                       onControllerEvent( VController::eControllerEventType pEvent );
+    virtual void                       onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Reference Methods.
+
+    VTorque::PathObjectType           *getPath( void );
+    void                               attachObject( void );
+    void                               detachObject( void );
+
+    void                               resetObject( const S32 &pTime );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VMotionTrack );
+
+protected:
+
+    // Static Field Methods.
+
+    static bool                        setOrientationMode( void *pObject, const char *pArray, const char *pData );
+    static bool                        setOrientationData( void *pObject, const char *pArray, const char *pData );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VMOTIONTRACK_H_

+ 32 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectGroup.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/ParticleEffect/VParticleEffectGroup.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VParticleEffectGroup );
+//-----------------------------------------------------------------------------
+
+VParticleEffectGroup::VParticleEffectGroup( void )
+{
+    setLabel( "ParticleEffectGroup" );
+};

+ 47 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectGroup.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPARTICLEEFFECTGROUP_H_
+#define _VT_VPARTICLEEFFECTGROUP_H_
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VParticleEffectGroup : public VSceneObjectGroup
+{
+    typedef VSceneObjectGroup Parent;
+
+public:
+
+    VParticleEffectGroup( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VParticleEffectGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPARTICLEEFFECTGROUP_H_

+ 70 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.cpp

@@ -0,0 +1,70 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VParticleEffectToggleEvent );
+//-----------------------------------------------------------------------------
+
+VParticleEffectToggleEvent::VParticleEffectToggleEvent( void ) : 
+        mEventType( VSharedEnum::k_ActionTurnOn )
+{
+    setLabel( "ToggleEvent" );
+}
+
+void VParticleEffectToggleEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Action", TYPEID<VActionToggle>(), Offset( mEventType, VParticleEffectToggleEvent ) );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VParticleEffectToggleEvent::onTrigger( pTime, pDelta );
+// 
+// Toggle the Particle Effect.
+// 
+//-----------------------------------------------------------------------------
+void VParticleEffectToggleEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    VTorque::ParticleEffectType *particleEffect;
+    if ( getSceneObject( particleEffect ) )
+    {
+        // Turn On?
+        const bool turnOn = ( mEventType == VSharedEnum::k_ActionTurnOn );
+
+        // Toggle Particle Effect.
+        VTorque::setParticleEffectOn( particleEffect, turnOn );
+    }
+}

+ 65 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.h

@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPARTICLEFFECTTOGGLEEVENT_H_
+#define _VT_VPARTICLEFFECTTOGGLEEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_PARTICLEEFFECT_H_
+#include "Verve/Torque/TParticleEffect.h"
+#endif
+
+#ifndef _VT_VSHAREDENUM_H_
+#include "Verve/Core/Util/VSharedEnum.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VParticleEffectToggleEvent : public VSceneObjectEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VSharedEnum::eActionToggle    mEventType;
+
+public:
+
+    VParticleEffectToggleEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VParticleEffectToggleEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPARTICLEFFECTTOGGLEEVENT_H_

+ 63 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleTrack.cpp

@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/ParticleEffect/VParticleEffectToggleTrack.h"
+#include "Verve/Extension/ParticleEffect/VParticleEffectToggleEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VParticleEffectToggleTrack );
+//-----------------------------------------------------------------------------
+
+VParticleEffectToggleTrack::VParticleEffectToggleTrack( void )
+{
+    setLabel( "ToggleTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VParticleEffectToggleTrack::onControllerReset( pTime, pForward );
+// 
+// Enable or Disable the particle effect after a reset.
+// 
+//-----------------------------------------------------------------------------
+void VParticleEffectToggleTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Default Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    VParticleEffectToggleEvent  *event;
+    VTorque::ParticleEffectType *particleEffect;
+    if ( getSceneObject( particleEffect ) && getPreviousEvent( event ) )
+    {
+        // Turn On?
+        const bool turnOn = ( event->mEventType == VSharedEnum::k_ActionTurnOn );
+
+        // Toggle the Particle Effect.
+        VTorque::setParticleEffectOn( particleEffect, turnOn );
+    }
+}

+ 55 - 0
Engine/modules/Verve/Extension/ParticleEffect/VParticleEffectToggleTrack.h

@@ -0,0 +1,55 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPARTICLEEFFECTTOGGLETRACK_H_
+#define _VT_VPARTICLEEFFECTTOGGLETRACK_H_
+
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_PARTICLEEFFECT_H_
+#include "Verve/Torque/TParticleEffect.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VParticleEffectToggleTrack : public VSceneObjectTrack
+{
+    typedef VSceneObjectTrack Parent;
+
+public:
+
+    VParticleEffectToggleTrack( void );
+
+    // Controller Methods.
+
+    virtual void      onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VParticleEffectToggleTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPARTICLEEFFECTTOGGLETRACK_H_

+ 77 - 0
Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleEvent.cpp

@@ -0,0 +1,77 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/PostEffect/VPostEffectToggleEvent.h"
+#include "Verve/Extension/PostEffect/VPostEffectToggleTrack.h"
+#include "Verve/Extension/Camera/VCameraGroup.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VPostEffectToggleEvent );
+//-----------------------------------------------------------------------------
+
+VPostEffectToggleEvent::VPostEffectToggleEvent( void ) : 
+        mEventType( VSharedEnum::k_ActionTurnOn )
+{
+    setLabel( "ToggleEvent" );
+}
+
+void VPostEffectToggleEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Action", TYPEID<VActionToggle>(), Offset( mEventType, VPostEffectToggleEvent ) );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VPostEffectToggleEvent::onTrigger( pTime, pDelta );
+// 
+// Only enable this effect if the parent group is currently active. 
+// 
+//-----------------------------------------------------------------------------
+void VPostEffectToggleEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Parent Objects.
+    VCameraGroup           *group;
+    VPostEffectToggleTrack *track;
+    if ( ( !getGroup( group ) || !group->isActive() ) || !getTrack( track ) )
+    {
+        // Quit.
+        return;
+    }
+
+    // Turn On?
+    const bool turnOn = ( mEventType == VSharedEnum::k_ActionTurnOn );
+
+    // Enable Effect.
+    VTorque::setPostEffectOn( track->getPostEffect(), turnOn );
+}

+ 65 - 0
Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleEvent.h

@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPOSTEFFECTTOGGLEEVENT_H_
+#define _VT_VPOSTEFFECTTOGGLEEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_POSTEFFECT_H_
+#include "Verve/Torque/TPostEffect.h"
+#endif
+
+#ifndef _VT_VSHAREDENUM_H_
+#include "Verve/Core/Util/VSharedEnum.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VPostEffectToggleEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VSharedEnum::eActionToggle    mEventType;
+
+public:
+
+    VPostEffectToggleEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VPostEffectToggleEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPOSTEFFECTTOGGLEEVENT_H_

+ 103 - 0
Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleTrack.cpp

@@ -0,0 +1,103 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/PostEffect/VPostEffectToggleTrack.h"
+#include "Verve/Extension/PostEffect/VPostEffectToggleEvent.h"
+#include "Verve/Extension/Camera/VCameraGroup.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VPostEffectToggleTrack );
+//-----------------------------------------------------------------------------
+
+VPostEffectToggleTrack::VPostEffectToggleTrack( void ) : 
+        mPostEffect( NULL )
+{
+    setLabel( "PostEffectTrack" );
+}
+
+void VPostEffectToggleTrack::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "PostEffect", TYPEID<VTorque::PostEffectType>(), Offset( mPostEffect, VPostEffectToggleTrack ), "The name of the PostEffect object to be triggered." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Camera Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VPostEffectToggleTrack::onCameraEvent( pEvent );
+// 
+// When the Camera changes, this method is called on both the outgoing and
+// incoming Camera Groups.
+// 
+// For a full list of possible events, see the 'eCameraEventType' declaration
+// in VCameraGroup.h.
+// 
+//-----------------------------------------------------------------------------
+bool VPostEffectToggleTrack::onCameraEvent( const VCameraGroup::eCameraEventType &pEvent )
+{
+    // Parent Call.
+    if ( !Parent::onCameraEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() || !mPostEffect.isValid() )
+    {
+        // Quit Now.
+        return true;
+    }
+
+    switch( pEvent )
+    {
+        case VCameraGroup::k_EventActivate :
+            {
+
+                VPostEffectToggleEvent *event;
+                if ( getPreviousEvent( event ) && event->mEventType == VSharedEnum::k_ActionTurnOn )
+                {
+                    // Toggle Post Effect On.
+                    VTorque::setPostEffectOn( mPostEffect, true );
+                }
+
+            } break;
+
+        case VCameraGroup::k_EventDeactivate :
+            {
+
+                // Turn Post Effect Off.
+                VTorque::setPostEffectOn( mPostEffect, false );
+
+            } break;
+    }
+
+    return true;
+}

+ 65 - 0
Engine/modules/Verve/Extension/PostEffect/VPostEffectToggleTrack.h

@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VPOSTEFFECTTOGGLETRACK_H_
+#define _VT_VPOSTEFFECTTOGGLETRACK_H_
+
+#ifndef _VT_VCAMERATRACK_H_
+#include "Verve/Extension/Camera/VCameraTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_POSTEFFECT_H_
+#include "Verve/Torque/TPostEffect.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VPostEffectToggleTrack : public VCameraTrack
+{
+    typedef VCameraTrack Parent;
+
+protected:
+
+    SimObjectPtr<VTorque::PostEffectType>   mPostEffect;
+
+public:
+
+    VPostEffectToggleTrack( void );
+
+    static  void               initPersistFields( void );
+
+    // Camera Methods.
+
+    bool            onCameraEvent( const VCameraGroup::eCameraEventType &pEvent );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VPostEffectToggleTrack );
+
+public:
+
+    VTorque::PostEffectType   *getPostEffect( void ) { return mPostEffect; };
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VPOSTEFFECTTOGGLETRACK_H_

+ 77 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectEvent.cpp

@@ -0,0 +1,77 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSceneObjectEvent );
+//-----------------------------------------------------------------------------
+
+VSceneObjectEvent::VSceneObjectEvent( void )
+{
+    // Void.
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSceneObjectEvent::getSceneObject();
+// 
+// Returns the parent group's object reference.
+// 
+//-----------------------------------------------------------------------------
+VTorque::SceneObjectType *VSceneObjectEvent::getSceneObject( void )
+{
+    VSceneObjectGroup *group;
+    if ( !getGroup( group ) )
+    {
+        // No Group!
+        return NULL;
+    }
+
+    // Return Object.
+    return group->getSceneObject();
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VSceneObjectEvent, getSceneObject, S32, 2, 2, "( void ) - Get the object this group references.\n"
+                                                             "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Object.
+    VTorque::SceneObjectType *objReference = object->getSceneObject();
+
+    // Return.
+    return ( objReference ) ? objReference->getId() : 0;
+}
+#endif

+ 63 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectEvent.h

@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#define _VT_VSCENEOBJECTEVENT_H_
+
+#ifndef _VT_VEVENT_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSceneObjectEvent : public VEvent
+{
+    typedef VEvent Parent;
+
+public:
+
+    VSceneObjectEvent( void );
+
+    // Reference Methods.
+
+    VTorque::SceneObjectType   *getSceneObject( void );
+    template <class T> inline bool getSceneObject( T *&pSceneObject )
+    {
+        // Reference Scene Object.
+        pSceneObject = dynamic_cast<T*>( getSceneObject() );
+
+        // Valid?
+        return ( pSceneObject != NULL );
+    }
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSceneObjectEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCENEOBJECTEVENT_H_

+ 104 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectGroup.cpp

@@ -0,0 +1,104 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#include "Verve/Core/VController.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSceneObjectGroup );
+//-----------------------------------------------------------------------------
+
+VSceneObjectGroup::VSceneObjectGroup( void ) : 
+        mDataReference( String::EmptyString ),
+        mSceneObject( NULL )
+{
+    setLabel( "SceneObjectGroup" );
+};
+
+void VSceneObjectGroup::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "Reference", TypeRealString, Offset( mDataReference, VSceneObjectGroup ), "The name of the data field referencing the targeted object." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSceneObjectGroup::getObject();
+// 
+// Returns the group's object reference.
+// 
+//-----------------------------------------------------------------------------
+VTorque::SceneObjectType *VSceneObjectGroup::getSceneObject( void )
+{
+#ifndef VT_EDITOR
+    // Already Referenced?
+    if ( mSceneObject )
+    {
+        // Return Object.
+        return mSceneObject;
+    }
+#endif
+
+    VController *controller = getController();
+    if ( !controller )
+    {
+        // No Controller!
+        return NULL;
+    }
+
+    String fieldValue;
+    if ( controller->getDataValue( mDataReference, fieldValue ) )
+    {
+        // Store Object.
+        mSceneObject = dynamic_cast<VTorque::SceneObjectType*>( Sim::findObject( fieldValue ) );
+    }
+
+    // Return.
+    return mSceneObject;
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VSceneObjectGroup, getSceneObject, S32, 2, 2, "( void ) - Get the object this group references.\n"
+                                                             "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Object.
+    VTorque::SceneObjectType *objReference = object->getSceneObject();
+
+    // Return.
+    return ( objReference ) ? objReference->getId() : 0;
+}
+#endif

+ 72 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectGroup.h

@@ -0,0 +1,72 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#define _VT_VSCENEOBJECTGROUP_H_
+
+#ifndef _VT_VGROUP_H_
+#include "Verve/Core/VGroup.h"
+#endif
+
+#ifndef _VT_TORQUE_SCENEOBJECT_H_
+#include "Verve/Torque/TSceneObject.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSceneObjectGroup : public VGroup
+{
+    typedef VGroup Parent;
+
+public:
+
+    // Reference Members.
+
+    String                      mDataReference;
+    VTorque::SceneObjectType   *mSceneObject;
+
+public:
+
+    VSceneObjectGroup( void );
+
+    static void                         initPersistFields( void );
+
+    // Reference Methods.
+    
+    VTorque::SceneObjectType   *getSceneObject( void );
+    template <class T> inline bool getSceneObject( T *&pSceneObject )
+    {
+        // Reference Scene Object.
+        pSceneObject = dynamic_cast<T*>( getSceneObject() );
+
+        // Valid?
+        return ( pSceneObject != NULL );
+    }
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSceneObjectGroup );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCENEOBJECTGROUP_H_

+ 77 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectTrack.cpp

@@ -0,0 +1,77 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#include "Verve/Extension/SceneObject/VSceneObjectTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSceneObjectTrack );
+//-----------------------------------------------------------------------------
+
+VSceneObjectTrack::VSceneObjectTrack( void )
+{
+    setLabel( "SceneObjectTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Reference Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSceneObjectTrack::getSceneObject();
+// 
+// Returns the parent group's object reference.
+// 
+//-----------------------------------------------------------------------------
+VTorque::SceneObjectType *VSceneObjectTrack::getSceneObject( void )
+{
+    VSceneObjectGroup *group;
+    if ( !getGroup( group ) )
+    {
+        // No Group!
+        return NULL;
+    }
+
+    // Return Object.
+    return group->getSceneObject();
+}
+
+#ifdef VT_EDITOR
+//-----------------------------------------------------------------------------
+//
+// Debug Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VSceneObjectTrack, getSceneObject, S32, 2, 2, "( void ) - Get the object this group references.\n"
+                                                             "@return Returns the SimObjectID for the object." )
+{
+    // Fetch Object.
+    VTorque::SceneObjectType *objReference = object->getSceneObject();
+
+    // Return.
+    return ( objReference ) ? objReference->getId() : 0;
+}
+#endif

+ 63 - 0
Engine/modules/Verve/Extension/SceneObject/VSceneObjectTrack.h

@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCENEOBJECTTRACK_H_
+#define _VT_VSCENEOBJECTTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+#ifndef _VT_VSCENEOBJECTGROUP_H_
+#include "Verve/Extension/SceneObject/VSceneObjectGroup.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSceneObjectTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VSceneObjectTrack( void );
+
+    // Reference Methods.
+
+    VTorque::SceneObjectType   *getSceneObject( void );
+    template <class T> inline bool getSceneObject( T *&pSceneObject )
+    {
+        // Reference Scene Object.
+        pSceneObject = dynamic_cast<T*>( getSceneObject() );
+
+        // Valid?
+        return ( pSceneObject != NULL );
+    }
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSceneObjectTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCENEOBJECTTRACK_H_

+ 101 - 0
Engine/modules/Verve/Extension/Script/VScriptEvent.cpp

@@ -0,0 +1,101 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+#include "Verve/Core/VTrack.h"
+
+#include "Verve/Extension/Script/VScriptEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VScriptEvent );
+//-----------------------------------------------------------------------------
+
+// Implement the Command Type enum list.
+ImplementEnumType( VScriptEventCommandType, "" )
+    { VScriptEvent::k_TypeExpression, "EXPRESSION" },
+    { VScriptEvent::k_TypeMethod,     "METHOD"     },
+EndImplementEnumType;
+
+//-----------------------------------------------------------------------------
+
+VScriptEvent::VScriptEvent( void ) : 
+        mCommandType( k_TypeMethod ),
+        mCommand( String::EmptyString )
+{
+    setLabel( "ScriptEvent" );
+}
+
+void VScriptEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "CommandType", TYPEID<eCommandType>(), Offset( mCommandType, VScriptEvent ), "The type of command to be evaluated." );
+    addField( "Command",     TypeRealString,         Offset( mCommand,     VScriptEvent ), "The command to be evaluated." );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VScriptEvet::onTrigger( pTime, pDelta );
+// 
+// Execute a method or evaluate a command.
+// 
+//-----------------------------------------------------------------------------
+void VScriptEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    switch ( mCommandType )
+    {
+        case k_TypeExpression :
+            {
+
+                // Evaluate Expression.
+                Con::evaluate( mCommand, false, NULL );
+
+            } break;
+
+        case k_TypeMethod :
+            {
+
+                SimObject *object = getSceneObject();
+                if ( object )
+                {
+                    // Execute Method.
+                    Con::executef( object, mCommand );
+                }
+                else
+                {
+                    // Execute Function.
+                    Con::executef( mCommand );
+                }
+
+            } break;
+    }
+}

+ 74 - 0
Engine/modules/Verve/Extension/Script/VScriptEvent.h

@@ -0,0 +1,74 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCRIPTEVENT_H_
+#define _VT_VSCRIPTEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VScriptEvent : public VSceneObjectEvent
+{
+    typedef VSceneObjectEvent Parent;
+
+public:
+
+    enum eCommandType
+    {
+        k_TypeExpression,
+        k_TypeMethod,
+
+        k_TypeInvalid,
+    };
+
+    eCommandType        mCommandType;
+    String              mCommand;
+    
+public:
+
+    VScriptEvent( void );
+
+    static void     initPersistFields( void );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VScriptEvent );
+};
+
+//-----------------------------------------------------------------------------
+
+// Define Types.
+typedef VScriptEvent::eCommandType VScriptEventCommandType;
+
+// Declare Enum Types.
+DefineEnumType( VScriptEventCommandType );
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCRIPTEVENT_H_

+ 32 - 0
Engine/modules/Verve/Extension/Script/VScriptEventTrack.cpp

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/Script/VScriptEventTrack.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VScriptEventTrack );
+//-----------------------------------------------------------------------------
+
+VScriptEventTrack::VScriptEventTrack( void )
+{
+    setLabel( "ScriptEventTrack" );
+}

+ 47 - 0
Engine/modules/Verve/Extension/Script/VScriptEventTrack.h

@@ -0,0 +1,47 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSCRIPTEVENTTRACK_H_
+#define _VT_VSCRIPTEVENTTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VScriptEventTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VScriptEventTrack( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VScriptEventTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSCRIPTEVENTTRACK_H_

+ 131 - 0
Engine/modules/Verve/Extension/SoundEffect/VSoundEffectEvent.cpp

@@ -0,0 +1,131 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Core/VGroup.h"
+#include "Verve/Extension/SoundEffect/VSoundEffectEvent.h"
+#include "Verve/Extension/SoundEffect/VSoundEffectTrack.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSoundEffectEvent );
+//-----------------------------------------------------------------------------
+
+VSoundEffectEvent::VSoundEffectEvent( void ) : 
+        mSoundEffect( NULL )
+{
+    setLabel( "SoundEvent" );
+}
+
+void VSoundEffectEvent::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addProtectedField( "SoundEffect", TYPEID<VTorque::SoundEffectType>(), Offset( mSoundEffect, VSoundEffectEvent ), &setSoundData, &defaultProtectedGetFn, "" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Callback Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSoundEffectEvent::onTrigger( pTime, pDelta );
+// 
+// Play the target sound effect. If this track belongs to a SceneObjectGroup,
+// then the sound will play with the reference object's transform. If this is
+// not the case, then a 2D sound will be played.
+// 
+//-----------------------------------------------------------------------------
+void VSoundEffectEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
+{
+    Parent::onTrigger( pTime, pDelta );
+
+    // Fetch Track.
+    VSoundEffectTrack *track;
+    if ( !getTrack( track ) )
+    {
+        return;
+    }
+
+    // Position & Pitch.
+    U32 position = mAbs( ( pTime + pDelta ) - getStartTime() );
+    F32 pitch    = mFabs( getControllerTimeScale() );
+    if ( position < SFXStartBuffer )
+    {
+        // Zero.
+        position = 0;
+    }
+
+    VSceneObjectGroup *group;
+    if ( getGroup( group ) )
+    {
+        // Play Sound With Reference.
+        track->mSource = VTorque::playSound( mSoundEffect, group->getSceneObject(), position, pitch );
+    }
+    else
+    {
+        // Play Sound.
+        track->mSource = VTorque::playSound( mSoundEffect, position, pitch );
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Property Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSoundEffectEvent::setDuration( pDuration );
+// 
+// This event's duration is always set to the sound object's duration.
+// 
+//-----------------------------------------------------------------------------
+void VSoundEffectEvent::setDuration( const S32 &pDuration )
+{
+    // Clear Duration.
+    mDuration = VTorque::getSoundDuration( mSoundEffect );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Static Field Methods.
+//
+//-----------------------------------------------------------------------------
+
+bool VSoundEffectEvent::setSoundData( void *pObject, const char *pArray, const char *pData )
+{
+    // Fetch Event.
+    VSoundEffectEvent *event = static_cast<VSoundEffectEvent*>( pObject );
+
+    // Use Object.
+    event->mSoundEffect = dynamic_cast<VTorque::SoundEffectType*>( Sim::findObject( pData ) );
+
+    // Set Duration.
+    event->setDuration( 0 );
+
+    return false;
+}

+ 74 - 0
Engine/modules/Verve/Extension/SoundEffect/VSoundEffectEvent.h

@@ -0,0 +1,74 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSOUNDEFFECTEVENT_H_
+#define _VT_VSOUNDEFFECTEVENT_H_
+
+#ifndef _VT_VSCENEOBJECTEVENT_H_
+#include "Verve/Extension/SceneObject/VSceneObjectEvent.h"
+#endif
+
+#ifndef _VT_TORQUE_SOUNDEFFECT_H_
+#include "Verve/Torque/TSoundEffect.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSoundEffectEvent : public VSceneObjectEvent
+{
+    typedef VSceneObjectEvent Parent;
+
+    enum
+    {
+        SFXStartBuffer = 100,
+    };
+
+public:
+
+    SimObjectPtr<VTorque::SoundEffectType>    mSoundEffect;
+
+public:
+
+    VSoundEffectEvent( void );
+
+    static void     initPersistFields( void );
+
+    static bool     setSoundData( void *pObject, const char *pArray, const char *pData );
+
+    // Event Methods.
+
+    virtual void    onTrigger( const S32 &pTime, const S32 &pDelta );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSoundEffectEvent );
+
+public:
+
+    // Property Methods.
+
+    virtual void    setDuration( const S32 &pDuration );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSOUNDEFFECTEVENT_H_

+ 111 - 0
Engine/modules/Verve/Extension/SoundEffect/VSoundEffectTrack.cpp

@@ -0,0 +1,111 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/Extension/SoundEffect/VSoundEffectTrack.h"
+#include "Verve/Extension/SoundEffect/VSoundEffectEvent.h"
+
+#include "console/consoleTypes.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VSoundEffectTrack );
+//-----------------------------------------------------------------------------
+
+VSoundEffectTrack::VSoundEffectTrack( void ) : 
+        mSource( NULL )
+{
+    setLabel( "SoundTrack" );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Controller Methods.
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 
+// VSoundEffectTrack::onControllerEvent( pEvent );
+// 
+// If the controller ceases playback and the track has a valid reference to a
+// source provider, then the sound is stopped.
+// 
+//-----------------------------------------------------------------------------
+bool VSoundEffectTrack::onControllerEvent( VController::eControllerEventType pEvent )
+{
+    if ( !Parent::onControllerEvent( pEvent ) )
+    {
+        // Skip.
+        return false;
+    }
+
+    // Enabled?
+    if ( !isEnabled() )
+    {
+        // Continue Processing Events.
+        return true;
+    }
+
+    switch ( pEvent )
+    {
+        case VController::k_EventPause :
+        case VController::k_EventStop :
+            {
+#ifdef VT_EDITOR
+
+                if ( mSource )
+                {
+                    // Stop Sound.
+                    VTorque::stopSound( mSource );
+
+                    // Clear Source.
+                    mSource = NULL;
+                }
+
+#endif
+            } break;
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// 
+// VSoundEffectTrack::onControllerReset( pTime, pForward );
+// 
+// If the track is reset and it has a valid reference to a source provider,
+// then the sound is stopped.
+// 
+//-----------------------------------------------------------------------------
+void VSoundEffectTrack::onControllerReset( const S32 &pTime, const bool &pForward )
+{
+    // Default Reset.
+    Parent::onControllerReset( pTime, pForward );
+
+    if ( mSource )
+    {
+        // Stop Sound.
+        VTorque::stopSound( mSource );
+    }
+
+    // Clear Source.
+    mSource = NULL;
+}

+ 60 - 0
Engine/modules/Verve/Extension/SoundEffect/VSoundEffectTrack.h

@@ -0,0 +1,60 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VSOUNDEFFECTTRACK_H_
+#define _VT_VSOUNDEFFECTTRACK_H_
+
+#ifndef _VT_VTRACK_H_
+#include "Verve/Core/VTrack.h"
+#endif
+
+#ifndef _VT_TORQUE_SOUNDEFFECT_H_
+#include "Verve/Torque/TSoundEffect.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VSoundEffectTrack : public VTrack
+{
+    typedef VTrack Parent;
+
+public:
+
+    VTorque::SoundSourceType   *mSource;
+
+public:
+
+    VSoundEffectTrack( void );
+
+    // Controller Methods.
+
+    virtual bool    onControllerEvent( VController::eControllerEventType pEvent );
+    virtual void    onControllerReset( const S32 &pTime, const bool &pForward );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VSoundEffectTrack );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VSOUNDEFFECTTRACK_H_

+ 216 - 0
Engine/modules/Verve/GUI/VEditorButton.cpp

@@ -0,0 +1,216 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/GUI/VEditorButton.h"
+#include "console/consoleTypes.h"
+#include "gfx/gfxDrawUtil.h"
+#include "gui/core/guiCanvas.h"
+#include "gui/core/guiDefaultControlRender.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VEditorButton );
+//-----------------------------------------------------------------------------
+
+VEditorButton::VEditorButton( void ) :
+        mIsDraggable( false )
+{
+    // Void.
+}
+
+void VEditorButton::initPersistFields( void )
+{
+    Parent::initPersistFields();
+
+    addField( "IsDraggable", TypeBool, Offset( mIsDraggable, VEditorButton ) );
+}
+
+//-----------------------------------------------------------------------------
+
+void VEditorButton::onMouseDown( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onMouseDown( pEvent );
+
+    onMouseEvent( "onMouseDown", pEvent );
+}
+
+void VEditorButton::onMouseUp( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onMouseUp( pEvent );
+
+    if ( mIsDraggable && isMouseLocked() )
+    {
+        // Unlock.
+        mouseUnlock();
+    }
+
+    onMouseEvent( "onMouseUp", pEvent );
+}
+
+void VEditorButton::onMouseDragged( const GuiEvent &pEvent )
+{
+    if ( !mActive || !mIsDraggable )
+    {
+        return;
+    }
+
+    Parent::onMouseDragged( pEvent );
+
+    if ( !isMouseLocked() )
+    {
+        GuiCanvas *canvas = getRoot();
+        if ( canvas->getMouseLockedControl() )
+        {
+            GuiEvent event;
+            canvas->getMouseLockedControl()->onMouseLeave( event );
+            canvas->mouseUnlock( canvas->getMouseLockedControl() );
+        }
+
+        // Lock.
+        mouseLock();
+    }
+
+    onMouseEvent( "onMouseDragged", pEvent );
+}
+
+void VEditorButton::onRightMouseDown( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onRightMouseDown( pEvent );
+
+    onMouseEvent( "onRightMouseDown", pEvent );
+}
+
+void VEditorButton::onRightMouseUp( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onRightMouseUp( pEvent );
+
+    onMouseEvent( "onRightMouseUp", pEvent );
+}
+
+void VEditorButton::onMouseEnter( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onMouseEnter( pEvent );
+
+    onMouseEvent( "onMouseEnter", pEvent );
+}
+
+void VEditorButton::onMouseLeave( const GuiEvent &pEvent )
+{
+    if ( !mActive )
+    {
+        return;
+    }
+
+    Parent::onMouseLeave( pEvent );
+
+    onMouseEvent( "onMouseLeave", pEvent );
+}
+
+void VEditorButton::onMouseEvent( const char *pEventName, const GuiEvent &pEvent )
+{
+    // Argument Buffers.
+    char argBuffer[3][32];
+
+    // Format Event-Position Buffer.
+    dSprintf( argBuffer[0], 32, "%d %d", pEvent.mousePoint.x, pEvent.mousePoint.y );
+
+    // Format Event-Modifier Buffer.
+    dSprintf( argBuffer[1], 32, "%d", pEvent.modifier );
+
+    // Format Mouse-Click Count Buffer.
+    dSprintf( argBuffer[2], 32, "%d", pEvent.mouseClickCount );
+
+    // Call Scripts.
+    Con::executef( this, pEventName, argBuffer[0], argBuffer[1], argBuffer[2] );
+}
+
+//-----------------------------------------------------------------------------
+
+void VEditorButton::onRender( Point2I offset, const RectI& updateRect )
+{
+    // Fetch Texture.
+    GFXTexHandle texture = getTextureForCurrentState();
+
+    // Valid?
+    if ( texture )
+    {
+        GFX->getDrawUtil()->clearBitmapModulation();
+        GFX->getDrawUtil()->drawBitmapStretch( texture, RectI( offset, getExtent() ) );
+    }
+    else
+    {
+        if ( mProfile->mBorder != 0 )
+        {
+            RectI boundsRect( offset, getExtent() );
+
+            if ( mDepressed || mStateOn || mMouseOver )
+            {
+                renderFilledBorder( boundsRect, mProfile->mBorderColorHL, mProfile->mFillColorHL );
+            }
+            else
+            {
+                renderFilledBorder( boundsRect, mProfile->mBorderColor, mProfile->mFillColor );
+            }
+        }
+    }
+
+    // Render Text.
+    GFX->getDrawUtil()->setBitmapModulation( mProfile->mFontColor );
+    renderJustifiedText( offset + mProfile->mTextOffset, getExtent(), mButtonText );
+
+    renderChildControls( offset, updateRect);
+}
+
+//-----------------------------------------------------------------------------
+//
+// Console Methods.
+//
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VEditorButton, getState, bool, 2, 2, "()" )
+{
+    return object->getStateOn();
+}

+ 62 - 0
Engine/modules/Verve/GUI/VEditorButton.h

@@ -0,0 +1,62 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VEDITORBUTTON_H_
+#define _VT_VEDITORBUTTON_H_
+
+#ifndef _GUIBITMAPBUTTON_H_
+#include "gui/buttons/guiBitmapButtonCtrl.h"
+#endif
+
+class VEditorButton : public GuiBitmapButtonTextCtrl
+{
+    typedef GuiBitmapButtonTextCtrl Parent;
+
+public:
+
+    bool            mIsDraggable;
+
+public:
+
+    VEditorButton();
+
+    static void     initPersistFields( void );
+
+    void            onMouseDown( const GuiEvent &pEvent );
+    void            onMouseUp( const GuiEvent &pEvent );
+    void            onMouseDragged( const GuiEvent &pEvent );
+
+    void            onRightMouseDown( const GuiEvent &pEvent );
+    void            onRightMouseUp( const GuiEvent &pEvent );
+
+    void            onMouseEnter( const GuiEvent &pEvent );
+    void            onMouseLeave( const GuiEvent &pEvent );
+    void            onMouseEvent( const char *pEventName, const GuiEvent &pEvent );
+
+    void            onRender( Point2I offset, const RectI &updateRect );
+
+public:
+
+    DECLARE_CONOBJECT( VEditorButton );
+};
+
+#endif //_VT_VEDITORBUTTON_H_

+ 97 - 0
Engine/modules/Verve/GUI/VEditorScrollControl.cpp

@@ -0,0 +1,97 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/GUI/VEditorScrollControl.h"
+#include "gfx/gfxDrawUtil.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VEditorScrollControl );
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+//
+// Mouse Methods.
+//
+//-----------------------------------------------------------------------------
+
+void VEditorScrollControl::onMouseUp( const GuiEvent &pEvent )
+{
+    Parent::onMouseUp( pEvent );
+
+    // Event.
+    onMouseEvent( "onMouseUp", pEvent );
+}
+
+void VEditorScrollControl::onRightMouseUp( const GuiEvent &pEvent )
+{
+    Parent::onMouseUp( pEvent );
+
+    // Event.
+    onMouseEvent( "onRightMouseUp", pEvent );
+}
+
+void VEditorScrollControl::onMouseEvent( const char *pEventName, const GuiEvent &pEvent )
+{
+    const S32 offsetX = ( mHasVScrollBar ) ? mScrollBarThickness : 0;
+    const S32 offsetY = ( mHasHScrollBar ) ? mScrollBarThickness : 0;
+
+    const RectI contentRect( 2, 2, getWidth() - offsetX - 4 - 1, getHeight() - offsetY - 4 - ( mHasHScrollBar ) );
+    if ( !contentRect.pointInRect( pEvent.mousePoint ) )
+    {
+        // Return!
+        return;
+    }
+
+    // Argument Buffers.
+    char argBuffer[3][32];
+
+    // Format Event-Position Buffer.
+    dSprintf( argBuffer[0], 32, "%d %d", pEvent.mousePoint.x, pEvent.mousePoint.y );
+
+    // Format Event-Modifier Buffer.
+    dSprintf( argBuffer[1], 32, "%d", pEvent.modifier );
+
+    // Format Mouse-Click Count Buffer.
+    dSprintf( argBuffer[2], 32, "%d", pEvent.mouseClickCount );
+
+    // Call Scripts.
+    Con::executef( this, pEventName, argBuffer[0], argBuffer[1], argBuffer[2] );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Render Methods.
+//
+//-----------------------------------------------------------------------------
+
+void VEditorScrollControl::onRender( Point2I pOffset, const RectI &pUpdateRect )
+{
+    Parent::onRender( pOffset, pUpdateRect );
+
+    const S32 offsetX = ( mHasVScrollBar ) ? mScrollBarThickness : 1;
+    const S32 offsetY = ( mHasHScrollBar ) ? mScrollBarThickness : 1;
+
+    RectI contentRect( pOffset.x + 1, pOffset.y + 1, getWidth() - offsetX - 1, getHeight() - offsetY - 1 );
+    contentRect.intersect( pUpdateRect );
+
+    GFX->getDrawUtil()->drawRect( contentRect, mProfile->mBorderColor );
+}

+ 56 - 0
Engine/modules/Verve/GUI/VEditorScrollControl.h

@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VEDITORSCROLLCONTROL_H_
+#define _VT_VEDITORSCROLLCONTROL_H_
+
+#ifndef _GUISCROLLCTRL_H_
+#include "gui/containers/guiScrollCtrl.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VEditorScrollControl : public GuiScrollCtrl
+{
+    typedef GuiScrollCtrl Parent;
+    
+public:
+
+    // Mouse.
+
+    virtual void    onMouseUp( const GuiEvent &pEvent );
+    virtual void    onRightMouseUp( const GuiEvent &pEvent );
+
+    void            onMouseEvent( const char *pEventName, const GuiEvent &pEvent );
+
+    // Rendering.
+
+    void            onRender( Point2I pOffset, const RectI &pUpdateRect );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VEditorScrollControl );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VEDITORSCROLLCONTROL_H_

+ 158 - 0
Engine/modules/Verve/GUI/VEditorWindow.cpp

@@ -0,0 +1,158 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/GUI/VEditorWindow.h"
+#include "gfx/gfxInit.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VEditorWindow );
+//-----------------------------------------------------------------------------
+
+bool VEditorWindow::onAdd( void )
+{
+    if ( !Parent::onAdd() )
+    {
+        return false;
+    }
+
+    GFXAdapter *adapter = GFXInit::getBestAdapterChoice();
+    if ( adapter && adapter->mType != NullDevice )
+    {
+        mPlatformWindow->setMinimumWindowSize( Point2I( 904, 287 ) );
+    }
+
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+
+ConsoleMethod( VEditorWindow, resetCursor, void, 2, 2, "( )" )
+{
+    S32 currCursor = PlatformCursorController::curArrow;
+    if ( object->mCursorChanged == currCursor )
+    {
+        return;
+    }
+
+    PlatformWindow *window = object->getPlatformWindow();
+    PlatformCursorController *controller = window->getCursorController();
+
+    if( object->mCursorChanged != -1)
+    {
+        controller->popCursor();
+    }
+
+    controller->pushCursor(currCursor);
+    object->mCursorChanged = currCursor;   
+
+    Platform::setWindowLocked( false );
+}
+
+ConsoleMethod( VEditorWindow, setVideoMode, void, 5, 8,
+               "(int width, int height, bool fullscreen, [int bitDepth], [int refreshRate])\n"
+               "Change the video mode of this canvas. This method has the side effect of setting the $pref::Video::mode to the new values.\n\n"
+               "\\param width The screen width to set.\n"
+               "\\param height The screen height to set.\n"
+               "\\param fullscreen Specify true to run fullscreen or false to run in a window\n"
+               "\\param bitDepth [optional] The desired bit-depth. Defaults to the current setting. This parameter is ignored if you are running in a window.\n"
+               "\\param refreshRate [optional] The desired refresh rate. Defaults to the current setting. This parameter is ignored if you are running in a window"
+                    "\\param antialiasLevel [optional] The level of anti-aliasing to apply 0 = none" )
+{
+   if (!object->getPlatformWindow())
+      return;
+
+   // Update the video mode and tell the window to reset.
+   GFXVideoMode vm = object->getPlatformWindow()->getVideoMode();
+
+   U32 width = dAtoi(argv[2]);
+   U32 height = dAtoi(argv[3]);
+
+   bool changed = false;
+   if (width == 0 && height > 0)
+   {
+      // Our width is 0 but our height isn't...
+      // Try to find a matching width
+      for(S32 i=0; i<object->getPlatformWindow()->getGFXDevice()->getVideoModeList()->size(); i++)
+      {
+         const GFXVideoMode &newVm = (*(object->getPlatformWindow()->getGFXDevice()->getVideoModeList()))[i];
+
+         if(newVm.resolution.y == height)
+         {
+            width = newVm.resolution.x;
+            changed = true;
+            break;
+         }
+      }
+   }
+   else if (height == 0 && width > 0)
+   {
+      // Our height is 0 but our width isn't...
+      // Try to find a matching height
+      for(S32 i=0; i<object->getPlatformWindow()->getGFXDevice()->getVideoModeList()->size(); i++)
+      {
+         const GFXVideoMode &newVm = (*(object->getPlatformWindow()->getGFXDevice()->getVideoModeList()))[i];
+
+         if(newVm.resolution.x == width)
+         {
+            height = newVm.resolution.y;
+            changed = true;
+            break;
+         }
+      }
+   }
+
+   if (width == 0 || height == 0)
+   {
+      // Got a bad size for both of our dimensions or one of our dimensions and
+      // didn't get a match for the other default back to our current resolution
+      width  = vm.resolution.x;
+      height = vm.resolution.y;
+
+      changed = true;
+   }
+
+   if (changed)
+      Con::errorf("GuiCanvas::setVideoMode(): Error - Invalid resolution of (%d, %d) - attempting (%d, %d)", dAtoi(argv[2]), dAtoi(argv[3]), width, height);
+
+   vm.resolution  = Point2I(width, height);
+   vm.fullScreen  = dAtob(argv[4]);
+
+   // These optional params are set to default at construction of vm. If they
+   // aren't specified, just leave them at whatever they were set to.
+   if ((argc > 5) && (dStrlen(argv[5]) > 0))
+   {
+      vm.bitDepth = dAtoi(argv[5]);
+   }
+   if ((argc > 6) && (dStrlen(argv[6]) > 0))
+   {
+      vm.refreshRate = dAtoi(argv[6]);
+   }
+
+   if ((argc > 7) && (dStrlen(argv[7]) > 0))
+   {
+      vm.antialiasLevel = dAtoi(argv[7]);
+   }
+
+#ifndef TORQUE_OS_XENON
+   object->getPlatformWindow()->setVideoMode(vm);
+#endif
+}

+ 49 - 0
Engine/modules/Verve/GUI/VEditorWindow.h

@@ -0,0 +1,49 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef _VT_VEDITORWINDOW_H_
+#define _VT_VEDITORWINDOW_H_
+
+#ifndef _GUICANVAS_H_
+#include "gui/core/guiCanvas.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+class VEditorWindow : public GuiCanvas
+{
+    typedef GuiCanvas Parent;
+    
+public:
+
+    // Properties.
+
+    virtual bool    onAdd( void );
+
+    // Console Declaration.
+
+    DECLARE_CONOBJECT( VEditorWindow );
+};
+
+//-----------------------------------------------------------------------------
+
+#endif // _VT_VEDITORWINDOW_H_

+ 114 - 0
Engine/modules/Verve/GUI/VFadeControl.cpp

@@ -0,0 +1,114 @@
+//-----------------------------------------------------------------------------
+// Verve
+// Copyright (C) 2014 - Violent Tulip
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#include "Verve/GUI/VFadeControl.h"
+
+#include "console/consoleTypes.h"
+#include "gfx/gfxDrawUtil.h"
+#include "math/mMathFn.h"
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CONOBJECT( VFadeControl );
+//-----------------------------------------------------------------------------
+
+VFadeControl::VFadeControl( void ) : 
+        mActive( false ),
+        mFadeType( k_TypeInvalid ),
+        mElapsedTime( 0 ),
+        mDuration( 1000 ),
+        mLastTime( 0 )
+{
+    // Void.
+}
+
+//-----------------------------------------------------------------------------
+//
+// Render Methods.
+//
+//-----------------------------------------------------------------------------
+
+void VFadeControl::onRender( Point2I pOffset, const RectI &pUpdateRect )
+{
+    Parent::onRender( pOffset, pUpdateRect );
+
+    if ( mFadeType == k_TypeInvalid )
+    {
+        // Invalid Fade State.
+        return;
+    }
+
+    // Fetch Time.
+    const U32 time  = Platform::getRealMilliseconds();
+    // Fetch Delta.
+    const U32 delta = ( time - mLastTime );
+    // Store Time.
+    mLastTime       = time;
+
+    if ( mActive )
+    {
+        // Update Elapsed Time.
+        mElapsedTime += delta;
+    }
+
+    F32 alpha = 1.f - mClampF( F32( mElapsedTime ) / F32( mDuration ), 0.f, 1.f );
+
+    if ( mFadeType == k_TypeOut )
+    {
+        // Flip.
+        alpha = 1.f - alpha;
+    }
+
+    if ( alpha > 0.f )
+    {
+        // Render.
+        GFX->getDrawUtil()->drawRectFill( pOffset, pOffset + getExtent(), ColorF( 0, 0, 0, alpha ) );
+    }
+
+    if ( mElapsedTime >= mDuration )
+    {
+        // Stop.
+        mActive = false;
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Control Methods.
+//
+//-----------------------------------------------------------------------------
+
+void VFadeControl::start( eFadeType pType, S32 pDuration )
+{
+    mActive      = true;
+
+    mFadeType    = pType;
+
+    mElapsedTime = 0;
+    mDuration    = pDuration;
+
+    mLastTime    = Platform::getRealMilliseconds();
+}
+
+void VFadeControl::pause( void )
+{
+    mActive = false;
+}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff