Przeglądaj źródła

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Conflicts:
	gameplay/src/ScriptController.cpp
ablake 12 lat temu
rodzic
commit
0095ca6a75
59 zmienionych plików z 2058 dodań i 486 usunięć
  1. 4 1
      .gitignore
  2. 4 3
      CMakeLists.txt
  3. 1 1
      gameplay/.cproject
  4. 5 3
      gameplay/src/Animation.cpp
  5. 1 1
      gameplay/src/FileSystem.cpp
  6. 5 1
      gameplay/src/Game.h
  7. 199 21
      gameplay/src/MaterialParameter.cpp
  8. 125 0
      gameplay/src/MaterialParameter.h
  9. 10 7
      gameplay/src/Model.cpp
  10. 23 15
      gameplay/src/Node.cpp
  11. 11 0
      gameplay/src/Node.h
  12. 13 0
      gameplay/src/PhysicsCollisionObject.cpp
  13. 10 0
      gameplay/src/PhysicsCollisionObject.h
  14. 2 2
      gameplay/src/PhysicsVehicleWheel.cpp
  15. 5 1
      gameplay/src/Platform.h
  16. 1 1
      gameplay/src/PlatformAndroid.cpp
  17. 1 0
      gameplay/src/SceneLoader.cpp
  18. 5 2
      gameplay/src/ScriptController.cpp
  19. 156 22
      gameplay/src/Transform.cpp
  20. 10 0
      gameplay/src/Transform.h
  21. 36 0
      gameplay/src/lua/lua_Joint.cpp
  22. 1 0
      gameplay/src/lua/lua_Joint.h
  23. 942 166
      gameplay/src/lua/lua_MaterialParameter.cpp
  24. 13 0
      gameplay/src/lua/lua_MaterialParameter.h
  25. 36 0
      gameplay/src/lua/lua_Node.cpp
  26. 1 0
      gameplay/src/lua/lua_Node.h
  27. 36 0
      gameplay/src/lua/lua_PhysicsCharacter.cpp
  28. 1 0
      gameplay/src/lua/lua_PhysicsCharacter.h
  29. 36 0
      gameplay/src/lua/lua_PhysicsCollisionObject.cpp
  30. 1 0
      gameplay/src/lua/lua_PhysicsCollisionObject.h
  31. 36 0
      gameplay/src/lua/lua_PhysicsGhostObject.cpp
  32. 1 0
      gameplay/src/lua/lua_PhysicsGhostObject.h
  33. 36 0
      gameplay/src/lua/lua_PhysicsVehicle.cpp
  34. 1 0
      gameplay/src/lua/lua_PhysicsVehicle.h
  35. 36 0
      gameplay/src/lua/lua_PhysicsVehicleWheel.cpp
  36. 1 0
      gameplay/src/lua/lua_PhysicsVehicleWheel.h
  37. 36 0
      gameplay/src/lua/lua_Transform.cpp
  38. 1 0
      gameplay/src/lua/lua_Transform.h
  39. 1 1
      samples/browser/CMakeLists.txt
  40. 2 2
      samples/character/CMakeLists.txt
  41. 8 0
      samples/character/bar-descriptor.xml
  42. 2 2
      samples/longboard/CMakeLists.txt
  43. 2 2
      samples/lua/CMakeLists.txt
  44. 2 2
      samples/mesh/CMakeLists.txt
  45. 2 2
      samples/particles/CMakeLists.txt
  46. 1 1
      samples/racer/.cproject
  47. 2 2
      samples/racer/CMakeLists.txt
  48. 2 2
      samples/spaceship/CMakeLists.txt
  49. 93 93
      tools/encoder/CMakeLists.txt
  50. 3 49
      tools/encoder/README.md
  51. 48 42
      tools/encoder/src/EncoderArguments.cpp
  52. 36 10
      tools/encoder/src/FBXSceneEncoder.cpp
  53. 0 3
      tools/encoder/src/FBXSceneEncoder.h
  54. 0 4
      tools/encoder/src/FBXUtil.cpp
  55. 0 3
      tools/encoder/src/FBXUtil.h
  56. 1 1
      tools/encoder/src/Material.cpp
  57. 1 3
      tools/encoder/src/MeshSkin.cpp
  58. 0 5
      tools/encoder/src/main.cpp
  59. 10 10
      tools/luagen/CMakeLists.txt

+ 4 - 1
.gitignore

@@ -89,9 +89,11 @@ Thumbs.db
 /samples/character/Simulator-Coverage
 /samples/character/Simulator-Profile
 /samples/character/Device-Debug
+/samples/character/Device-Debug-QC
 /samples/character/Device-Coverage
 /samples/character/Device-Profile
 /samples/character/Device-Release
+/samples/character/Device-Release-QC
 /samples/character/game.config
 /samples/character/res/shaders
 /samples/character/res/logo_powered_white.png
@@ -214,10 +216,11 @@ Thumbs.db
 /samples/racer/Simulator-Coverage
 /samples/racer/Simulator-Profile
 /samples/racer/Device-Debug
-/samples/racer/Device-Debug-IMG
+/samples/racer/Device-Debug-QC
 /samples/racer/Device-Coverage
 /samples/racer/Device-Profile
 /samples/racer/Device-Release
+/samples/racer/Device-Release-QC
 /samples/racer/game.config
 /samples/racer/res/shaders
 /samples/racer/res/logo_powered_white.png

+ 4 - 3
CMakeLists.txt

@@ -24,6 +24,7 @@ add_subdirectory(gameplay)
 # gameplay samples
 add_subdirectory(samples)
 
-
-
-
+# gameplay encoder
+# A pre-compiled executable can be found in 'gameplay/bin'
+# Uncomment out this line if you want to build the encoder instead of using the pre-compiled gameplay-encoder.
+#add_subdirectory(tools/encoder)

+ 1 - 1
gameplay/.cproject

@@ -82,7 +82,7 @@
 							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1117051584" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
 							<builder buildPath="${workspace_loc:/gameplay/Device-Release}" id="cdt.managedbuild.target.gnu.builder.base.1199322737" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
 							<tool id="com.qnx.qcc.tool.compiler.1345567866" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compiler.optlevel.1056793982" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.0" valueType="enumerated"/>
+								<option id="com.qnx.qcc.option.compiler.optlevel.1056793982" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.1" valueType="enumerated"/>
 								<option id="com.qnx.qcc.option.compiler.security.324540233" name="Enhanced Security (-fstack-protector-strong)" superClass="com.qnx.qcc.option.compiler.security" value="false" valueType="boolean"/>
 								<option id="com.qnx.qcc.option.compiler.defines.398688299" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>

+ 5 - 3
gameplay/src/Animation.cpp

@@ -343,9 +343,11 @@ Animation::Channel* Animation::createChannel(AnimationTarget* target, int proper
         curve->setPoint(i, normalizedKeyTimes[i], (keyValues + pointOffset), (Curve::InterpolationType) type);
         pointOffset += propertyComponentCount;
     }
-    i = keyCount - 1;
-    normalizedKeyTimes[i] = 1.0f;
-    curve->setPoint(i, normalizedKeyTimes[i], keyValues + pointOffset, (Curve::InterpolationType) type);
+    if (keyCount > 1) {
+        i = keyCount - 1;
+        normalizedKeyTimes[i] = 1.0f;
+        curve->setPoint(i, normalizedKeyTimes[i], keyValues + pointOffset, (Curve::InterpolationType) type);
+    }
 
     SAFE_DELETE_ARRAY(normalizedKeyTimes);
 

+ 1 - 1
gameplay/src/FileSystem.cpp

@@ -590,7 +590,7 @@ std::string FileSystem::getDirectoryName(const char* path)
 #else
     // dirname() modifies the input string so create a temp string
     std::string dirname;
-    char* tempPath = new char[strlen(path)];
+    char* tempPath = new char[strlen(path) + 1];
     strcpy(tempPath, path);
     char* dir = ::dirname(tempPath);
     if (dir && strlen(dir) > 0)

+ 5 - 1
gameplay/src/Game.h

@@ -511,7 +511,11 @@ public:
     inline bool canExit() const;
 
     /**
-     * Gets the current accelerometer values.
+     * Gets the current accelerometer values for use as an indication of device
+     * orientation. Despite its name, implementations are at liberty to combine
+     * accelerometer data with data from other sensors as well, such as the gyros.
+     * This method is best used to obtain an indication of device orientation; it
+     * does not necessarily distinguish between acceleration and rotation rate.
      *
      * @param pitch The pitch angle returned (in degrees). If NULL then not returned.
      * @param roll The roll angle returned (in degrees). If NULL then not returned.

+ 199 - 21
gameplay/src/MaterialParameter.cpp

@@ -225,47 +225,225 @@ void MaterialParameter::setValue(const Matrix* values, unsigned int count)
 
 void MaterialParameter::setValue(const Texture::Sampler* sampler)
 {
+    GP_ASSERT(sampler);
     clearValue();
 
+    const_cast<Texture::Sampler*>(sampler)->addRef();
+    _value.samplerValue = sampler;
+    _type = MaterialParameter::SAMPLER;
+}
+
+void MaterialParameter::setValue(const Texture::Sampler** samplers, unsigned int count)
+{
+    GP_ASSERT(samplers);
+    clearValue();
+
+    for (unsigned int i = 0; i < count; ++i)
+    {
+        const_cast<Texture::Sampler*>(samplers[i])->addRef();
+    }
+    _value.samplerArrayValue = samplers;
+    _count = count;
+    _type = MaterialParameter::SAMPLER_ARRAY;
+}
+
+Texture::Sampler* MaterialParameter::setValue(const char* texturePath, bool generateMipmaps)
+{
+    GP_ASSERT(texturePath);
+    clearValue();
+
+    Texture::Sampler* sampler = Texture::Sampler::create(texturePath, generateMipmaps);
     if (sampler)
     {
-        const_cast<Texture::Sampler*>(sampler)->addRef();
         _value.samplerValue = sampler;
         _type = MaterialParameter::SAMPLER;
     }
+    return sampler;
 }
 
-void MaterialParameter::setValue(const Texture::Sampler** samplers, unsigned int count)
+void MaterialParameter::setFloat(float value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setFloatArray(const float* values, unsigned int count, bool copy)
 {
+    GP_ASSERT(values);
     clearValue();
 
-    if (samplers)
+    if (copy)
     {
-        for (unsigned int i = 0; i < count; ++i)
-        {
-            const_cast<Texture::Sampler*>(samplers[i])->addRef();
-        }
-        _value.samplerArrayValue = samplers;
-        _count = count;
-        _type = MaterialParameter::SAMPLER_ARRAY;
+        _value.floatPtrValue = new float[count];
+        memcpy(_value.floatPtrValue, values, sizeof(float) * count);
+        _dynamic = true;
     }
+    else
+    {
+        _value.floatPtrValue = const_cast<float*> (values);
+    }
+
+    _count = count;
+    _type = MaterialParameter::FLOAT_ARRAY;
 }
 
-Texture::Sampler* MaterialParameter::setValue(const char* texturePath, bool generateMipmaps)
+void MaterialParameter::setInt(int value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setIntArray(const int* values, unsigned int count, bool copy)
 {
-    if (texturePath)
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
     {
-        clearValue();
+        _value.intPtrValue = new int[count];
+        memcpy(_value.intPtrValue, values, sizeof(int) * count);
+        _dynamic = true;
+    }
+    else
+    {
+        _value.intPtrValue = const_cast<int*> (values);
+    }
 
-        Texture::Sampler* sampler = Texture::Sampler::create(texturePath, generateMipmaps);
-        if (sampler)
-        {
-            _value.samplerValue = sampler;
-            _type = MaterialParameter::SAMPLER;
-        }
-        return sampler;
+    _count = count;
+    _type = MaterialParameter::INT_ARRAY;
+}
+
+void MaterialParameter::setVector2(const Vector2& value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setVector2Array(const Vector2* values, unsigned int count, bool copy)
+{
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
+    {
+        _value.floatPtrValue = new float[2 * count];
+        memcpy(_value.floatPtrValue, const_cast<float*> (&values[0].x), sizeof(float) * 2 * count);
+        _dynamic = true;
     }
-    return NULL;
+    else
+    {
+        _value.floatPtrValue = const_cast<float*> (&values[0].x);
+    }
+
+    _count = count;
+    _type = MaterialParameter::VECTOR2;
+}
+
+void MaterialParameter::setVector3(const Vector3& value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setVector3Array(const Vector3* values, unsigned int count, bool copy)
+{
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
+    {
+        _value.floatPtrValue = new float[3 * count];
+        memcpy(_value.floatPtrValue, const_cast<float*> (&values[0].x), sizeof(float) * 3 * count);
+        _dynamic = true;
+    }
+    else
+    {
+        _value.floatPtrValue = const_cast<float*> (&values[0].x);
+    }
+
+    _count = count;
+    _type = MaterialParameter::VECTOR3;
+}
+
+void MaterialParameter::setVector4(const Vector4& value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setVector4Array(const Vector4* values, unsigned int count, bool copy)
+{
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
+    {
+        _value.floatPtrValue = new float[4 * count];
+        memcpy(_value.floatPtrValue, const_cast<float*> (&values[0].x), sizeof(float) * 4 * count);
+        _dynamic = true;
+    }
+    else
+    {
+        _value.floatPtrValue = const_cast<float*> (&values[0].x);
+    }
+
+    _count = count;
+    _type = MaterialParameter::VECTOR4;
+}
+
+void MaterialParameter::setMatrix(const Matrix& value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setMatrixArray(const Matrix* values, unsigned int count, bool copy)
+{
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
+    {
+        _value.floatPtrValue = new float[16 * count];
+        memcpy(_value.floatPtrValue, const_cast<Matrix&> (values[0]).m, sizeof(float) * 16 * count);
+        _dynamic = true;
+    }
+    else
+    {
+        _value.floatPtrValue = const_cast<Matrix&> (values[0]).m;
+    }
+
+    _count = count;
+    _type = MaterialParameter::MATRIX;
+}
+
+Texture::Sampler* MaterialParameter::setSampler(const char* texturePath, bool generateMipmaps)
+{
+    return setValue(texturePath, generateMipmaps);
+}
+
+void MaterialParameter::setSampler(const Texture::Sampler* value)
+{
+    setValue(value);
+}
+
+void MaterialParameter::setSamplerArray(const Texture::Sampler** values, unsigned int count, bool copy)
+{
+    GP_ASSERT(values);
+    clearValue();
+
+    if (copy)
+    {
+        _value.samplerArrayValue = new const Texture::Sampler*[count];
+        memcpy(_value.samplerArrayValue, values, sizeof(Texture::Sampler*) * count);
+        _dynamic = true;
+    }
+    else
+    {
+        _value.samplerArrayValue = values;
+    }
+
+    for (unsigned int i = 0; i < count; ++i)
+    {
+        const_cast<Texture::Sampler*>(_value.samplerArrayValue[i])->addRef();
+    }
+
+    _count = count;
+    _type = MaterialParameter::SAMPLER_ARRAY;
 }
 
 void MaterialParameter::bind(Effect* effect)

+ 125 - 0
gameplay/src/MaterialParameter.h

@@ -142,6 +142,131 @@ public:
      */
     Texture::Sampler* setValue(const char* texturePath, bool generateMipmaps);
 
+    /**
+     * Stores a float value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setFloat(float value);
+
+    /**
+     * Stores an array of float values in this parameter.
+     *
+     * @param values The array of values.
+     * @param count The number of values in the array.
+     * @param copy True to make a copy of the array in the material parameter, or false
+     *      to point to the passed in array/pointer (which must be valid for the lifetime
+     *      of the MaterialParameter).
+     */
+    void setFloatArray(const float* values, unsigned int count, bool copy = false);
+
+    /**
+     * Stores an integer value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setInt(int value);
+
+    /**
+     * Stores an array of integer values in this parameter.
+     */
+    void setIntArray(const int* values, unsigned int count, bool copy = false);
+
+    /**
+     * Stores a Vector2 value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setVector2(const Vector2& value);
+
+    /**
+     * Stores an array of Vector2 values in this parameter.
+     *
+     * @param values The array of values.
+     * @param count The number of values in the array.
+     * @param copy True to make a copy of the array in the material parameter, or false
+     *      to point to the passed in array/pointer (which must be valid for the lifetime
+     *      of the MaterialParameter).
+     */
+    void setVector2Array(const Vector2* values, unsigned int count, bool copy = false);
+
+    /**
+     * Stores a Vector3 value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setVector3(const Vector3& value);
+
+    /**
+     * Stores an array of Vector3 values in this parameter.
+     */
+    void setVector3Array(const Vector3* values, unsigned int count, bool copy = false);
+
+    /**
+     * Stores a Vector4 value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setVector4(const Vector4& value);
+
+    /**
+     * Stores an array of Vector4 values in this parameter.
+     *
+     * @param values The array of values.
+     * @param count The number of values in the array.
+     * @param copy True to make a copy of the array in the material parameter, or false
+     *      to point to the passed in array/pointer (which must be valid for the lifetime
+     *      of the MaterialParameter).
+     */
+    void setVector4Array(const Vector4* values, unsigned int count, bool copy = false);
+
+    /**
+     * Stores a Matrix value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setMatrix(const Matrix& value);
+
+    /**
+     * Stores an array of Matrix values in this parameter.
+     *
+     * @param values The array of values.
+     * @param count The number of values in the array.
+     * @param copy True to make a copy of the array in the material parameter, or false
+     *      to point to the passed in array/pointer (which must be valid for the lifetime
+     *      of the MaterialParameter).
+     */
+    void setMatrixArray(const Matrix* values, unsigned int count, bool copy = false);
+
+    /**
+     * Loads a texture sampler from the specified path and sets it as the value of this parameter.
+     *
+     * @param texturePath The path to the texture to set.
+     * @param generateMipmaps True to generate a full mipmap chain for the texture, false otherwise.
+     *
+     * @return The texture sampler that was set for this material parameter.
+     */
+    Texture::Sampler* setSampler(const char* texturePath, bool generateMipmaps);
+
+    /**
+     * Stores a Sampler value in this parameter.
+     *
+     * @param value The value to set.
+     */
+    void setSampler(const Texture::Sampler* value);
+
+    /**
+     * Stores an array of Sampler values in this parameter.
+     *
+     * @param values The array of values.
+     * @param count The number of values in the array.
+     * @param copy True to make a copy of the array in the material parameter, or false
+     *      to point to the passed in array/pointer (which must be valid for the lifetime
+     *      of the MaterialParameter).
+     * @script{ignore}
+     */
+    void setSamplerArray(const Texture::Sampler** values, unsigned int count, bool copy = false);
+
     /**
      * Binds the return value of a class method to this material parameter.
      *

+ 10 - 7
gameplay/src/Model.cpp

@@ -54,17 +54,20 @@ unsigned int Model::getMeshPartCount() const
 
 Material* Model::getMaterial(int partIndex)
 {
-    GP_ASSERT(partIndex == -1 || (partIndex >= 0 && partIndex < (int)getMeshPartCount()));
+    GP_ASSERT(partIndex == -1 || partIndex >= 0);
 
     Material* m = NULL;
 
-    if (partIndex >= 0 && partIndex < (int)_partCount)
+    if (partIndex < 0)
+        return _material;
+
+    if (partIndex >= (int)_partCount)
+        return NULL;
+
+    // Look up explicitly specified part material.
+    if (_partMaterials)
     {
-        // Look up explicitly specified part material.
-        if (_partMaterials)
-        {
-            m = _partMaterials[partIndex];
-        }
+        m = _partMaterials[partIndex];
     }
 
     if (m == NULL)

+ 23 - 15
gameplay/src/Node.cpp

@@ -402,6 +402,11 @@ Node* Node::getRootNode() const
     return n;
 }
 
+bool Node::isStatic() const
+{
+    return (_collisionObject && _collisionObject->isStatic());
+}
+
 const Matrix& Node::getWorldMatrix() const
 {
     if (_dirtyBits & NODE_DIRTY_WORLD)
@@ -410,23 +415,26 @@ const Matrix& Node::getWorldMatrix() const
         // parent calls our getWorldMatrix() method as a result of the following calculations.
         _dirtyBits &= ~NODE_DIRTY_WORLD;
 
-        // If we have a parent, multiply our parent world transform by our local
-        // transform to obtain our final resolved world transform.
-        Node* parent = getParent();
-        if (parent && (!_collisionObject || _collisionObject->isKinematic()))
-        {
-            Matrix::multiply(parent->getWorldMatrix(), getMatrix(), &_world);
-        }
-        else
+        if (!isStatic())
         {
-            _world = getMatrix();
-        }
+            // If we have a parent, multiply our parent world transform by our local
+            // transform to obtain our final resolved world transform.
+            Node* parent = getParent();
+            if (parent && (!_collisionObject || _collisionObject->isKinematic()))
+            {
+                Matrix::multiply(parent->getWorldMatrix(), getMatrix(), &_world);
+            }
+            else
+            {
+                _world = getMatrix();
+            }
 
-        // Our world matrix was just updated, so call getWorldMatrix() on all child nodes
-        // to force their resolved world matrices to be updated.
-        for (Node* child = getFirstChild(); child != NULL; child = child->getNextSibling())
-        {
-            child->getWorldMatrix();
+            // Our world matrix was just updated, so call getWorldMatrix() on all child nodes
+            // to force their resolved world matrices to be updated.
+            for (Node* child = getFirstChild(); child != NULL; child = child->getNextSibling())
+            {
+                child->getWorldMatrix();
+            }
         }
     }
 

+ 11 - 0
gameplay/src/Node.h

@@ -230,6 +230,17 @@ public:
      * Gets the top level node in this node's parent hierarchy.
      */
     Node* getRootNode() const;
+    
+    /**
+     * Returns whether the transformation of this node is static.
+     *
+     * Nodes that have static rigid bodies attached to them are considered static.
+     *
+     * @return True if the transformation of this Node is static, false otherwise.
+     *
+     * @see Transform::isStatic()
+     */
+    bool isStatic() const;
 
     /**
      * Gets the world matrix corresponding to this node.

+ 13 - 0
gameplay/src/PhysicsCollisionObject.cpp

@@ -85,6 +85,19 @@ bool PhysicsCollisionObject::isKinematic() const
     }
 }
 
+bool PhysicsCollisionObject::isStatic() const
+{
+    switch (getType())
+    {
+    case GHOST_OBJECT:
+    case CHARACTER:
+        return false;
+    default:
+        GP_ASSERT(getCollisionObject());
+        return getCollisionObject()->isStaticObject();
+    }
+}
+
 bool PhysicsCollisionObject::isDynamic() const
 {
     GP_ASSERT(getCollisionObject());

+ 10 - 0
gameplay/src/PhysicsCollisionObject.h

@@ -178,6 +178,16 @@ public:
      */
     bool isKinematic() const;
 
+    /**
+     * Returns whether this collision object is static.
+     *
+     * A static collision object is not simulated by the physics system and cannot be
+     * transformed once created.
+     *
+     * @return true if the collision object is static.
+     */
+    bool isStatic() const;
+
     /**
      * Returns whether this collision object is dynamic.
      *

+ 2 - 2
gameplay/src/PhysicsVehicleWheel.cpp

@@ -7,7 +7,7 @@ namespace gameplay
 {
 
 PhysicsVehicleWheel::PhysicsVehicleWheel(Node* node, const PhysicsCollisionShape::Definition& shape, const PhysicsRigidBody::Parameters& parameters)
-    : PhysicsCollisionObject(node)
+    : PhysicsCollisionObject(node), _rigidBody(NULL), _host(NULL), _indexInHost(0)
 {
     // Note that the constructor for PhysicsRigidBody calls addCollisionObject and so
     // that is where the rigid body gets added to the dynamics world.
@@ -17,7 +17,7 @@ PhysicsVehicleWheel::PhysicsVehicleWheel(Node* node, const PhysicsCollisionShape
 }
 
 PhysicsVehicleWheel::PhysicsVehicleWheel(Node* node, PhysicsRigidBody* rigidBody)
-    : PhysicsCollisionObject(node)
+    : PhysicsCollisionObject(node), _rigidBody(NULL), _host(NULL), _indexInHost(0)
 {
     _rigidBody = rigidBody;
 

+ 5 - 1
gameplay/src/Platform.h

@@ -201,7 +201,11 @@ private:
     static bool isCursorVisible();
 
     /**
-     * Gets the platform accelerometer values.
+     * Gets the platform accelerometer values for use as an indication of device
+     * orientation. Despite its name, implementations are at liberty to combine
+     * accelerometer data with data from other sensors as well, such as the gyros.
+     * This method is best used to obtain an indication of device orientation; it
+     * does not necessarily distinguish between acceleration and rotation rate.
      * 
      * @param pitch The accelerometer pitch.
      * @param roll The accelerometer roll.

+ 1 - 1
gameplay/src/PlatformAndroid.cpp

@@ -810,7 +810,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
                             gameplay::Game::getInstance()->getAbsoluteTime() - __pointer1.time < GESTURE_SWIPE_DURATION_MAX && 
                             (abs(deltaX) > GESTURE_SWIPE_DISTANCE_MIN || abs(deltaY) > GESTURE_SWIPE_DISTANCE_MIN) )
                         {
-                            int direction;
+                            int direction = 0;
                             if (deltaX > 0)
                                 direction |= gameplay::Gesture::SWIPE_DIRECTION_RIGHT;
                             else if (deltaX < 0)

+ 1 - 0
gameplay/src/SceneLoader.cpp

@@ -226,6 +226,7 @@ void SceneLoader::applyNodeProperty(SceneNode& sceneNode, Node* node, const Prop
             GP_ERROR("The referenced node data at url '%s' failed to load.", snp._url.c_str());
             return;
         }
+        p->rewind();
 
         // If the URL didn't specify a particular namespace within the file, pick the first one.
         p = (strlen(p->getNamespace()) > 0) ? p : p->getNextNamespace();

+ 5 - 2
gameplay/src/ScriptController.cpp

@@ -99,7 +99,7 @@ static bool getNestedVariable(lua_State* lua, const char* name)
     {
         start = end;
         end = strchr(start, '.');
-        if (end == '\0' || end == NULL)
+        if (end == NULL || *end == '\0')
         {
             // push the last variable
             lua_pushstring(lua, start);
@@ -692,7 +692,10 @@ static const char* lua_dofile_function =
     "    end\n"
     "end\n";
 
-static void appendLuaPath(lua_State* state, const char* path)
+/**
+ * @script{ignore}
+ */
+void appendLuaPath(lua_State* state, const char* path)
 {
     lua_getglobal(state, "package");
 

+ 156 - 22
gameplay/src/Transform.cpp

@@ -92,36 +92,39 @@ const Matrix& Transform::getMatrix() const
 {
     if (_matrixDirtyBits)
     {
-        bool hasTranslation = !_translation.isZero();
-        bool hasScale = !_scale.isOne();
-        bool hasRotation = !_rotation.isIdentity();
-
-        // Compose the matrix in TRS order since we use column-major matrices with column vectors and
-        // multiply M*v (as opposed to XNA and DirectX that use row-major matrices with row vectors and multiply v*M).
-        if (hasTranslation || (_matrixDirtyBits & DIRTY_TRANSLATION) == DIRTY_TRANSLATION)
+        if (!isStatic())
         {
-            Matrix::createTranslation(_translation, &_matrix);
-            if (hasRotation || (_matrixDirtyBits & DIRTY_ROTATION) == DIRTY_ROTATION)
+            bool hasTranslation = !_translation.isZero();
+            bool hasScale = !_scale.isOne();
+            bool hasRotation = !_rotation.isIdentity();
+
+            // Compose the matrix in TRS order since we use column-major matrices with column vectors and
+            // multiply M*v (as opposed to XNA and DirectX that use row-major matrices with row vectors and multiply v*M).
+            if (hasTranslation || (_matrixDirtyBits & DIRTY_TRANSLATION) == DIRTY_TRANSLATION)
             {
-                _matrix.rotate(_rotation);
+                Matrix::createTranslation(_translation, &_matrix);
+                if (hasRotation || (_matrixDirtyBits & DIRTY_ROTATION) == DIRTY_ROTATION)
+                {
+                    _matrix.rotate(_rotation);
+                }
+                if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
+                {
+                    _matrix.scale(_scale);
+                }
             }
-            if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
+            else if (hasRotation || (_matrixDirtyBits & DIRTY_ROTATION) == DIRTY_ROTATION)
             {
-                _matrix.scale(_scale);
+                Matrix::createRotation(_rotation, &_matrix);
+                if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
+                {
+                    _matrix.scale(_scale);
+                }
             }
-        }
-        else if (hasRotation || (_matrixDirtyBits & DIRTY_ROTATION) == DIRTY_ROTATION)
-        {
-            Matrix::createRotation(_rotation, &_matrix);
-            if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
+            else if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
             {
-                _matrix.scale(_scale);
+                Matrix::createScale(_scale, &_matrix);
             }
         }
-        else if (hasScale || (_matrixDirtyBits & DIRTY_SCALE) == DIRTY_SCALE)
-        {
-            Matrix::createScale(_scale, &_matrix);
-        }
 
         _matrixDirtyBits &= ~DIRTY_TRANSLATION & ~DIRTY_ROTATION & ~DIRTY_SCALE;
     }
@@ -278,6 +281,9 @@ void Transform::getRightVector(Vector3* dst) const
 
 void Transform::rotate(float qx, float qy, float qz, float qw)
 {
+    if (isStatic())
+        return;
+
     Quaternion q(qx, qy, qz, qw);
     _rotation.multiply(q);
     dirty(DIRTY_ROTATION);
@@ -285,12 +291,18 @@ void Transform::rotate(float qx, float qy, float qz, float qw)
 
 void Transform::rotate(const Quaternion& rotation)
 {
+    if (isStatic())
+        return;
+
     _rotation.multiply(rotation);
     dirty(DIRTY_ROTATION);
 }
 
 void Transform::rotate(const Vector3& axis, float angle)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromAxisAngle(axis, angle, &rotationQuat);
     _rotation.multiply(rotationQuat);
@@ -300,6 +312,9 @@ void Transform::rotate(const Vector3& axis, float angle)
 
 void Transform::rotate(const Matrix& rotation)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromRotationMatrix(rotation, &rotationQuat);
     _rotation.multiply(rotationQuat);
@@ -308,6 +323,9 @@ void Transform::rotate(const Matrix& rotation)
 
 void Transform::rotateX(float angle)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromAxisAngle(Vector3::unitX(), angle, &rotationQuat);
     _rotation.multiply(rotationQuat);
@@ -316,6 +334,9 @@ void Transform::rotateX(float angle)
 
 void Transform::rotateY(float angle)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromAxisAngle(Vector3::unitY(), angle, &rotationQuat);
     _rotation.multiply(rotationQuat);
@@ -324,6 +345,9 @@ void Transform::rotateY(float angle)
 
 void Transform::rotateZ(float angle)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromAxisAngle(Vector3::unitZ(), angle, &rotationQuat);
     _rotation.multiply(rotationQuat);
@@ -332,12 +356,18 @@ void Transform::rotateZ(float angle)
 
 void Transform::scale(float scale)
 {
+    if (isStatic())
+        return;
+
     _scale.scale(scale);
     dirty(DIRTY_SCALE);
 }
 
 void Transform::scale(float sx, float sy, float sz)
 {
+    if (isStatic())
+        return;
+
     _scale.x *= sx;
     _scale.y *= sy;
     _scale.z *= sz;
@@ -346,6 +376,9 @@ void Transform::scale(float sx, float sy, float sz)
 
 void Transform::scale(const Vector3& scale)
 {
+    if (isStatic())
+        return;
+
     _scale.x *= scale.x;
     _scale.y *= scale.y;
     _scale.z *= scale.z;
@@ -354,24 +387,36 @@ void Transform::scale(const Vector3& scale)
 
 void Transform::scaleX(float sx)
 {
+    if (isStatic())
+        return;
+
     _scale.x *= sx;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::scaleY(float sy)
 {
+    if (isStatic())
+        return;
+
     _scale.y *= sy;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::scaleZ(float sz)
 {
+    if (isStatic())
+        return;
+
     _scale.z *= sz;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::set(const Vector3& scale, const Quaternion& rotation, const Vector3& translation)
 {
+    if (isStatic())
+        return;
+
     _scale.set(scale);
     _rotation.set(rotation);
     _translation.set(translation);
@@ -380,6 +425,9 @@ void Transform::set(const Vector3& scale, const Quaternion& rotation, const Vect
 
 void Transform::set(const Vector3& scale, const Matrix& rotation, const Vector3& translation)
 {
+    if (isStatic())
+        return;
+
     _scale.set(scale);
     Quaternion rotationQuat;
     Quaternion::createFromRotationMatrix(rotation, &rotationQuat);
@@ -390,6 +438,9 @@ void Transform::set(const Vector3& scale, const Matrix& rotation, const Vector3&
 
 void Transform::set(const Vector3& scale, const Vector3& axis, float angle, const Vector3& translation)
 {
+    if (isStatic())
+        return;
+
     _scale.set(scale);
     _rotation.set(axis, angle);
     _translation.set(translation);
@@ -398,6 +449,9 @@ void Transform::set(const Vector3& scale, const Vector3& axis, float angle, cons
 
 void Transform::set(const Transform& transform)
 {
+    if (isStatic())
+        return;
+
     _scale.set(transform._scale);
     _rotation.set(transform._rotation);
     _translation.set(transform._translation);
@@ -406,6 +460,9 @@ void Transform::set(const Transform& transform)
 
 void Transform::setIdentity()
 {
+    if (isStatic())
+        return;
+
     _scale.set(1.0f, 1.0f, 1.0f);
     _rotation.setIdentity();
     _translation.set(0.0f, 0.0f, 0.0f);
@@ -414,12 +471,18 @@ void Transform::setIdentity()
 
 void Transform::setScale(float scale)
 {
+    if (isStatic())
+        return;
+
     _scale.set(scale, scale, scale);
     dirty(DIRTY_SCALE);
 }
 
 void Transform::setScale(float sx, float sy, float sz)
 {
+    if (isStatic())
+        return;
+
     _scale.set(sx, sy, sz);
     dirty(DIRTY_SCALE);
 }
@@ -432,36 +495,54 @@ void Transform::setScale(const Vector3& scale)
 
 void Transform::setScaleX(float sx)
 {
+    if (isStatic())
+        return;
+
     _scale.x = sx;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::setScaleY(float sy)
 {
+    if (isStatic())
+        return;
+
     _scale.y = sy;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::setScaleZ(float sz)
 {
+    if (isStatic())
+        return;
+
     _scale.z = sz;
     dirty(DIRTY_SCALE);
 }
 
 void Transform::setRotation(const Quaternion& rotation)
 {
+    if (isStatic())
+        return;
+
     _rotation.set(rotation);
     dirty(DIRTY_ROTATION);
 }
 
 void Transform::setRotation(float qx, float qy, float qz, float qw)
 {
+    if (isStatic())
+        return;
+
     _rotation.set(qx, qy, qz, qw);
     dirty(DIRTY_ROTATION);
 }
 
 void Transform::setRotation(const Matrix& rotation)
 {
+    if (isStatic())
+        return;
+
     Quaternion rotationQuat;
     Quaternion::createFromRotationMatrix(rotation, &rotationQuat);
     _rotation.set(rotationQuat);
@@ -470,42 +551,63 @@ void Transform::setRotation(const Matrix& rotation)
 
 void Transform::setRotation(const Vector3& axis, float angle)
 {
+    if (isStatic())
+        return;
+
     _rotation.set(axis, angle);
     dirty(DIRTY_ROTATION);
 }
 
 void Transform::setTranslation(const Vector3& translation)
 {
+    if (isStatic())
+        return;
+
     _translation.set(translation);
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::setTranslation(float tx, float ty, float tz)
 {
+    if (isStatic())
+        return;
+
     _translation.set(tx, ty, tz);
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::setTranslationX(float tx)
 {
+    if (isStatic())
+        return;
+
     _translation.x = tx;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::setTranslationY(float ty)
 {
+    if (isStatic())
+        return;
+
     _translation.y = ty;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::setTranslationZ(float tz)
 {
+    if (isStatic())
+        return;
+
     _translation.z = tz;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::translate(float tx, float ty, float tz)
 {
+    if (isStatic())
+        return;
+
     _translation.x += tx;
     _translation.y += ty;
     _translation.z += tz;
@@ -514,6 +616,9 @@ void Transform::translate(float tx, float ty, float tz)
 
 void Transform::translate(const Vector3& translation)
 {
+    if (isStatic())
+        return;
+
     _translation.x += translation.x;
     _translation.y += translation.y;
     _translation.z += translation.z;
@@ -522,24 +627,36 @@ void Transform::translate(const Vector3& translation)
 
 void Transform::translateX(float tx)
 {
+    if (isStatic())
+        return;
+
     _translation.x += tx;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::translateY(float ty)
 {
+    if (isStatic())
+        return;
+
     _translation.y += ty;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::translateZ(float tz)
 {
+    if (isStatic())
+        return;
+
     _translation.z += tz;
     dirty(DIRTY_TRANSLATION);
 }
 
 void Transform::translateLeft(float amount)
 {
+    if (isStatic())
+        return;
+
     // Force the current transform matrix to be updated.
     getMatrix();
 
@@ -553,6 +670,9 @@ void Transform::translateLeft(float amount)
 
 void Transform::translateUp(float amount)
 {
+    if (isStatic())
+        return;
+
     // Force the current transform matrix to be updated.
     getMatrix();
 
@@ -566,6 +686,9 @@ void Transform::translateUp(float amount)
 
 void Transform::translateForward(float amount)
 {
+    if (isStatic())
+        return;
+
     // Force the current transform matrix to be updated.
     getMatrix();
 
@@ -579,6 +702,9 @@ void Transform::translateForward(float amount)
 
 void Transform::translateSmooth(const Vector3& target, float elapsedTime, float responseTime)
 {
+    if (isStatic())
+        return;
+
     if (elapsedTime > 0)
     {
         _translation += (target - _translation) * (elapsedTime / (elapsedTime + responseTime));
@@ -616,6 +742,11 @@ void Transform::transformVector(float x, float y, float z, float w, Vector3* dst
     _matrix.transformVector(x, y, z, w, dst);
 }
 
+bool Transform::isStatic() const
+{
+    return false;
+}
+
 unsigned int Transform::getAnimationPropertyComponentCount(int propertyId) const
 {
     switch (propertyId)
@@ -876,6 +1007,9 @@ void Transform::cloneInto(Transform* transform, NodeCloneContext &context) const
 
 void Transform::applyAnimationValueRotation(AnimationValue* value, unsigned int index, float blendWeight)
 {
+    if (isStatic())
+        return;
+
     GP_ASSERT(value);
     Quaternion::slerp(_rotation.x, _rotation.y, _rotation.z, _rotation.w, value->getFloat(index), value->getFloat(index + 1), value->getFloat(index + 2), value->getFloat(index + 3), blendWeight, 
         &_rotation.x, &_rotation.y, &_rotation.z, &_rotation.w);

+ 10 - 0
gameplay/src/Transform.h

@@ -747,6 +747,16 @@ public:
      */
     void transformVector(float x, float y, float z, float w, Vector3* dst);
 
+    /**
+     * Returns whether or not this Transform object is static.
+     *
+     * A static transform object cannot be transformed. This may be the case for special
+     * types of Transform objects, such as Nodes that have a static rigid body attached to them.
+     *
+     * @return True if this Transform is static, false otherwise.
+     */
+    virtual bool isStatic() const;
+
     /**
      * Adds a transform listener.
      *

+ 36 - 0
gameplay/src/lua/lua_Joint.cpp

@@ -104,6 +104,7 @@ void luaRegister_Joint()
         {"getWorldViewMatrix", lua_Joint_getWorldViewMatrix},
         {"getWorldViewProjectionMatrix", lua_Joint_getWorldViewProjectionMatrix},
         {"hasTag", lua_Joint_hasTag},
+        {"isStatic", lua_Joint_isStatic},
         {"release", lua_Joint_release},
         {"removeAllChildren", lua_Joint_removeAllChildren},
         {"removeChild", lua_Joint_removeChild},
@@ -3934,6 +3935,41 @@ int lua_Joint_hasTag(lua_State* state)
     return 0;
 }
 
+int lua_Joint_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joint* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joint_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_release(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Joint.h

@@ -79,6 +79,7 @@ int lua_Joint_getWorldMatrix(lua_State* state);
 int lua_Joint_getWorldViewMatrix(lua_State* state);
 int lua_Joint_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Joint_hasTag(lua_State* state);
+int lua_Joint_isStatic(lua_State* state);
 int lua_Joint_release(lua_State* state);
 int lua_Joint_removeAllChildren(lua_State* state);
 int lua_Joint_removeChild(lua_State* state);

+ 942 - 166
gameplay/src/lua/lua_MaterialParameter.cpp

@@ -31,7 +31,20 @@ void luaRegister_MaterialParameter()
         {"getSampler", lua_MaterialParameter_getSampler},
         {"release", lua_MaterialParameter_release},
         {"setAnimationPropertyValue", lua_MaterialParameter_setAnimationPropertyValue},
+        {"setFloat", lua_MaterialParameter_setFloat},
+        {"setFloatArray", lua_MaterialParameter_setFloatArray},
+        {"setInt", lua_MaterialParameter_setInt},
+        {"setIntArray", lua_MaterialParameter_setIntArray},
+        {"setMatrix", lua_MaterialParameter_setMatrix},
+        {"setMatrixArray", lua_MaterialParameter_setMatrixArray},
+        {"setSampler", lua_MaterialParameter_setSampler},
         {"setValue", lua_MaterialParameter_setValue},
+        {"setVector2", lua_MaterialParameter_setVector2},
+        {"setVector2Array", lua_MaterialParameter_setVector2Array},
+        {"setVector3", lua_MaterialParameter_setVector3},
+        {"setVector3Array", lua_MaterialParameter_setVector3Array},
+        {"setVector4", lua_MaterialParameter_setVector4},
+        {"setVector4Array", lua_MaterialParameter_setVector4Array},
         {NULL, NULL}
     };
     const luaL_Reg lua_statics[] = 
@@ -969,6 +982,409 @@ int lua_MaterialParameter_setAnimationPropertyValue(lua_State* state)
     return 0;
 }
 
+int lua_MaterialParameter_setFloat(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setFloat(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setFloat - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setFloatArray(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                lua_type(state, 3) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setFloatArray(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setFloatArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setFloatArray(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setFloatArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setInt(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                int param1 = (int)luaL_checkint(state, 2);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setInt(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setInt - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setIntArray(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                lua_type(state, 3) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setIntArray(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setIntArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setIntArray(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setIntArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setMatrix(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
+                    lua_error(state);
+                }
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setMatrix(*param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setMatrix - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setMatrixArray(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
+                    lua_error(state);
+                }
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setMatrixArray(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setMatrixArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
+                    lua_error(state);
+                }
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setMatrixArray(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setMatrixArray - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setSampler(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Texture::Sampler> param1 = gameplay::ScriptUtil::getObjectPointer<Texture::Sampler>(2, "TextureSampler", false, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setSampler(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            lua_pushstring(state, "lua_MaterialParameter_setSampler - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    const char* param1 = gameplay::ScriptUtil::getString(2, false);
+
+                    // Get parameter 2 off the stack.
+                    bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                    MaterialParameter* instance = getInstance(state);
+                    void* returnPtr = (void*)instance->setSampler(param1, param2);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = false;
+                        luaL_getmetatable(state, "TextureSampler");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
+                }
+            } while (0);
+
+            lua_pushstring(state, "lua_MaterialParameter_setSampler - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_MaterialParameter_setValue(lua_State* state)
 {
     // Get the number of parameters.
@@ -1027,13 +1443,139 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA))
+                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA))
+                {
+                    // Get parameter 1 off the stack.
+                    gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(*param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(*param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(*param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    MaterialParameter* instance = getInstance(state);
+                    instance->setValue(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
                 {
                     // Get parameter 1 off the stack.
-                    gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
+                    if (!param1Valid)
+                        break;
 
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1);
+                    instance->setValue(*param1);
                     
                     return 0;
                 }
@@ -1042,16 +1584,16 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
+                    gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
                     if (!param1Valid)
                         break;
 
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(*param1);
+                    instance->setValue(param1);
                     
                     return 0;
                 }
@@ -1064,7 +1606,7 @@ int lua_MaterialParameter_setValue(lua_State* state)
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
+                    gameplay::ScriptUtil::LuaArray<Texture::Sampler> param1 = gameplay::ScriptUtil::getObjectPointer<Texture::Sampler>(2, "TextureSampler", false, &param1Valid);
                     if (!param1Valid)
                         break;
 
@@ -1075,19 +1617,26 @@ int lua_MaterialParameter_setValue(lua_State* state)
                 }
             } while (0);
 
+            lua_pushstring(state, "lua_MaterialParameter_setValue - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
+
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(*param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1096,16 +1645,17 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1114,16 +1664,20 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true, &param1Valid);
+                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
                     if (!param1Valid)
                         break;
 
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(*param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1132,16 +1686,20 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
+                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
                     if (!param1Valid)
                         break;
 
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1150,16 +1708,20 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
+                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
                     if (!param1Valid)
                         break;
 
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(*param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1168,7 +1730,8 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TNUMBER)
                 {
                     // Get parameter 1 off the stack.
                     bool param1Valid;
@@ -1176,8 +1739,11 @@ int lua_MaterialParameter_setValue(lua_State* state)
                     if (!param1Valid)
                         break;
 
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1);
+                    instance->setValue(param1, param2);
                     
                     return 0;
                 }
@@ -1186,18 +1752,31 @@ int lua_MaterialParameter_setValue(lua_State* state)
             do
             {
                 if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TBOOLEAN)
                 {
                     // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Texture::Sampler> param1 = gameplay::ScriptUtil::getObjectPointer<Texture::Sampler>(2, "TextureSampler", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    const char* param1 = gameplay::ScriptUtil::getString(2, false);
+
+                    // Get parameter 2 off the stack.
+                    bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
 
                     MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1);
-                    
-                    return 0;
+                    void* returnPtr = (void*)instance->setValue(param1, param2);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = false;
+                        luaL_getmetatable(state, "TextureSampler");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
                 }
             } while (0);
 
@@ -1205,172 +1784,369 @@ int lua_MaterialParameter_setValue(lua_State* state)
             lua_error(state);
             break;
         }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setVector2(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'.");
+                    lua_error(state);
+                }
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector2(*param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setVector2 - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setVector2Array(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'.");
+                    lua_error(state);
+                }
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector2Array(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setVector2Array - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'.");
+                    lua_error(state);
+                }
+
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector2Array(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setVector2Array - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setVector3(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
+                    lua_error(state);
+                }
+
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector3(*param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_MaterialParameter_setVector3 - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_MaterialParameter_setVector3Array(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
         case 3:
         {
-            do
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
+                if (!param1Valid)
                 {
-                    // Get parameter 1 off the stack.
-                    gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
-
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
-
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
+                    lua_error(state);
                 }
-            } while (0);
 
-            do
-            {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
-                {
-                    // Get parameter 1 off the stack.
-                    gameplay::ScriptUtil::LuaArray<int> param1 = gameplay::ScriptUtil::getIntPointer(2);
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector3Array(param1, param2);
 
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
-                }
-            } while (0);
+                return 0;
+            }
 
-            do
+            lua_pushstring(state, "lua_MaterialParameter_setVector3Array - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
             {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
+                if (!param1Valid)
                 {
-                    // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
+                    lua_error(state);
+                }
 
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
-                }
-            } while (0);
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
 
-            do
-            {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
-                {
-                    // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector3Array(param1, param2, param3);
 
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+                return 0;
+            }
 
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
-                }
-            } while (0);
+            lua_pushstring(state, "lua_MaterialParameter_setVector3Array - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
 
-            do
+int lua_MaterialParameter_setVector4(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
             {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true, &param1Valid);
+                if (!param1Valid)
                 {
-                    // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector4'.");
+                    lua_error(state);
+                }
 
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector4(*param1);
+                
+                return 0;
+            }
 
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
-                }
-            } while (0);
+            lua_pushstring(state, "lua_MaterialParameter_setVector4 - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
 
-            do
+int lua_MaterialParameter_setVector4Array(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                    lua_type(state, 3) == LUA_TNUMBER)
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
+                if (!param1Valid)
                 {
-                    // Get parameter 1 off the stack.
-                    bool param1Valid;
-                    gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
-                    if (!param1Valid)
-                        break;
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector4'.");
+                    lua_error(state);
+                }
 
-                    // Get parameter 2 off the stack.
-                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
-                    MaterialParameter* instance = getInstance(state);
-                    instance->setValue(param1, param2);
-                    
-                    return 0;
-                }
-            } while (0);
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector4Array(param1, param2);
+                
+                return 0;
+            }
 
-            do
+            lua_pushstring(state, "lua_MaterialParameter_setVector4Array - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TBOOLEAN)
             {
-                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                    lua_type(state, 3) == LUA_TBOOLEAN)
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
+                if (!param1Valid)
                 {
-                    // Get parameter 1 off the stack.
-                    const char* param1 = gameplay::ScriptUtil::getString(2, false);
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector4'.");
+                    lua_error(state);
+                }
 
-                    // Get parameter 2 off the stack.
-                    bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+                // Get parameter 2 off the stack.
+                unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
 
-                    MaterialParameter* instance = getInstance(state);
-                    void* returnPtr = (void*)instance->setValue(param1, param2);
-                    if (returnPtr)
-                    {
-                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                        object->instance = returnPtr;
-                        object->owns = false;
-                        luaL_getmetatable(state, "TextureSampler");
-                        lua_setmetatable(state, -2);
-                    }
-                    else
-                    {
-                        lua_pushnil(state);
-                    }
+                // Get parameter 3 off the stack.
+                bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
 
-                    return 1;
-                }
-            } while (0);
+                MaterialParameter* instance = getInstance(state);
+                instance->setVector4Array(param1, param2, param3);
+                
+                return 0;
+            }
 
-            lua_pushstring(state, "lua_MaterialParameter_setValue - Failed to match the given parameters to a valid function signature.");
+            lua_pushstring(state, "lua_MaterialParameter_setVector4Array - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
             lua_error(state);
             break;
         }

+ 13 - 0
gameplay/src/lua/lua_MaterialParameter.h

@@ -20,7 +20,20 @@ int lua_MaterialParameter_getRefCount(lua_State* state);
 int lua_MaterialParameter_getSampler(lua_State* state);
 int lua_MaterialParameter_release(lua_State* state);
 int lua_MaterialParameter_setAnimationPropertyValue(lua_State* state);
+int lua_MaterialParameter_setFloat(lua_State* state);
+int lua_MaterialParameter_setFloatArray(lua_State* state);
+int lua_MaterialParameter_setInt(lua_State* state);
+int lua_MaterialParameter_setIntArray(lua_State* state);
+int lua_MaterialParameter_setMatrix(lua_State* state);
+int lua_MaterialParameter_setMatrixArray(lua_State* state);
+int lua_MaterialParameter_setSampler(lua_State* state);
 int lua_MaterialParameter_setValue(lua_State* state);
+int lua_MaterialParameter_setVector2(lua_State* state);
+int lua_MaterialParameter_setVector2Array(lua_State* state);
+int lua_MaterialParameter_setVector3(lua_State* state);
+int lua_MaterialParameter_setVector3Array(lua_State* state);
+int lua_MaterialParameter_setVector4(lua_State* state);
+int lua_MaterialParameter_setVector4Array(lua_State* state);
 int lua_MaterialParameter_static_ANIMATE_UNIFORM(lua_State* state);
 
 void luaRegister_MaterialParameter();

+ 36 - 0
gameplay/src/lua/lua_Node.cpp

@@ -102,6 +102,7 @@ void luaRegister_Node()
         {"getWorldViewMatrix", lua_Node_getWorldViewMatrix},
         {"getWorldViewProjectionMatrix", lua_Node_getWorldViewProjectionMatrix},
         {"hasTag", lua_Node_hasTag},
+        {"isStatic", lua_Node_isStatic},
         {"release", lua_Node_release},
         {"removeAllChildren", lua_Node_removeAllChildren},
         {"removeChild", lua_Node_removeChild},
@@ -3889,6 +3890,41 @@ int lua_Node_hasTag(lua_State* state)
     return 0;
 }
 
+int lua_Node_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Node* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Node_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_release(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Node.h

@@ -78,6 +78,7 @@ int lua_Node_getWorldMatrix(lua_State* state);
 int lua_Node_getWorldViewMatrix(lua_State* state);
 int lua_Node_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Node_hasTag(lua_State* state);
+int lua_Node_isStatic(lua_State* state);
 int lua_Node_release(lua_State* state);
 int lua_Node_removeAllChildren(lua_State* state);
 int lua_Node_removeChild(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_PhysicsCharacter.cpp

@@ -47,6 +47,7 @@ void luaRegister_PhysicsCharacter()
         {"isEnabled", lua_PhysicsCharacter_isEnabled},
         {"isKinematic", lua_PhysicsCharacter_isKinematic},
         {"isPhysicsEnabled", lua_PhysicsCharacter_isPhysicsEnabled},
+        {"isStatic", lua_PhysicsCharacter_isStatic},
         {"jump", lua_PhysicsCharacter_jump},
         {"removeCollisionListener", lua_PhysicsCharacter_removeCollisionListener},
         {"rotate", lua_PhysicsCharacter_rotate},
@@ -861,6 +862,41 @@ int lua_PhysicsCharacter_isPhysicsEnabled(lua_State* state)
     return 0;
 }
 
+int lua_PhysicsCharacter_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                PhysicsCharacter* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_PhysicsCharacter_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_PhysicsCharacter_jump(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_PhysicsCharacter.h

@@ -23,6 +23,7 @@ int lua_PhysicsCharacter_isDynamic(lua_State* state);
 int lua_PhysicsCharacter_isEnabled(lua_State* state);
 int lua_PhysicsCharacter_isKinematic(lua_State* state);
 int lua_PhysicsCharacter_isPhysicsEnabled(lua_State* state);
+int lua_PhysicsCharacter_isStatic(lua_State* state);
 int lua_PhysicsCharacter_jump(lua_State* state);
 int lua_PhysicsCharacter_removeCollisionListener(lua_State* state);
 int lua_PhysicsCharacter_rotate(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_PhysicsCollisionObject.cpp

@@ -37,6 +37,7 @@ void luaRegister_PhysicsCollisionObject()
         {"isDynamic", lua_PhysicsCollisionObject_isDynamic},
         {"isEnabled", lua_PhysicsCollisionObject_isEnabled},
         {"isKinematic", lua_PhysicsCollisionObject_isKinematic},
+        {"isStatic", lua_PhysicsCollisionObject_isStatic},
         {"removeCollisionListener", lua_PhysicsCollisionObject_removeCollisionListener},
         {"setEnabled", lua_PhysicsCollisionObject_setEnabled},
         {NULL, NULL}
@@ -730,6 +731,41 @@ int lua_PhysicsCollisionObject_isKinematic(lua_State* state)
     return 0;
 }
 
+int lua_PhysicsCollisionObject_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                PhysicsCollisionObject* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_PhysicsCollisionObject_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_PhysicsCollisionObject_removeCollisionListener(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_PhysicsCollisionObject.h

@@ -20,6 +20,7 @@ int lua_PhysicsCollisionObject_getType(lua_State* state);
 int lua_PhysicsCollisionObject_isDynamic(lua_State* state);
 int lua_PhysicsCollisionObject_isEnabled(lua_State* state);
 int lua_PhysicsCollisionObject_isKinematic(lua_State* state);
+int lua_PhysicsCollisionObject_isStatic(lua_State* state);
 int lua_PhysicsCollisionObject_removeCollisionListener(lua_State* state);
 int lua_PhysicsCollisionObject_setEnabled(lua_State* state);
 

+ 36 - 0
gameplay/src/lua/lua_PhysicsGhostObject.cpp

@@ -42,6 +42,7 @@ void luaRegister_PhysicsGhostObject()
         {"isDynamic", lua_PhysicsGhostObject_isDynamic},
         {"isEnabled", lua_PhysicsGhostObject_isEnabled},
         {"isKinematic", lua_PhysicsGhostObject_isKinematic},
+        {"isStatic", lua_PhysicsGhostObject_isStatic},
         {"removeCollisionListener", lua_PhysicsGhostObject_removeCollisionListener},
         {"setEnabled", lua_PhysicsGhostObject_setEnabled},
         {"transformChanged", lua_PhysicsGhostObject_transformChanged},
@@ -698,6 +699,41 @@ int lua_PhysicsGhostObject_isKinematic(lua_State* state)
     return 0;
 }
 
+int lua_PhysicsGhostObject_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                PhysicsGhostObject* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_PhysicsGhostObject_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_PhysicsGhostObject_removeCollisionListener(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_PhysicsGhostObject.h

@@ -19,6 +19,7 @@ int lua_PhysicsGhostObject_getType(lua_State* state);
 int lua_PhysicsGhostObject_isDynamic(lua_State* state);
 int lua_PhysicsGhostObject_isEnabled(lua_State* state);
 int lua_PhysicsGhostObject_isKinematic(lua_State* state);
+int lua_PhysicsGhostObject_isStatic(lua_State* state);
 int lua_PhysicsGhostObject_removeCollisionListener(lua_State* state);
 int lua_PhysicsGhostObject_setEnabled(lua_State* state);
 int lua_PhysicsGhostObject_transformChanged(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_PhysicsVehicle.cpp

@@ -56,6 +56,7 @@ void luaRegister_PhysicsVehicle()
         {"isDynamic", lua_PhysicsVehicle_isDynamic},
         {"isEnabled", lua_PhysicsVehicle_isEnabled},
         {"isKinematic", lua_PhysicsVehicle_isKinematic},
+        {"isStatic", lua_PhysicsVehicle_isStatic},
         {"removeCollisionListener", lua_PhysicsVehicle_removeCollisionListener},
         {"reset", lua_PhysicsVehicle_reset},
         {"setBoost", lua_PhysicsVehicle_setBoost},
@@ -1380,6 +1381,41 @@ int lua_PhysicsVehicle_isKinematic(lua_State* state)
     return 0;
 }
 
+int lua_PhysicsVehicle_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                PhysicsVehicle* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_PhysicsVehicle_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_PhysicsVehicle_removeCollisionListener(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_PhysicsVehicle.h

@@ -37,6 +37,7 @@ int lua_PhysicsVehicle_getWheel(lua_State* state);
 int lua_PhysicsVehicle_isDynamic(lua_State* state);
 int lua_PhysicsVehicle_isEnabled(lua_State* state);
 int lua_PhysicsVehicle_isKinematic(lua_State* state);
+int lua_PhysicsVehicle_isStatic(lua_State* state);
 int lua_PhysicsVehicle_removeCollisionListener(lua_State* state);
 int lua_PhysicsVehicle_reset(lua_State* state);
 int lua_PhysicsVehicle_setBoost(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_PhysicsVehicleWheel.cpp

@@ -49,6 +49,7 @@ void luaRegister_PhysicsVehicleWheel()
         {"isDynamic", lua_PhysicsVehicleWheel_isDynamic},
         {"isEnabled", lua_PhysicsVehicleWheel_isEnabled},
         {"isKinematic", lua_PhysicsVehicleWheel_isKinematic},
+        {"isStatic", lua_PhysicsVehicleWheel_isStatic},
         {"isSteerable", lua_PhysicsVehicleWheel_isSteerable},
         {"removeCollisionListener", lua_PhysicsVehicleWheel_removeCollisionListener},
         {"setEnabled", lua_PhysicsVehicleWheel_setEnabled},
@@ -1160,6 +1161,41 @@ int lua_PhysicsVehicleWheel_isKinematic(lua_State* state)
     return 0;
 }
 
+int lua_PhysicsVehicleWheel_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                PhysicsVehicleWheel* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_PhysicsVehicleWheel_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_PhysicsVehicleWheel_isSteerable(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_PhysicsVehicleWheel.h

@@ -31,6 +31,7 @@ int lua_PhysicsVehicleWheel_getWheelRadius(lua_State* state);
 int lua_PhysicsVehicleWheel_isDynamic(lua_State* state);
 int lua_PhysicsVehicleWheel_isEnabled(lua_State* state);
 int lua_PhysicsVehicleWheel_isKinematic(lua_State* state);
+int lua_PhysicsVehicleWheel_isStatic(lua_State* state);
 int lua_PhysicsVehicleWheel_isSteerable(lua_State* state);
 int lua_PhysicsVehicleWheel_removeCollisionListener(lua_State* state);
 int lua_PhysicsVehicleWheel_setEnabled(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_Transform.cpp

@@ -43,6 +43,7 @@ void luaRegister_Transform()
         {"getTranslationY", lua_Transform_getTranslationY},
         {"getTranslationZ", lua_Transform_getTranslationZ},
         {"getUpVector", lua_Transform_getUpVector},
+        {"isStatic", lua_Transform_isStatic},
         {"removeListener", lua_Transform_removeListener},
         {"removeScriptCallback", lua_Transform_removeScriptCallback},
         {"rotate", lua_Transform_rotate},
@@ -1899,6 +1900,41 @@ int lua_Transform_getUpVector(lua_State* state)
     return 0;
 }
 
+int lua_Transform_isStatic(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Transform* instance = getInstance(state);
+                bool result = instance->isStatic();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Transform_isStatic - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Transform_removeListener(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Transform.h

@@ -32,6 +32,7 @@ int lua_Transform_getTranslationX(lua_State* state);
 int lua_Transform_getTranslationY(lua_State* state);
 int lua_Transform_getTranslationZ(lua_State* state);
 int lua_Transform_getUpVector(lua_State* state);
+int lua_Transform_isStatic(lua_State* state);
 int lua_Transform_removeListener(lua_State* state);
 int lua_Transform_removeScriptCallback(lua_State* state);
 int lua_Transform_rotate(lua_State* state);

+ 1 - 1
samples/browser/CMakeLists.txt

@@ -53,7 +53,7 @@ set(GAME_SRC
     src/BillboardSample.cpp
     src/BillboardSample.h
     src/CreateSceneSample.cpp
-    src/CreateSceneSample.h	
+    src/CreateSceneSample.h    
     src/CreateSceneSample.h
     src/FirstPersonCamera.cpp
     src/FirstPersonCamera.h

+ 2 - 2
samples/character/CMakeLists.txt

@@ -1,8 +1,8 @@
 set(GAME_NAME sample-character)
 
 set(GAME_SRC
-	src/CharacterGame.cpp
-	src/CharacterGame.h
+    src/CharacterGame.cpp
+    src/CharacterGame.h
 )
 
 add_executable(${GAME_NAME}

+ 8 - 0
samples/character/bar-descriptor.xml

@@ -94,6 +94,14 @@
        <platformArchitecture>x86</platformArchitecture>
        <asset path="Simulator/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
     </configuration>
+    <configuration name="Device-Debug-QC">
+       <platformArchitecture>armle-v7</platformArchitecture>
+       <asset path="Device-Debug-QC/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
+    </configuration>
+    <configuration name="Device-Release-QC">
+       <platformArchitecture>armle-v7</platformArchitecture>
+       <asset path="Device-Release-QC/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
+    </configuration>
   
     
     <!-- The icon for the application, which should be 114x114. -->

+ 2 - 2
samples/longboard/CMakeLists.txt

@@ -1,8 +1,8 @@
 set( GAME_NAME sample-longboard )
 
 set(GAME_SRC
-	src/LongboardGame.cpp
-	src/LongboardGame.h
+    src/LongboardGame.cpp
+    src/LongboardGame.h
 )
 
 add_executable(${GAME_NAME}

+ 2 - 2
samples/lua/CMakeLists.txt

@@ -1,8 +1,8 @@
 set(GAME_NAME sample-lua)
 
 set(GAME_SRC
-	src/LuaGame.cpp
-	src/LuaGame.h
+    src/LuaGame.cpp
+    src/LuaGame.h
 )
 
 add_executable(${GAME_NAME}

+ 2 - 2
samples/mesh/CMakeLists.txt

@@ -1,8 +1,8 @@
 set( GAME_NAME sample-mesh )
 
 set(GAME_SRC
-	src/MeshGame.cpp
-	src/MeshGame.h
+    src/MeshGame.cpp
+    src/MeshGame.h
 )
 
 add_executable(${GAME_NAME}

+ 2 - 2
samples/particles/CMakeLists.txt

@@ -1,8 +1,8 @@
 set(GAME_NAME sample-particles)
 
 set(GAME_SRC
-	src/ParticlesGame.cpp
-	src/ParticlesGame.h
+    src/ParticlesGame.cpp
+    src/ParticlesGame.h
 )
 
 add_executable(${GAME_NAME}

+ 1 - 1
samples/racer/.cproject

@@ -391,7 +391,7 @@
 								<option id="com.qnx.qcc.option.linker.libraryPaths.46585527" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
 									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
 									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../gameplay/${ConfigName}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../gameplay/Device-Release&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../external-deps/lua/lib/blackberry/arm&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../external-deps/bullet/lib/blackberry/arm&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../external-deps/oggvorbis/lib/blackberry/arm&quot;"/>

+ 2 - 2
samples/racer/CMakeLists.txt

@@ -1,8 +1,8 @@
 set(GAME_NAME sample-racer)
 
 set(GAME_SRC
-	src/RacerGame.cpp
-	src/RacerGame.h
+    src/RacerGame.cpp
+    src/RacerGame.h
 )
 
 add_executable(${GAME_NAME}

+ 2 - 2
samples/spaceship/CMakeLists.txt

@@ -1,8 +1,8 @@
 set(GAME_NAME sample-spaceship)
 
 set(GAME_SRC
-	src/SpaceshipGame.cpp
-	src/SpaceshipGame.h
+    src/SpaceshipGame.cpp
+    src/SpaceshipGame.h
 )
 
 add_executable(${GAME_NAME}

+ 93 - 93
tools/encoder/CMakeLists.txt

@@ -32,101 +32,101 @@ add_definitions(-lstdc++ -ldl -lfbxsdk-2013.3-static -lpng -lz -lfreetype -lpthr
 set( APP_NAME gameplay-encoder )
 
 set(APP_SRC
-	src/AnimationChannel.cpp
-	src/AnimationChannel.h
-	src/Animation.cpp
-	src/Animation.h
-	src/Animations.cpp
-	src/Animations.h
-	src/Base.cpp
-	src/Base.h
-	src/BoundingVolume.cpp
-	src/BoundingVolume.h
-	src/Camera.cpp
-	src/Camera.h
+    src/AnimationChannel.cpp
+    src/AnimationChannel.h
+    src/Animation.cpp
+    src/Animation.h
+    src/Animations.cpp
+    src/Animations.h
+    src/Base.cpp
+    src/Base.h
+    src/BoundingVolume.cpp
+    src/BoundingVolume.h
+    src/Camera.cpp
+    src/Camera.h
     src/Constants.cpp
     src/Constants.h
-	src/Curve.cpp
-	src/Curve.h
-	src/Curve.inl
-	src/Effect.cpp
-	src/Effect.h
-	src/EncoderArguments.cpp
-	src/EncoderArguments.h
-	src/FBXSceneEncoder.cpp
-	src/FBXSceneEncoder.h
-	src/FBXUtil.cpp
-	src/FBXUtil.h
-	src/FileIO.cpp
-	src/FileIO.h
-	src/Font.cpp
-	src/Font.h
-	src/Glyph.cpp
-	src/Glyph.h
-	src/GPBDecoder.cpp
-	src/GPBDecoder.h
-	src/GPBFile.cpp
-	src/GPBFile.h
-	src/Heightmap.cpp
-	src/Heightmap.h
-	src/Image.cpp
-	src/Image.h
-	src/Light.cpp
-	src/Light.h
-	src/main.cpp
-	src/Material.cpp
-	src/Material.h
-	src/MaterialParameter.cpp
-	src/MaterialParameter.h
-	src/Matrix.cpp
-	src/Matrix.h
-	src/Mesh.cpp
-	src/Mesh.h
-	src/MeshPart.cpp
-	src/MeshPart.h
-	src/MeshSkin.cpp
-	src/MeshSkin.h
-	src/MeshSubSet.cpp
-	src/MeshSubSet.h
-	src/Model.cpp
-	src/Model.h
-	src/Node.cpp
-	src/Node.h
-	src/NormalMapGenerator.cpp
-	src/NormalMapGenerator.h
-	src/Object.cpp
-	src/Object.h
-	src/Quaternion.cpp
-	src/Quaternion.h
-	src/Quaternion.inl
-	src/Reference.cpp
-	src/Reference.h
-	src/ReferenceTable.cpp
-	src/ReferenceTable.h
-	src/Sampler.cpp
-	src/Sampler.h
-	src/Scene.cpp
-	src/Scene.h
-	src/StringUtil.cpp
-	src/StringUtil.h
-	src/Thread.h
-	src/Transform.cpp
-	src/Transform.h
-	src/TTFFontEncoder.cpp
-	src/TTFFontEncoder.h
-	src/Vector2.cpp
-	src/Vector2.h
-	src/Vector2.inl
-	src/Vector3.cpp
-	src/Vector3.h
-	src/Vector3.inl
-	src/Vector4.cpp
-	src/Vector4.h
-	src/Vector4.inl
-	src/Vertex.cpp
-	src/VertexElement.cpp
-	src/VertexElement.h
-	src/Vertex.h
+    src/Curve.cpp
+    src/Curve.h
+    src/Curve.inl
+    src/Effect.cpp
+    src/Effect.h
+    src/EncoderArguments.cpp
+    src/EncoderArguments.h
+    src/FBXSceneEncoder.cpp
+    src/FBXSceneEncoder.h
+    src/FBXUtil.cpp
+    src/FBXUtil.h
+    src/FileIO.cpp
+    src/FileIO.h
+    src/Font.cpp
+    src/Font.h
+    src/Glyph.cpp
+    src/Glyph.h
+    src/GPBDecoder.cpp
+    src/GPBDecoder.h
+    src/GPBFile.cpp
+    src/GPBFile.h
+    src/Heightmap.cpp
+    src/Heightmap.h
+    src/Image.cpp
+    src/Image.h
+    src/Light.cpp
+    src/Light.h
+    src/main.cpp
+    src/Material.cpp
+    src/Material.h
+    src/MaterialParameter.cpp
+    src/MaterialParameter.h
+    src/Matrix.cpp
+    src/Matrix.h
+    src/Mesh.cpp
+    src/Mesh.h
+    src/MeshPart.cpp
+    src/MeshPart.h
+    src/MeshSkin.cpp
+    src/MeshSkin.h
+    src/MeshSubSet.cpp
+    src/MeshSubSet.h
+    src/Model.cpp
+    src/Model.h
+    src/Node.cpp
+    src/Node.h
+    src/NormalMapGenerator.cpp
+    src/NormalMapGenerator.h
+    src/Object.cpp
+    src/Object.h
+    src/Quaternion.cpp
+    src/Quaternion.h
+    src/Quaternion.inl
+    src/Reference.cpp
+    src/Reference.h
+    src/ReferenceTable.cpp
+    src/ReferenceTable.h
+    src/Sampler.cpp
+    src/Sampler.h
+    src/Scene.cpp
+    src/Scene.h
+    src/StringUtil.cpp
+    src/StringUtil.h
+    src/Thread.h
+    src/Transform.cpp
+    src/Transform.h
+    src/TTFFontEncoder.cpp
+    src/TTFFontEncoder.h
+    src/Vector2.cpp
+    src/Vector2.h
+    src/Vector2.inl
+    src/Vector3.cpp
+    src/Vector3.h
+    src/Vector3.inl
+    src/Vector4.cpp
+    src/Vector4.h
+    src/Vector4.inl
+    src/Vertex.cpp
+    src/VertexElement.cpp
+    src/VertexElement.h
+    src/Vertex.h
 )
 
 add_executable(${APP_NAME}

+ 3 - 49
tools/encoder/README.md

@@ -26,60 +26,14 @@ Note: On Linux Ubuntu 12 (64-bit), you must first install the required 32-bit li
 `sudo apt-get install ia32-libs`
 
 ## Building gameplay-encoder
-The gameplay-encoder comes pre-built for Windows 7, MacOS X and Linux Ubuntu 12 (32-bit) in the 'bin' folder.
-However, to build the gameplay-encoder yourself just open either the 
-Visual Studio 2010 project "gameplay-encoder.vccproj" on Windows 7 or
-XCode project "gameplay-encoder.xcodeproj" on MacOSX.
-Uncomment the root CMakeList.txt for the gameplay-encoder and run standard cmake .. from build then make.
 
-### Building with FBX Support on Windows 7 using Visual Studio 2010
-- Download and install the FBX SDK for Window VS2010. (http://www.autodesk.com/fbx)
-- Edit the project properties of "gameplay-encoder" for Debug
-- Add Preprocessor Definition "USE_FBX" (C++/Preprocessor)
-- Add the FBX SDK include directory to Additional Include Directories (C++/General)
-  * Example: C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/include
-- Add the FBX lib directory to the Additional Library Directories (Linker/General)
-  * Example: C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/lib/vs2010/x86
-- Add "fbxsdk-2013.3-md.lib"(Release) to the Additional Dependencies (Linker/Input)
-  * Example: fbxsdk-2013.3-md.lib
-- Build gameplay-encoder
-
-### Building with FBX Support on MacOS X using XCode 4
-- Download and install the FBX SDK for MacOS X (http://www.autodesk.com/fbx)
-- Edit the project properties of target "gameplay-encoder".
-- Add Preprocessor Macro "USE_FBX" to both Debug/Release sections. (Build Settings)
-- Add the FBX include directory to Header Search Paths: (Build Settings)
-  * Example: "/Applications/Autodesk/FBX SDK/2013.3/include" (Use quotes due to additional space in path)
-- Add the FBX library and dependency Library/Frameworks: (Build Phases -> Link Binary with Libraries)
-  * Example: /Applications/Autodesk/FBX SDK/2013.3/lib/gcc4/ub/libfbxsdk-2013.3-static.a  (Add Other)
-- Build gameplay-encoder
-
-### Building with FBX Support on Linux Ubuntu 12 (32-bit) using CMake
-- Download and install the FBX SDK for MacOS X (http://www.autodesk.com/fbx)
-- Edit the gameplay-encoder/CMakeLists.txt adding the following:
-- Add the FBX include directory to Header Search Paths: (Build Settings)
-  * Example: /usr/include/fbxsdk
-- Add Preprocessor Macro to the add"-DUSE_FBX" to the end of the add_definitions(...) section of the CMakeLists.txt
-- Add the FBX library path to the link_directories(...) section of the CMakeLists.txt
-  * Example: /usr/lib/gcc4
-- Add the FBX library to the set(APP_LIBRARIES {...} )
-  * Example: fbxsdk-2013.3-static
-- Add the FBX library to the library to the add_definitions(-l...) section of the CMakeLists.txt
-  * Example -lfbxsdk-2013.3-static
-- Build gameplay-encoder by uncommenting the last line in the gameplay/CMakeLists.txt and running the CMake build via:
-
-```
-mkdir build
-cd build
-cmake ..
-make
- ```
+See [Building gameplay-encoder](https://github.com/blackberry/GamePlay/wiki/Building-gameplay-encoder) on the wiki.
 
 ## Bundle File Format
-The gameplay bundle file format is well defined in the gameplay-encoder/gameplay-bundle.txt file.
+The gameplay bundle file format is defined in the [tools/encoder/gameplay-bundle.txt](gameplay-bundle.txt) file.
 
 ## Bundle File Loading
-Bundle files can easily be loaded using the gameplay/Bundle.h which is part of the gameplay runtime framework.
+Bundle files can easily be loaded using the `gameplay/Bundle.h` which is part of the gameplay runtime framework.
 
 ## Disclaimer
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 

+ 48 - 42
tools/encoder/src/EncoderArguments.cpp

@@ -233,54 +233,60 @@ void splitString(const char* str, std::vector<std::string>* tokens)
 
 void EncoderArguments::printUsage() const
 {
-    LOG(1, "Usage: gameplay-encoder [options] <input filepath> <output filepath>\n\n");
-    LOG(1, "Supported file extensions:\n");
-    LOG(1, "  .fbx\t(FBX)\n");
-    LOG(1, "  .ttf\t(TrueType Font)\n");
-    LOG(1, "\n");
-    LOG(1, "General Options:\n");
-    LOG(1, "  -v <verbosity>\tVerbosity level (0-4).\n");
-    LOG(1, "\n");
-    LOG(1, "FBX file options:\n");
-    LOG(1, "  -i <id>\tFilter by node ID.\n");
-    LOG(1, "  -t\t\tWrite text/xml.\n");
-    LOG(1, "  -g:auto\tAutomatically group animation channels into a new animation.\n");
-    LOG(1, "  -g:none\tDo not prompt to group animations.\n");
-    LOG(1, "  -g <node id> <animation id>\n" \
-        "\t\tGroup all animation channels targeting the nodes into a new animation.\n");
-    LOG(1, "  -tb <node id>\n" \
-        "\t\tGenerates tangents and binormals for the given node.\n");
-    LOG(1, "  -oa\n" \
+    LOG(1, "Usage: gameplay-encoder [options] <input filepath> <output filepath>\n\n" \
+    "Supported file extensions:\n" \
+    "  .fbx\t(FBX)\n" \
+    "  .ttf\t(TrueType Font)\n" \
+    "\n" \
+    "General Options:\n" \
+    "  -v <verbosity>\tVerbosity level (0-4).\n" \
+    "\n" \
+    "FBX file options:\n" \
+    "  -i <id>\tFilter by node ID.\n" \
+    "  -t\t\tWrite text/xml.\n" \
+    "  -g:auto\tAutomatically group animation channels into a new animation.\n" \
+    "  -g:none\tDo not prompt to group animations.\n" \
+    "  -g <node id> <animation id>\n" \
+        "\t\tGroup all animation channels targeting the nodes into a \n" \
+        "\t\tnew animation.\n" \
+    "  -m\t\tOutput material file for scene.\n" \
+    "  -tb <node id>\n" \
+        "\t\tGenerates tangents and binormals for the given node.\n" \
+    "  -oa\n" \
         "\t\tOptimizes animations by analyzing animation channel data and\n" \
         "\t\tremoving any channels that contain default/identity values\n" \
-        "\t\tand removing any duplicate contiguous keyframes, which are common\n" \
-        "\t\twhen exporting baked animation data.\n");
-    LOG(1, "  -h <size> \"<node ids>\" <filename>\n" \
-        "\t\tGenerates a single heightmap image using meshes from the specified\n" \
-        "\t\tnodes. <size> should be two comma-separated numbers in the format\n" \
-        "\t\t\"X,Y\", indicating the dimensions of the produced heightmap image.\n" \
+        "\t\tand removing any duplicate contiguous keyframes, which are \n" \
+        "\t\tcommon when exporting baked animation data.\n" \
+    "  -h <size> \"<node ids>\" <filename>\n" \
+        "\t\tGenerates a single heightmap image using meshes from the \n" \
+        "\t\tspecified nodes. \n" \
+        "\t\t<size> is two comma-separated numbers in the format \"X,Y\", \n" \
+        "\t\tindicating the dimensions of the produced heightmap image.\n" \
         "\t\t<node ids> should be in quotes with a space between each id.\n" \
         "\t\tFilename is the name of the image (PNG) to be saved.\n" \
-        "\t\tMultiple -h arguments can be supplied to generate more than one heightmap.\n" \
-        "\t\tFor 24-bit packed height data use -hp instead of -h.\n");
-    LOG(1, "\n");
-    LOG(1, "Normal map generation options:\n" \
+        "\t\tMultiple -h arguments can be supplied to generate more than one \n" \
+        "\t\theightmap. For 24-bit packed height data use -hp instead of -h.\n" \
+    "\n" \
+    "Normal map generation options:\n" \
         "  -n\t\tGenerate normal map (requires input file of type PNG or RAW)\n" \
-        "  -s\t\tSize/resolution of the input heightmap image (requried for RAW files)\n" \
-        "  -w <size>\tSpecifies the size of an input terran heightmap file in world\n" \
-        "\t\tunits, along the X, Y and Z axes. <size> should be three comma-separated\n" \
-        "\t\tnumbers in the format \"X,Y,Z\". The Y value represents the maximum\n" \
-        "\t\tpossible height value of a full intensity heightmap pixel.\n" \
+        "  -s\t\tSize/resolution of the input heightmap image \n" \
+        "    \t\t(required for RAW files)\n" \
+        "  -w <size>\tSpecifies the size of an input terrain heightmap file in world\n" \
+        "\t\tunits, along the X, Y and Z axes. <size> should be three \n" \
+        "\t\tcomma-separated numbers in the format \"X,Y,Z\". The Y value \n" \
+        "\t\trepresents the maximum possible height value of a full \n" \
+        "\t\tintensity heightmap pixel.\n" \
         "\n" \
-        "  Normal map generation can be used to create object-space normal maps from heightmap\n" \
-        "  images. Heightmaps must be in either PNG format (where the intensity of each pixel\n" \
-        "  represents a height value), or in RAW format (8 or 16-bit), which is a common\n" \
-        "  headerless format supported by most terran generation tools.\n");
-    LOG(1, "\n");
-    LOG(1, "TTF file options:\n");
-    LOG(1, "  -s <size>\tSize of the font.\n");
-    LOG(1, "  -p\t\tOutput font preview.\n");
-    LOG(1, "\n");
+        "  Normal map generation can be used to create object-space normal maps from \n" \
+        "  heightmap images. Heightmaps must be in either PNG format (where the \n" \
+        "  intensity of each pixel represents a height value), or in RAW format \n" \
+        "  (8 or 16-bit), which is a common headerless format supported by most \n" \
+        "  terrain generation tools.\n" \
+    "\n" \
+    "TTF file options:\n" \
+    "  -s <size>\tSize of the font.\n" \
+    "  -p\t\tOutput font preview.\n" \
+    "\n");
     exit(8);
 }
 

+ 36 - 10
tools/encoder/src/FBXSceneEncoder.cpp

@@ -1,5 +1,3 @@
-#ifdef USE_FBX
-
 #include <algorithm>
 #include <string>
 #include <sstream>
@@ -14,6 +12,9 @@ using std::vector;
 using std::map;
 using std::ostringstream;
 
+// Fix bad material names
+static void fixMaterialName(string& name);
+
 FBXSceneEncoder::FBXSceneEncoder()
     : _groupAnimation(NULL), _autoGroupAnimations(false)
 {
@@ -60,11 +61,8 @@ void FBXSceneEncoder::write(const string& filepath, const EncoderArguments& argu
 
     print("Loading Scene.");
     loadScene(fbxScene);
-    if (arguments.outputMaterialEnabled())
-    {
-        print("Load materials");
-        loadMaterials(fbxScene);
-    }
+    print("Load materials");
+    loadMaterials(fbxScene);
     print("Loading animations.");
     loadAnimations(fbxScene, arguments);
     sdkManager->Destroy();
@@ -922,7 +920,8 @@ void FBXSceneEncoder::loadMaterial(FbxNode* fbxNode)
     for (int index = 0; index < materialCount; ++index)
     {
         FbxSurfaceMaterial* fbxMaterial = fbxNode->GetMaterial(index);
-        const string materialName(fbxMaterial->GetName());
+        string materialName(fbxMaterial->GetName());
+        fixMaterialName(materialName);
         Material* material = NULL;
         map<string, Material*>::iterator it = _materials.find(materialName);
         if (it != _materials.end())
@@ -932,7 +931,16 @@ void FBXSceneEncoder::loadMaterial(FbxNode* fbxNode)
         }
         else
         {
-            material = createMaterial(materialName, fbxMaterial, node);
+            if (EncoderArguments::getInstance()->outputMaterialEnabled())
+            {
+                material = createMaterial(materialName, fbxMaterial, node);
+            }
+            else
+            {
+                // If outputMaterialEnabled() is not enabled then only create the materials for the purpose of writing 
+                // the material name in the GPB file. There is no need to load uniforms and samplers for the material.
+                material = new Material(materialName);
+            }
             _materials[materialName] = material;
         }
 
@@ -1361,4 +1369,22 @@ void FBXSceneEncoder::triangulateRecursive(FbxNode* fbxNode)
     }
 }
 
-#endif
+// Functions
+
+void fixMaterialName(string& name)
+{
+    static int unnamedCount = 0;
+
+    for (string::size_type i = 0, len = name.length(); i < len; ++i)
+    {
+        if (!isalnum(name[i]))
+            name[i] = '_';
+    }
+
+    if (name.length() == 0)
+    {
+        ostringstream stream;
+        stream << "unnamed_" << (++unnamedCount);
+        name = stream.str();
+    }
+}

+ 0 - 3
tools/encoder/src/FBXSceneEncoder.h

@@ -1,8 +1,6 @@
 #ifndef FBXSCENEEENCODER_H_
 #define FBXSCENEEENCODER_H_
 
-#ifdef USE_FBX
-
 #define FBXSDK_NEW_API
 
 #include <iostream>
@@ -295,4 +293,3 @@ private:
 };
 
 #endif
-#endif

+ 0 - 4
tools/encoder/src/FBXUtil.cpp

@@ -1,5 +1,3 @@
-#ifdef USE_FBX
-
 #include <algorithm>
 #include <string>
 #include <sstream>
@@ -805,5 +803,3 @@ std::string toString(double value)
     stream << value;
     return stream.str();
 }
-
-#endif

+ 0 - 3
tools/encoder/src/FBXUtil.h

@@ -1,8 +1,6 @@
 #ifndef FBXUTIL_H_
 #define FBXUTIL_H_
 
-#ifdef USE_FBX
-
 #define FBXSDK_NEW_API
 
 #include <iostream>
@@ -203,4 +201,3 @@ std::string toString(const FbxDouble3& fbxDouble, double d);
 std::string toString(double value);
 
 #endif
-#endif

+ 1 - 1
tools/encoder/src/Material.cpp

@@ -16,7 +16,7 @@ Material::Material(const std::string& id) :
 
 Material::Material(const Material& c) :
     _parent(c._parent),
-    _id(c._id),
+    _id(c._id), _lit(false),
     _vertexShader(c._vertexShader),
     _fragmentShader(c._fragmentShader),
     _defines(c._defines),

+ 1 - 3
tools/encoder/src/MeshSkin.cpp

@@ -170,8 +170,6 @@ void MeshSkin::computeBounds()
 
     LOG(2, "Computing bounds for skin of mesh: %s\n", _mesh->getId().c_str());
 
-    Node* joint;
-
     // Get the root joint
     Node* rootJoint = _joints[0];
     Node* parent = rootJoint->getParent();
@@ -210,7 +208,7 @@ void MeshSkin::computeBounds()
     LOG(3, "  0%%\r");
     for (unsigned int i = 0; i < jointCount; ++i)
     {
-        joint = _joints[i];
+        Node* joint = _joints[i];
 
         // Find all animations that target this joint
         Animations* animations = GPBFile::getInstance()->getAnimations();

+ 0 - 5
tools/encoder/src/main.cpp

@@ -72,15 +72,10 @@ int main(int argc, const char** argv)
         }
     case EncoderArguments::FILEFORMAT_FBX:
         {
-#ifdef USE_FBX
             std::string realpath(arguments.getFilePath());
             FBXSceneEncoder fbxEncoder;
             fbxEncoder.write(realpath, arguments);
             break;
-#else
-            LOG(1, "Error: FBX not enabled. Install the FBX SDK and use the preprocessor definition USE_FBX.\n");
-            return -1;
-#endif
         }
     case EncoderArguments::FILEFORMAT_TTF:
         {

+ 10 - 10
tools/luagen/CMakeLists.txt

@@ -23,16 +23,16 @@ add_definitions(-lstdc++ -llua -ltinyxml2)
 set( APP_NAME gameplay-luagen )
 
 set(APP_SRC
-	src/Base.h
-	src/ClassBinding.cpp
-	src/ClassBinding.h
-	src/DebugNew.cpp
-	src/DebugNew.h
-	src/EnumBinding.h
-	src/FunctionBinding.cpp
-	src/FunctionBinding.h
-	src/Generator.cpp
-	src/Generator.h
+    src/Base.h
+    src/ClassBinding.cpp
+    src/ClassBinding.h
+    src/DebugNew.cpp
+    src/DebugNew.h
+    src/EnumBinding.h
+    src/FunctionBinding.cpp
+    src/FunctionBinding.h
+    src/Generator.cpp
+    src/Generator.h
     src/main.cpp
     src/TypedefBinding.h
 )