1. Jason McKesson
  2. gltut

Source

gltut / Tut 06 Objects in Motion / GimbalLock.cpp

Diff from to

File Tut 06 Objects in Motion/GimbalLock.cpp

  • Ignore whitespace
 	std::stack<glm::mat4> m_matrices;
 };
 
-void DrawGimbalSides(MatrixStack &currMatrix, float fGimbolSidesOffset, float fGimbolSidesScale)
+void DrawGimbalSides(MatrixStack &currMatrix, float fGimbalSidesOffset, float fGimbalSidesScale)
 {
 	//Draw the top
 	{
 		currMatrix.Push();
-		currMatrix.Translate(glm::vec3(0.0f, fGimbolSidesOffset, 0.0f));
-		currMatrix.Scale(glm::vec3(fGimbolSidesScale, 1.0f, 1.0f));
+		currMatrix.Translate(glm::vec3(0.0f, fGimbalSidesOffset, 0.0f));
+		currMatrix.Scale(glm::vec3(fGimbalSidesScale, 1.0f, 1.0f));
 		glUniformMatrix4fv(modelToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(currMatrix.Top()));
 		glDrawElements(GL_TRIANGLES, ARRAY_COUNT(indexData), GL_UNSIGNED_SHORT, 0);
 		currMatrix.Pop();
 	//Draw the bottom
 	{
 		currMatrix.Push();
-		currMatrix.Translate(glm::vec3(0.0f, -fGimbolSidesOffset, 0.0f));
-		currMatrix.Scale(glm::vec3(fGimbolSidesScale, 1.0f, 1.0f));
+		currMatrix.Translate(glm::vec3(0.0f, -fGimbalSidesOffset, 0.0f));
+		currMatrix.Scale(glm::vec3(fGimbalSidesScale, 1.0f, 1.0f));
 		glUniformMatrix4fv(modelToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(currMatrix.Top()));
 		glDrawElements(GL_TRIANGLES, ARRAY_COUNT(indexData), GL_UNSIGNED_SHORT, 0);
 		currMatrix.Pop();
 	//Draw the right
 	{
 		currMatrix.Push();
-		currMatrix.Translate(glm::vec3(fGimbolSidesOffset, 0.0f, 0.0f));
-		currMatrix.Scale(glm::vec3(1.0f, fGimbolSidesScale, 1.0f));
+		currMatrix.Translate(glm::vec3(fGimbalSidesOffset, 0.0f, 0.0f));
+		currMatrix.Scale(glm::vec3(1.0f, fGimbalSidesScale, 1.0f));
 		glUniformMatrix4fv(modelToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(currMatrix.Top()));
 		glDrawElements(GL_TRIANGLES, ARRAY_COUNT(indexData), GL_UNSIGNED_SHORT, 0);
 		currMatrix.Pop();
 	//Draw the left
 	{
 		currMatrix.Push();
-		currMatrix.Translate(glm::vec3(-fGimbolSidesOffset, 0.0f, 0.0f));
-		currMatrix.Scale(glm::vec3(1.0f, fGimbolSidesScale, 1.0f));
+		currMatrix.Translate(glm::vec3(-fGimbalSidesOffset, 0.0f, 0.0f));
+		currMatrix.Scale(glm::vec3(1.0f, fGimbalSidesScale, 1.0f));
 		glUniformMatrix4fv(modelToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(currMatrix.Top()));
 		glDrawElements(GL_TRIANGLES, ARRAY_COUNT(indexData), GL_UNSIGNED_SHORT, 0);
 		currMatrix.Pop();
 	glUniform4fv(baseColorUnif, 1, glm::value_ptr(baseColor));
 	glBindVertexArray(vao);
 
-	float fGimbolSidesOffset = (fSize / 2.0f) - 1.5f;
-	float fGimbolSidesScale = fSize - 2.0f;
+	float fGimbalSidesOffset = (fSize / 2.0f) - 1.5f;
+	float fGimbalSidesScale = fSize - 2.0f;
 
-	DrawGimbalSides(currMatrix, fGimbolSidesOffset, fGimbolSidesScale);
+	DrawGimbalSides(currMatrix, fGimbalSidesOffset, fGimbalSidesScale);
 	
 	float fGimbalAttachOffset = (fSize / 2.0f) - 0.5f;