Переглянути джерело

Merge pull request #385 from dgough/next

pull request to next
Sean Paul Taylor 13 роки тому
батько
коміт
46f7d33724

+ 11 - 0
.gitignore

@@ -199,3 +199,14 @@ Thumbs.db
 
 /gameplay-internal
 /gameplay\android/proguard-project.txt
+/gameplay-tests/DebugMem
+/gameplay-tests/Device-Debug
+/gameplay-tests\android/bin
+/gameplay-tests\android/gen
+/gameplay-tests\android/libs
+/gameplay-tests\android/obj
+/gameplay-tests\android/src
+/gameplay-tests\android/local.properties
+/gameplay-tests\android/proguard-project.txt
+/gameplay-tests\android/project.properties
+/gameplay-tests\android/assets

+ 4 - 0
CHANGES.md

@@ -1,3 +1,7 @@
+## v1.5.0
+-- Adds gameplay-tests project as a test app for various engine features. More tests will be added in the future.
+-- Fixes the texture coordinates of Mesh::createQuad(float x, float y, float width, float height).
+
 ## v1.4.0
 
 - Lua script bindings for all gameplay interfaces.

+ 1 - 1
gameplay-encoder/src/AnimationChannel.cpp

@@ -130,7 +130,7 @@ void AnimationChannel::setInterpolations(const std::vector<unsigned int>& values
 
 void AnimationChannel::removeDuplicates()
 {
-    LOG(3, "      Removing duplicates for channel with target attribute: %d.\n", _targetAttrib);
+    LOG(3, "      Removing duplicates for channel with target attribute: %u.\n", _targetAttrib);
 
     int startCount = _keytimes.size();
 

+ 1 - 0
gameplay-encoder/src/Camera.cpp

@@ -5,6 +5,7 @@ namespace gameplay
 {
 
 Camera::Camera(void) :
+    _cameraType(CameraPerspective), 
     _fieldOfView(0.0f),
     _aspectRatio(0.0f),
     _nearPlane(0.0f),

+ 4 - 5
gameplay-encoder/src/DAESceneEncoder.cpp

@@ -287,10 +287,9 @@ void DAESceneEncoder::write(const std::string& filepath, const EncoderArguments&
 
     // Find the <visual_scene> element within the <scene>
     const domCOLLADA::domSceneRef& domScene = _dom->getScene();
-    daeElement* scene = NULL;
     if (domScene && domScene->getInstance_visual_scene())
     {
-        scene = getVisualScene(domScene);
+        daeElement* scene = getVisualScene(domScene);
         if (scene)
         {
             if (nodeId == NULL)
@@ -1317,7 +1316,7 @@ void DAESceneEncoder::loadSkeleton(domNode* rootNode, MeshSkin* skin)
     // Resolve and set joints array for skin
     std::vector<Node*> _joints;
     const std::vector<std::string>& jointNames = skin->getJointNames();
-    for (std::vector<std::string>::const_iterator i = jointNames.begin(); i != jointNames.end(); i++)
+    for (std::vector<std::string>::const_iterator i = jointNames.begin(); i != jointNames.end(); ++i)
     {
         Object* obj = _gamePlayFile.getFromRefTable(*i);
         if (obj && obj->getTypeId() == Object::NODE_ID)
@@ -1369,7 +1368,7 @@ Model* DAESceneEncoder::loadSkin(const domSkin* skinElement)
 
             // Go through the joint list and convert them from sid to id because the sid information is
             // lost when converting to the gameplay binary format.
-            for (std::vector<std::string>::iterator i = list.begin(); i != list.end(); i++)
+            for (std::vector<std::string>::iterator i = list.begin(); i != list.end(); ++i)
             {
                 daeSIDResolver resolver(source->getDocument()->getDomRoot(), i->c_str());
                 daeElement* element = resolver.getElement();
@@ -1388,7 +1387,7 @@ Model* DAESceneEncoder::loadSkin(const domSkin* skinElement)
             jointCount = list.size();
             _jointInverseBindPoseMatrices.reserve(jointCount);
             unsigned int j = 0;
-            for (std::vector<std::string>::const_iterator i = list.begin(); i != list.end(); i++)
+            for (std::vector<std::string>::const_iterator i = list.begin(); i != list.end(); ++i)
             {
                 _jointLookupTable[*i] = j++;
             }

+ 1 - 1
gameplay-encoder/src/DAEUtil.cpp

@@ -538,7 +538,7 @@ void findChannelsTargetingJoints(const domSourceRef& source, std::list<domChanne
 {
     std::vector<std::string> jointNames;
     getJointNames(source, jointNames);
-    for (std::vector<std::string>::iterator i = jointNames.begin(); i != jointNames.end(); i++)
+    for (std::vector<std::string>::iterator i = jointNames.begin(); i != jointNames.end(); ++i)
     {
         daeSIDResolver resolver(source->getDocument()->getDomRoot(), i->c_str());
         daeElement* element = resolver.getElement();

+ 0 - 1
gameplay-encoder/src/EncoderArguments.cpp

@@ -137,7 +137,6 @@ bool EncoderArguments::containsGroupNodeId(const std::string& nodeId) const
 
 const std::string EncoderArguments::getAnimationId(const std::string& nodeId) const
 {
-    std::vector<std::string>::const_iterator it = find(_groupAnimationNodeId.begin(), _groupAnimationNodeId.end(), nodeId);
     for (size_t i = 0, size = _groupAnimationNodeId.size(); i < size; ++i)
     {
         if (_groupAnimationNodeId[i].compare(nodeId) == 0)

+ 0 - 2
gameplay-encoder/src/FBXSceneEncoder.cpp

@@ -308,8 +308,6 @@ void FBXSceneEncoder::loadScene(FbxScene* fbxScene)
 
 void FBXSceneEncoder::loadAnimationChannels(FbxAnimLayer* animLayer, FbxNode* fbxNode, Animation* animation)
 {
-    const std::string* targetId = NULL;
-
     const char* name = fbxNode->GetName();
     Node* node = _gamePlayFile.getNode(name);
     if (node)

+ 1 - 1
gameplay-encoder/src/GPBFile.cpp

@@ -496,7 +496,7 @@ void GPBFile::decomposeTransformAnimationChannel(Animation* animation, Animation
             ++oneCount;
         else
         {
-            LOG(4, "Rotation not identity: %d\n", i);
+            LOG(4, "Rotation not identity: %u\n", i);
             Quaternion q(x, y, z, w);
             Vector3 axis;
             float angle = q.toAxisAngle(&axis);

+ 2 - 2
gameplay-encoder/src/Mesh.cpp

@@ -28,7 +28,7 @@ void Mesh::writeBinary(FILE* file)
     Object::writeBinary(file);
     // vertex formats
     write(_vertexFormat.size(), file);
-    for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); i++)
+    for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); ++i)
     {
         i->writeBinary(file);
     }
@@ -74,7 +74,7 @@ void Mesh::writeText(FILE* file)
     // for each VertexFormat
     if (vertices.size() > 0 )
     {
-        for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); i++)
+        for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); ++i)
         {
             i->writeText(file);
         }

+ 6 - 6
gameplay-encoder/src/MeshSkin.cpp

@@ -37,12 +37,12 @@ void MeshSkin::writeBinary(FILE* file)
     Object::writeBinary(file);
     write(_bindShape, 16, file);
     write(_joints.size(), file);
-    for (std::vector<Node*>::const_iterator i = _joints.begin(); i != _joints.end(); i++)
+    for (std::vector<Node*>::const_iterator i = _joints.begin(); i != _joints.end(); ++i)
     {
         (*i)->writeBinaryXref(file);
     }
     write(_bindPoses.size() * 16, file);
-    for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); i++)
+    for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); ++i)
     {
         write(i->m, 16, file);
     }
@@ -68,13 +68,13 @@ void MeshSkin::writeText(FILE* file)
     fprintfMatrix4f(file, _bindShape);
     fprintf(file, "</bindShape>");
     fprintf(file, "<joints>");
-    for (std::vector<std::string>::const_iterator i = _jointNames.begin(); i != _jointNames.end(); i++)
+    for (std::vector<std::string>::const_iterator i = _jointNames.begin(); i != _jointNames.end(); ++i)
     {
         fprintf(file, "%s ", i->c_str());
     }
     fprintf(file, "</joints>\n");
     fprintf(file, "<bindPoses count=\"%lu\">", _bindPoses.size() * 16);
-    for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); i++)
+    for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); ++i)
     {
         for (unsigned int j = 0; j < 16; ++j)
         {
@@ -129,7 +129,7 @@ void MeshSkin::setBindPoses(std::vector<Matrix>& list)
 
 bool MeshSkin::hasJoint(const char* id)
 {
-    for (std::vector<std::string>::iterator i = _jointNames.begin(); i != _jointNames.end(); i++)
+    for (std::vector<std::string>::iterator i = _jointNames.begin(); i != _jointNames.end(); ++i)
     {
         if (equals(*i, id))
         {
@@ -192,7 +192,7 @@ void MeshSkin::computeBounds()
     unsigned int jointCount = _joints.size();
     unsigned int vertexCount = _mesh->getVertexCount();
 
-    LOG(3, "  %d joints found.\n", jointCount);
+    LOG(3, "  %u joints found.\n", jointCount);
 
     std::vector<AnimationChannel*> channels;
     std::vector<Node*> channelTargets;

+ 1 - 1
gameplay-encoder/src/Quaternion.cpp

@@ -52,7 +52,7 @@ bool Quaternion::isIdentity() const
 
 bool Quaternion::isZero() const
 {
-    return x == 0.0f && y == 0.0f && z == 0.0f && z == 0.0f;
+    return x == 0.0f && y == 0.0f && z == 0.0f && w == 0.0f;
 }
 
 void Quaternion::createFromAxisAngle(const Vector3& axis, float angle, Quaternion* dst)

+ 4 - 4
gameplay-encoder/src/TTFFontEncoder.cpp

@@ -222,10 +222,10 @@ int writeFont(const char* inFilePath, const char* outFilePath, unsigned int font
             penY = row * rowSize;
             if (penY + rowSize > (int)imageHeight)
             {
-                LOG(1, "Image size exceeded!");
-               return -1;
+                free(imageBuffer);
+				LOG(1, "Image size exceeded!");
+				return -1;
             }
-
         }
         
         // penY should include the glyph offsets.
@@ -306,7 +306,7 @@ int writeFont(const char* inFilePath, const char* outFilePath, unsigned int font
         std::string pgmFilePath = getFilenameNoExt(outFilePath);
         pgmFilePath.append(".pgm");
         FILE *imageFp = fopen(pgmFilePath.c_str(), "wb");
-        fprintf(imageFp, "P5 %d %d 255\n", imageWidth, imageHeight);
+        fprintf(imageFp, "P5 %u %u 255\n", imageWidth, imageHeight);
         fwrite((const char *)imageBuffer, sizeof(unsigned char), imageWidth * imageHeight, imageFp);
         fclose(imageFp);
     }

+ 1 - 1
gameplay-encoder/src/Vector4.cpp

@@ -91,7 +91,7 @@ bool Vector4::isZero() const
 
 bool Vector4::isOne() const
 {
-    return x == 1.0f && y == 1.0f && z == 1.0f && z == 1.0f;
+    return x == 1.0f && y == 1.0f && z == 1.0f && w == 1.0f;
 }
 
 float Vector4::angle(const Vector4& v1, const Vector4& v2)

+ 18 - 7
gameplay.sln

@@ -28,7 +28,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample00-mesh", "gameplay-s
 		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample05-lua", "gameplay-samples\sample05-lua\sample05-lua.vcxproj", "{C6121A62-AA46-BA6D-A1CE-8000544456AA}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample05-lua", "gameplay-samples\sample05-lua\sample05-lua.vcxproj", "{C220DB61-B43A-9628-54DF-7285E1F597C8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay-tests", "gameplay-tests\gameplay-tests.vcxproj", "{F66B0042-1F98-C080-F6FA-D41B855D4FC6}"
 	ProjectSection(ProjectDependencies) = postProject
 		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
 	EndProjectSection
@@ -76,12 +81,18 @@ Global
 		{D672DC66-3CE0-4878-B0D2-813CA731012F}.DebugMem|Win32.Build.0 = DebugMem|Win32
 		{D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|Win32.ActiveCfg = Release|Win32
 		{D672DC66-3CE0-4878-B0D2-813CA731012F}.Release|Win32.Build.0 = Release|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.Debug|Win32.Build.0 = Debug|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.DebugMem|Win32.Build.0 = DebugMem|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.Release|Win32.ActiveCfg = Release|Win32
-		{C6121A62-AA46-BA6D-A1CE-8000544456AA}.Release|Win32.Build.0 = Release|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.Debug|Win32.Build.0 = Debug|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.DebugMem|Win32.Build.0 = DebugMem|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.Release|Win32.ActiveCfg = Release|Win32
+		{C220DB61-B43A-9628-54DF-7285E1F597C8}.Release|Win32.Build.0 = Release|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.Debug|Win32.Build.0 = Debug|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.DebugMem|Win32.Build.0 = DebugMem|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.Release|Win32.ActiveCfg = Release|Win32
+		{F66B0042-1F98-C080-F6FA-D41B855D4FC6}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 5 - 5
gameplay/src/Mesh.cpp

@@ -68,17 +68,17 @@ Mesh* Mesh::createMesh(const VertexFormat& vertexFormat, unsigned int vertexCoun
 }
 
 
-Mesh* Mesh::createQuad(float x, float y, float width, float height)
+Mesh* Mesh::createQuad(float x, float y, float width, float height, float s1, float t1, float s2, float t2)
 {
     float x2 = x + width;
     float y2 = y + height;
 
     float vertices[] =
     {
-        x, y2, 0,   0, 0, 1,    0, 0,
-        x, y, 0,    0, 0, 1,    0, 1,
-        x2, y2, 0,  0, 0, 1,    1, 0,
-        x2, y, 0,   0, 0, 1,    1, 1
+        x, y2, 0,   0, 0, 1,    s1, t2,
+        x, y, 0,    0, 0, 1,    s1, t1,
+        x2, y2, 0,  0, 0, 1,    s2, t2,
+        x2, y, 0,   0, 0, 1,    s2, t1,
     };
 
     VertexFormat::Element elements[] =

+ 5 - 1
gameplay/src/Mesh.h

@@ -83,11 +83,15 @@ public:
      * @param y The y coordinate.
      * @param width The width of the quad.
      * @param height The height of the quad.
+     * @param s1 The S texture coordinate of the bottom left point.
+     * @param t1 The T texture coordinate of the bottom left point.
+     * @param s2 The S texture coordinate of the top right point.
+     * @param t2 The T texture coordinate of the top right point.
      * 
      * @return The newly created mesh.
      * @script{create}
      */
-    static Mesh* createQuad(float x, float y, float width, float height);
+    static Mesh* createQuad(float x, float y, float width, float height, float s1 = 0.0f, float t1 = 0.0f, float s2 = 1.0f, float t2 = 1.0f);
 
     /**
      * Creates a new full-screen 2D quad.

+ 209 - 1
gameplay/src/lua/lua_Mesh.cpp

@@ -1241,9 +1241,217 @@ int lua_Mesh_static_createQuad(lua_State* state)
             }
             break;
         }
+        case 5:
+        {
+            if (lua_type(state, 1) == LUA_TNUMBER &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TNUMBER &&
+                lua_type(state, 5) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 1);
+
+                // Get parameter 2 off the stack.
+                float param2 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 3 off the stack.
+                float param3 = (float)luaL_checknumber(state, 3);
+
+                // Get parameter 4 off the stack.
+                float param4 = (float)luaL_checknumber(state, 4);
+
+                // Get parameter 5 off the stack.
+                float param5 = (float)luaL_checknumber(state, 5);
+
+                void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5);
+                if (returnPtr)
+                {
+                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = true;
+                    luaL_getmetatable(state, "Mesh");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Mesh_static_createQuad - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        case 6:
+        {
+            if (lua_type(state, 1) == LUA_TNUMBER &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TNUMBER &&
+                lua_type(state, 5) == LUA_TNUMBER &&
+                lua_type(state, 6) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 1);
+
+                // Get parameter 2 off the stack.
+                float param2 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 3 off the stack.
+                float param3 = (float)luaL_checknumber(state, 3);
+
+                // Get parameter 4 off the stack.
+                float param4 = (float)luaL_checknumber(state, 4);
+
+                // Get parameter 5 off the stack.
+                float param5 = (float)luaL_checknumber(state, 5);
+
+                // Get parameter 6 off the stack.
+                float param6 = (float)luaL_checknumber(state, 6);
+
+                void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6);
+                if (returnPtr)
+                {
+                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = true;
+                    luaL_getmetatable(state, "Mesh");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Mesh_static_createQuad - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        case 7:
+        {
+            if (lua_type(state, 1) == LUA_TNUMBER &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TNUMBER &&
+                lua_type(state, 5) == LUA_TNUMBER &&
+                lua_type(state, 6) == LUA_TNUMBER &&
+                lua_type(state, 7) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 1);
+
+                // Get parameter 2 off the stack.
+                float param2 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 3 off the stack.
+                float param3 = (float)luaL_checknumber(state, 3);
+
+                // Get parameter 4 off the stack.
+                float param4 = (float)luaL_checknumber(state, 4);
+
+                // Get parameter 5 off the stack.
+                float param5 = (float)luaL_checknumber(state, 5);
+
+                // Get parameter 6 off the stack.
+                float param6 = (float)luaL_checknumber(state, 6);
+
+                // Get parameter 7 off the stack.
+                float param7 = (float)luaL_checknumber(state, 7);
+
+                void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7);
+                if (returnPtr)
+                {
+                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = true;
+                    luaL_getmetatable(state, "Mesh");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Mesh_static_createQuad - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        case 8:
+        {
+            if (lua_type(state, 1) == LUA_TNUMBER &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TNUMBER &&
+                lua_type(state, 5) == LUA_TNUMBER &&
+                lua_type(state, 6) == LUA_TNUMBER &&
+                lua_type(state, 7) == LUA_TNUMBER &&
+                lua_type(state, 8) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 1);
+
+                // Get parameter 2 off the stack.
+                float param2 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 3 off the stack.
+                float param3 = (float)luaL_checknumber(state, 3);
+
+                // Get parameter 4 off the stack.
+                float param4 = (float)luaL_checknumber(state, 4);
+
+                // Get parameter 5 off the stack.
+                float param5 = (float)luaL_checknumber(state, 5);
+
+                // Get parameter 6 off the stack.
+                float param6 = (float)luaL_checknumber(state, 6);
+
+                // Get parameter 7 off the stack.
+                float param7 = (float)luaL_checknumber(state, 7);
+
+                // Get parameter 8 off the stack.
+                float param8 = (float)luaL_checknumber(state, 8);
+
+                void* returnPtr = (void*)Mesh::createQuad(param1, param2, param3, param4, param5, param6, param7, param8);
+                if (returnPtr)
+                {
+                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = true;
+                    luaL_getmetatable(state, "Mesh");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Mesh_static_createQuad - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 4).");
+            lua_pushstring(state, "Invalid number of parameters (expected 4, 5, 6, 7 or 8).");
             lua_error(state);
             break;
         }