Jelajahi Sumber

API Reference only.

setaylor 13 tahun lalu
induk
melakukan
37247319c0
100 mengubah file dengan 0 tambahan dan 19178 penghapusan
  1. 0 168
      .gitignore
  2. 0 36
      README.md
  3. 0 5
      gameplay-api/gameplay.html
  4. TEMPAT SAMPAH
      gameplay-api/gameplay.png
  5. 0 155
      gameplay-codestyle.xml
  6. 0 56
      gameplay-encoder/README.md
  7. 0 226
      gameplay-encoder/gameplay-bundle.txt
  8. 0 199
      gameplay-encoder/gameplay-encoder.vcxproj
  9. 0 279
      gameplay-encoder/gameplay-encoder.vcxproj.filters
  10. 0 13
      gameplay-encoder/gameplay-encoder.vcxproj.user
  11. 0 587
      gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj
  12. 0 86
      gameplay-encoder/gameplay-encoder.xcodeproj/xcshareddata/xcschemes/gameplay-encoder.xcscheme
  13. 0 74
      gameplay-encoder/src/Animation.cpp
  14. 0 66
      gameplay-encoder/src/Animation.h
  15. 0 299
      gameplay-encoder/src/AnimationChannel.cpp
  16. 0 105
      gameplay-encoder/src/AnimationChannel.h
  17. 0 65
      gameplay-encoder/src/Animations.cpp
  18. 0 43
      gameplay-encoder/src/Animations.h
  19. 0 14
      gameplay-encoder/src/Base.cpp
  20. 0 99
      gameplay-encoder/src/Base.h
  21. 0 137
      gameplay-encoder/src/BoundingVolume.cpp
  22. 0 57
      gameplay-encoder/src/BoundingVolume.h
  23. 0 125
      gameplay-encoder/src/Camera.cpp
  24. 0 59
      gameplay-encoder/src/Camera.h
  25. 0 1346
      gameplay-encoder/src/Curve.cpp
  26. 0 484
      gameplay-encoder/src/Curve.h
  27. 0 36
      gameplay-encoder/src/Curve.inl
  28. 0 101
      gameplay-encoder/src/DAEChannelTarget.cpp
  29. 0 84
      gameplay-encoder/src/DAEChannelTarget.h
  30. 0 78
      gameplay-encoder/src/DAEOptimizer.cpp
  31. 0 49
      gameplay-encoder/src/DAEOptimizer.h
  32. 0 1946
      gameplay-encoder/src/DAESceneEncoder.cpp
  33. 0 210
      gameplay-encoder/src/DAESceneEncoder.h
  34. 0 358
      gameplay-encoder/src/DAEUtil.cpp
  35. 0 119
      gameplay-encoder/src/DAEUtil.h
  36. 0 40
      gameplay-encoder/src/Effect.cpp
  37. 0 39
      gameplay-encoder/src/Effect.h
  38. 0 365
      gameplay-encoder/src/EncoderArguments.cpp
  39. 0 134
      gameplay-encoder/src/EncoderArguments.h
  40. 0 1437
      gameplay-encoder/src/FBXSceneEncoder.cpp
  41. 0 222
      gameplay-encoder/src/FBXSceneEncoder.h
  42. 0 187
      gameplay-encoder/src/FileIO.cpp
  43. 0 141
      gameplay-encoder/src/FileIO.h
  44. 0 54
      gameplay-encoder/src/Font.cpp
  45. 0 49
      gameplay-encoder/src/Font.h
  46. 0 117
      gameplay-encoder/src/GPBDecoder.cpp
  47. 0 42
      gameplay-encoder/src/GPBDecoder.h
  48. 0 406
      gameplay-encoder/src/GPBFile.cpp
  49. 0 132
      gameplay-encoder/src/GPBFile.h
  50. 0 42
      gameplay-encoder/src/Glyph.cpp
  51. 0 34
      gameplay-encoder/src/Glyph.h
  52. 0 231
      gameplay-encoder/src/Light.cpp
  53. 0 82
      gameplay-encoder/src/Light.h
  54. 0 39
      gameplay-encoder/src/Material.cpp
  55. 0 37
      gameplay-encoder/src/Material.h
  56. 0 39
      gameplay-encoder/src/MaterialParameter.cpp
  57. 0 35
      gameplay-encoder/src/MaterialParameter.h
  58. 0 407
      gameplay-encoder/src/Matrix.cpp
  59. 0 169
      gameplay-encoder/src/Matrix.h
  60. 0 433
      gameplay-encoder/src/Mesh.cpp
  61. 0 83
      gameplay-encoder/src/Mesh.h
  62. 0 114
      gameplay-encoder/src/MeshPart.cpp
  63. 0 97
      gameplay-encoder/src/MeshPart.h
  64. 0 442
      gameplay-encoder/src/MeshSkin.cpp
  65. 0 73
      gameplay-encoder/src/MeshSkin.h
  66. 0 40
      gameplay-encoder/src/MeshSubSet.cpp
  67. 0 31
      gameplay-encoder/src/MeshSubSet.h
  68. 0 105
      gameplay-encoder/src/Model.cpp
  69. 0 45
      gameplay-encoder/src/Model.h
  70. 0 354
      gameplay-encoder/src/Node.cpp
  71. 0 199
      gameplay-encoder/src/Node.h
  72. 0 80
      gameplay-encoder/src/Object.cpp
  73. 0 150
      gameplay-encoder/src/Object.h
  74. 0 400
      gameplay-encoder/src/Quaternion.cpp
  75. 0 364
      gameplay-encoder/src/Quaternion.h
  76. 0 19
      gameplay-encoder/src/Quaternion.inl
  77. 0 87
      gameplay-encoder/src/Reference.cpp
  78. 0 57
      gameplay-encoder/src/Reference.h
  79. 0 69
      gameplay-encoder/src/ReferenceTable.cpp
  80. 0 58
      gameplay-encoder/src/ReferenceTable.h
  81. 0 123
      gameplay-encoder/src/Scene.cpp
  82. 0 77
      gameplay-encoder/src/Scene.h
  83. 0 121
      gameplay-encoder/src/StringUtil.cpp
  84. 0 26
      gameplay-encoder/src/StringUtil.h
  85. 0 334
      gameplay-encoder/src/TTFFontEncoder.cpp
  86. 0 31
      gameplay-encoder/src/TTFFontEncoder.h
  87. 0 91
      gameplay-encoder/src/Transform.cpp
  88. 0 68
      gameplay-encoder/src/Transform.h
  89. 0 271
      gameplay-encoder/src/Vector2.cpp
  90. 0 413
      gameplay-encoder/src/Vector2.h
  91. 0 77
      gameplay-encoder/src/Vector2.inl
  92. 0 318
      gameplay-encoder/src/Vector3.cpp
  93. 0 443
      gameplay-encoder/src/Vector3.h
  94. 0 82
      gameplay-encoder/src/Vector3.inl
  95. 0 330
      gameplay-encoder/src/Vector4.cpp
  96. 0 438
      gameplay-encoder/src/Vector4.h
  97. 0 89
      gameplay-encoder/src/Vector4.inl
  98. 0 114
      gameplay-encoder/src/Vertex.cpp
  99. 0 112
      gameplay-encoder/src/Vertex.h
  100. 0 76
      gameplay-encoder/src/VertexElement.cpp

+ 0 - 168
.gitignore

@@ -1,168 +0,0 @@
-*.suo
-*.sdf
-*.opensdf
-.DS_Store*
-ehthumbs.db
-Icon?
-Thumbs.db
-/.metadata
-/169.254.0.1
-/ipch
-/Debug
-/Release
-/Simulator
-/Simulator-Coverage
-/Simulator-Profile
-/Device-Debug
-/Device-Coverage
-/Device-Profile
-/Device-Release
-/gameplay.xcworkspace/xcuserdata
-/gameplay/Debug
-/gameplay/DebugMem
-/gameplay/Release
-/gameplay/Simulator
-/gameplay/Simulator-Coverage
-/gameplay/Simulator-Profile
-/gameplay/Device-Debug
-/gameplay/Device-Coverage
-/gameplay/Device-Profile
-/gameplay/Device-Release
-/gameplay/gameplay.xcodeproj/xcuserdata
-/gameplay-encoder/Debug
-/gameplay-encoder/Release
-/gameplay-encoder/gameplay-encoder.xcodeproj/xcuserdata
-/gameplay-internal
-/gameplay-samples/sample00-mesh/Debug
-/gameplay-samples/sample00-mesh/DebugMem
-/gameplay-samples/sample00-mesh/Release
-/gameplay-samples/sample00-mesh/Simulator
-/gameplay-samples/sample00-mesh/Simulator-Coverage
-/gameplay-samples/sample00-mesh/Simulator-Profile
-/gameplay-samples/sample00-mesh/Device-Debug
-/gameplay-samples/sample00-mesh/Device-Coverage
-/gameplay-samples/sample00-mesh/Device-Profile
-/gameplay-samples/sample00-mesh/Device-Release
-/gameplay-samples/sample00-mesh/res/shaders
-/gameplay-samples/sample00-mesh/res/logo_powered_white.png
-/gameplay-samples/sample00-mesh/sample00-mesh.xcodeproj/xcuserdata
-/gameplay-samples/sample01-longboard/Debug
-/gameplay-samples/sample01-longboard/DebugMem
-/gameplay-samples/sample01-longboard/Release
-/gameplay-samples/sample01-longboard/Simulator
-/gameplay-samples/sample01-longboard/Simulator-Coverage
-/gameplay-samples/sample01-longboard/Simulator-Profile
-/gameplay-samples/sample01-longboard/Device-Debug
-/gameplay-samples/sample01-longboard/Device-Coverage
-/gameplay-samples/sample01-longboard/Device-Profile
-/gameplay-samples/sample01-longboard/Device-Release
-/gameplay-samples/sample01-longboard/res/shaders
-/gameplay-samples/sample01-longboard/res/logo_powered_white.png
-/gameplay-samples/sample01-longboard/sample01-longboard.xcodeproj/xcuserdata
-/gameplay-samples/sample02-spaceship/Debug
-/gameplay-samples/sample02-spaceship/DebugMem
-/gameplay-samples/sample02-spaceship/Release
-/gameplay-samples/sample02-spaceship/Simulator
-/gameplay-samples/sample02-spaceship/Simulator-Coverage
-/gameplay-samples/sample02-spaceship/Simulator-Profile
-/gameplay-samples/sample02-spaceship/Device-Debug
-/gameplay-samples/sample02-spaceship/Device-Coverage
-/gameplay-samples/sample02-spaceship/Device-Profile
-/gameplay-samples/sample02-spaceship/Device-Release
-/gameplay-samples/sample02-spaceship/res/shaders
-/gameplay-samples/sample02-spaceship/res/logo_powered_white.png
-/gameplay-samples/sample02-spaceship/sample02-spaceship.xcodeproj/xcuserdata
-/gameplay-samples/sample03-character/Debug
-/gameplay-samples/sample03-character/DebugMem
-/gameplay-samples/sample03-character/Release
-/gameplay-samples/sample03-character/Simulator
-/gameplay-samples/sample03-character/Simulator-Coverage
-/gameplay-samples/sample03-character/Simulator-Profile
-/gameplay-samples/sample03-character/Device-Debug
-/gameplay-samples/sample03-character/Device-Coverage
-/gameplay-samples/sample03-character/Device-Profile
-/gameplay-samples/sample03-character/Device-Release
-/gameplay-samples/sample03-character/res/shaders
-/gameplay-samples/sample03-character/res/logo_powered_white.png
-/gameplay-samples/sample03-character/sample03-character.xcodeproj/xcuserdata
-/gameplay-samples/sample04-particles/Debug
-/gameplay-samples/sample04-particles/DebugMem
-/gameplay-samples/sample04-particles/Release
-/gameplay-samples/sample04-particles/Simulator
-/gameplay-samples/sample04-particles/Simulator-Coverage
-/gameplay-samples/sample04-particles/Simulator-Profile
-/gameplay-samples/sample04-particles/Device-Debug
-/gameplay-samples/sample04-particles/Device-Coverage
-/gameplay-samples/sample04-particles/Device-Profile
-/gameplay-samples/sample04-particles/Device-Release
-/gameplay-samples/sample04-particles/res/shaders
-/gameplay-samples/sample04-particles/res/logo_powered_white.png
-/gameplay-samples/sample04-particles/sample04-particles.xcodeproj/xcuserdata
-
-/gameplay-android/obj
-/gameplay-android/NUL
-/gameplay/android/NUL
-/gameplay/android/proguard.cfg
-/gameplay/android/local.properties
-/gameplay/android/project.properties
-/gameplay/android/obj
-/gameplay-samples/sample00-mesh/android/src
-/gameplay-samples/sample00-mesh/android/assets
-/gameplay-samples/sample00-mesh/android/bin
-/gameplay-samples/sample00-mesh/android/gen
-/gameplay-samples/sample00-mesh/android/libs
-/gameplay-samples/sample00-mesh/android/obj
-/gameplay-android/local.properties
-/gameplay-android/proguard.cfg
-/gameplay-android/project.properties
-/gameplay-samples/sample00-mesh/android/NUL
-/gameplay-samples/sample00-mesh/android/local.properties
-/gameplay-samples/sample00-mesh/android/proguard.cfg
-/gameplay-samples/sample00-mesh/android/project.properties
-/gameplay-samples/sample01-longboard/android/NUL
-/gameplay-samples/sample01-longboard/android/src
-/gameplay-samples/sample01-longboard/android/assets
-/gameplay-samples/sample01-longboard/android/bin
-/gameplay-samples/sample01-longboard/android/gen
-/gameplay-samples/sample01-longboard/android/libs
-/gameplay-samples/sample01-longboard/android/obj
-/gameplay-samples/sample01-longboard/android/project.properties
-/gameplay-samples/sample01-longboard/android/local.properties
-/gameplay-samples/sample02-spaceship/android/project.properties
-/gameplay-samples/sample02-spaceship/android/assets
-/gameplay-samples/sample02-spaceship/android/bin
-/gameplay-samples/sample02-spaceship/android/gen
-/gameplay-samples/sample02-spaceship/android/libs
-/gameplay-samples/sample02-spaceship/android/obj
-/gameplay-samples/sample02-spaceship/android/src
-/gameplay-samples/sample02-spaceship/android/proguard.cfg
-/gameplay-samples/sample02-spaceship/android/local.properties
-/gameplay-samples/sample03-character/android/project.properties
-/gameplay-samples/sample03-character/android/proguard.cfg
-/gameplay-samples/sample03-character/android/local.properties
-/gameplay-samples/sample01-longboard/android/proguard.cfg
-/gameplay-samples/sample02-spaceship/android/NUL
-/gameplay-samples/sample01-longboard/android/proguard.cfg
-/gameplay-samples/sample03-character/android/src
-/gameplay-samples/sample03-character/android/assets
-/gameplay-samples/sample03-character/android/bin
-/gameplay-samples/sample03-character/android/gen
-/gameplay-samples/sample03-character/android/libs
-/gameplay-samples/sample03-character/android/obj
-/gameplay-samples/sample03-character/android/NUL
-/gameplay-samples/sample01-longboard/NUL
-
-
-/gameplay-samples/sample04-particles/Device-Debug
-/gameplay-samples/sample04-particles/Debug
-/gameplay-samples/sample04-particles/DebugMem
-/gameplay-samples/sample03-character/res/gamepad.xcf
-/gameplay-samples/sample04-particles/android/src
-/gameplay-samples/sample04-particles/android/assets
-/gameplay-samples/sample04-particles/android/bin
-/gameplay-samples/sample04-particles/android/gen
-/gameplay-samples/sample04-particles/android/libs
-/gameplay-samples/sample04-particles/android/obj
-/gameplay-samples/sample04-particles/android/proguard.cfg
-/gameplay-samples/sample04-particles/android/local.properties
-/gameplay-samples/sample04-particles/android/project.properties

+ 0 - 36
README.md

@@ -1,36 +0,0 @@
-## gameplay v1.2.0
-An open-source, cross-platform 3D native C++ game framework making it easy to learn and write mobile and desktop games. 
-
-## Supported Mobile Platforms
-- BlackBerry PlayBook 2.0 (using BlackBerry Native SDK 2)
-- Google Android 2.3 (using Google Android NDK r7, SDK API level 9 and up)
-- Apple iOS 5.1 (using Apple XCode 4.3.2)
-
-## Supported Desktop Platforms
-- Microsoft Windows 7 (using Microsoft Visual Studio 2010)
-- Apple MacOS X (using Apple XCode 4.3.2)
-
-## Roadmap for 'next' branch
-- Shadows
-- Lua Script Bindings
-- Terrain
-- AI
-- Editor
-- Performance/Optimizations
-
-## Licence
-The project is open sourced under the Apache 2.0 license.
-
-## Bug Reporting and Feature Requests
-If you find a bug in a Sample, or have an enhancement request, simply file an 
-[Issue](https://github.com/blackberry/GamePlay/issues) and send a message (via github messages) 
-to the Committers to the project to let them know that you have filed 
-an [Issue](https://github.com/blackberry/GamePlay/issues).
-
-## Disclaimer
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 5
gameplay-api/gameplay.html

@@ -1,5 +0,0 @@
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Refresh" CONTENT="0; URL=html/index.html">
-</HEAD>
-</HTML>

TEMPAT SAMPAH
gameplay-api/gameplay.png


+ 0 - 155
gameplay-codestyle.xml

@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<profiles version="1">
-<profile kind="CodeFormatterProfile" name="BSD/Allman Gaming" version="1">
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.lineSplit" value="1024"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_enumerator_list" value="49"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_declarator_list" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_expression_list" value="0"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_compact_if" value="0"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration" value="80"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_switch" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.brace_position_for_array_initializer" value="next_line"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket" value="do not insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters" value="insert"/>
-<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments" value="do not insert"/>
-</profile>
-</profiles>

+ 0 - 56
gameplay-encoder/README.md

@@ -1,56 +0,0 @@
-## gameplay-encoder
-Command-line tool for encoding games assets like true-type fonts and 3D scene files
-into a simple binary-based bundle file format for the gameplay 3D game framework runtime. 
-
-## TrueType Font Support
-TrueType Fonts conversion is enabled/built-in by default into gameplay-encoder via freetype 2 library.
-
-## COLLADA Scene Support
-COLLADA is enabled/built-in by default into gameplay-encoder via COLLADA-DOM library.
-Most major 3D DCC tools support the export of COLLADA 1.4.
-We also recommend you download and use OpenCOLADA (http://opencollada.org/)
-for Autodesk Maya and 3DS Max.
-
-## FBX Scene Support
-FBX support can easily be enabled in gameplay-encoder but requires an 
-additional installation of Autodesk FBX SDK. (http://www.autodesk.com/fbx).
-You must then rebuild gameplay-encoder with the follow platform/tooling instructions:
-
-### Building 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"
-- 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/FbxSdk/2012.2/include
-- Add the FBX lib directory to the Additional Library Directories (Linker/General)
-  * Example: C:/Program Files/Autodesk/FBX/FbxSdk/2012.2/lib/vs2010/x86
-- Add "fbxsdk-2012.2-mdd.lib" and "wininet.lib" to the Additional Dependencies (Linker/Input)
-  * Example: fbxsdk-2012.2-mdd.lib;wininet.lib
-- Add a post build event to copy the DLL (Build Events/Post-Build Event)
-  * Example: copy /Y "C:\Program Files\Autodesk\FBX\FbxSdk\2012.2\lib\vs2010\x86\fbxsdk-2012.2d.dll" "$(TargetDir)"
-- Build gameplay-encoder
-
-### Building FBX Support on Mac OS X using XCode 4.3.2+
-- Download and install the FBX SDK for Mac OS 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/FBXSDK20122/include
-- Add the FBX library and dependency Library/Frameworks: (Build Phases -> Link Binary with Libraries)
-  * Example: /Applications/Autodesk/FBXSDK20122/lib/gcc4/ub/libfbxsdk-2012.2-static.a  (Add Other)
-  * Example: libiconv.dylib, Cocoa.framework, SystemConfiguration.framework
-- Build gameplay-encoder
-
-## Bundle File Format
-The gameplay bundle file format is well defined in the gameplay-encoder/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.
-
-## Disclaimer
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 226
gameplay-encoder/gameplay-bundle.txt

@@ -1,226 +0,0 @@
-gameplay Bundle File Format (.gpb)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-File Description
-================
-A simple binary bundle file format supporting definition of primitve and builtin objects.
-
-File Extension and Mime Type
-============================
-File extension is '.gpb' and the mime type is 'application/gpb'
-
-File Structure
-==============
-
-Section      Name            Type
-------------------------------------------------------------------------------------------------------
-Header
-             Identifier      byte[9]     = { '«', 'G', 'P', 'B', '»', '\r', '\n', '\x1A', '\n' } 
-             Version         byte[2]     = { 1, 1 }
-             References      Reference[]
-Data
-             Objects         Object[]
-
-Objects
-=======
-Supported object types are defined in the table below. Object with unique ids are included
-in the Reference table (see below).
-
-References
-==========
-A Reference is an Object that has a unique id. The Reference contains the unique id of the
-object, a uint for the TypeID a uint for the offset into the package for the object definition.
-
-ID's
-====
-Object ID's are represented as a string which is guaranteed to be unique per file.
-Any object which host an object id should be added to the header Reference table so that it can
-be consumed by reference internally and externally.
-
-Xrefs
-=====
-Xrefs are string with a specific format used for referencing objects internal and external to
-a package. An xref with the format "#id" references an object within the current package with
-the given ID. Xrefs can also have the format "file#id", where "file" is the name of package file
-(relative to the locaiton of the current package) and "id" is the unique identifier of an object
-in that bundle.
-
-Primitives
-==========
-
-Name            Description
-------------------------------------------------------------------------------------------------------
-string          8-bit char array prefixed by unint for length encoding.
-bool            8-bit unsigned char   false=0, true=1.
-byte            8-bit unsigned char
-uint            32-bit unsigned int, stored as four bytes, lowest byte first.
-int             32-bit signed int, stored as four bytes, lowest byte first.
-float           32-bit float, stored as four bytes, with the least significant 
-                    byte of the mantissa first, and the exponent byte last.
-enum X          A uint which is restricted to values from the given enum name "X".
-
-Arrays
-======
-Arrays of constant length are simply the array of data for the expected type. 
-Arrays of dynamic size length(uint) encoded followed by expected type of data.
-Notation:   byte[3]  - constant length notation = byte[3]
-            int[]    - dynamic length notation = length+int[count]
-            Mesh[]   - dynamic length notation = length+Mesh[count]
-
-Enums
-=====
-
-enum VertexUsage
-{
-    POSITION = 1,
-    NORMAL = 2,
-    COLOR = 3,
-    TANGENT = 4,
-    BINORMAL = 5,
-    BLENDWEIGHTS = 6,
-    BLENDINDICES = 7,
-    TEXCOORD0 = 8,
-    TEXCOORD1 = 9,
-    TEXCOORD2 = 10,
-    TEXCOORD3 = 11,
-    TEXCOORD4 = 12,
-    TEXCOORD5 = 13,
-    TEXCOORD6 = 14,
-    TEXCOORD7 = 15
-}
-
-enum FontStyle
-{
-    PLAIN = 0,
-    BOLD = 1,
-    ITALIC = 2,
-    BOLD_ITALIC = 4
-}
-
-enum PrimitiveType
-{
-    TRIANGLES = GL_TRIANGLES (4),
-    TRIANGLE_STRIP = GL_TRIANGLE_STRIP (5),
-    LINES = GL_LINES (1),
-    LINE_STRIP = GL_LINE_STRIP (3),
-    POINTS = GL_POINTS (0)
-}
-
-enum IndexFormat
-{
-    INDEX8 = GL_UNSIGNED_BYTE (0x1401),
-    INDEX16 = GL_UNSIGNED_SHORT (0x1403),
-    INDEX32 = GL_UNSIGNED_INT (0x1405)
-}
-
-enum NodeType
-{
-    NODE = 1,
-    JOINT = 2
-}
-
-
-Object Definitions
-==================
-TypeID->Name    Member                  Type
-------------------------------------------------------------------------------------------------------
-Reference
-                id                      string
-                type                    uint
-                offset                  uint
-------------------------------------------------------------------------------------------------------
-1->Scene
-                nodes                   Node[]
-                activeCameraNode        xref:Node
-                ambientColor            float[3]
-------------------------------------------------------------------------------------------------------
-2->Node
-                type                    enum NodeType
-                transform               float[16]
-                parent_id               string
-                children                Node[]
-                camera                  Camera
-                light                   Light
-                model                   Model
-------------------------------------------------------------------------------------------------------
-3->Animations
-                animations              Animation[]
-------------------------------------------------------------------------------------------------------
-4->Animation
-                id                      string
-                channels                AnimationChannel[]
------------------------------------------------------------------------------------------------------
-5->AnimationChannel
-                targetId                string
-                targetAttribute         uint
-                keyTimes                unsigned long[]  (milliseconds)
-                values                  float[]
-                tangents_in             float[]
-                tangents_out            float[]
-                interpolation           uint[]
-------------------------------------------------------------------------------------------------------
-11->Model
-                mesh                    xref:Mesh
-                meshSkin                MeshSkin
-                materials               Material[]
-------------------------------------------------------------------------------------------------------
-16->Material
-                parameters              MaterialParameter[] { string name, float[] value, uint type }
-                effect                  xref:Effect
-------------------------------------------------------------------------------------------------------
-17->Effect
-                vertexShader            string
-                fragmentShader          string
-------------------------------------------------------------------------------------------------------
-32->Camera
-                cameraType              byte {perspective|orthographic}
-                aspectRatio             float
-                nearPlane               float
-                farPlane                float
-                [ cameraType : perspective
-                  fieldOfView           float
-                ]
-                [ cameraType : orthographic
-                  magnification         float[2]
-                ]
-------------------------------------------------------------------------------------------------------
-33->Light
-                lightType               byte {directional|point|spot}
-                color                   float[3]
-                [ lightType : point
-                  range                 float
-                ]
-                [ lightType : spot
-                  range                 float 
-                  innerAngle            float (in radians)
-                  outerAngle            float (in radians)
-                ]
-------------------------------------------------------------------------------------------------------
-34->Mesh
-                vertexFormat            VertexElement[] { enum VertexUsage usage, unint size }
-                vertices                byte[]
-                boundingBox             BoundingBox { float[3] min, float[3] max }
-                boundingSphere          BoundingSphere { float[3] center, float radius }
-                parts                   MeshPart[]
-------------------------------------------------------------------------------------------------------
-35->MeshPart
-                primitiveType           enum PrimitiveType
-                indexFormat             enum IndexFormat
-                indices                 byte[]
-------------------------------------------------------------------------------------------------------
-36->MeshSkin
-                bindShape               float[16]
-                joints                  xref:Node[]
-                jointsBindPoses         float[] // 16 * joints.length
-                boundingBox             BoundingBox { float[3] min, float[3] max }
-                boundingSphere          BoundingSphere { float[3] center, float radius }
-------------------------------------------------------------------------------------------------------
-128->Font
-                family                  string
-                style                   enum FontStyle
-                size                    uint
-                charset                 string
-                glyphs                  Glyph[] { uint index, uint width, float[4] uvCoords }
-                texMapWidth             uint
-                texMapHeight            uint
-                texMap                  byte[]

+ 0 - 199
gameplay-encoder/gameplay-encoder.vcxproj

@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\Animation.cpp" />
-    <ClCompile Include="src\AnimationChannel.cpp" />
-    <ClCompile Include="src\Base.cpp" />
-    <ClCompile Include="src\BoundingVolume.cpp" />
-    <ClCompile Include="src\Camera.cpp" />
-    <ClCompile Include="src\Curve.cpp" />
-    <ClCompile Include="src\EncoderArguments.cpp" />
-    <ClCompile Include="src\DAEChannelTarget.cpp" />
-    <ClCompile Include="src\DAEOptimizer.cpp" />
-    <ClCompile Include="src\DAESceneEncoder.cpp" />
-    <ClCompile Include="src\DAEUtil.cpp" />
-    <ClCompile Include="src\Effect.cpp" />
-    <ClCompile Include="src\FBXSceneEncoder.cpp" />
-    <ClCompile Include="src\FileIO.cpp" />
-    <ClCompile Include="src\Font.cpp" />
-    <ClCompile Include="src\GPBFile.cpp" />
-    <ClCompile Include="src\Glyph.cpp" />
-    <ClCompile Include="src\GPBDecoder.cpp" />
-    <ClCompile Include="src\Animations.cpp" />
-    <ClCompile Include="src\Light.cpp" />
-    <ClCompile Include="src\main.cpp" />
-    <ClCompile Include="src\Material.cpp" />
-    <ClCompile Include="src\MaterialParameter.cpp" />
-    <ClCompile Include="src\Matrix.cpp" />
-    <ClCompile Include="src\Mesh.cpp" />
-    <ClCompile Include="src\Model.cpp" />
-    <ClCompile Include="src\MeshPart.cpp" />
-    <ClCompile Include="src\MeshSkin.cpp" />
-    <ClCompile Include="src\Node.cpp" />
-    <ClCompile Include="src\Object.cpp" />
-    <ClCompile Include="src\Quaternion.cpp" />
-    <ClCompile Include="src\Reference.cpp" />
-    <ClCompile Include="src\ReferenceTable.cpp" />
-    <ClCompile Include="src\Scene.cpp" />
-    <ClCompile Include="src\StringUtil.cpp" />
-    <ClCompile Include="src\Transform.cpp" />
-    <ClCompile Include="src\TTFFontEncoder.cpp" />
-    <ClCompile Include="src\Vector2.cpp" />
-    <ClCompile Include="src\Vector3.cpp" />
-    <ClCompile Include="src\Vector4.cpp" />
-    <ClCompile Include="src\Vertex.cpp" />
-    <ClCompile Include="src\VertexElement.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\Animation.h" />
-    <ClInclude Include="src\AnimationChannel.h" />
-    <ClInclude Include="src\Base.h" />
-    <ClInclude Include="src\BoundingVolume.h" />
-    <ClInclude Include="src\Camera.h" />
-    <ClInclude Include="src\Curve.h" />
-    <ClInclude Include="src\EncoderArguments.h" />
-    <ClInclude Include="src\DAEChannelTarget.h" />
-    <ClInclude Include="src\DAEOptimizer.h" />
-    <ClInclude Include="src\DAESceneEncoder.h" />
-    <ClInclude Include="src\DAEUtil.h" />
-    <ClInclude Include="src\Effect.h" />
-    <ClInclude Include="src\FBXSceneEncoder.h" />
-    <ClInclude Include="src\FileIO.h" />
-    <ClInclude Include="src\Font.h" />
-    <ClInclude Include="src\GPBFile.h" />
-    <ClInclude Include="src\Glyph.h" />
-    <ClInclude Include="src\GPBDecoder.h" />
-    <ClInclude Include="src\Animations.h" />
-    <ClInclude Include="src\Light.h" />
-    <ClInclude Include="src\Material.h" />
-    <ClInclude Include="src\MaterialParameter.h" />
-    <ClInclude Include="src\Matrix.h" />
-    <ClInclude Include="src\Mesh.h" />
-    <ClInclude Include="src\Model.h" />
-    <ClInclude Include="src\MeshPart.h" />
-    <ClInclude Include="src\MeshSkin.h" />
-    <ClInclude Include="src\Node.h" />
-    <ClInclude Include="src\Object.h" />
-    <ClInclude Include="src\Quaternion.h" />
-    <ClInclude Include="src\Reference.h" />
-    <ClInclude Include="src\ReferenceTable.h" />
-    <ClInclude Include="src\Scene.h" />
-    <ClInclude Include="src\StringUtil.h" />
-    <ClInclude Include="src\Transform.h" />
-    <ClInclude Include="src\TTFFontEncoder.h" />
-    <ClInclude Include="src\Vector2.h" />
-    <ClInclude Include="src\Vector3.h" />
-    <ClInclude Include="src\Vector4.h" />
-    <ClInclude Include="src\Vertex.h" />
-    <ClInclude Include="src\VertexElement.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="gameplay-bundle.txt" />
-    <None Include="src\Curve.inl" />
-    <None Include="src\Quaternion.inl" />
-    <None Include="src\Vector2.inl" />
-    <None Include="src\Vector3.inl" />
-    <None Include="src\Vector4.inl" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{9D69B743-4872-4DD1-8E30-0087C64298D7}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>gameplay-encoder</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <OutDir>$(Configuration)\</OutDir>
-    <IntDir>$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-    <OutDir>$(Configuration)\</OutDir>
-    <IntDir>$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4;../external-deps/libpng/include;../external-deps/zlib/include</AdditionalIncludeDirectories>
-      <DisableLanguageExtensions>
-      </DisableLanguageExtensions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>../external-deps/freetype2/lib/win32;../external-deps/collada-dom/lib/win32;../external-deps/libpng/lib/win32;../external-deps/zlib/lib/win32</AdditionalLibraryDirectories>
-      <AdditionalDependencies>freetype245.lib;libcollada14dom22-d.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy /Y "$(ProjectDir)..\external-deps\collada-dom\lib\win32\*.dll" "$(TargetDir)"
-copy /Y "$(ProjectDir)..\external-deps\zlib\lib\win32\*.dll" "$(TargetDir)"
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4;../external-deps/libpng/include;../external-deps/zlib/include</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>freetype245.lib;libcollada14dom22-d.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>../external-deps/freetype2/lib/win32;../external-deps/collada-dom/lib/win32;../external-deps/libpng/lib/win32;../external-deps/zlib/lib/win32</AdditionalLibraryDirectories>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy /Y "$(ProjectDir)..\external-deps\collada-dom\lib\win32\*.dll" "$(TargetDir)"
-copy /Y "$(ProjectDir)..\external-deps\zlib\lib\win32\*.dll" "$(TargetDir)"
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 279
gameplay-encoder/gameplay-encoder.vcxproj.filters

@@ -1,279 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <ClCompile Include="src\Animation.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\AnimationChannel.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Animations.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Base.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\BoundingVolume.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Camera.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DAEChannelTarget.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DAEOptimizer.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DAESceneEncoder.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DAEUtil.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Effect.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\EncoderArguments.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\FBXSceneEncoder.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\FileIO.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Font.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Glyph.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\GPBDecoder.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\GPBFile.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Light.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\main.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Material.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MaterialParameter.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Matrix.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Mesh.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MeshPart.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MeshSkin.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Model.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Node.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Object.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Quaternion.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Reference.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\ReferenceTable.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Scene.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\StringUtil.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Transform.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\TTFFontEncoder.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Vector2.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Vector3.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Vector4.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Vertex.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\VertexElement.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Curve.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\VertexElement.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Animation.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AnimationChannel.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Animations.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Base.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\BoundingVolume.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Camera.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DAEChannelTarget.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DAEOptimizer.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DAESceneEncoder.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DAEUtil.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Effect.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\EncoderArguments.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\FBXSceneEncoder.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\FileIO.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Font.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Glyph.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\GPBDecoder.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\GPBFile.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Light.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Material.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MaterialParameter.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Matrix.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Mesh.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MeshPart.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MeshSkin.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Model.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Node.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Object.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Quaternion.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Reference.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\ReferenceTable.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Scene.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\StringUtil.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Transform.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\TTFFontEncoder.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Vector2.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Vector3.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Vector4.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Vertex.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Curve.h">
-      <Filter>src</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\Vector2.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\Vector3.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\Vector4.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\Quaternion.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\Curve.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="gameplay-bundle.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <Filter Include="src">
-      <UniqueIdentifier>{6393521c-00fb-48f6-b480-87f8d978a74f}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-</Project>

+ 0 - 13
gameplay-encoder/gameplay-encoder.vcxproj.user

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LocalDebuggerCommandArguments>
-    </LocalDebuggerCommandArguments>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=%PATH%;../external-deps/zlib/lib/win32;../external-deps/libpng/lib/win32</LocalDebuggerEnvironment>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LocalDebuggerEnvironment>PATH=%PATH%;../external-deps/zlib/lib/win32;../external-deps/libpng/lib/win32</LocalDebuggerEnvironment>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-  </PropertyGroup>
-</Project>

+ 0 - 587
gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj

@@ -1,587 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		42475D7C14720ECE00610A6A /* libdom.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42475D7B14720ECE00610A6A /* libdom.a */; };
-		4251B12C152D044B002F6199 /* Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4251B128152D044B002F6199 /* Curve.cpp */; };
-		42783423148D6F7500A6E27F /* FBXSceneEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4278341E148D6F7500A6E27F /* FBXSceneEncoder.cpp */; };
-		4283905914896E6C00E2B2F5 /* BoundingVolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */; };
-		42C8EE0A14724CD700E43619 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDB714724CD700E43619 /* Animation.cpp */; };
-		42C8EE0B14724CD700E43619 /* AnimationChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDB914724CD700E43619 /* AnimationChannel.cpp */; };
-		42C8EE0C14724CD700E43619 /* Animations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDBB14724CD700E43619 /* Animations.cpp */; };
-		42C8EE0D14724CD700E43619 /* Base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDBD14724CD700E43619 /* Base.cpp */; };
-		42C8EE0E14724CD700E43619 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDBF14724CD700E43619 /* Camera.cpp */; };
-		42C8EE1014724CD700E43619 /* DAEChannelTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDC314724CD700E43619 /* DAEChannelTarget.cpp */; };
-		42C8EE1114724CD700E43619 /* DAEOptimizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDC514724CD700E43619 /* DAEOptimizer.cpp */; };
-		42C8EE1214724CD700E43619 /* DAESceneEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDC714724CD700E43619 /* DAESceneEncoder.cpp */; };
-		42C8EE1314724CD700E43619 /* DAEUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDC914724CD700E43619 /* DAEUtil.cpp */; };
-		42C8EE1414724CD700E43619 /* Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDCB14724CD700E43619 /* Effect.cpp */; };
-		42C8EE1514724CD700E43619 /* EncoderArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDCD14724CD700E43619 /* EncoderArguments.cpp */; };
-		42C8EE1614724CD700E43619 /* FileIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDCF14724CD700E43619 /* FileIO.cpp */; };
-		42C8EE1714724CD700E43619 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDD114724CD700E43619 /* Font.cpp */; };
-		42C8EE1814724CD700E43619 /* Glyph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDD314724CD700E43619 /* Glyph.cpp */; };
-		42C8EE1914724CD700E43619 /* GPBDecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDD514724CD700E43619 /* GPBDecoder.cpp */; };
-		42C8EE1A14724CD700E43619 /* GPBFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDD714724CD700E43619 /* GPBFile.cpp */; };
-		42C8EE1B14724CD700E43619 /* Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDD914724CD700E43619 /* Light.cpp */; };
-		42C8EE1D14724CD700E43619 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDDD14724CD700E43619 /* main.cpp */; };
-		42C8EE1E14724CD700E43619 /* Material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDDE14724CD700E43619 /* Material.cpp */; };
-		42C8EE1F14724CD700E43619 /* MaterialParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDE014724CD700E43619 /* MaterialParameter.cpp */; };
-		42C8EE2014724CD700E43619 /* Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDE214724CD700E43619 /* Matrix.cpp */; };
-		42C8EE2114724CD700E43619 /* Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDE414724CD700E43619 /* Mesh.cpp */; };
-		42C8EE2214724CD700E43619 /* MeshPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDE614724CD700E43619 /* MeshPart.cpp */; };
-		42C8EE2314724CD700E43619 /* MeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDE814724CD700E43619 /* MeshSkin.cpp */; };
-		42C8EE2414724CD700E43619 /* MeshSubSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDEA14724CD700E43619 /* MeshSubSet.cpp */; };
-		42C8EE2514724CD700E43619 /* Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDEC14724CD700E43619 /* Model.cpp */; };
-		42C8EE2614724CD700E43619 /* Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDEE14724CD700E43619 /* Node.cpp */; };
-		42C8EE2714724CD700E43619 /* Object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDF014724CD700E43619 /* Object.cpp */; };
-		42C8EE2814724CD700E43619 /* Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDF214724CD700E43619 /* Quaternion.cpp */; };
-		42C8EE2914724CD700E43619 /* Reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDF414724CD700E43619 /* Reference.cpp */; };
-		42C8EE2A14724CD700E43619 /* ReferenceTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDF614724CD700E43619 /* ReferenceTable.cpp */; };
-		42C8EE2B14724CD700E43619 /* Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDF814724CD700E43619 /* Scene.cpp */; };
-		42C8EE2C14724CD700E43619 /* StringUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDFA14724CD700E43619 /* StringUtil.cpp */; };
-		42C8EE2D14724CD700E43619 /* Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDFC14724CD700E43619 /* Transform.cpp */; };
-		42C8EE2E14724CD700E43619 /* TTFFontEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDFE14724CD700E43619 /* TTFFontEncoder.cpp */; };
-		42C8EE2F14724CD700E43619 /* Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EE0014724CD700E43619 /* Vector2.cpp */; };
-		42C8EE3014724CD700E43619 /* Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EE0214724CD700E43619 /* Vector3.cpp */; };
-		42C8EE3114724CD700E43619 /* Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EE0414724CD700E43619 /* Vector4.cpp */; };
-		42C8EE3214724CD700E43619 /* Vertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EE0614724CD700E43619 /* Vertex.cpp */; };
-		42C8EE3314724CD700E43619 /* VertexElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EE0814724CD700E43619 /* VertexElement.cpp */; };
-		42C8EE351472B60100E43619 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C8EE341472B60100E43619 /* libfreetype.a */; };
-		42C8EE371472D7E700E43619 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C8EE361472D7E700E43619 /* libxml2.dylib */; };
-		42C8EE391472DAA300E43619 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C8EE381472DAA300E43619 /* libz.dylib */; };
-		42C8EE3B1472DAAE00E43619 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C8EE3A1472DAAE00E43619 /* libbz2.dylib */; };
-		42D277591472EFA700D867A4 /* libpcre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42D277571472EFA700D867A4 /* libpcre.a */; };
-		42D2775A1472EFA700D867A4 /* libpcrecpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42D277581472EFA700D867A4 /* libpcrecpp.a */; };
-		5BCD0643152CFC3C0071FAB5 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BCD0642152CFC3C0071FAB5 /* libpng.a */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-		42475CE4147208A000610A6A /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = /usr/share/man/man1/;
-			dstSubfolderSpec = 0;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 1;
-		};
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-		42475CE6147208A000610A6A /* gameplay-encoder */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "gameplay-encoder"; sourceTree = BUILT_PRODUCTS_DIR; };
-		42475D7B14720ECE00610A6A /* libdom.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdom.a; path = "../external-deps/collada-dom/lib/macosx/libdom.a"; sourceTree = "<group>"; };
-		4251B128152D044B002F6199 /* Curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Curve.cpp; path = src/Curve.cpp; sourceTree = SOURCE_ROOT; };
-		4251B129152D044B002F6199 /* Curve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Curve.h; path = src/Curve.h; sourceTree = SOURCE_ROOT; };
-		4251B12A152D044B002F6199 /* Curve.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Curve.inl; path = src/Curve.inl; sourceTree = SOURCE_ROOT; };
-		4251B12B152D044B002F6199 /* Quaternion.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Quaternion.inl; path = src/Quaternion.inl; sourceTree = SOURCE_ROOT; };
-		4278341E148D6F7500A6E27F /* FBXSceneEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FBXSceneEncoder.cpp; path = src/FBXSceneEncoder.cpp; sourceTree = SOURCE_ROOT; };
-		4278341F148D6F7500A6E27F /* FBXSceneEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBXSceneEncoder.h; path = src/FBXSceneEncoder.h; sourceTree = SOURCE_ROOT; };
-		42783420148D6F7500A6E27F /* Vector2.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Vector2.inl; path = src/Vector2.inl; sourceTree = SOURCE_ROOT; };
-		42783421148D6F7500A6E27F /* Vector3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Vector3.inl; path = src/Vector3.inl; sourceTree = SOURCE_ROOT; };
-		42783422148D6F7500A6E27F /* Vector4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Vector4.inl; path = src/Vector4.inl; sourceTree = SOURCE_ROOT; };
-		4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoundingVolume.cpp; path = src/BoundingVolume.cpp; sourceTree = SOURCE_ROOT; };
-		4283905814896E6C00E2B2F5 /* BoundingVolume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoundingVolume.h; path = src/BoundingVolume.h; sourceTree = SOURCE_ROOT; };
-		42C8EDB714724CD700E43619 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = src/Animation.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDB814724CD700E43619 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = src/Animation.h; sourceTree = SOURCE_ROOT; };
-		42C8EDB914724CD700E43619 /* AnimationChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationChannel.cpp; path = src/AnimationChannel.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDBA14724CD700E43619 /* AnimationChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationChannel.h; path = src/AnimationChannel.h; sourceTree = SOURCE_ROOT; };
-		42C8EDBB14724CD700E43619 /* Animations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animations.cpp; path = src/Animations.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDBC14724CD700E43619 /* Animations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animations.h; path = src/Animations.h; sourceTree = SOURCE_ROOT; };
-		42C8EDBD14724CD700E43619 /* Base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Base.cpp; path = src/Base.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDBE14724CD700E43619 /* Base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Base.h; path = src/Base.h; sourceTree = SOURCE_ROOT; };
-		42C8EDBF14724CD700E43619 /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Camera.cpp; path = src/Camera.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDC014724CD700E43619 /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Camera.h; path = src/Camera.h; sourceTree = SOURCE_ROOT; };
-		42C8EDC314724CD700E43619 /* DAEChannelTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DAEChannelTarget.cpp; path = src/DAEChannelTarget.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDC414724CD700E43619 /* DAEChannelTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DAEChannelTarget.h; path = src/DAEChannelTarget.h; sourceTree = SOURCE_ROOT; };
-		42C8EDC514724CD700E43619 /* DAEOptimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DAEOptimizer.cpp; path = src/DAEOptimizer.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDC614724CD700E43619 /* DAEOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DAEOptimizer.h; path = src/DAEOptimizer.h; sourceTree = SOURCE_ROOT; };
-		42C8EDC714724CD700E43619 /* DAESceneEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DAESceneEncoder.cpp; path = src/DAESceneEncoder.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDC814724CD700E43619 /* DAESceneEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DAESceneEncoder.h; path = src/DAESceneEncoder.h; sourceTree = SOURCE_ROOT; };
-		42C8EDC914724CD700E43619 /* DAEUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DAEUtil.cpp; path = src/DAEUtil.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDCA14724CD700E43619 /* DAEUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DAEUtil.h; path = src/DAEUtil.h; sourceTree = SOURCE_ROOT; };
-		42C8EDCB14724CD700E43619 /* Effect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Effect.cpp; path = src/Effect.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDCC14724CD700E43619 /* Effect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Effect.h; path = src/Effect.h; sourceTree = SOURCE_ROOT; };
-		42C8EDCD14724CD700E43619 /* EncoderArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EncoderArguments.cpp; path = src/EncoderArguments.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDCE14724CD700E43619 /* EncoderArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EncoderArguments.h; path = src/EncoderArguments.h; sourceTree = SOURCE_ROOT; };
-		42C8EDCF14724CD700E43619 /* FileIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileIO.cpp; path = src/FileIO.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDD014724CD700E43619 /* FileIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileIO.h; path = src/FileIO.h; sourceTree = SOURCE_ROOT; };
-		42C8EDD114724CD700E43619 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Font.cpp; path = src/Font.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDD214724CD700E43619 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Font.h; path = src/Font.h; sourceTree = SOURCE_ROOT; };
-		42C8EDD314724CD700E43619 /* Glyph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Glyph.cpp; path = src/Glyph.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDD414724CD700E43619 /* Glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Glyph.h; path = src/Glyph.h; sourceTree = SOURCE_ROOT; };
-		42C8EDD514724CD700E43619 /* GPBDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GPBDecoder.cpp; path = src/GPBDecoder.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDD614724CD700E43619 /* GPBDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPBDecoder.h; path = src/GPBDecoder.h; sourceTree = SOURCE_ROOT; };
-		42C8EDD714724CD700E43619 /* GPBFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GPBFile.cpp; path = src/GPBFile.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDD814724CD700E43619 /* GPBFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPBFile.h; path = src/GPBFile.h; sourceTree = SOURCE_ROOT; };
-		42C8EDD914724CD700E43619 /* Light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Light.cpp; path = src/Light.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDDA14724CD700E43619 /* Light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Light.h; path = src/Light.h; sourceTree = SOURCE_ROOT; };
-		42C8EDDD14724CD700E43619 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDDE14724CD700E43619 /* Material.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Material.cpp; path = src/Material.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDDF14724CD700E43619 /* Material.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Material.h; path = src/Material.h; sourceTree = SOURCE_ROOT; };
-		42C8EDE014724CD700E43619 /* MaterialParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MaterialParameter.cpp; path = src/MaterialParameter.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDE114724CD700E43619 /* MaterialParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MaterialParameter.h; path = src/MaterialParameter.h; sourceTree = SOURCE_ROOT; };
-		42C8EDE214724CD700E43619 /* Matrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Matrix.cpp; path = src/Matrix.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDE314724CD700E43619 /* Matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Matrix.h; path = src/Matrix.h; sourceTree = SOURCE_ROOT; };
-		42C8EDE414724CD700E43619 /* Mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mesh.cpp; path = src/Mesh.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDE514724CD700E43619 /* Mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mesh.h; path = src/Mesh.h; sourceTree = SOURCE_ROOT; };
-		42C8EDE614724CD700E43619 /* MeshPart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshPart.cpp; path = src/MeshPart.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDE714724CD700E43619 /* MeshPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshPart.h; path = src/MeshPart.h; sourceTree = SOURCE_ROOT; };
-		42C8EDE814724CD700E43619 /* MeshSkin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshSkin.cpp; path = src/MeshSkin.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDE914724CD700E43619 /* MeshSkin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshSkin.h; path = src/MeshSkin.h; sourceTree = SOURCE_ROOT; };
-		42C8EDEA14724CD700E43619 /* MeshSubSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshSubSet.cpp; path = src/MeshSubSet.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDEB14724CD700E43619 /* MeshSubSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshSubSet.h; path = src/MeshSubSet.h; sourceTree = SOURCE_ROOT; };
-		42C8EDEC14724CD700E43619 /* Model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Model.cpp; path = src/Model.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDED14724CD700E43619 /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Model.h; path = src/Model.h; sourceTree = SOURCE_ROOT; };
-		42C8EDEE14724CD700E43619 /* Node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Node.cpp; path = src/Node.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDEF14724CD700E43619 /* Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Node.h; path = src/Node.h; sourceTree = SOURCE_ROOT; };
-		42C8EDF014724CD700E43619 /* Object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Object.cpp; path = src/Object.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDF114724CD700E43619 /* Object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Object.h; path = src/Object.h; sourceTree = SOURCE_ROOT; };
-		42C8EDF214724CD700E43619 /* Quaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Quaternion.cpp; path = src/Quaternion.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDF314724CD700E43619 /* Quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Quaternion.h; path = src/Quaternion.h; sourceTree = SOURCE_ROOT; };
-		42C8EDF414724CD700E43619 /* Reference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Reference.cpp; path = src/Reference.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDF514724CD700E43619 /* Reference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reference.h; path = src/Reference.h; sourceTree = SOURCE_ROOT; };
-		42C8EDF614724CD700E43619 /* ReferenceTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ReferenceTable.cpp; path = src/ReferenceTable.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDF714724CD700E43619 /* ReferenceTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ReferenceTable.h; path = src/ReferenceTable.h; sourceTree = SOURCE_ROOT; };
-		42C8EDF814724CD700E43619 /* Scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Scene.cpp; path = src/Scene.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDF914724CD700E43619 /* Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scene.h; path = src/Scene.h; sourceTree = SOURCE_ROOT; };
-		42C8EDFA14724CD700E43619 /* StringUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringUtil.cpp; path = src/StringUtil.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDFB14724CD700E43619 /* StringUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringUtil.h; path = src/StringUtil.h; sourceTree = SOURCE_ROOT; };
-		42C8EDFC14724CD700E43619 /* Transform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Transform.cpp; path = src/Transform.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDFD14724CD700E43619 /* Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Transform.h; path = src/Transform.h; sourceTree = SOURCE_ROOT; };
-		42C8EDFE14724CD700E43619 /* TTFFontEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TTFFontEncoder.cpp; path = src/TTFFontEncoder.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EDFF14724CD700E43619 /* TTFFontEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TTFFontEncoder.h; path = src/TTFFontEncoder.h; sourceTree = SOURCE_ROOT; };
-		42C8EE0014724CD700E43619 /* Vector2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vector2.cpp; path = src/Vector2.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EE0114724CD700E43619 /* Vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vector2.h; path = src/Vector2.h; sourceTree = SOURCE_ROOT; };
-		42C8EE0214724CD700E43619 /* Vector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vector3.cpp; path = src/Vector3.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EE0314724CD700E43619 /* Vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vector3.h; path = src/Vector3.h; sourceTree = SOURCE_ROOT; };
-		42C8EE0414724CD700E43619 /* Vector4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vector4.cpp; path = src/Vector4.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EE0514724CD700E43619 /* Vector4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vector4.h; path = src/Vector4.h; sourceTree = SOURCE_ROOT; };
-		42C8EE0614724CD700E43619 /* Vertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vertex.cpp; path = src/Vertex.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EE0714724CD700E43619 /* Vertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vertex.h; path = src/Vertex.h; sourceTree = SOURCE_ROOT; };
-		42C8EE0814724CD700E43619 /* VertexElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexElement.cpp; path = src/VertexElement.cpp; sourceTree = SOURCE_ROOT; };
-		42C8EE0914724CD700E43619 /* VertexElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexElement.h; path = src/VertexElement.h; sourceTree = SOURCE_ROOT; };
-		42C8EE341472B60100E43619 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = "../external-deps/freetype2/lib/macosx/libfreetype.a"; sourceTree = "<group>"; };
-		42C8EE361472D7E700E43619 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
-		42C8EE381472DAA300E43619 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
-		42C8EE3A1472DAAE00E43619 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; };
-		42D277571472EFA700D867A4 /* libpcre.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpcre.a; path = "../external-deps/pcre/lib/macosx/libpcre.a"; sourceTree = "<group>"; };
-		42D277581472EFA700D867A4 /* libpcrecpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpcrecpp.a; path = "../external-deps/pcre/lib/macosx/libpcrecpp.a"; sourceTree = "<group>"; };
-		5BCD0642152CFC3C0071FAB5 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/libpng/lib/macosx/libpng.a"; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		42475CE3147208A000610A6A /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				42D277591472EFA700D867A4 /* libpcre.a in Frameworks */,
-				42D2775A1472EFA700D867A4 /* libpcrecpp.a in Frameworks */,
-				42C8EE351472B60100E43619 /* libfreetype.a in Frameworks */,
-				42475D7C14720ECE00610A6A /* libdom.a in Frameworks */,
-				42C8EE3B1472DAAE00E43619 /* libbz2.dylib in Frameworks */,
-				42C8EE391472DAA300E43619 /* libz.dylib in Frameworks */,
-				42C8EE371472D7E700E43619 /* libxml2.dylib in Frameworks */,
-				5BCD0643152CFC3C0071FAB5 /* libpng.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		42475CDB147208A000610A6A = {
-			isa = PBXGroup;
-			children = (
-				42475CE9147208A000610A6A /* src */,
-				427D4F44147DC9080076760E /* Libraries */,
-				42475CE7147208A000610A6A /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		42475CE7147208A000610A6A /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				42475CE6147208A000610A6A /* gameplay-encoder */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		42475CE9147208A000610A6A /* src */ = {
-			isa = PBXGroup;
-			children = (
-				42C8EDB714724CD700E43619 /* Animation.cpp */,
-				42C8EDB814724CD700E43619 /* Animation.h */,
-				42C8EDB914724CD700E43619 /* AnimationChannel.cpp */,
-				42C8EDBA14724CD700E43619 /* AnimationChannel.h */,
-				42C8EDBB14724CD700E43619 /* Animations.cpp */,
-				42C8EDBC14724CD700E43619 /* Animations.h */,
-				42C8EDBD14724CD700E43619 /* Base.cpp */,
-				42C8EDBE14724CD700E43619 /* Base.h */,
-				4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */,
-				4283905814896E6C00E2B2F5 /* BoundingVolume.h */,
-				42C8EDBF14724CD700E43619 /* Camera.cpp */,
-				42C8EDC014724CD700E43619 /* Camera.h */,
-				4251B128152D044B002F6199 /* Curve.cpp */,
-				4251B129152D044B002F6199 /* Curve.h */,
-				4251B12A152D044B002F6199 /* Curve.inl */,
-				42C8EDC314724CD700E43619 /* DAEChannelTarget.cpp */,
-				42C8EDC414724CD700E43619 /* DAEChannelTarget.h */,
-				42C8EDC514724CD700E43619 /* DAEOptimizer.cpp */,
-				42C8EDC614724CD700E43619 /* DAEOptimizer.h */,
-				42C8EDC714724CD700E43619 /* DAESceneEncoder.cpp */,
-				42C8EDC814724CD700E43619 /* DAESceneEncoder.h */,
-				42C8EDC914724CD700E43619 /* DAEUtil.cpp */,
-				42C8EDCA14724CD700E43619 /* DAEUtil.h */,
-				42C8EDCB14724CD700E43619 /* Effect.cpp */,
-				42C8EDCC14724CD700E43619 /* Effect.h */,
-				42C8EDCD14724CD700E43619 /* EncoderArguments.cpp */,
-				42C8EDCE14724CD700E43619 /* EncoderArguments.h */,
-				4278341E148D6F7500A6E27F /* FBXSceneEncoder.cpp */,
-				4278341F148D6F7500A6E27F /* FBXSceneEncoder.h */,
-				42C8EDCF14724CD700E43619 /* FileIO.cpp */,
-				42C8EDD014724CD700E43619 /* FileIO.h */,
-				42C8EDD114724CD700E43619 /* Font.cpp */,
-				42C8EDD214724CD700E43619 /* Font.h */,
-				42C8EDD314724CD700E43619 /* Glyph.cpp */,
-				42C8EDD414724CD700E43619 /* Glyph.h */,
-				42C8EDD514724CD700E43619 /* GPBDecoder.cpp */,
-				42C8EDD614724CD700E43619 /* GPBDecoder.h */,
-				42C8EDD714724CD700E43619 /* GPBFile.cpp */,
-				42C8EDD814724CD700E43619 /* GPBFile.h */,
-				42C8EDD914724CD700E43619 /* Light.cpp */,
-				42C8EDDA14724CD700E43619 /* Light.h */,
-				42C8EDDD14724CD700E43619 /* main.cpp */,
-				42C8EDDE14724CD700E43619 /* Material.cpp */,
-				42C8EDDF14724CD700E43619 /* Material.h */,
-				42C8EDE014724CD700E43619 /* MaterialParameter.cpp */,
-				42C8EDE114724CD700E43619 /* MaterialParameter.h */,
-				42C8EDE214724CD700E43619 /* Matrix.cpp */,
-				42C8EDE314724CD700E43619 /* Matrix.h */,
-				42C8EDE414724CD700E43619 /* Mesh.cpp */,
-				42C8EDE514724CD700E43619 /* Mesh.h */,
-				42C8EDE614724CD700E43619 /* MeshPart.cpp */,
-				42C8EDE714724CD700E43619 /* MeshPart.h */,
-				42C8EDE814724CD700E43619 /* MeshSkin.cpp */,
-				42C8EDE914724CD700E43619 /* MeshSkin.h */,
-				42C8EDEA14724CD700E43619 /* MeshSubSet.cpp */,
-				42C8EDEB14724CD700E43619 /* MeshSubSet.h */,
-				42C8EDEC14724CD700E43619 /* Model.cpp */,
-				42C8EDED14724CD700E43619 /* Model.h */,
-				42C8EDEE14724CD700E43619 /* Node.cpp */,
-				42C8EDEF14724CD700E43619 /* Node.h */,
-				42C8EDF014724CD700E43619 /* Object.cpp */,
-				42C8EDF114724CD700E43619 /* Object.h */,
-				42C8EDF214724CD700E43619 /* Quaternion.cpp */,
-				42C8EDF314724CD700E43619 /* Quaternion.h */,
-				4251B12B152D044B002F6199 /* Quaternion.inl */,
-				42C8EDF414724CD700E43619 /* Reference.cpp */,
-				42C8EDF514724CD700E43619 /* Reference.h */,
-				42C8EDF614724CD700E43619 /* ReferenceTable.cpp */,
-				42C8EDF714724CD700E43619 /* ReferenceTable.h */,
-				42C8EDF814724CD700E43619 /* Scene.cpp */,
-				42C8EDF914724CD700E43619 /* Scene.h */,
-				42C8EDFA14724CD700E43619 /* StringUtil.cpp */,
-				42C8EDFB14724CD700E43619 /* StringUtil.h */,
-				42C8EDFC14724CD700E43619 /* Transform.cpp */,
-				42C8EDFD14724CD700E43619 /* Transform.h */,
-				42C8EDFE14724CD700E43619 /* TTFFontEncoder.cpp */,
-				42C8EDFF14724CD700E43619 /* TTFFontEncoder.h */,
-				42C8EE0014724CD700E43619 /* Vector2.cpp */,
-				42C8EE0114724CD700E43619 /* Vector2.h */,
-				42783420148D6F7500A6E27F /* Vector2.inl */,
-				42C8EE0214724CD700E43619 /* Vector3.cpp */,
-				42C8EE0314724CD700E43619 /* Vector3.h */,
-				42783421148D6F7500A6E27F /* Vector3.inl */,
-				42C8EE0414724CD700E43619 /* Vector4.cpp */,
-				42C8EE0514724CD700E43619 /* Vector4.h */,
-				42783422148D6F7500A6E27F /* Vector4.inl */,
-				42C8EE0614724CD700E43619 /* Vertex.cpp */,
-				42C8EE0714724CD700E43619 /* Vertex.h */,
-				42C8EE0814724CD700E43619 /* VertexElement.cpp */,
-				42C8EE0914724CD700E43619 /* VertexElement.h */,
-			);
-			name = src;
-			path = "gameplay-encoder";
-			sourceTree = "<group>";
-		};
-		427D4F44147DC9080076760E /* Libraries */ = {
-			isa = PBXGroup;
-			children = (
-				5BCD0642152CFC3C0071FAB5 /* libpng.a */,
-				42D277571472EFA700D867A4 /* libpcre.a */,
-				42D277581472EFA700D867A4 /* libpcrecpp.a */,
-				42C8EE3A1472DAAE00E43619 /* libbz2.dylib */,
-				42C8EE381472DAA300E43619 /* libz.dylib */,
-				42C8EE361472D7E700E43619 /* libxml2.dylib */,
-				42C8EE341472B60100E43619 /* libfreetype.a */,
-				42475D7B14720ECE00610A6A /* libdom.a */,
-			);
-			name = Libraries;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		42475CE5147208A000610A6A /* gameplay-encoder */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 42475CF0147208A100610A6A /* Build configuration list for PBXNativeTarget "gameplay-encoder" */;
-			buildPhases = (
-				42475CE2147208A000610A6A /* Sources */,
-				42475CE3147208A000610A6A /* Frameworks */,
-				42475CE4147208A000610A6A /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "gameplay-encoder";
-			productName = "gameplay-encoder";
-			productReference = 42475CE6147208A000610A6A /* gameplay-encoder */;
-			productType = "com.apple.product-type.tool";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		42475CDD147208A000610A6A /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0430;
-			};
-			buildConfigurationList = 42475CE0147208A000610A6A /* Build configuration list for PBXProject "gameplay-encoder" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-			);
-			mainGroup = 42475CDB147208A000610A6A;
-			productRefGroup = 42475CE7147208A000610A6A /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				42475CE5147208A000610A6A /* gameplay-encoder */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-		42475CE2147208A000610A6A /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				42C8EE0A14724CD700E43619 /* Animation.cpp in Sources */,
-				42C8EE0B14724CD700E43619 /* AnimationChannel.cpp in Sources */,
-				42C8EE0C14724CD700E43619 /* Animations.cpp in Sources */,
-				42C8EE0D14724CD700E43619 /* Base.cpp in Sources */,
-				42C8EE0E14724CD700E43619 /* Camera.cpp in Sources */,
-				42C8EE1014724CD700E43619 /* DAEChannelTarget.cpp in Sources */,
-				42C8EE1114724CD700E43619 /* DAEOptimizer.cpp in Sources */,
-				42C8EE1214724CD700E43619 /* DAESceneEncoder.cpp in Sources */,
-				42C8EE1314724CD700E43619 /* DAEUtil.cpp in Sources */,
-				42C8EE1414724CD700E43619 /* Effect.cpp in Sources */,
-				42C8EE1514724CD700E43619 /* EncoderArguments.cpp in Sources */,
-				42C8EE1614724CD700E43619 /* FileIO.cpp in Sources */,
-				42C8EE1714724CD700E43619 /* Font.cpp in Sources */,
-				42C8EE1814724CD700E43619 /* Glyph.cpp in Sources */,
-				42C8EE1914724CD700E43619 /* GPBDecoder.cpp in Sources */,
-				42C8EE1A14724CD700E43619 /* GPBFile.cpp in Sources */,
-				42C8EE1B14724CD700E43619 /* Light.cpp in Sources */,
-				42C8EE1D14724CD700E43619 /* main.cpp in Sources */,
-				42C8EE1E14724CD700E43619 /* Material.cpp in Sources */,
-				42C8EE1F14724CD700E43619 /* MaterialParameter.cpp in Sources */,
-				42C8EE2014724CD700E43619 /* Matrix.cpp in Sources */,
-				42C8EE2114724CD700E43619 /* Mesh.cpp in Sources */,
-				42C8EE2214724CD700E43619 /* MeshPart.cpp in Sources */,
-				42C8EE2314724CD700E43619 /* MeshSkin.cpp in Sources */,
-				42C8EE2414724CD700E43619 /* MeshSubSet.cpp in Sources */,
-				42C8EE2514724CD700E43619 /* Model.cpp in Sources */,
-				42C8EE2614724CD700E43619 /* Node.cpp in Sources */,
-				42C8EE2714724CD700E43619 /* Object.cpp in Sources */,
-				42C8EE2814724CD700E43619 /* Quaternion.cpp in Sources */,
-				42C8EE2914724CD700E43619 /* Reference.cpp in Sources */,
-				42C8EE2A14724CD700E43619 /* ReferenceTable.cpp in Sources */,
-				42C8EE2B14724CD700E43619 /* Scene.cpp in Sources */,
-				42C8EE2C14724CD700E43619 /* StringUtil.cpp in Sources */,
-				42C8EE2D14724CD700E43619 /* Transform.cpp in Sources */,
-				42C8EE2E14724CD700E43619 /* TTFFontEncoder.cpp in Sources */,
-				42C8EE2F14724CD700E43619 /* Vector2.cpp in Sources */,
-				42C8EE3014724CD700E43619 /* Vector3.cpp in Sources */,
-				42C8EE3114724CD700E43619 /* Vector4.cpp in Sources */,
-				42C8EE3214724CD700E43619 /* Vertex.cpp in Sources */,
-				42C8EE3314724CD700E43619 /* VertexElement.cpp in Sources */,
-				4283905914896E6C00E2B2F5 /* BoundingVolume.cpp in Sources */,
-				42783423148D6F7500A6E27F /* FBXSceneEncoder.cpp in Sources */,
-				4251B12C152D044B002F6199 /* Curve.cpp in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		42475CEE147208A100610A6A /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				COPY_PHASE_STRIP = NO;
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					DOM_INCLUDE_LIBXML,
-					NO_BOOST,
-					NO_ZAE,
-					"DEBUG=1",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype/include",
-					"../external-deps/collada-dom/include",
-					"../external-deps/collada-dom/include/1.4",
-					"../external-deps/libpng/include",
-				);
-				INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				ONLY_ACTIVE_ARCH = YES;
-				OTHER_TEST_FLAGS = "";
-				PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
-				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = "../external-deps/freetype/include ../external-deps/collada-dom/include ../external-deps/collada-dom/include/1.4 ./external-deps/libpng/include";
-				WARNING_CFLAGS = "";
-			};
-			name = Debug;
-		};
-		42475CEF147208A100610A6A /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					DOM_INCLUDE_LIBXML,
-					NO_BOOST,
-					NO_ZAE,
-				);
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype/include",
-					"../external-deps/collada-dom/include",
-					"../external-deps/collada-dom/include/1.4",
-					"../external-deps/libpng/include",
-				);
-				INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				OTHER_TEST_FLAGS = "";
-				PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
-				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = "../external-deps/freetype/include ../external-deps/collada-dom/include ../external-deps/collada-dom/include/1.4 ./external-deps/libpng/include";
-				WARNING_CFLAGS = "";
-			};
-			name = Release;
-		};
-		42475CF1147208A100610A6A /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
-				CLANG_CXX_LIBRARY = "compiler-default";
-				GCC_C_LANGUAGE_STANDARD = "compiler-default";
-				GCC_ENABLE_CPP_EXCEPTIONS = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
-				GCC_WARN_UNUSED_VARIABLE = NO;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype2/include",
-					"../external-deps/collada-dom/include",
-					"../external-deps/collada-dom/include/1.4",
-					"../external-deps/libpng/include",
-				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/freetype2/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/collada-dom/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/pcre/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
-					"\"$(SRCROOT)\"",
-				);
-				MACH_O_TYPE = mh_execute;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				USER_HEADER_SEARCH_PATHS = "../external-deps/freetype2/include ../external-deps/collada-dom/include ../external-deps/collada-dom/include/1.4 ../external-deps/libpng/include";
-			};
-			name = Debug;
-		};
-		42475CF2147208A100610A6A /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
-				CLANG_CXX_LIBRARY = "compiler-default";
-				GCC_C_LANGUAGE_STANDARD = "compiler-default";
-				GCC_ENABLE_CPP_EXCEPTIONS = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
-				GCC_WARN_UNUSED_VARIABLE = NO;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype2/include",
-					"../external-deps/collada-dom/include",
-					"../external-deps/collada-dom/include/1.4",
-					"../external-deps/libpng/include",
-				);
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/freetype2/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/collada-dom/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/pcre/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
-					"\"$(SRCROOT)\"",
-				);
-				MACH_O_TYPE = mh_execute;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				USER_HEADER_SEARCH_PATHS = "../external-deps/freetype2/include ../external-deps/collada-dom/include ../external-deps/collada-dom/include/1.4 ../external-deps/libpng/include";
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		42475CE0147208A000610A6A /* Build configuration list for PBXProject "gameplay-encoder" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				42475CEE147208A100610A6A /* Debug */,
-				42475CEF147208A100610A6A /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		42475CF0147208A100610A6A /* Build configuration list for PBXNativeTarget "gameplay-encoder" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				42475CF1147208A100610A6A /* Debug */,
-				42475CF2147208A100610A6A /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 42475CDD147208A000610A6A /* Project object */;
-}

+ 0 - 86
gameplay-encoder/gameplay-encoder.xcodeproj/xcshareddata/xcschemes/gameplay-encoder.xcscheme

@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "0430"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "42475CE5147208A000610A6A"
-               BuildableName = "gameplay-encoder"
-               BlueprintName = "gameplay-encoder"
-               ReferencedContainer = "container:gameplay-encoder.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      buildConfiguration = "Debug">
-      <Testables>
-      </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "42475CE5147208A000610A6A"
-            BuildableName = "gameplay-encoder"
-            BlueprintName = "gameplay-encoder"
-            ReferencedContainer = "container:gameplay-encoder.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-   </TestAction>
-   <LaunchAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      buildConfiguration = "Debug"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      allowLocationSimulation = "YES">
-      <BuildableProductRunnable>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "42475CE5147208A000610A6A"
-            BuildableName = "gameplay-encoder"
-            BlueprintName = "gameplay-encoder"
-            ReferencedContainer = "container:gameplay-encoder.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      buildConfiguration = "Release"
-      debugDocumentVersioning = "YES">
-      <BuildableProductRunnable>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "42475CE5147208A000610A6A"
-            BuildableName = "gameplay-encoder"
-            BlueprintName = "gameplay-encoder"
-            ReferencedContainer = "container:gameplay-encoder.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 0 - 74
gameplay-encoder/src/Animation.cpp

@@ -1,74 +0,0 @@
-#include "Base.h"
-#include "Animation.h"
-
-namespace gameplay
-{
-
-Animation::Animation(void)
-{
-}
-
-Animation::~Animation(void)
-{
-}
-
-unsigned int Animation::getTypeId(void) const
-{
-    return ANIMATION_ID;
-}
-const char* Animation::getElementName(void) const
-{
-    return "Animation";
-}
-
-void Animation::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    // Animation writes its ID because it is not listed in the ref table.
-    write(getId(), file);
-    write(_channels.size(), file);
-    for (std::vector<AnimationChannel*>::iterator i = _channels.begin(); i != _channels.end(); ++i)
-    {
-        (*i)->writeBinary(file);
-    }
-}
-
-void Animation::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    if (_channels.size() > 0 )
-    {
-        for (std::vector<AnimationChannel*>::iterator i = _channels.begin(); i != _channels.end(); ++i)
-        {
-            (*i)->writeText(file);
-        }
-    }
-    fprintElementEnd(file);
-}
-
-void Animation::add(AnimationChannel* animationChannel)
-{
-    _channels.push_back(animationChannel);
-}
-
-void Animation::remove(AnimationChannel* animationChannel)
-{
-    std::vector<AnimationChannel*>::iterator it = std::find(_channels.begin(), _channels.end(), animationChannel);
-    if (it != _channels.end())
-    {
-        _channels.erase(it);
-    }
-}
-
-unsigned int Animation::getAnimationChannelCount() const
-{
-    return _channels.size();
-}
-
-AnimationChannel* Animation::getAnimationChannel(unsigned int index) const
-{
-    assert(index < _channels.size());
-    return _channels[index];
-}
-
-}

+ 0 - 66
gameplay-encoder/src/Animation.h

@@ -1,66 +0,0 @@
-#ifndef ANIMATION_H_
-#define ANIMATION_H_
-
-#include "Object.h"
-#include "AnimationChannel.h"
-
-namespace gameplay
-{
-
-class Animation : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Animation(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Animation(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    /**
-     * Adds the given animation channel to this animation.
-     * 
-     * @param animationChannel The animation channel to add.
-     */
-    void add(AnimationChannel* animationChannel);
-
-    /**
-     * Removes the given animation channel from this animation.
-     * 
-     * @param animationChannel The animation channel to remove.
-     */
-    void remove(AnimationChannel* animationChannel);
-
-    /**
-     * Returns the number of animation channels contained in this animation.
-     * 
-     * @return The number of animation channels.
-     */
-    unsigned int getAnimationChannelCount() const;
-
-    /**
-     * Returns the animation channel at the given index.
-     * 
-     * @param index The index of the animation channel to get.
-     * 
-     * @return The pointer to the animation channel or NULL if not found.
-     */
-    AnimationChannel* getAnimationChannel(unsigned int index) const;
-
-private:
-
-    std::vector<AnimationChannel*> _channels;
-};
-
-}
-
-#endif

+ 0 - 299
gameplay-encoder/src/AnimationChannel.cpp

@@ -1,299 +0,0 @@
-#include "Base.h"
-#include "AnimationChannel.h"
-#include "Transform.h"
-
-namespace gameplay
-{
-
-AnimationChannel::AnimationChannel(void) :
-    _targetAttrib(0)
-{
-}
-
-AnimationChannel::~AnimationChannel(void)
-{
-}
-
-unsigned int AnimationChannel::getTypeId(void) const
-{
-    return ANIMATIONCHANNEL_ID;
-}
-const char* AnimationChannel::getElementName(void) const
-{
-    return "AnimationChannel";
-}
-
-void AnimationChannel::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_targetId, file);
-    write(_targetAttrib, file);
-    write(_keytimes.size(), file);
-    for (std::vector<float>::const_iterator i = _keytimes.begin(); i != _keytimes.end(); ++i)
-    {
-        write((unsigned long)*i, file);
-    }
-    write(_keyValues, file);
-    write(_tangentsIn, file);
-    write(_tangentsOut, file);
-    write(_interpolations, file);
-}
-
-void AnimationChannel::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "targetId", _targetId);
-    fprintf(file, "<%s>%u %s</%s>\n", "targetAttrib", _targetAttrib, Transform::getPropertyString(_targetAttrib), "targetAttrib");
-    fprintfElement(file, "%f ", "keytimes", _keytimes);
-    fprintfElement(file, "%f ", "values", _keyValues);
-    fprintfElement(file, "%f ", "tangentsIn", _tangentsIn);
-    fprintfElement(file, "%f ", "tangentsOut", _tangentsOut);
-    fprintfElement(file, "%u ", "interpolations", _interpolations);
-    fprintElementEnd(file);
-}
-
-void AnimationChannel::setInterpolation(unsigned int interpolation)
-{
-    _interpolations.clear();
-    _interpolations.push_back(interpolation);
-}
-
-const std::string& AnimationChannel::getTargetId() const
-{
-    return _targetId;
-}
-
-unsigned int AnimationChannel::getTargetAttribute() const
-{
-    return _targetAttrib;
-}
-
-const std::vector<float>& AnimationChannel::getKeyValues() const
-{
-    return _keyValues;
-}
-
-const std::vector<float>& AnimationChannel::getKeyTimes() const
-{
-    return _keytimes;
-}
-
-const std::vector<float>& AnimationChannel::getTangentsIn() const
-{
-    return _tangentsIn;
-}
-
-const std::vector<float>& AnimationChannel::getTangentsOut() const
-{
-    return _tangentsOut;
-}
-
-const std::vector<unsigned int>& AnimationChannel::getInterpolationTypes() const
-{
-    return _interpolations;
-}
-
-void AnimationChannel::setTargetId(const std::string& str)
-{
-    _targetId = str;
-}
-
-void AnimationChannel::setTargetAttribute(unsigned int attrib)
-{
-    _targetAttrib = attrib;
-}
-
-void AnimationChannel::setKeyTimes(const std::vector<float>& values)
-{
-    _keytimes = values;
-}
-
-void AnimationChannel::setKeyValues(const std::vector<float>& values)
-{
-    _keyValues = values;
-}
-
-void AnimationChannel::setTangentsIn(const std::vector<float>& values)
-{
-    _tangentsIn = values;
-}
-
-void AnimationChannel::setTangentsOut(const std::vector<float>& values)
-{
-    _tangentsOut = values;
-}
-
-void AnimationChannel::setInterpolations(const std::vector<unsigned int>& values)
-{
-    _interpolations = values;
-}
-
-void AnimationChannel::removeDuplicates()
-{
-    size_t propSize = Transform::getPropertySize(_targetAttrib);
-
-    if (propSize > 1 && !_interpolations.empty() && _interpolations[0] == LINEAR)
-    {
-        size_t prevIndex = 0;
-
-        std::vector<float>::iterator prevStart = _keyValues.begin();
-        std::vector<float>::iterator prevEnd = prevStart + propSize - 1;
-        
-        size_t i = 1;
-        for (i = 1; i < _keytimes.size(); ++i)
-        {
-            std::vector<float>::iterator start = _keyValues.begin() + i * propSize;
-            std::vector<float>::iterator end = start + propSize - 1;
-
-            if (!equal(prevStart, prevEnd, start) || i == _keytimes.size() - 1)
-            {
-                if (i - prevIndex > 2)
-                {
-                    deleteRange(prevIndex+1, i, propSize);
-                    i = prevIndex;
-                    prevStart = _keyValues.begin() + i * propSize;
-                    prevEnd = prevStart + propSize - 1;
-                }
-                else
-                {
-                    prevStart = start;
-                    prevEnd = end;
-                    prevIndex = i;
-                }
-            }
-        }
-        if (i - 1 - prevIndex >= 2)
-        {
-            deleteRange(prevIndex+1, i, propSize);
-        }
-    }
-}
-
-void AnimationChannel::convertToQuaternion()
-{
-    if (_targetAttrib == Transform::ANIMATE_ROTATE_X ||
-        _targetAttrib == Transform::ANIMATE_ROTATE_Y ||
-        _targetAttrib == Transform::ANIMATE_ROTATE_Z)
-    {
-        std::vector<float> newKeyValues;
-        newKeyValues.resize(_keyValues.size() * 4);
-        const size_t count = _keyValues.size();
-
-        float x = _targetAttrib == Transform::ANIMATE_ROTATE_X ? 1.0f : 0.0f;
-        float y = _targetAttrib == Transform::ANIMATE_ROTATE_Y ? 1.0f : 0.0f;
-        float z = _targetAttrib == Transform::ANIMATE_ROTATE_Z ? 1.0f : 0.0f;
-        for (size_t i = 0; i < count; ++i)
-        {
-            size_t j = i << 2;
-            newKeyValues[j] = x;
-            newKeyValues[j+1] = y;
-            newKeyValues[j+2] = z;
-            newKeyValues[j+3] = _keyValues[i];
-        }
-        setKeyValues(newKeyValues);
-        setTargetAttribute(Transform::ANIMATE_ROTATE);
-    }
-}
-
-void AnimationChannel::convertToTransform()
-{
-    if (_targetAttrib == Transform::ANIMATE_ROTATE_X ||
-        _targetAttrib == Transform::ANIMATE_ROTATE_Y ||
-        _targetAttrib == Transform::ANIMATE_ROTATE_Z)
-    {
-        std::vector<float> newKeyValues;
-        newKeyValues.resize(_keyValues.size() * 10);
-        const size_t count = _keyValues.size();
-
-        float x = _targetAttrib == Transform::ANIMATE_ROTATE_X ? 1.0f : 0.0f;
-        float y = _targetAttrib == Transform::ANIMATE_ROTATE_Y ? 1.0f : 0.0f;
-        float z = _targetAttrib == Transform::ANIMATE_ROTATE_Z ? 1.0f : 0.0f;
-        for (size_t i = 0; i < count; ++i)
-        {
-            size_t j = i << 2;
-            newKeyValues[j+0] = 1.0f;
-            newKeyValues[j+1] = 1.0f;
-            newKeyValues[j+2] = 1.0f;
-            newKeyValues[j+3] = x;
-            newKeyValues[j+4] = y;
-            newKeyValues[j+5] = z;
-            newKeyValues[j+6] = _keyValues[i];
-            newKeyValues[j+7] = 0.0f;
-            newKeyValues[j+8] = 0.0f;
-            newKeyValues[j+9] = 0.0f;
-        }
-        setKeyValues(newKeyValues);
-        setTargetAttribute(Transform::ANIMATE_SCALE_ROTATE_TRANSLATE);
-    }
-}
-
-unsigned int AnimationChannel::getInterpolationType(const char* str)
-{
-    unsigned int value = 0;
-    switch (str[0])
-    {
-    case 'L':
-        if (strcmp(str, "LINEAR") == 0)
-        {
-            value = AnimationChannel::LINEAR;
-        }
-        break;
-    case 'B':
-        if (strcmp(str, "BEZIER") == 0)
-        {
-            value = AnimationChannel::BEZIER;
-        }
-        else if (strcmp(str, "BSPLINE") == 0)
-        {
-            value = AnimationChannel::BSPLINE;
-        }
-        break;
-    case 'C':
-        if (strcmp(str, "CARDINAL") == 0)
-        {
-            value = AnimationChannel::CARDINAL;
-        }
-        break;
-    case 'H':
-        if (strcmp(str, "HERMITE") == 0)
-        {
-            value = AnimationChannel::HERMITE;
-        }
-        break;
-    case 'S':
-        if (strcmp(str, "STEP") == 0)
-        {
-            value = AnimationChannel::STEP;
-        }
-        break;
-    default:
-        break;
-    }
-    return value;
-}
-
-void AnimationChannel::deleteRange(size_t begin, size_t end, size_t propSize)
-{
-    assert(end > begin);
-    // delete range
-    printf("delete %lu to %lu\n", begin, end - 1);
-
-    std::vector<float>::iterator a = _keyValues.begin() + begin * propSize;
-    std::vector<float>::iterator b = _keyValues.begin() + end * propSize;
-    _keyValues.erase(a, b);
-
-    a = _keytimes.begin() + begin;
-    b = _keytimes.begin() + end;
-    _keytimes.erase(a, b);
-
-    if (_interpolations.size() > 1)
-    {
-        std::vector<unsigned int>::iterator a = _interpolations.begin() + begin;
-        std::vector<unsigned int>::iterator b = _interpolations.begin() + end * propSize;
-        _interpolations.erase(a, b);
-    }
-
-    // TODO: also remove key frames from _tangentsIn and _tangentsOut once other curve types are supported.
-}
-
-}

+ 0 - 105
gameplay-encoder/src/AnimationChannel.h

@@ -1,105 +0,0 @@
-#ifndef ANIMATIONCHANNEL_H_
-#define ANIMATIONCHANNEL_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class AnimationChannel : public Object
-{
-public:
-
-    enum InterpolationTypes
-    {
-        LINEAR = 1,
-        BEZIER = 2,
-        CARDINAL = 3,
-        HERMITE = 4,
-        BSPLINE = 5,
-        STEP = 6
-    };
-
-    /**
-     * Constructor.
-     */
-    AnimationChannel(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~AnimationChannel(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    const std::string& getTargetId() const;
-
-    /**
-     * Sets the interpolation type of the entire animation channel.
-     * 
-     * @param interpolation The interpolation type from InterpolationTypes enum.
-     */
-    void setInterpolation(unsigned int interpolation);
-
-    void setTargetId(const std::string& str);
-    void setTargetAttribute(unsigned int attrib);
-
-    void setKeyTimes(const std::vector<float>& values);
-    void setKeyValues(const std::vector<float>& values);
-    void setTangentsIn(const std::vector<float>& values);
-    void setTangentsOut(const std::vector<float>& values);
-    void setInterpolations(const std::vector<unsigned int>& values);
-
-    unsigned int getTargetAttribute() const;
-    const std::vector<float>& getKeyValues() const;
-    const std::vector<float>& getKeyTimes() const;
-    const std::vector<float>& getTangentsIn() const;
-    const std::vector<float>& getTangentsOut() const;
-    const std::vector<unsigned int>& getInterpolationTypes() const;
-
-    /**
-     * Removes duplicate key frames from the animation channel.
-     */
-    void removeDuplicates();
-
-    void convertToQuaternion();
-    void convertToTransform();
-
-    /**
-     * Returns the interpolation type value for the given string or zero if not valid.
-     * Example: "LINEAR" returns AnimationChannel::LINEAR
-     * 
-     * @param str Interpolation such as "LINEAR" or "BSPLINE".
-     * 
-     * @return A value from InterpolationTypes enum or zero if not valid.
-     */
-    static unsigned int getInterpolationType(const char* str);
-
-private:
-
-    /**
-     * Deletes all key frames from key time index begin to key time index end (exclusive).
-     * 
-     * @param begin The start index to delete.
-     * @param end The index to delete up to but not including.
-     * @param propSize The size of the animation propery to delete. Example: Translate(x,y,z) is size 3.
-     */
-    void deleteRange(size_t begin, size_t end, size_t propSize);
-
-private:
-
-    std::string _targetId;
-    unsigned int _targetAttrib;
-    std::vector<float> _keytimes;
-    std::vector<float> _keyValues;
-    std::vector<float> _tangentsIn;
-    std::vector<float> _tangentsOut;
-    std::vector<unsigned int> _interpolations;
-};
-
-}
-
-#endif

+ 0 - 65
gameplay-encoder/src/Animations.cpp

@@ -1,65 +0,0 @@
-#include "Base.h"
-#include "Animations.h"
-
-namespace gameplay
-{
-
-Animations::Animations(void)
-{
-    // There will only be one Animations.
-    // It requires an ID because it will be stores in the ref table.
-    setId("__Animations__");
-}
-
-Animations::~Animations(void)
-{
-}
-
-unsigned int Animations::getTypeId(void) const
-{
-    return ANIMATIONS_ID;
-}
-const char* Animations::getElementName(void) const
-{
-    return "Animations";
-}
-
-void Animations::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_animations.size(), file);
-    for (std::vector<Animation*>::iterator i = _animations.begin(); i != _animations.end(); ++i)
-    {
-        (*i)->writeBinary(file);
-    }
-}
-
-void Animations::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    if (_animations.size() > 0 )
-    {
-        for (std::vector<Animation*>::iterator i = _animations.begin(); i != _animations.end(); ++i)
-        {
-            (*i)->writeText(file);
-        }
-    }
-    fprintElementEnd(file);
-}
-
-void Animations::add(Animation* animation)
-{
-    _animations.push_back(animation);
-}
-
-unsigned int Animations::getAnimationCount() const
-{
-    return _animations.size();
-}
-
-Animation* Animations::getAnimation(unsigned int index) const
-{
-    return _animations[index];
-}
-
-}

+ 0 - 43
gameplay-encoder/src/Animations.h

@@ -1,43 +0,0 @@
-#ifndef LIBRARYANIMATIONS_H_
-#define LIBRARYANIMATIONS_H_
-
-#include "Object.h"
-#include "Animation.h"
-
-namespace gameplay
-{
-
-/**
- * Animations contains all of the animations in the GamePlay Binary file.
- */
-class Animations : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Animations(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Animations(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    void add(Animation* animation);
-    unsigned int getAnimationCount() const;
-    Animation* getAnimation(unsigned int index) const;
-
-private:
-
-    std::vector<Animation*> _animations;
-};
-
-}
-
-#endif

+ 0 - 14
gameplay-encoder/src/Base.cpp

@@ -1,14 +0,0 @@
-#include "Base.h"
-
-namespace gameplay
-{
-
-void fillArray(float values[], float value, size_t length)
-{
-    for (size_t i = 0; i < length; ++i)
-    {
-        values[i] = value;
-    }
-}
-
-}

+ 0 - 99
gameplay-encoder/src/Base.h

@@ -1,99 +0,0 @@
-#ifndef BASE_H_
-#define BASE_H_
-
-// C++ includes
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
-#include <cstdarg>
-#include <cassert>
-#include <cmath>
-#include <cfloat>
-#include <ctime>
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <list>
-#include <map>
-#include <algorithm>
-#include <sys/stat.h>
-
-// PNG
-#include <png.h>
-
-// Collada includes
-#include <dae.h>
-#include <dae/daeSIDResolver.h>
-#include <dae/domAny.h>
-#include <dom/domCOLLADA.h>
-#include <dom/domConstants.h>
-#include <dom/domElements.h>
-#include <dom/domCamera.h>
-#include <dom/domProfile_COMMON.h>
-
-// Defines
-#ifndef M_1_PI        
-#define M_1_PI                      0.31830988618379067154
-#endif
-#define MATH_FLOAT_SMALL            1.0e-37f
-#define MATH_TOLERANCE              2e-37f
-#define MATH_E                      2.71828182845904523536f
-#define MATH_LOG10E                 0.4342944819032518f
-#define MATH_LOG2E                  1.442695040888963387f
-#define MATH_PI                     3.14159265358979323846f
-#define MATH_PIOOVER2               1.57079632679489661923f
-#define MATH_PIOOVER4               M_PI_4
-#define MATH_PIX2                   6.28318530717958647693f
-#define MATH_EPSILON                0.000001f
-#define MATH_DEG_TO_RAD(x)          ((x) * 0.0174532925f)
-#define MATH_RAD_TO_DEG(x)          ((x)* 57.29577951f)
-#define MATH_RANDOM_MINUS1_1()      ((2.0f*((float)rand()/RAND_MAX))-1.0f) // Returns a random float between -1 and 1.
-#define MATH_RANDOM_0_1()           ((float)rand()/RAND_MAX) // Returns a random float between 0 and 1.
-
-namespace gameplay
-{
-
-enum VertexUsage
-{
-    UNKNOWN = 0,
-    POSITION = 1,
-    NORMAL = 2,
-    COLOR = 3,
-    TANGENT = 4,
-    BINORMAL = 5,
-    BLENDWEIGHTS = 6,
-    BLENDINDICES = 7,
-    TEXCOORD0 = 8,
-    TEXCOORD1 = 9,
-    TEXCOORD2 = 10,
-    TEXCOORD3 = 11,
-    TEXCOORD4 = 12,
-    TEXCOORD5 = 13,
-    TEXCOORD6 = 14,
-    TEXCOORD7 = 15
-};
-
-void fillArray(float values[], float value, size_t length);
-
-#define ISZERO(x) (fabs(x) < 0.000001f)
-
-// Object deletion macro
-#define SAFE_DELETE(x) \
-    if (x) \
-    { \
-        delete x; \
-        x = NULL; \
-    }
-
-#ifdef NDEBUG
-#define DEBUGPRINT(x)
-#define DEBUGPRINT_VARG(x, ...)
-#else
-#define DEBUGPRINT(x)  printf(x)
-#define DEBUGPRINT_VARG(x, ...) printf(x, __VA_ARGS__)
-#endif
-
-}
-
-#endif

+ 0 - 137
gameplay-encoder/src/BoundingVolume.cpp

@@ -1,137 +0,0 @@
-#include "Base.h"
-#include "BoundingVolume.h"
-
-namespace gameplay
-{
-
-BoundingVolume::BoundingVolume()
-    : radius(0.0f)
-{
-}
-
-void updateMinMax(Vector3* point, Vector3* min, Vector3* max)
-{
-    // Leftmost point.
-    if (point->x < min->x)
-    {
-        min->x = point->x;
-    }
-
-    // Rightmost point.
-    if (point->x > max->x)
-    {
-        max->x = point->x;
-    }
-
-    // Lowest point.
-    if (point->y < min->y)
-    {
-        min->y = point->y;
-    }
-
-    // Highest point.
-    if (point->y > max->y)
-    {
-        max->y = point->y;
-    }
-
-    // Farthest point.
-    if (point->z < min->z)
-    {
-        min->z = point->z;
-    }
-
-    // Nearest point.
-    if (point->z > max->z)
-    {
-        max->z = point->z;
-    }
-}
-
-void BoundingVolume::transform(const Matrix& m)
-{
-    // Transform the bounding sphere
-    m.transformPoint(center, &center);
-    Vector3 translate;
-    m.decompose(&translate, NULL, NULL);
-    float r = radius * translate.x;
-    r = std::max(radius, radius * translate.y);
-    r = std::max(radius, radius * translate.z);
-    radius = r;
-
-    // Transform the bounding box
-    Vector3 corners[8];
-    corners[0].set(min.x, max.y, max.z);
-    // Left-bottom-front.
-    corners[1].set(min.x, min.y, max.z);
-    // Right-bottom-front.
-    corners[2].set(max.x, min.y, max.z);
-    // Right-top-front.
-    corners[3].set(max.x, max.y, max.z);
-    // Right-top-back.
-    corners[4].set(max.x, max.y, min.z);
-    // Right-bottom-back.
-    corners[5].set(max.x, min.y, min.z);
-    // Left-bottom-back.
-    corners[6].set(min.x, min.y, min.z);
-    // Left-top-back.
-    corners[7].set(min.x, max.y, min.z);
-
-    // Transform the corners, recalculating the min and max points along the way.
-    m.transformPoint(corners[0], &corners[0]);
-    Vector3 newMin = corners[0];
-    Vector3 newMax = corners[0];
-    for (int i = 1; i < 8; i++)
-    {
-        m.transformPoint(corners[i], &corners[i]);
-        updateMinMax(&corners[i], &newMin, &newMax);
-    }
-    min = newMin;
-    max = newMax;
-}
-
-void BoundingVolume::merge(const BoundingVolume& v)
-{
-    // Calculate the distance between the two centers.
-    float vx = center.x - v.center.x;
-    float vy = center.y - v.center.y;
-    float vz = center.z - v.center.z;
-    float d = sqrt(vx * vx + vy * vy + vz * vz);
-
-    // If one sphere is contained inside the other, set to the larger sphere.
-    if (d <= (v.radius - radius))
-    {
-        // Use targert volume
-        radius = v.radius;
-        center = v.center;
-    }
-    else if (d <= (radius - v.radius))
-    {
-        // No change
-    }
-    else
-    {
-        // Calculate the unit vector between the two centers.
-        float dI = 1.0f / d;
-        vx *= dI;
-        vy *= dI;
-        vz *= dI;
-
-        // Calculate the new radius.
-        float r = (radius + v.radius + d) * 0.5f;
-
-        // Calculate the new center.
-        float scaleFactor = (r - v.radius);
-        vx = vx * scaleFactor + v.center.x;
-        vy = vy * scaleFactor + v.center.y;
-        vz = vz * scaleFactor + v.center.z;
-
-        // Set the new center and radius.
-        center.x = vx;
-        center.y = vy;
-        center.z = vz;
-        radius = r;
-    }
-}
-
-}

+ 0 - 57
gameplay-encoder/src/BoundingVolume.h

@@ -1,57 +0,0 @@
-#ifndef BOUNDINGVOLUME_H_
-#define BOUNDINGVOLUME_H_
-
-#include "Vector3.h"
-#include "Matrix.h"
-
-namespace gameplay
-{
-
-/**
- * Represents a 3D bounding volumes, which defines both a
- * bounding sphere and an axis-aligned bounding box (AABB).
- */
-class BoundingVolume
-{
-public:
-
-    /**
-     * Radius of the bounding sphere.
-     */
-    float radius;
-
-    /**
-     * Center point of the bounding sphere.
-     */
-    Vector3 center;
-
-    /**
-     * Minimum point of the AABB.
-     */
-    Vector3 min;
-
-    /**
-     * Maximum point of the AABB.
-     */
-    Vector3 max;
-
-    /**
-     * Constructor.
-     */
-    BoundingVolume();
-
-    /**
-     * Transforms this bounding volume by the specified matrix.
-     */
-    void transform(const Matrix& m);
-
-    /**
-     * Merges this bounding volume with the specified one and
-     * stores the result in this BoundingVolume.
-     */
-    void merge(const BoundingVolume& v);
-};
-
-}
-
-#endif

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

@@ -1,125 +0,0 @@
-#include "Base.h"
-#include "Camera.h"
-
-namespace gameplay
-{
-
-Camera::Camera(void) :
-    _fieldOfView(0.0f),
-    _aspectRatio(0.0f),
-    _nearPlane(0.0f),
-    _farPlane(0.0f),
-    _viewportWidth(0.0f),
-    _viewportHeight(0.0f)
-{
-}
-
-Camera::~Camera(void)
-{
-}
-
-void Camera::setFieldOfView(float value)
-{
-    _fieldOfView = value;
-}
-
-
-void Camera::setAspectRatio(float value)
-{
-    _aspectRatio = value;
-}
-
-
-void Camera::setNearPlane(float value)
-{
-    _nearPlane = value;
-}
-
-
-void Camera::setFarPlane(float value)
-{
-    _farPlane = value;
-}
-
-unsigned int Camera::getTypeId(void) const
-{
-    return CAMERA_ID;
-}
-const char* Camera::getElementName(void) const
-{
-    return "Camera";
-}
-
-void Camera::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_cameraType, file);
-    write(_aspectRatio, file);
-    write(_nearPlane, file);
-    write(_farPlane, file);
-
-    if (_cameraType == CameraPerspective)
-    {
-        write(_fieldOfView, file);
-    }
-    else if (_cameraType == CameraOrthographic)
-    {
-        write(getViewPortWidth(), file);
-        write(getViewPortHeight(), file);
-    }
-    else
-    {
-        assert(false);
-    }
-}
-void Camera::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "cameraType", _cameraType == CameraPerspective ? "CameraPerspective" : "CameraOrthographic");
-    fprintfElement(file, "aspectRatio", _aspectRatio);
-    fprintfElement(file, "nearPlane", _nearPlane);
-    fprintfElement(file, "farPlane", _farPlane);
-
-    if (_cameraType == CameraPerspective)
-    {
-        fprintfElement(file, "fieldOfView", _fieldOfView);
-    }
-    else if (_cameraType == CameraOrthographic)
-    {
-        fprintfElement(file, "viewportWidth", _viewportWidth);
-        fprintfElement(file, "viewportHeight", _viewportHeight);
-    }
-    else
-    {
-        assert(false);
-    }
-    fprintElementEnd(file);
-}
-
-void Camera::setPerspective()
-{
-    _cameraType = CameraPerspective;
-}
-void Camera::setOrthographic()
-{
-    _cameraType = CameraOrthographic;
-}
-void Camera::setViewportWidth(float width)
-{
-    _viewportWidth = width;
-}
-void Camera::setViewportHeight(float height)
-{
-    _viewportHeight = height;
-}
-
-float Camera::getViewPortWidth()
-{
-    return _viewportWidth;
-}
-float Camera::getViewPortHeight()
-{
-    return _viewportHeight;
-}
-
-}

+ 0 - 59
gameplay-encoder/src/Camera.h

@@ -1,59 +0,0 @@
-#ifndef CAMERA_H_
-#define CAMERA_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class Camera : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Camera(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Camera(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    void setPerspective();
-    void setOrthographic();
-    void setAspectRatio(float value);
-    void setNearPlane(float value);
-    void setFarPlane(float value);
-    void setViewportWidth(float width);
-    void setViewportHeight(float height);
-    void setFieldOfView(float value);
-
-    float getViewPortWidth();
-    float getViewPortHeight();
-
-    enum CameraType
-    {
-        CameraPerspective = 1,
-        CameraOrthographic = 2
-    };
-
-private:
-    
-    unsigned char _cameraType;
-    float _fieldOfView;
-    float _aspectRatio;
-    float _nearPlane;
-    float _farPlane;
-    float _viewportWidth;
-    float _viewportHeight;
-};
-
-}
-
-#endif

+ 0 - 1346
gameplay-encoder/src/Curve.cpp

@@ -1,1346 +0,0 @@
-// Purposely not including Base.h here, or any other gameplay dependencies
-// so this class can be reused between gameplay and gameplay-encoder.
-#include "Curve.h"
-#include "Quaternion.h"
-#include <cassert>
-#include <cmath>
-#include <memory>
-
-using std::memcpy;
-using std::fabs;
-using std::sqrt;
-using std::cos;
-using std::sin;
-using std::exp;
-using std::strcmp;
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef MATH_PI
-#define MATH_PI 3.14159265358979323846f
-#endif
-
-#ifndef MATH_PIOVER2 
-#define MATH_PIOVER2 1.57079632679489661923f
-#endif
-
-#ifndef MATH_PIX2
-#define MATH_PIX2 6.28318530717958647693f
-#endif
-
-// Object deletion macro
-#ifndef SAFE_DELETE
-#define SAFE_DELETE(x) \
-    if (x) \
-    { \
-        delete x; \
-        x = NULL; \
-    }
-#endif
-
-// Array deletion macro
-#ifndef SAFE_DELETE_ARRAY
-#define SAFE_DELETE_ARRAY(x) \
-    if (x) \
-    { \
-        delete[] x; \
-        x = NULL; \
-    }
-#endif
-
-
-namespace gameplay
-{
-
-Curve::Curve(unsigned int pointCount, unsigned int componentCount)
-    : _pointCount(pointCount), _componentCount(componentCount), _componentSize(sizeof(float)*componentCount), _quaternionOffset(NULL), _points(NULL)
-{
-    _points = new Point[_pointCount];
-    for (unsigned int i = 0; i < _pointCount; i++)
-    {
-        _points[i].time = 0.0f;
-        _points[i].value = new float[_componentCount];
-        _points[i].inValue = new float[_componentCount];
-        _points[i].outValue = new float[_componentCount];
-        _points[i].type = LINEAR;
-    }
-    _points[_pointCount - 1].time = 1.0f;
-}
-
-Curve::~Curve()
-{
-    SAFE_DELETE_ARRAY(_points);
-    SAFE_DELETE_ARRAY(_quaternionOffset);
-}
-
-Curve::Point::Point()
-    : time(0.0f), value(NULL), inValue(NULL), outValue(NULL)
-{
-}
-
-Curve::Point::~Point()
-{
-    SAFE_DELETE_ARRAY(value);
-    SAFE_DELETE_ARRAY(inValue);
-    SAFE_DELETE_ARRAY(outValue);
-}
-
-unsigned int Curve::getPointCount() const
-{
-    return _pointCount;
-}
-
-unsigned int Curve::getComponentCount() const
-{
-    return _componentCount;
-}
-
-float Curve::getStartTime() const
-{
-    return _points[0].time;
-}
-
-float Curve::getEndTime() const
-{
-    return _points[_pointCount-1].time;
-}
-
-void Curve::setPoint(unsigned int index, float time, float* value, InterpolationType type)
-{
-    setPoint(index, time, value, type, NULL, NULL);
-}
-
-void Curve::setPoint(unsigned int index, float time, float* value, InterpolationType type, float* inValue, float* outValue)
-{
-    assert(index < _pointCount && time >= 0.0f && time <= 1.0f && !(index == 0 && time != 0.0f) && !(index == _pointCount - 1 && time != 1.0f));
-
-    _points[index].time = time;
-    _points[index].type = type;
-
-    if (value)
-        memcpy(_points[index].value, value, _componentSize);
-
-    if (inValue)
-        memcpy(_points[index].inValue, inValue, _componentSize);
-
-    if (outValue)
-        memcpy(_points[index].outValue, outValue, _componentSize);
-}
-
-void Curve::setTangent(unsigned int index, InterpolationType type, float* inValue, float* outValue)
-{
-    assert(index < _pointCount);
-
-    _points[index].type = type;
-
-    if (inValue)
-        memcpy(_points[index].inValue, inValue, _componentSize);
-
-    if (outValue)
-        memcpy(_points[index].outValue, outValue, _componentSize);
-}
-
-void Curve::evaluate(float time, float* dst) const
-{
-    assert(dst && time >= 0 && time <= 1.0f);
-
-    // Check if we are at or beyond the bounds of the curve.
-    if (time <= _points[0].time)
-    {
-        memcpy(dst, _points[0].value, _componentSize);
-        return;
-    }
-    else if (time >= _points[_pointCount - 1].time)
-    {
-        memcpy(dst, _points[_pointCount - 1].value, _componentSize);
-        return;
-    }
-
-    // Locate the points we are interpolating between using a binary search.
-    unsigned int index = determineIndex(time);
-    
-    Point* from = _points + index;
-    Point* to = _points + (index + 1);
-
-    // Calculate the fractional time between the two points.
-    float scale = (to->time - from->time);
-    float t = (time - from->time) / scale;
-
-    // Calculate the value of the curve discretely if appropriate.
-    switch (from->type)
-    {
-        case BEZIER:
-        {
-            interpolateBezier(t, from, to, dst);
-            return;
-        }
-        case BSPLINE:
-        {
-            Point* c0;
-            Point* c1;
-            if (index == 0)
-            {
-                c0 = from;
-            }
-            else
-            {
-                c0 = (_points + index - 1);
-            }
-            
-            if (index == _pointCount - 2)
-            {
-                c1 = to;
-            }
-            else
-            {
-                c1 = (_points + index + 2);
-            }
-            interpolateBSpline(t, c0, from, to, c1, dst);
-            return;
-        }
-        case FLAT:
-        {
-            interpolateHermiteFlat(t, from, to, dst);
-            return;
-        }
-        case HERMITE:
-        {
-            interpolateHermite(t, from, to, dst);
-            return;
-        }
-        case LINEAR:
-        {
-            // Can just break here because linear formula follows switch
-            break;
-        }
-        case SMOOTH:
-        {
-            interpolateHermiteSmooth(t, index, from, to, dst);
-            return;
-        }
-        case STEP:
-        {
-            memcpy(dst, from->value, _componentSize);
-            return;
-        }
-        case QUADRATIC_IN:
-        {
-            t *= t;
-            break;
-        }
-        case QUADRATIC_OUT:
-        {
-            t *= -(t - 2.0f);
-            break;
-        }
-        case QUADRATIC_IN_OUT:
-        {
-            float tx2 = t * 2.0f;
-
-            if (tx2 < 1.0f)
-                t = 0.5f * (tx2 * tx2);
-            else
-            {
-                float temp = tx2 - 1.0f;
-                t = 0.5f * (-( temp * (temp - 2.0f)) + 1.0f);
-            }
-            break;
-        }
-        case QUADRATIC_OUT_IN:
-        {
-            if (t < 0.5f)
-            {
-                t = 2.0f * t * (1.0f - t);
-            }
-            else
-            {
-                t = 1.0f + 2.0f * t * (t - 1.0f);
-            }
-            break;
-        }
-        case CUBIC_IN:
-        {
-            t *= t * t;
-            break;
-        }
-        case CUBIC_OUT:
-        {
-            t--;
-            t = t * t * t + 1;
-            break;
-        }
-        case CUBIC_IN_OUT:
-        {
-            if ((t *= 2.0f) < 1.0f)
-            {
-                t = t * t * t * 0.5f;
-            }
-            else
-            {
-                t -= 2.0f;
-                t = (t * t * t + 2.0f) * 0.5f;
-            }
-            break;
-        }
-        case CUBIC_OUT_IN:
-        {
-            t = (2.0f * t - 1.0f);
-            t = (t * t * t + 1) * 0.5f;
-            break;
-        }
-        case QUARTIC_IN:
-        {
-            t *= t * t * t;
-            break;
-        }
-        case QUARTIC_OUT:
-        {
-            t--;
-            t = -(t * t * t * t) + 1.0f;
-            break;
-        }
-        case QUARTIC_IN_OUT:
-        {
-            t *= 2.0f;
-            if (t < 1.0f)
-            {
-                t = 0.5f * t * t * t * t;
-            }
-            else
-            {
-                t -= 2.0f;
-                t = -0.5f * (t * t * t * t - 2.0f);
-            }
-            break;
-        }
-        case QUARTIC_OUT_IN:
-        {
-            t = 2.0f * t - 1.0f;
-            if (t < 0.0f)
-            {
-                t = 0.5f * (-(t * t) * t * t + 1.0f);
-            }
-            else
-            {
-                t = 0.5f * (t * t * t * t + 1.0f);
-            }
-            break;
-        }
-        case QUINTIC_IN:
-        {
-            t *= t * t * t * t;
-            break;
-        }
-        case QUINTIC_OUT:
-        {
-            t--;
-            t = t * t * t * t * t + 1.0f;
-            break;
-        }
-        case QUINTIC_IN_OUT:
-        {
-            t *= 2.0f;
-            if (t < 1.0f)
-            {
-                t = 0.5f * t * t * t * t * t;
-            }
-            else
-            {
-                t -= 2.0f;
-                t = 0.5f * (t * t * t * t * t + 2.0f);
-            }
-            break;
-        }
-        case QUINTIC_OUT_IN:
-        {
-            t = 2.0f * t - 1.0f;
-            t = 0.5f * (t * t * t * t * t + 1.0f);
-            break;
-        }
-        case SINE_IN:
-        {
-            t = -(cos(t * MATH_PIOVER2) - 1.0f);
-            break;
-        }
-        case SINE_OUT:
-        {
-            t = sin(t * MATH_PIOVER2);
-            break;
-        }
-        case SINE_IN_OUT:
-        {
-            t = -0.5f * (cos(MATH_PI * t) - 1.0f);
-            break;
-        }
-        case SINE_OUT_IN:
-        {
-            if (t < 0.5f)
-            {
-                t = 0.5f * sin(MATH_PI * t);
-            }
-            else
-            {
-                t = -0.5f * cos(MATH_PIOVER2 * (2.0f * t - 1.0f)) + 1.0f;
-            }
-            break;
-        }
-        case EXPONENTIAL_IN:
-        {
-            if (t != 0.0f)
-            {
-                t = exp(10.0f * (t - 1.0f));
-            }
-            break;
-        }
-        case EXPONENTIAL_OUT:
-        {
-            if (t != 1.0f)
-            {
-                t = -exp(-10.0f * t) + 1.0f;
-            }
-            break;
-        }
-        case EXPONENTIAL_IN_OUT:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                if (t < 0.5f)
-                {
-                    t = 0.5f * exp(10.0f * (2.0f * t - 1.0f));
-                }
-                else
-                {
-                    t = -0.5f * exp(10.0f * (-2.0f * t + 1.0f)) + 1.0f;
-                }
-            }
-            break;
-        }
-        case EXPONENTIAL_OUT_IN:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                if (t < 0.5f)
-                {
-                    t = -0.5f * exp(-20.0f * t) + 0.5f;
-                }
-                else
-                {
-                    t = 0.5f * exp(20.0f * (t - 1.0f)) + 0.5f;
-                }
-            }
-            break;
-        }
-        case CIRCULAR_IN:
-        {
-            t = -(sqrt(1.0f - t * t) - 1.0f);
-            break;
-        }
-        case CIRCULAR_OUT:
-        {
-            t--;
-            t = sqrt(1.0f - t * t);
-            break;
-        }
-        case CIRCULAR_IN_OUT:
-        {
-            t *= 2.0f;
-            if (t < 1.0f)
-            {
-                t = 0.5f * (-sqrt((1.0f - t * t)) + 1.0f);
-            }
-            else
-            {
-                t -= 2.0f;
-                t = 0.5f * (sqrt((1.0f - t * t)) + 1.0f);
-            }
-            break;
-        }
-        case CIRCULAR_OUT_IN:
-        {
-            t = 2.0f * t - 1.0f;
-            if (t < 0.0f)
-            {
-                t = 0.5f * sqrt(1.0f - t * t);
-            }
-            else
-            {
-                t = 0.5f * (2.0f - sqrt(1.0f - t * t));
-            }
-            break;
-        }
-        case ELASTIC_IN:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                t = t - 1.0f;
-                t = -1.0f * ( exp(10.0f * t) * sin( (t - 0.075f) * MATH_PIX2 / 0.3f ) );
-            }
-            break;
-        }
-        case ELASTIC_OUT:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                t = exp(-10.0f * t) * sin((t - 0.075f) * MATH_PIX2 / 0.3f) + 1.0f;
-            }
-            break;
-        }
-        case ELASTIC_IN_OUT:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                t = 2.0f * t - 1.0f;
-                if (t < 0.0f)
-                {
-                    t = -0.5f * (exp((10 * t)) * sin(((t - 0.1125f) * MATH_PIX2 / 0.45f)));
-                }
-                else
-                {
-                    t = 0.5f * exp((-10 * t)) * sin(((t - 0.1125f) * MATH_PIX2 / 0.45f)) + 1.0f;
-                }
-            }
-            break;
-        }
-        case ELASTIC_OUT_IN:
-        {
-            if (t != 0.0f && t != 1.0f)
-            {
-                t *= 2.0f;
-                if (t < 1.0f)
-                {
-                    t = 0.5f * (exp((-10 * t)) * sin(((t - 0.1125f) * (MATH_PIX2) / 0.45f))) + 0.5f;
-                }
-                else
-                {
-                    t = 0.5f * (exp((10 *(t - 2))) * sin(((t - 0.1125f) * (MATH_PIX2) / 0.45f))) + 0.5f;
-                }
-            }
-            break;
-        }
-        case OVERSHOOT_IN:
-        {
-            t = t * t * (2.70158f * t - 1.70158f);
-            break;
-        }
-        case OVERSHOOT_OUT:
-        {
-            t--;
-            t = t * t * (2.70158f * t + 1.70158f) + 1;
-            break;
-        }
-        case OVERSHOOT_IN_OUT:
-        {
-            t *= 2.0f;
-            if (t < 1.0f)
-            {
-                t = 0.5f * t * t * (3.5949095f * t - 2.5949095f);
-            }
-            else
-            {
-                t -= 2.0f;
-                t = 0.5f * (t * t * (3.5949095f * t + 2.5949095f) + 2.0f);
-            }
-            break;
-        }
-        case OVERSHOOT_OUT_IN:
-        {
-            t = 2.0f * t - 1.0f;
-            if (t < 0.0f)
-            {
-                t = 0.5f * (t * t * (3.5949095f * t + 2.5949095f) + 1.0f);
-            }
-            else
-            {
-                t = 0.5f * (t * t * (3.5949095f * t - 2.5949095f) + 1.0f);
-            }
-            break;
-        }
-        case BOUNCE_IN:
-        {
-            t = 1.0f - t;
-
-            if (t < 0.36363636363636365f)
-            {
-                t = 7.5625f * t * t;
-            }
-            else if (t < 0.7272727272727273f)
-            {
-                t -= 0.5454545454545454f;
-                t = 7.5625f * t * t + 0.75f;
-            }
-            else if (t < 0.9090909090909091f)
-            {
-                t -= 0.8181818181818182f;
-                t = 7.5625f * t * t + 0.9375f;
-            }
-            else
-            {
-                t -= 0.9545454545454546f;
-                t = 7.5625f * t * t + 0.984375f;
-            }
-
-            t = 1.0f - t;
-            break;
-        }
-        case BOUNCE_OUT:
-        {
-            if (t < 0.36363636363636365f)
-            {
-                t = 7.5625f * t * t;
-            }
-            else if (t < 0.7272727272727273f)
-            {
-                t -= 0.5454545454545454f;
-                t = 7.5625f * t * t + 0.75f;
-            }
-            else if (t < 0.9090909090909091f)
-            {
-                t -= 0.8181818181818182f;
-                t = 7.5625f * t * t + 0.9375f;
-            }
-            else
-            {
-                t -= 0.9545454545454546f;
-                t = 7.5625f * t * t + 0.984375f;
-            }
-            break;
-        }
-        case BOUNCE_IN_OUT:
-        {
-            if (t < 0.5f)
-            {
-                t = 1.0f - t * 2.0f;
-
-                if (t < 0.36363636363636365f)
-                {
-                    t = 7.5625f * t * t;
-                }
-                else if (t < 0.7272727272727273f)
-                {
-                    t -= 0.5454545454545454f;
-                    t = 7.5625f * t * t + 0.75f;
-                }
-                else if (t < 0.9090909090909091f)
-                {
-                    t -= 0.8181818181818182f;
-                    t = 7.5625f * t * t + 0.9375f;
-                }
-                else
-                {
-                    t -= 0.9545454545454546f;
-                    t = 7.5625f * t * t + 0.984375f;
-                }
-
-                t = (1.0f - t) * 0.5f;
-            }
-            else
-            {
-                t = t * 2.0f - 1.0f;
-                if (t < 0.36363636363636365f)
-                {
-                    t = 7.5625f * t * t;
-                }
-                else if (t < 0.7272727272727273f)
-                {
-                    t -= 0.5454545454545454f;
-                    t = 7.5625f * t * t + 0.75f;
-                }
-                else if (t < 0.9090909090909091f)
-                {
-                    t -= 0.8181818181818182f;
-                    t = 7.5625f * t * t + 0.9375f;
-                }
-                else
-                {
-                    t -= 0.9545454545454546f;
-                    t = 7.5625f * t * t + 0.984375f;
-                }
-
-                t = 0.5f * t + 0.5f;
-            }
-            break;
-        }
-        case BOUNCE_OUT_IN:
-        {
-            if (t < 0.1818181818f)
-            {
-                t = 15.125f * t * t;
-            }
-            else if (t < 0.3636363636f)
-            {
-                t = 1.5f + (-8.250000001f + 15.125f * t) * t;
-            }
-            else if (t < 0.4545454546f)
-            {
-                t = 3.0f + (-12.375f + 15.125f * t) * t;
-            }
-            else if (t < 0.5f)
-            {
-                t = 3.9375f + (-14.4375f + 15.125f * t) * t;
-            }
-            else if (t <= 0.5454545455f)
-            {
-                t = -3.625000004f + (15.81250001f - 15.125f * t) * t;
-            }
-            else if (t <= 0.6363636365f)
-            {
-                t = -4.75f + (17.875f - 15.125f * t) * t;
-            }
-            else if (t <= 0.8181818180f)
-            {
-                t = -7.374999995f + (21.99999999f - 15.125f * t) * t;
-            }
-            else
-            {
-                t = -14.125f + (30.25f - 15.125f * t) * t;
-            }
-            break;
-        }
-    }
-
-    interpolateLinear(t, from, to, dst);
-}
-
-float Curve::lerp(float t, float from, float to)
-{
-    return lerpInl(t, from, to);
-}
-
-void Curve::setQuaternionOffset(unsigned int offset)
-{
-    assert(offset <= (_componentCount - 4));
-
-    if (!_quaternionOffset)
-        _quaternionOffset = new unsigned int[1];
-    
-    *_quaternionOffset = offset;
-}
-
-void Curve::interpolateBezier(float s, Point* from, Point* to, float* dst) const
-{
-    float s_2 = s * s;
-    float eq0 = 1 - s;
-    float eq0_2 = eq0 * eq0;
-    float eq1 = eq0_2 * eq0;
-    float eq2 = 3 * s * eq0_2;
-    float eq3 = 3 * s_2 * eq0;
-    float eq4 = s_2 * s;
-
-    float* fromValue = from->value;
-    float* toValue = to->value;
-    float* outValue = from->outValue;
-    float* inValue = to->inValue;
-
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = bezier(eq1, eq2, eq3, eq4, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = bezier(eq1, eq2, eq3, eq4, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-
-        // Handle quaternion component.
-        float interpTime = bezier(eq1, eq2, eq3, eq4, from->time, outValue[i], to->time, inValue[i]);
-        interpolateQuaternion(interpTime, (fromValue + i), (toValue + i), (dst + i));
-        
-        // Handle remaining components (if any) as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = bezier(eq1, eq2, eq3, eq4, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-    }
-}
-
-void Curve::interpolateBSpline(float s, Point* c0, Point* c1, Point* c2, Point* c3, float* dst) const
-{   
-    float s_2 = s * s;
-    float s_3 = s_2 * s;
-    float eq0 = (-s_3 + 3 * s_2 - 3 * s + 1) / 6.0f;
-    float eq1 = (3 * s_3 - 6 * s_2 + 4) / 6.0f;
-    float eq2 = (-3 * s_3 + 3 * s_2 + 3 * s + 1) / 6.0f;
-    float eq3 = s_3 / 6.0f;
-
-    float* c0Value = c0->value;
-    float* c1Value = c1->value;
-    float* c2Value = c2->value;
-    float* c3Value = c3->value;
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (c1Value[i] == c2Value[i])
-                dst[i] = c1Value[i];
-            else
-                dst[i] = bspline(eq0, eq1, eq2, eq3, c0Value[i], c1Value[i], c2Value[i], c3Value[i]);
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {
-            if (c1Value[i] == c2Value[i])
-                dst[i] = c1Value[i];
-            else
-                dst[i] = bspline(eq0, eq1, eq2, eq3, c0Value[i], c1Value[i], c2Value[i], c3Value[i]);
-        }
-
-        // Handle quaternion component.
-        float interpTime;
-        if (c0->time == c1->time)
-            interpTime = bspline(eq0, eq1, eq2, eq3, -c0->time, c1->time, c2->time, c3->time);
-        else if (c2->time == c3->time)
-            interpTime = bspline(eq0, eq1, eq2, eq3, c0->time, c1->time, c2->time, -c3->time); 
-        else
-            interpTime = bspline(eq0, eq1, eq2, eq3, c0->time, c1->time, c2->time, c3->time);
-        interpolateQuaternion(s, (c1Value + i) , (c2Value + i), (dst + i));
-            
-        // Handle remaining components (if any) as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (c1Value[i] == c2Value[i])
-                dst[i] = c1Value[i];
-            else
-                dst[i] = bspline(eq0, eq1, eq2, eq3, c0Value[i], c1Value[i], c2Value[i], c3Value[i]);
-        }
-    }
-}
-
-void Curve::interpolateHermite(float s, Point* from, Point* to, float* dst) const
-{
-    // Calculate the hermite basis functions.
-    float s_2 = s * s;                   // t^2
-    float s_3 = s_2 * s;                 // t^3
-    float h00 = 2 * s_3 - 3 * s_2 + 1;   // basis function 0
-    float h01 = -2 * s_3 + 3 * s_2;      // basis function 1
-    float h10 = s_3 - 2 * s_2 + s;       // basis function 2
-    float h11 = s_3 - s_2;               // basis function 3
-
-    float* fromValue = from->value;
-    float* toValue = to->value;
-    float* outValue = from->outValue;
-    float* inValue = to->inValue;
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermite(h00, h01, h10, h11, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermite(h00, h01, h10, h11, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-
-        // Handle quaternion component.
-        float interpTime = hermite(h00, h01, h10, h11, from->time, outValue[i], to->time, inValue[i]);
-        interpolateQuaternion(interpTime, (fromValue + i), (toValue + i), (dst + i));
-        
-        // Handle remaining components (if any) as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermite(h00, h01, h10, h11, fromValue[i], outValue[i], toValue[i], inValue[i]);
-        }
-    }
-}
-
-void Curve::interpolateHermiteFlat(float s, Point* from, Point* to, float* dst) const
-{
-    // Calculate the hermite basis functions.
-    float s_2 = s * s;                   // t^2
-    float s_3 = s_2 * s;                 // t^3
-    float h00 = 2 * s_3 - 3 * s_2 + 1;   // basis function 0
-    float h01 = -2 * s_3 + 3 * s_2;      // basis function 1
-
-    float* fromValue = from->value;
-    float* toValue = to->value;
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermiteFlat(h00, h01, fromValue[i], toValue[i]);
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermiteFlat(h00, h01, fromValue[i], toValue[i]);
-        }
-
-        // Handle quaternion component.
-        float interpTime = hermiteFlat(h00, h01, from->time, to->time);
-        interpolateQuaternion(interpTime, (fromValue + i), (toValue + i), (dst + i));
-        
-        // Handle remaining components (if any) as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = hermiteFlat(h00, h01, fromValue[i], toValue[i]);
-        }
-    }
-}
-
-void Curve::interpolateHermiteSmooth(float s, unsigned int index, Point* from, Point* to, float* dst) const
-{
-    // Calculate the hermite basis functions.
-    float s_2 = s * s;                   // t^2
-    float s_3 = s_2 * s;                 // t^3
-    float h00 = 2 * s_3 - 3 * s_2 + 1;   // basis function 0
-    float h01 = -2 * s_3 + 3 * s_2;      // basis function 1
-    float h10 = s_3 - 2 * s_2 + s;       // basis function 2
-    float h11 = s_3 - s_2;               // basis function 3
-
-    float inValue;
-    float outValue;
-
-    float* fromValue = from->value;
-    float* toValue = to->value;
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-            {
-                dst[i] = fromValue[i];
-            }
-            else
-            {
-                if (index == 0)
-                {
-                    outValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    outValue = (toValue[i] - (from - 1)->value[i]) * ((from->time - (from - 1)->time) / (to->time - (from - 1)->time));
-                }
-
-                if (index == _pointCount - 2)
-                {
-                    inValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    inValue = ((to + 1)->value[i] - fromValue[i]) * ((to->time - from->time) / ((to + 1)->time - from->time));
-                }
-
-                dst[i] = hermiteSmooth(h00, h01, h10, h11, fromValue[i], outValue, toValue[i], inValue);
-            }
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {   
-            if (fromValue[i] == toValue[i])
-            {
-                dst[i] = fromValue[i];
-            }
-            else
-            {    
-                if (index == 0)
-                {
-                    outValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    outValue = (toValue[i] - (from - 1)->value[i]) * ((from->time - (from - 1)->time) / (to->time - (from - 1)->time));
-                }
-
-                if (index == _pointCount - 2)
-                {
-                    inValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    inValue = ((to + 1)->value[i] - fromValue[i]) * ((to->time - from->time) / ((to + 1)->time - from->time));
-                }
-
-                dst[i] = hermiteSmooth(h00, h01, h10, h11, fromValue[i], outValue, toValue[i], inValue);
-            }
-        }
-
-        // Handle quaternion component.
-        if (index == 0)
-        {
-            outValue = to->time - from->time;
-        }
-        else
-        {
-            outValue = (to->time - (from - 1)->time) * ((from->time - (from - 1)->time) / (to->time - (from - 1)->time));
-        }
-
-        if (index == _pointCount - 2)
-        {
-            inValue = to->time - from->time;
-        }
-        else
-        {
-            inValue = ((to + 1)->time - from->time) * ((to->time - from->time) / ((to + 1)->time - from->time));
-        }
-
-        float interpTime = hermiteSmooth(h00, h01, h10, h11, from->time, outValue, to->time, inValue);
-        interpolateQuaternion(interpTime, (fromValue + i), (toValue + i), (dst + i));
-        
-        // Handle remaining components (if any) as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-            {
-                dst[i] = fromValue[i];
-            }
-            else
-            {
-                // Interpolate as scalar.
-                if (index == 0)
-                {
-                    outValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    outValue = (toValue[i] - (from - 1)->value[i]) * ((from->time - (from - 1)->time) / (to->time - (from - 1)->time));
-                }
-
-                if (index == _pointCount - 2)
-                {
-                    inValue = toValue[i] - fromValue[i];
-                }
-                else
-                {
-                    inValue = ((to + 1)->value[i] - fromValue[i]) * ((to->time - from->time) / ((to + 1)->time - from->time));
-                }
-
-                dst[i] = hermiteSmooth(h00, h01, h10, h11, fromValue[i], outValue, toValue[i], inValue);
-            }
-        }
-    }
-}
-
-void Curve::interpolateLinear(float s, Point* from, Point* to, float* dst) const
-{
-    float* fromValue = from->value;
-    float* toValue = to->value;
-
-    if (!_quaternionOffset)
-    {
-        for (unsigned int i = 0; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = lerpInl(s, fromValue[i], toValue[i]);
-        }
-    }
-    else
-    {
-        // Interpolate any values up to the quaternion offset as scalars.
-        unsigned int quaternionOffset = *_quaternionOffset;
-        unsigned int i = 0;
-        for (i = 0; i < quaternionOffset; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = lerpInl(s, fromValue[i], toValue[i]);
-        }
-
-        // Handle quaternion component.
-        interpolateQuaternion(s, (fromValue + i), (toValue + i), (dst + i));
-        
-        // handle any remaining components as scalars
-        for (i += 4; i < _componentCount; i++)
-        {
-            if (fromValue[i] == toValue[i])
-                dst[i] = fromValue[i];
-            else
-                dst[i] = lerpInl(s, fromValue[i], toValue[i]);
-        }
-    }
-}
-
-void Curve::interpolateQuaternion(float s, float* from, float* to, float* dst) const
-{
-    // Evaluate.
-    if (s >= 0)
-    {
-        Quaternion::slerp(from[0], from[1], from[2], from[3], to[0], to[1], to[2], to[3], s, dst, dst + 1, dst + 2, dst + 3);
-    }
-    else
-        Quaternion::slerp(to[0], to[1], to[2], to[3], from[0], from[1], from[2], from[3], s, dst, dst + 1, dst + 2, dst + 3);
-
-    //((Quaternion*) dst)->normalize();
-}
-
-int Curve::determineIndex(float time) const
-{
-    unsigned int min = 0;
-    unsigned int max = _pointCount - 1;
-    unsigned int mid = 0;
-
-    // Do a binary search to determine the index.
-    do 
-    {
-        mid = (min + max) >> 1;
-
-        if (time >= _points[mid].time && time <= _points[mid + 1].time)
-            return mid;
-        else if (time < _points[mid].time)
-            max = mid - 1;
-        else
-            min = mid + 1;
-    } while (min <= max);
-    
-    // We should never hit this!
-    return -1;
-}
-
-int Curve::getInterpolationType(const char* curveId)
-{
-    if (strcmp(curveId, "BEZIER") == 0)
-    {
-        return Curve::BEZIER;
-    }
-    else if (strcmp(curveId, "BSPLINE") == 0)
-    {
-        return Curve::BSPLINE;
-    }
-    else if (strcmp(curveId, "FLAT") == 0)
-    {
-        return Curve::FLAT;
-    }
-    else if (strcmp(curveId, "HERMITE") == 0)
-    {
-        return Curve::HERMITE;
-    }
-    else if (strcmp(curveId, "LINEAR") == 0)
-    {
-        return Curve::LINEAR;
-    }
-    else if (strcmp(curveId, "SMOOTH") == 0)
-    {
-        return Curve::SMOOTH;
-    }
-    else if (strcmp(curveId, "STEP") == 0)
-    {
-        return Curve::STEP;
-    }
-    else if (strcmp(curveId, "QUADRATIC_IN") == 0)
-    {
-        return Curve::QUADRATIC_IN;
-    }
-    else if (strcmp(curveId, "QUADRATIC_OUT") == 0)
-    {
-        return Curve::QUADRATIC_OUT;
-    }
-    else if (strcmp(curveId, "QUADRATIC_IN_OUT") == 0)
-    {
-        return Curve::QUADRATIC_IN_OUT;
-    }
-    else if (strcmp(curveId, "QUADRATIC_OUT_IN") == 0)
-    {
-        return Curve::QUADRATIC_OUT_IN;
-    }
-    else if (strcmp(curveId, "CUBIC_IN") == 0)
-    {
-        return Curve::CUBIC_IN;
-    }
-    else if (strcmp(curveId, "CUBIC_OUT") == 0)
-    {
-        return Curve::CUBIC_OUT;
-    }
-    else if (strcmp(curveId, "CUBIC_IN_OUT") == 0)
-    {
-        return Curve::CUBIC_IN_OUT;
-    }
-    else if (strcmp(curveId, "CUBIC_OUT_IN") == 0)
-    {
-        return Curve::CUBIC_OUT_IN;
-    }
-    else if (strcmp(curveId, "QUARTIC_IN") == 0)
-    {
-        return Curve::QUARTIC_IN;
-    }
-    else if (strcmp(curveId, "QUARTIC_OUT") == 0)
-    {
-        return Curve::QUARTIC_OUT;
-    }
-    else if (strcmp(curveId, "QUARTIC_IN_OUT") == 0)
-    {
-        return Curve::QUARTIC_IN_OUT;
-    }
-    else if (strcmp(curveId, "QUARTIC_OUT_IN") == 0)
-    {
-        return Curve::QUARTIC_OUT_IN;
-    }
-    else if (strcmp(curveId, "QUINTIC_IN") == 0)
-    {
-        return Curve::QUINTIC_IN;
-    }
-    else if (strcmp(curveId, "QUINTIC_OUT") == 0)
-    {
-        return Curve::QUINTIC_OUT;
-    }
-    else if (strcmp(curveId, "QUINTIC_IN_OUT") == 0)
-    {
-        return Curve::QUINTIC_IN_OUT;
-    }
-    else if (strcmp(curveId, "QUINTIC_OUT_IN") == 0)
-    {
-        return Curve::QUINTIC_OUT_IN;
-    }
-    else if (strcmp(curveId, "SINE_IN") == 0)
-    {
-        return Curve::SINE_IN;
-    }
-    else if (strcmp(curveId, "SINE_OUT") == 0)
-    {
-        return Curve::SINE_OUT;
-    }
-    else if (strcmp(curveId, "SINE_IN_OUT") == 0)
-    {
-        return Curve::SINE_IN_OUT;
-    }
-    else if (strcmp(curveId, "SINE_OUT_IN") == 0)
-    {
-        return Curve::SINE_OUT_IN;
-    }
-    else if (strcmp(curveId, "EXPONENTIAL_IN") == 0)
-    {
-        return Curve::EXPONENTIAL_IN;
-    }
-    else if (strcmp(curveId, "EXPONENTIAL_OUT") == 0)
-    {
-        return Curve::EXPONENTIAL_OUT;
-    }
-    else if (strcmp(curveId, "EXPONENTIAL_IN_OUT") == 0)
-    {
-        return Curve::EXPONENTIAL_IN_OUT;
-    }
-    else if (strcmp(curveId, "EXPONENTIAL_OUT_IN") == 0)
-    {
-        return Curve::EXPONENTIAL_OUT_IN;
-    }
-    else if (strcmp(curveId, "CIRCULAR_IN") == 0)
-    {
-        return Curve::CIRCULAR_IN;
-    }
-    else if (strcmp(curveId, "CIRCULAR_OUT") == 0)
-    {
-        return Curve::CIRCULAR_OUT;
-    }
-    else if (strcmp(curveId, "CIRCULAR_IN_OUT") == 0)
-    {
-        return Curve::CIRCULAR_IN_OUT;
-    }
-    else if (strcmp(curveId, "CIRCULAR_OUT_IN") == 0)
-    {
-        return Curve::CIRCULAR_OUT_IN;
-    }
-    else if (strcmp(curveId, "ELASTIC_IN") == 0)
-    {
-        return Curve::ELASTIC_IN;
-    }
-    else if (strcmp(curveId, "ELASTIC_OUT") == 0)
-    {
-        return Curve::ELASTIC_OUT;
-    }
-    else if (strcmp(curveId, "ELASTIC_IN_OUT") == 0)
-    {
-        return Curve::ELASTIC_IN_OUT;
-    }
-    else if (strcmp(curveId, "ELASTIC_OUT_IN") == 0)
-    {
-        return Curve::ELASTIC_OUT_IN;
-    }
-    else if (strcmp(curveId, "OVERSHOOT_IN") == 0)
-    {
-        return Curve::OVERSHOOT_IN;
-    }
-    else if (strcmp(curveId, "OVERSHOOT_OUT") == 0)
-    {
-        return Curve::OVERSHOOT_OUT;
-    }
-    else if (strcmp(curveId, "OVERSHOOT_IN_OUT") == 0)
-    {
-        return Curve::OVERSHOOT_IN_OUT;
-    }
-    else if (strcmp(curveId, "OVERSHOOT_OUT_IN") == 0)
-    {
-        return Curve::OVERSHOOT_OUT_IN;
-    }
-    else if (strcmp(curveId, "BOUNCE_IN") == 0)
-    {
-        return Curve::BOUNCE_IN;
-    }
-    else if (strcmp(curveId, "BOUNCE_OUT") == 0)
-    {
-        return Curve::BOUNCE_OUT;
-    }
-    else if (strcmp(curveId, "BOUNCE_IN_OUT") == 0)
-    {
-        return Curve::BOUNCE_IN_OUT;
-    }
-    else if (strcmp(curveId, "BOUNCE_OUT_IN") == 0)
-    {
-        return Curve::BOUNCE_OUT_IN;
-    }
-
-    return -1;
-}
-
-}

+ 0 - 484
gameplay-encoder/src/Curve.h

@@ -1,484 +0,0 @@
-#ifndef CURVE_H_
-#define CURVE_H_
-
-namespace gameplay
-{
-
-/**
- * Represents an n-dimensional curve.
- */
-class Curve
-{
-    friend class Animation;
-    friend class AnimationClip;
-    friend class AnimationController;
-    friend class MeshSkin;
-
-public:
-
-    /**
-     * Types of interpolation.
-     *
-     * Defines how the points in the curve are connected.
-     *
-     * Note: InterpolationType::BEZIER requires control points and InterpolationType::HERMITE requires tangents.
-     */
-    enum InterpolationType
-    {
-        /**
-         * Bezier Interpolation. 
-         *
-         * Requires that two control points are set for each segment.
-         */
-        BEZIER,
-
-        /**
-         * B-Spline Interpolation. 
-         *
-         * Uses the points as control points, and the curve is guaranteed to only pass through the
-         * first and last point.
-         */
-        BSPLINE,
-
-        /**
-         * Flat Interpolation. 
-         * 
-         * A form of Hermite interpolation that generates flat tangents for you. The tangents have a value equal to 0.
-         */
-        FLAT,
-
-        /**
-         * Hermite Interpolation. 
-         *
-         * Requires that two tangents for each segment.
-         */
-        HERMITE,
-
-        /**
-         * Linear Interpolation.
-         */
-        LINEAR,
-
-        /** 
-         * Smooth Interpolation. 
-         *
-         * A form of Hermite interpolation that generates tangents for each segment based on the points prior to and after the segment.
-         */
-        SMOOTH,
-
-        /**
-         * Discrete Interpolation.
-         */ 
-        STEP,
-
-        /**
-         * Quadratic-In Interpolation.
-         */
-        QUADRATIC_IN, 
-        
-        /**
-         * Quadratic-Out Interpolation.
-         */
-        QUADRATIC_OUT,
-
-        /**
-         * Quadratic-In-Out Interpolation.
-         */
-        QUADRATIC_IN_OUT,
-
-        /**
-         * Quadratic-Out-In Interpolation.
-         */
-        QUADRATIC_OUT_IN,
-
-        /**
-         * Cubic-In Interpolation.
-         */
-        CUBIC_IN,
-        
-        /**
-         * Cubic-Out Interpolation.
-         */
-        CUBIC_OUT,
-        
-        /**
-         * Cubic-In-Out Interpolation.
-         */
-        CUBIC_IN_OUT,
-        
-        /**
-         * Cubic-Out-In Interpolation.
-         */
-        CUBIC_OUT_IN,
-
-        /**
-         * Quartic-In Interpolation.
-         */
-        QUARTIC_IN,
-
-        /**
-         * Quartic-Out Interpolation.
-         */
-        QUARTIC_OUT,
-
-        /**
-         * Quartic-In-Out Interpolation.
-         */
-        QUARTIC_IN_OUT,
-
-        /**
-         * Quartic-Out-In Interpolation.
-         */
-        QUARTIC_OUT_IN,
-
-        /**
-         * Quintic-In Interpolation.
-         */
-        QUINTIC_IN,
-        
-        /**
-         * Quintic-Out Interpolation.
-         */
-        QUINTIC_OUT,
-        
-        /**
-         * Quintic-In-Out Interpolation.
-         */
-        QUINTIC_IN_OUT,
-        
-        /**
-         * Quintic-Out-In Interpolation.
-         */
-        QUINTIC_OUT_IN,
-        
-        /**
-         * Sine-In Interpolation.
-         */
-        SINE_IN,
-        
-        /**
-         * Sine-Out Interpolation.
-         */
-        SINE_OUT,
-        
-        /**
-         * Sine-In-Out Interpolation.
-         */
-        SINE_IN_OUT,
-        
-        /**
-         * Sine-Out-In Interpolation.
-         */
-        SINE_OUT_IN,
-
-        /**
-         * Exponential-In Interpolation.
-         */
-        EXPONENTIAL_IN,
-
-        /**
-         * Exponential-Out Interpolation.
-         */
-        EXPONENTIAL_OUT,
-
-        /**
-         * Exponential-In-Out Interpolation.
-         */
-        EXPONENTIAL_IN_OUT,
-
-        /**
-         * Exponential-Out-In Interpolation.
-         */
-        EXPONENTIAL_OUT_IN,
-
-        /**
-         * Circular-In Interpolation.
-         */
-        CIRCULAR_IN,
-
-        /**
-         * Circular-Out Interpolation.
-         */
-        CIRCULAR_OUT,
-
-        /**
-         * Circular-In-Out Interpolation.
-         */
-        CIRCULAR_IN_OUT,
-
-        /**
-         * Circular-Out-In Interpolation.
-         */
-        CIRCULAR_OUT_IN,
-
-        /**
-         * Elastic-In Interpolation.
-         */
-        ELASTIC_IN,
-
-        /**
-         * Elastic-Out Interpolation.
-         */
-        ELASTIC_OUT,
-
-        /**
-         * Elastic-In-Out Interpolation.
-         */
-        ELASTIC_IN_OUT,
-
-        /**
-         * Elastic-Out-In Interpolation.
-         */
-        ELASTIC_OUT_IN,
-
-        /**
-         * Overshoot-In Interpolation.
-         */
-        OVERSHOOT_IN,
-
-        /**
-         * Overshoot-Out Interpolation.
-         */
-        OVERSHOOT_OUT,
-
-        /**
-         * Overshoot-In-Out Interpolation.
-         */
-        OVERSHOOT_IN_OUT,
-
-        /**
-         * Overshoot-Out-In Interpolation.
-         */
-        OVERSHOOT_OUT_IN,
-
-        /**
-         * Bounce-In Interpolation.
-         */
-        BOUNCE_IN,
-
-        /**
-         * Bounce-Out Interpolation.
-         */
-        BOUNCE_OUT,
-
-        /**
-         * Bounce-In-Out Interpolation.
-         */
-        BOUNCE_IN_OUT,
-
-        /**
-         * Bounce-Out-In Interpolation.
-         */
-        BOUNCE_OUT_IN
-    };
-
-
-    /**
-     * Constructs a new curve and the specified parameters.
-     *
-     * @param pointCount The number of points in the curve.
-     * @param componentCount The number of float component values per key value.
-     */
-    Curve(unsigned int pointCount, unsigned int componentCount);
-
-    /**
-     * Destructor.
-     */
-    ~Curve();
-
-    /**
-     * Gets the number of points in the curve.
-     *
-     * @return The number of points in the curve.
-     */
-    unsigned int getPointCount() const;
-
-    /**
-     * Gets the number of float component values per points.
-     *
-     * @return The number of float component values per point.
-     */
-    unsigned int getComponentCount() const;
-
-    /**
-     * Returns the start time for the curve.
-     *
-     * @return The curve's start time.
-     */
-    float getStartTime() const;
-
-    /**
-     * Returns the end time for the curve.
-     *
-     * @return The curve's end time.
-     */
-    float getEndTime() const;
-
-    /**
-     * Sets the given point values on the curve the curve.
-     *
-     * @param index The index of the point.
-     * @param time The time for the key.
-     * @param value The point to add.
-     * @param type The curve interpolation type.
-     */
-    void setPoint(unsigned int index, float time, float* value, InterpolationType type);
-
-    /**
-     * Sets the given point on the curve for the specified index and the specified parameters.
-     *
-     * @param index The index of the point.
-     * @param time The time of the point within the curve.
-     * @param value The value of the point to copy the data from.
-     * @param type The curve interpolation type.
-     * @param inValue The tangent approaching the point.
-     * @param outValue The tangent leaving the point.
-     */
-    void setPoint(unsigned int index, float time, float* value, InterpolationType type, float* inValue, float* outValue);
-
-    /**
-     * Sets the tangents for a point on the curve specified by the index.
-     *
-     * @param index The index of the point.
-     * @param type The curve interpolation type.
-     * @param inValue The tangent approaching the point.
-     * @param outValue The tangent leaving the point.
-     */
-    void setTangent(unsigned int index, InterpolationType type, float* inValue, float* outValue);
-    
-    /**
-     * Evaluates the curve at the given position value (between 0.0 and 1.0 inclusive).
-     *
-     * @param time The position to evaluate the curve at.
-     * @param dst The evaluated value of the curve at the given time.
-     */
-    void evaluate(float time, float* dst) const;
-
-    /**
-     * Linear interpolation function.
-     */
-    static float lerp(float t, float from, float to);
-
-private:
-
-    /**
-     * Defines a single point within a curve.
-     */
-    class Point
-    {
-    public:
-
-        /** The time of the point within the curve. */
-        float time;
-        /** The value of the point. */
-        float* value;
-        /** The value of the tangent when approaching this point (from the previous point in the curve). */
-        float* inValue;
-        /** The value of the tangent when leaving this point (towards the next point in the curve). */
-        float* outValue;
-        /** The type of interpolation to use between this point and the next point. */
-        InterpolationType type;
-
-        /**
-         * Constructor.
-         */
-        Point();
-
-        /**
-         * Destructor.
-         */
-        ~Point();
-    };
-
-    /**
-     * Constructor.
-     */
-    Curve();
-
-    /**
-     * Constructor.
-     */
-    Curve(const Curve& copy);
-
-    /**
-     * Bezier interpolation function.
-     */
-    void interpolateBezier(float s, Point* from, Point* to, float* dst) const;
-
-    /**
-     * Bspline interpolation function.
-     */
-    void interpolateBSpline(float s, Point* c0, Point* c1, Point* c2, Point* c3, float* dst) const;
-
-    /**
-     * Hermite interpolation function.
-     */
-    void interpolateHermite(float s, Point* from, Point* to, float* dst) const;
-
-    /**
-     * Hermite interpolation function.
-     */
-    void interpolateHermiteFlat(float s, Point* from, Point* to, float* dst) const;
-
-    /**
-     * Hermite interpolation function.
-     */
-    void interpolateHermiteSmooth(float s, unsigned int index, Point* from, Point* to, float* dst) const;
-
-    /** 
-     * Linear interpolation function.
-     */ 
-    void interpolateLinear(float s, Point* from, Point* to, float* dst) const;
-
-    /**
-     * Quaternion interpolation function.
-     */
-    void interpolateQuaternion(float s, float* from, float* to, float* dst) const;
-    
-    /**
-     * Determines the current keyframe to interpolate from based on the specified time.
-     */ 
-    int determineIndex(float time) const;
-
-    /**
-     * Sets the offset for the beginning of a Quaternion piece of data within the curve's value span at the specified
-     * index. The next four components of data starting at the given index will be interpolated as a Quaternion.
-     * This function will assert an error if the given index is greater than the component size subtracted by the four components required
-     * to store a quaternion.
-     * 
-     * @param index The index of the Quaternion rotation data.
-     */
-    void setQuaternionOffset(unsigned int index);
-
-    /**
-     * Gets the InterpolationType value for the given string ID
-     *
-     * @param interpolationId The string representation of the InterpolationType
-     * @return the InterpolationType value; -1 if the string does not represent an InterpolationType.
-     */
-    static int getInterpolationType(const char* interpolationId);
-
-    unsigned int _pointCount;           // Number of points on the curve.
-    unsigned int _componentCount;       // Number of components on the curve.
-    unsigned int _componentSize;        // The component size (in bytes).
-    unsigned int* _quaternionOffset;    // Offset for the rotation component.
-    Point* _points;                     // The points on the curve.
-};
-
-inline static float bezier(float eq0, float eq1, float eq2, float eq3, float from, float out, float to, float in);
-
-inline static float bspline(float eq0, float eq1, float eq2, float eq3, float c0, float c1, float c2, float c3);
-
-inline static float hermite(float h00, float h01, float h10, float h11, float from, float out, float to, float in);
-
-inline static float hermiteFlat(float h00, float h01, float from, float to);
-
-inline static float hermiteSmooth(float h00, float h01, float h10, float h11, float from, float out, float to, float in);
-
-inline static float lerpInl(float s, float from, float to);
-
-}
-
-#include "Curve.inl"
-
-#endif

+ 0 - 36
gameplay-encoder/src/Curve.inl

@@ -1,36 +0,0 @@
-
-
-namespace gameplay
-{
-
-inline float bezier(float eq0, float eq1, float eq2, float eq3, float from, float out, float to, float in)
-{
-    return from * eq0 + out * eq1 + in * eq2 + to * eq3;
-}
-
-inline float bspline(float eq0, float eq1, float eq2, float eq3, float c0, float c1, float c2, float c3)
-{
-    return c0 * eq0 + c1 * eq1 + c2 * eq2 + c3 * eq3;
-}
-
-inline float hermite(float h00, float h01, float h10, float h11, float from, float out, float to, float in)
-{
-    return h00 * from + h01 * to + h10 * out + h11 * in;
-}
-
-inline float hermiteFlat(float h00, float h01, float from, float to)
-{
-    return h00 * from + h01 * to;
-}
-
-inline float hermiteSmooth(float h00, float h01, float h10, float h11, float from, float out, float to, float in)
-{
-    return h00 * from + h01 * to + h10 * out + h11 * in;
-}
-
-inline float lerpInl(float s, float from, float to)
-{
-    return from + (to - from) * s;
-}
-
-}

+ 0 - 101
gameplay-encoder/src/DAEChannelTarget.cpp

@@ -1,101 +0,0 @@
-
-#include "Base.h"
-#include "DAEChannelTarget.h"
-
-namespace gameplay
-{
-
-DAEChannelTarget::DAEChannelTarget(const domChannelRef channelRef) : _channel(channelRef), _targetElement(NULL)
-{
-    const std::string target = channelRef->getTarget();
-    size_t index = target.find('/');
-    if (index == std::string::npos)
-    {
-        // If the string doesn't contain a '/' then the whole string is the id
-        // and there are no sid's being targeted.
-        _targetId = target;
-    }
-    else
-    {
-        // The targetId is the part before the first '/'
-        _targetId = target.substr(0, index);
-
-        // each '/' denotes another sid
-        size_t start;
-        size_t end;
-        do
-        {
-            start = index + 1;
-            end = target.find('/', start);
-        
-            std::string sub;
-            if (end == std::string::npos)
-            {
-                sub = target.substr(start);
-                // break;
-            }
-            else
-            {
-                sub = target.substr(start, end - start);
-                index = end + 1;
-            }
-            _attributeIds.push_back(sub);
-        } while (end != std::string::npos);
-    }
-
-}
-
-DAEChannelTarget::~DAEChannelTarget(void)
-{
-}
-
-daeElement* DAEChannelTarget::getTargetElement()
-{
-    if (!_targetElement && _targetId.length() > 0)
-    {
-        daeSIDResolver resolver(_channel->getDocument()->getDomRoot(), _targetId.c_str());
-        _targetElement = resolver.getElement();
-    }
-    return _targetElement;
-}
-
-const std::string& DAEChannelTarget::getTargetId() const
-{
-    return _targetId;
-}
-
-size_t DAEChannelTarget::getTargetAttributeCount() const
-{
-    return _attributeIds.size();
-}
-
-daeElement* DAEChannelTarget::getTargetAttribute(size_t index)
-{
-    if (index >= _attributeIds.size())
-    {
-        return NULL;
-    }
-    const std::string& att = _attributeIds[index];
-    std::string sid = att.substr(0, att.find('.'));
-    daeSIDResolver resolver(getTargetElement(), sid.c_str());
-    return resolver.getElement();
-}
-
-void DAEChannelTarget::getPropertyName(size_t index, std::string* str)
-{
-    if (index < _attributeIds.size())
-    {
-        // The property name is the string segment after the '.'
-        // The propery is optional so it might not be found.
-        const std::string& att = _attributeIds[index];
-        size_t i = att.find('.');
-        if (i != std::string::npos && i < att.size())
-        {
-            str->assign(att.substr(i+1));
-            return;
-        }
-    }
-    str->clear();
-}
-
-}

+ 0 - 84
gameplay-encoder/src/DAEChannelTarget.h

@@ -1,84 +0,0 @@
-#ifndef DAECHANNELTARGET_H_
-#define DAECHANNELTARGET_H_
-
-namespace gameplay
-{
-
-/**
- * DAEChannelTarget represents the target attribute of the COLLADA dom element "channel".
- * The syntax for the channel target is in the COLLADA spec under "COLLADA Target Addressing".
- */
-class DAEChannelTarget
-{
-public:
-
-    /**
-     * Constructs the DAEChannelTarget from the given channel element.
-     */
-    DAEChannelTarget(const domChannelRef channelRef);
-
-    /**
-     * Destructor.
-     */
-    virtual ~DAEChannelTarget(void);
-
-    /**
-     * Returns a pointer to the dom element that this targeted.
-     * 
-     * @return Pointer to the dom element or NULL if not found.
-     */
-    daeElement* getTargetElement();
-
-    /**
-     * Returns the target ID string.
-     */
-    const std::string& getTargetId() const;
-
-    /**
-     * Returns the number of target attributes for this channel target.
-     */
-    size_t getTargetAttributeCount() const;
-
-    /**
-     * Returns the attribute element at the given index.
-     */
-    daeElement* getTargetAttribute(size_t index);
-
-    /**
-     * Returns property name of the attribute at the given index.
-     * The property name is copied to str.
-     * If the attribute is not found or it doesn't have a property, str is cleared.
-     * 
-     * @param index Index of the attribute.
-     * @param str Destination string to copy the property name to.
-     */
-    void getPropertyName(size_t index, std::string* str);
-
-private:
-    
-    /**
-     * The channel element.
-     */
-    const domChannelRef _channel;
-
-    domElement* _targetElement;
-
-    /**
-     * The first part is the id attribute of an element in the instance document
-     * or a dot segment (".") indicating that this is a relative address.
-     */
-    std::string _targetId;
-
-    /**
-     * A channel target can have zero or more target attributes.
-     * Each target attribute my have a property.
-     * Example: "cube/Translate.X/Translate.Y"
-     * Result: attributeIds will contain 2 elements. "Translate.X" and "Translate.Y"
-     * Refer to the COLLADA spec "COLLADA Target Addressing".
-     */
-    std::vector<std::string> _attributeIds;
-};
-
-}
-
-#endif

+ 0 - 78
gameplay-encoder/src/DAEOptimizer.cpp

@@ -1,78 +0,0 @@
-#include "Base.h"
-#include "DAEOptimizer.h"
-
-namespace gameplay
-{
-
-DAEOptimizer::DAEOptimizer(domCOLLADA* dom)
-{
-    _dom = dom;
-}
-
-DAEOptimizer::~DAEOptimizer()
-{   
-}
-
-void DAEOptimizer::combineAnimations(const std::string& nodeId, const std::string& animationId)
-{
-    std::list<domChannelRef> channels;
-
-    daeSIDResolver resolver(_dom, nodeId.c_str());
-    daeElement* element = resolver.getElement();
-    if (element && element->getElementType() == COLLADA_TYPE::NODE)
-    {
-        domNodeRef node = daeSafeCast<domNode>(resolver.getElement());
-        getAnimationChannels(node, channels);
-    }
-
-    // Get the <library_animations>
-    domLibrary_animations_Array& animationsLibraryArray = _dom->getLibrary_animations_array();
-    assert(animationsLibraryArray.getCount() > 0);
-    domLibrary_animationsRef& animationsLibrary = animationsLibraryArray.get(0);
-
-    // Add a new animation
-    domAnimationRef animation = daeSafeCast<domAnimation>(animationsLibrary->createAndPlace("animation"));
-    assert(animation);
-    animation->setId(animationId.c_str());
-    // TODO: Make sure that there doesn't already exist an animation with this ID.
-
-    // Move each of the channels to this animation
-    for (std::list<domChannelRef>::iterator i = channels.begin(); i != channels.end(); ++i)
-    {
-        moveChannelAndSouresToAnimation(*i, animation);
-    }
-
-    // Clean up the empty animations
-    deleteEmptyAnimations();
-}
-
-void DAEOptimizer::deleteEmptyAnimations()
-{
-    std::list<domAnimationRef> animations;
-    
-    // Get the list of empty animations
-    domLibrary_animations_Array& animationLibrary = _dom->getLibrary_animations_array();
-    size_t animationLibraryCount = animationLibrary.getCount();
-    for (size_t i = 0; i < animationLibraryCount; ++i)
-    {
-        domLibrary_animationsRef& animationsRef = animationLibrary.get(i);
-        domAnimation_Array& animationArray = animationsRef->getAnimation_array();
-        size_t animationCount = animationArray.getCount();
-        for (size_t j = 0; j < animationCount; ++j)
-        {
-            domAnimationRef& animation = animationArray.get(j);
-            if (isEmptyAnimation(animation))
-            {
-                animations.push_back(animation);
-            }
-        }
-    }
-
-    // Delete all of the empty animations
-    for (std::list<domAnimationRef>::iterator i = animations.begin(); i != animations.end(); ++i)
-    {
-        daeElement::removeFromParent(*i);
-    }
-}
-
-}

+ 0 - 49
gameplay-encoder/src/DAEOptimizer.h

@@ -1,49 +0,0 @@
-#ifndef DAEOPTIMIZER_H_
-#define DAEOPTIMIZER_H_
-
-#include "DAEUtil.h"
-
-namespace gameplay
-{
-
-/**
- * The DAEOptimizer optimizes a COLLADA dom.
- */
-class DAEOptimizer
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    DAEOptimizer(domCOLLADA* dom);
-
-    /**
-     * Destructor.
-     */
-    ~DAEOptimizer(void);
-
-    /**
-     * Combines all of the animations that target the node and all of its child nodes into a new animation with the given ID.
-     * 
-     * @param nodeId The ID of the node.
-     * @param animationId The ID of the new animation to create.
-     */
-    void combineAnimations(const std::string& nodeId, const std::string& animationId);
-
-private:
-
-    /**
-     * Deletes all of the empty animations in the dom.
-     */
-    void deleteEmptyAnimations();
-
-private:
-    
-    domCOLLADA* _dom;
-    std::string _inputPath;
-};
-
-}
-
-#endif

+ 0 - 1946
gameplay-encoder/src/DAESceneEncoder.cpp

@@ -1,1946 +0,0 @@
-/*
- * DAESceneEncoder.h
- */
-#include "Base.h"
-
-#include "DAESceneEncoder.h"
-#include "DAEOptimizer.h"
-
-//#define ENCODER_PRINT_TIME 1
-
-namespace gameplay
-{
-
-DAESceneEncoder::DAESceneEncoder()
-    : _collada(NULL), _dom(NULL), file(NULL), _vertexBlendWeights(NULL), _vertexBlendIndices(NULL)
-{
-}
-
-DAESceneEncoder::~DAESceneEncoder()
-{
-}
-
-unsigned int getMaxOffset(domInputLocalOffset_Array& inputArray)
-{
-    unsigned int maxOffset = 0;
-    for (unsigned int i = 0; i < (int)inputArray.getCount(); ++i)
-    {
-        if ( inputArray[i]->getOffset() > maxOffset )
-        {
-            maxOffset = (unsigned int)inputArray[i]->getOffset();
-        }
-    }
-
-    return maxOffset;
-}
-
-void DAESceneEncoder::optimizeCOLLADA(const EncoderArguments& arguments, domCOLLADA* dom)
-{
-    DAEOptimizer optimizer(dom);
-    const std::vector<std::string>& groupAnimatioNodeIds = arguments.getGroupAnimationNodeId();
-    const std::vector<std::string>& groupAnimatioIds = arguments.getGroupAnimationAnimationId();
-    assert(groupAnimatioNodeIds.size() == groupAnimatioIds.size());
-    size_t size = groupAnimatioNodeIds.size();
-    if (size > 0)
-    {
-        begin();
-        for (size_t i = 0; i < size; ++i)
-        {
-            optimizer.combineAnimations(groupAnimatioNodeIds[i], groupAnimatioIds[i]);
-        }
-        end("groupAnimation");
-    }
-    if (arguments.DAEOutputEnabled())
-    {
-        if (!_collada->writeTo(arguments.getFilePath(), arguments.getDAEOutputPath()))
-        {
-            fprintf(stderr,"Error: COLLADA failed to write the dom for file:%s\n", arguments.getDAEOutputPath().c_str());
-        }
-    }
-}
-
-void DAESceneEncoder::triangulate(DAE* dae)
-{
-    daeDatabase* dataBase = dae->getDatabase();
-
-    int geometryCount = (int)(dataBase->getElementCount(0, "geometry"));
-    for (int i = 0; i < geometryCount; ++i)
-    {
-        // Find the next geometry element.
-        domGeometry* domGeometry;
-        dataBase->getElement((daeElement**)&domGeometry, i, 0, "geometry");
-
-        // Get the mesh out of the geometry.
-        const domMeshRef domMesh = domGeometry->getMesh();
-        if (!domMesh)
-        {
-            continue;
-        }
-
-        // Loop over all the polygons elements.
-        int polygonsCount = (int)(domMesh->getPolygons_array().getCount());
-        for (int j = 0; j < polygonsCount; ++j)
-        {
-            // Get the polygons out of the mesh.
-            domPolygons* domPolygons = domMesh->getPolygons_array()[j];
-            // Create the triangles from the polygons
-            createTrianglesFromPolygons(domMesh, domPolygons);
-        }
-        while (domMesh->getPolygons_array().getCount() > 0)
-        {
-            domPolygons* domPolygons = domMesh->getPolygons_array().get(0);
-            // Remove the polygons from the mesh.
-            domMesh->removeChildElement(domPolygons);
-        }
-
-        // Loop over all the polylist elements.
-        int polylistCount = (int)(domMesh->getPolylist_array().getCount());
-        for (int j = 0; j < polylistCount; ++j)
-        {
-            // Get the polylist out of the mesh.
-            domPolylist* domPolylist = domMesh->getPolylist_array()[j];
-            // Create the triangles from the polygon list
-            createTrianglesFromPolylist(domMesh, domPolylist);
-        }
-        while (domMesh->getPolylist_array().getCount() > 0)
-        {
-            domPolylist* domPolylist = domMesh->getPolylist_array().get(0);
-            // Remove the polylist from the mesh.
-            domMesh->removeChildElement(domPolylist);
-        }
-    }
-}
-
-void DAESceneEncoder::createTrianglesFromPolygons(domMesh* domMesh, domPolygons* domPolygons)
-{
-    // Create a new <triangles> inside the mesh that has the same material as the <polygons>.
-    domTriangles* triangles = (domTriangles*)domMesh->createAndPlace("triangles");
-    triangles->setCount(0);
-    triangles->setMaterial(domPolygons->getMaterial());
-    domP* domTrianglesP = (domP*)triangles->createAndPlace("p");
-    
-    // Give the new <triangles> the same <_dae> and <parameters> as the old  <polygons>.
-    for (unsigned int i = 0; i < domPolygons->getInput_array().getCount(); ++i)
-    {
-        triangles->placeElement(domPolygons->getInput_array()[i]->clone());
-    }
-    
-    // Get the number of inputs and primitives for the polygons array.
-    unsigned int inputCount = getMaxOffset(domPolygons->getInput_array()) + 1;
-    unsigned int primitiveCount = domPolygons->getP_array().getCount();
-    
-    // Triangulate all the primitives, this generates all the triangles in a single <p> element.
-    for (unsigned int j = 0; j < primitiveCount; ++j)
-    {
-        // Check the polygons for consistancy (some exported files have had the wrong number of indices).
-        domP* domCurrentP = domPolygons->getP_array()[j];
-        int elementCount = (int)(domCurrentP->getValue().getCount());
-        if ( (elementCount % inputCount) != 0 )
-        {
-            // Skip this case.
-        }
-        else
-        {
-            unsigned int triangleCount = (elementCount / inputCount) - 2;
-            
-            // Write out the primitives as triangles, just fan using the first element as the base.
-            unsigned int index = inputCount;
-            for (unsigned int k = 0; k < triangleCount; ++k)
-            {
-                // First vertex.
-                for (unsigned int l = 0; l < inputCount; ++l)
-                {
-                    domTrianglesP->getValue().append(domCurrentP->getValue()[l]);
-                }
-                // Second vertex.
-                for (unsigned int l = 0; l < inputCount; ++l)
-                {
-                    domTrianglesP->getValue().append(domCurrentP->getValue()[index + l]);
-                }
-                // Third vertex.
-                index += inputCount;
-                for (unsigned int l = 0; l < inputCount; ++l)
-                {
-                    domTrianglesP->getValue().append(domCurrentP->getValue()[index + l]);
-                }
-                triangles->setCount(triangles->getCount() + 1);
-            }
-        }
-    }
-}
-
-void DAESceneEncoder::createTrianglesFromPolylist(domMesh* domMesh, domPolylist* domPolylist)
-{
-    // Create a new <triangles> inside the mesh that has the same material as the <polylist>.
-    domTriangles* triangles = (domTriangles*)domMesh->createAndPlace("triangles");
-    triangles->setMaterial(domPolylist->getMaterial());
-    domP* domTrianglesP = (domP*)triangles->createAndPlace("p");
-    
-    // Give the new <triangles> the same <_dae> and <parameters> as the old <polylist>.
-    for (int i = 0; i < (int)(domPolylist->getInput_array().getCount()); ++i)
-    {
-        triangles->placeElement(domPolylist->getInput_array()[i]->clone());
-    }
-    
-    // Get the number of inputs and primitives for the polygons array.
-    unsigned int inputCount = getMaxOffset(domPolylist->getInput_array()) + 1;
-    unsigned int primitiveCount = domPolylist->getVcount()->getValue().getCount();
-    
-    unsigned int offset = 0;
-    unsigned int trianglesProcessed = 0;
-    
-    // Triangulate all the primitives, this generates all the triangles in a single <p> element.
-    for (unsigned int j = 0; j < primitiveCount; ++j)
-    {
-        unsigned int triangleCount = (unsigned int)domPolylist->getVcount()->getValue()[j] - 2;
-        
-        // Write out the primitives as triangles, just fan using the first element as the base.
-        int index = inputCount;
-        for (unsigned int k = 0; k < triangleCount; ++k)
-        {
-            // First vertex.
-            for (unsigned int l = 0; l < inputCount; ++l)
-            {
-                domTrianglesP->getValue().append(domPolylist->getP()->getValue()[offset + l]);
-            }
-            // Second vertex.
-            for (unsigned int l = 0; l < inputCount; ++l)
-            {
-                domTrianglesP->getValue().append(domPolylist->getP()->getValue()[offset + index + l]);
-            }
-            // Third vertex.
-            index += inputCount;
-            for (unsigned int l = 0; l < inputCount; ++l)
-            {
-                domTrianglesP->getValue().append(domPolylist->getP()->getValue()[offset + index + l]);
-            }
-            
-            trianglesProcessed++;
-        }
-        
-        offset += (unsigned int)domPolylist->getVcount()->getValue()[j] * inputCount;
-    }
-    triangles->setCount(trianglesProcessed);
-}
-
-void DAESceneEncoder::write(const std::string& filepath, const EncoderArguments& arguments)
-{
-    _begin = clock();
-    const char* nodeId = arguments.getNodeId();
-    bool text = arguments.textOutputEnabled();
-
-    std::string filenameOnly = getFilenameFromFilePath(filepath);
-    std::string dstPath = filepath.substr(0, filepath.find_last_of('/'));
-    
-    // Load the collada document
-    _collada = new DAE();
-    begin();
-    _dom = _collada->open(filepath);
-    end("Open file");
-    if (!_dom)
-    {
-        fprintf(stderr,"Error: COLLADA failed to open file:%s\n", filepath.c_str());
-        if (_collada)
-        {
-            delete _collada;
-            _collada = NULL;
-        }
-        return;
-    }
-    
-    // Run collada conditioners
-    begin();
-    triangulate(_collada);
-    end("triangulate");
-
-    // Optimize the dom before encoding
-    optimizeCOLLADA(arguments, _dom);
-
-    // Find the <visual_scene> element within the <scene>
-    const domCOLLADA::domSceneRef& domScene = _dom->getScene();
-    daeElement* scene = NULL;
-    if (domScene && domScene->getInstance_visual_scene())
-    {
-        scene = domScene->getInstance_visual_scene()->getUrl().getElement();
-        if (scene->getElementType() != COLLADA_TYPE::VISUAL_SCENE)
-        {
-            // This occured once where Maya exported a Node and Scene element with the same ID.
-            fprintf(stderr,"Error: instance_visual_scene does not reference visual_scene for file:%s\n", filepath.c_str());
-            return;
-        }
-        if (scene)
-        {
-            if (nodeId == NULL)
-            {
-                // If the -i <node_id> parameter was not passed then write out the entire scene.
-                begin();
-                loadScene((domVisual_scene*)scene);
-                end("load scene");
-            }
-            else
-            {
-                // Resolve/Search for the node the user specified with the -i <node_id> parameter.
-                daeSIDResolver resolver(scene, nodeId);
-                domNode* nodeElement = daeSafeCast<domNode>(resolver.getElement());
-                if (nodeElement)
-                {
-                    Node* node = loadNode(nodeElement, NULL);
-                    if (node)
-                    {
-                        _gamePlayFile.addScenelessNode(node);
-                    }
-                    else
-                    {
-                        fprintf(stderr,"COLLADA File loaded to the dom, but failed to load node %s.\n", nodeId);
-                    }
-                }
-                else
-                {
-                    fprintf(stderr,"COLLADA File loaded to the dom, but node was not found with node ID %s.\n", nodeId);
-                }
-            }
-        }
-        else
-        {
-             fprintf(stderr,"COLLADA File loaded to the dom, but query for the dom assets failed.\n");
-        }
-    }
-    else
-    {
-        fprintf(stderr, "COLLADA File loaded to the dom, but missing <visual_scene>.\n");
-    }
-    
-    // The animations should be loaded last
-    begin();
-    loadAnimations(_dom);
-    end("loadAnimations");
-
-    std::string dstFilename = dstPath;
-    dstFilename.append(1, '/');
-    dstFilename.append(getFilenameNoExt(filenameOnly));
-
-    _gamePlayFile.adjust();
-
-    if (text)
-    {
-        std::string outFile = dstFilename + ".xml";
-        fprintf(stderr, "Saving debug file: %s\n", outFile.c_str());
-        _gamePlayFile.saveText(outFile);
-    }
-    else
-    {
-        std::string outFile = dstFilename + ".gpb";
-        fprintf(stderr, "Saving binary file: %s\n", outFile.c_str());
-        begin();
-        _gamePlayFile.saveBinary(outFile);
-        end("save binary");
-    }
-    
-    // Cleanup
-    if (file)
-    {
-        fclose(file);
-    }
-    if (_collada)
-    {
-        delete _collada;
-        _collada = NULL;
-    }
-}
-
-void DAESceneEncoder::loadAnimations(const domCOLLADA* dom)
-{
-    // Call loadAnimation on all <animation> elements in all <library_animations>
-    const domLibrary_animations_Array& animationLibrarys = dom->getLibrary_animations_array();
-    size_t animationLibrarysCount = animationLibrarys.getCount();
-    for (size_t i = 0; i < animationLibrarysCount; ++i)
-    {
-        const domLibrary_animationsRef& libraryAnimation = animationLibrarys.get(i);
-        const domAnimation_Array& animationArray = libraryAnimation->getAnimation_array();
-        size_t animationCount = animationArray.getCount();
-        for (size_t j = 0; j < animationCount; ++j)
-        {
-            const domAnimationRef& animationRef = animationArray.get(j);
-            loadAnimation(animationRef);
-        }
-    }
-}
-
-void DAESceneEncoder::loadAnimation(const domAnimationRef animationRef)
-{
-    // <channel> points to one <sampler>
-    // <sampler> points to multiple <input> elements
-
-    Animation* animation = new Animation();
-    const char* str = animationRef->getId();
-    if (str)
-    {
-        animation->setId(str);
-    }
-
-    // <channel>
-    const domChannel_Array& channelArray = animationRef->getChannel_array();
-    size_t channelArrayCount = channelArray.getCount();
-    for (size_t i = 0; i < channelArrayCount; ++i)
-    {
-        AnimationChannel* animationChannel = new AnimationChannel();
-
-        const domChannelRef& channelRef = channelArray.get(i);
-
-        // <sampler>
-        const domSamplerRef sampler = getSampler(channelRef);
-        assert(sampler);
-
-        // <input>
-        const domInputLocal_Array& inputArray = sampler->getInput_array();
-        size_t inputArrayCount = inputArray.getCount();
-        for (size_t j = 0; j < inputArrayCount; ++j)
-        {
-            const domInputLocalRef& inputLocal = inputArray.get(j);
-
-            // <source>
-            const domSourceRef source = getSource(inputLocal, animationRef);
-
-            std::string semantic = inputLocal->getSemantic();
-            if (equals(semantic, "INTERPOLATION"))
-            {
-                // Interpolation source is a list of strings
-                loadInterpolation(source, animationChannel);
-            }
-            else
-            {
-                // The other sources are lists of floats.
-                std::vector<float> floats;
-                copyFloats(source->getFloat_array(), &floats);
-                if (equals(semantic, "INPUT"))
-                {
-                    // TODO: Ensure param name is TIME?
-                    for (std::vector<float>::iterator k = floats.begin(); k != floats.end(); ++k)
-                    {
-                        // Convert seconds to milliseconds
-                        *k = *k * 1000.0f;
-                    }
-                    animationChannel->setKeyTimes(floats);
-                }
-                else if (equals(semantic, "OUTPUT"))
-                {
-                    animationChannel->setKeyValues(floats);
-                }
-                else if (equals(semantic, "IN_TANGENT"))
-                {
-                    animationChannel->setTangentsIn(floats);
-                }
-                else if (equals(semantic, "OUT_TANGENT"))
-                {
-                    animationChannel->setTangentsOut(floats);
-                }
-            }
-        }
-        // get target attribute enum value
-        if (loadTarget(channelRef, animationChannel))
-        {
-            animation->add(animationChannel);
-        }
-    }
-    if (animation->getAnimationChannelCount() > 0)
-    {
-        _gamePlayFile.addAnimation(animation);
-    }
-    else
-    {
-        delete animation;
-    }
-}
-
-void DAESceneEncoder::loadInterpolation(const domSourceRef source, AnimationChannel* animationChannel)
-{
-    // COLLADA stores the interpolations as a list of strings while GBP uses unsigned int
-    std::vector<unsigned int> values;
-    const domName_arrayRef nameArray = getSourceNameArray(source);
-    assert(nameArray);
-    const domListOfNames& names = nameArray->getValue();
-    size_t count = (size_t)names.getCount();
-    values.resize(count);
-    if (count > 0)
-    {
-        for (size_t i = 0; i < count; ++i)
-        {
-            values[i] = AnimationChannel::getInterpolationType(names.get(i));
-        }
-
-        // If all of the interpolation types are the same then only store the interpolation once
-        // instead of storing the same type for each key frame.
-        unsigned int firstType = values[0];
-        bool allEqual = true;
-        for (size_t i = 1; i < count; ++i)
-        {
-            if (firstType != values[i])
-            {
-                allEqual = false;
-                break;
-            }
-        }
-        if (allEqual)
-        {
-            values.resize(1);
-        }
-    }
-    animationChannel->setInterpolations(values);
-}
-
-bool DAESceneEncoder::loadTarget(const domChannelRef& channelRef, AnimationChannel* animationChannel)
-{
-    // GamePlay requires that animations are baked. Use "Bake Transforms" in your 3D modeling tool.
-    // If the target of an animation is not a matrix then an error will be printed.
-
-    const static char* TRANSFORM_WARNING_FORMAT = "Warning: Node \"%s\":\n %s %s\n";
-    const static char* TRANSFORM_MESSAGE = "transform found but not supported.\n Use \"Bake Transforms\" option when exporting.";
-
-    unsigned int targetProperty = 0;
-    DAEChannelTarget channelTarget(channelRef);
-
-    const char* targetId = channelTarget.getTargetId().c_str();
-
-    // TODO: Do we want to support more than one? If yes then this needs to be fixed.
-    for (size_t i = 0; i < channelTarget.getTargetAttributeCount(); ++i)
-    {
-        std::string prop;
-        channelTarget.getPropertyName(i, &prop);
-        daeElement* attributeElement = channelTarget.getTargetAttribute(i);
-        if (attributeElement)
-        {
-            daeInt type = attributeElement->typeID();
-            if (type == domRotate::ID())
-            {
-                printf(TRANSFORM_WARNING_FORMAT, targetId, "Rotate", TRANSFORM_MESSAGE);
-                return false;
-                /*
-                // <rotate>
-                const domRotate* rotate = daeSafeCast<domRotate>(attributeElement);
-
-                if (prop.size() > 0)
-                {
-                    if (equalsIgnoreCase(prop, "ANGLE"))
-                    {
-                        targetProperty = Transform::ANIMATE_ROTATE;
-
-                        // get the rotation axis
-                        const domFloat4& f = rotate->getValue();
-                        float x = (float)f.get(0);
-                        float y = (float)f.get(1);
-                        float z = (float)f.get(2);
-                        
-                        // Get the angle values that were already read
-                        const std::vector<float>& keyValues = animationChannel->getKeyValues();
-                        size_t size = keyValues.size();
-                        assert(size > 0);
-                        // COLLADA only targeted a single prop but GBP requires all 4 rotate values.
-                        // Convert (ANGLE ANGLE ANGLE) to (X Y Z ANGLE X Y Z ANGLE X Y Z ANGLE)
-                        std::vector<float> floats(size * 4);
-                        // Duplicate rotation axis. We will replace only the angle that COLLADA is targeting.
-                        for (size_t j = 0; j < size; ++j)
-                        {
-                            size_t k = j * 4;
-                            floats[k+0] = x;
-                            floats[k+1] = y;
-                            floats[k+2] = z;
-                            floats[k+3] = keyValues[j]; // angle
-                        }
-                        animationChannel->setKeyValues(floats);
-                    }
-                }
-                */
-            }
-            else if (type == domScale::ID())
-            {
-                printf(TRANSFORM_WARNING_FORMAT, targetId, "Scale", TRANSFORM_MESSAGE);
-                return false;
-                /*
-                // <scale>
-                //const domScale* scale = daeSafeCast<domScale>(attributeElement);
-                if (equalsIgnoreCase(prop, "X"))
-                {
-                    targetProperty = Transform::ANIMATE_SCALE_X;
-                }
-                else if (equalsIgnoreCase(prop, "Y"))
-                {
-                    targetProperty = Transform::ANIMATE_SCALE_Y;
-                }
-                else if (equalsIgnoreCase(prop, "Z"))
-                {
-                    targetProperty = Transform::ANIMATE_SCALE_Z;
-                }
-                else
-                {
-                    targetProperty = Transform::ANIMATE_SCALE;
-                }
-                */
-            }
-            else if (type == domTranslate::ID())
-            {
-                printf(TRANSFORM_WARNING_FORMAT, targetId, "Translate", TRANSFORM_MESSAGE);
-                return false;
-                /*
-                // <translate>
-                //const domTranslate* translate = daeSafeCast<domTranslate>(attributeElement);
-                if (equalsIgnoreCase(prop, "X"))
-                {
-                    targetProperty = Transform::ANIMATE_TRANSLATE_X;
-                }
-                else if (equalsIgnoreCase(prop, "Y"))
-                {
-                    targetProperty = Transform::ANIMATE_TRANSLATE_Y;
-                }
-                else if (equalsIgnoreCase(prop, "Z"))
-                {
-                    targetProperty = Transform::ANIMATE_TRANSLATE_Z;
-                }
-                else
-                {
-                    targetProperty = Transform::ANIMATE_TRANSLATE;
-                }
-                */
-            }
-            else if (type == domMatrix::ID())
-            {
-                // If the animation is targetting a matrix then convert it into
-                // a scale, rotate, translate animation by decomposing the matrix.
-                targetProperty = Transform::ANIMATE_SCALE_ROTATE_TRANSLATE;
-
-                const std::vector<float>& keyValues = animationChannel->getKeyValues();
-                assert(keyValues.size() % 16 == 0);
-                // The matrix was 16 floats and the new values will be 10 floats
-                size_t newSize = keyValues.size() / 16 * 10;
-                std::vector<float> floats(newSize);
-
-                size_t matrixCount = keyValues.size() / 16;
-                for (size_t i = 0; i < matrixCount; ++i)
-                {
-                    size_t j = i * 16;
-                    // COLLADA used row-major but the Matrix class uses column-major
-                    Matrix matrix(
-                        keyValues[j+0], keyValues[j+4], keyValues[j+8], keyValues[j+12],
-                        keyValues[j+1], keyValues[j+5], keyValues[j+9], keyValues[j+13],
-                        keyValues[j+2], keyValues[j+6], keyValues[j+10], keyValues[j+14],
-                        keyValues[j+3], keyValues[j+7], keyValues[j+11], keyValues[j+15]);
-                    Vector3 scale;
-                    Quaternion rotation;
-                    Vector3 translation;
-                    matrix.decompose(&scale, &rotation, &translation);
-                    rotation.normalize();
-
-                    size_t k = i * 10;
-                    floats[k+0] = scale.x;
-                    floats[k+1] = scale.y;
-                    floats[k+2] = scale.z;
-                    floats[k+3] = rotation.x;
-                    floats[k+4] = rotation.y;
-                    floats[k+5] = rotation.z;
-                    floats[k+6] = rotation.w;
-                    floats[k+7] = translation.x;
-                    floats[k+8] = translation.y;
-                    floats[k+9] = translation.z;
-                }
-                animationChannel->setKeyValues(floats);
-            }
-        }
-    }
-    animationChannel->setTargetAttribute(targetProperty);
-    animationChannel->setTargetId(channelTarget.getTargetId());
-    //animationChannel->removeDuplicates();
-    return true;
-}
-
-void DAESceneEncoder::begin()
-{
-    #ifdef ENCODER_PRINT_TIME
-    _begin = clock();
-    #endif
-}
-
-void DAESceneEncoder::end(const char* str)
-{
-    #ifdef ENCODER_PRINT_TIME
-    clock_t time = clock() - _begin;
-    fprintf(stderr,"%5d %s\n", time, str);
-    #endif
-}
-
-void DAESceneEncoder::copyFloats(const domFloat_array* source, std::vector<float>* target)
-{
-    std::vector<float>& t = *target;
-
-    size_t count = (size_t)source->getCount();
-    t.resize(count);
-    const domListOfFloats& listOfFloats = source->getValue();
-    for (size_t i = 0; i < count; ++i)
-    {
-        t[i] = (float)listOfFloats.get(i);
-    }
-}
-
-void DAESceneEncoder::loadScene(const domVisual_scene* visualScene)
-{
-    Scene* scene = new Scene();
-
-    const domNode_Array& nodes = visualScene->getNode_array();
-    scene->setId(visualScene->getId());
-    size_t childCount = nodes.getCount();
-    for (size_t i = 0; i < childCount; ++i)
-    {
-        scene->add(loadNode(nodes[i], NULL));
-    }
-    
-    Node* activeCameraNode = findSceneActiveCameraNode(visualScene, scene);
-    if (activeCameraNode)
-    {
-        scene->setActiveCameraNode(activeCameraNode);
-    }
-
-    _gamePlayFile.addScene(scene);
-}
-
-Node* DAESceneEncoder::findSceneActiveCameraNode(const domVisual_scene* visualScene, Scene* scene)
-{
-    // Loops through each evaluate_scene's render until an active camera node is found.
-    // Returns the first one found.
-
-    // Find the active camera
-    const domVisual_scene::domEvaluate_scene_Array& evaluateScenes = visualScene->getEvaluate_scene_array();
-    size_t evaluateSceneCount = evaluateScenes.getCount();
-    for (size_t i = 0; i < evaluateSceneCount; ++i)
-    {
-        const domVisual_scene::domEvaluate_scene::domRender_Array& renders = evaluateScenes[i]->getRender_array();
-        size_t renderCount = renders.getCount();
-        for (size_t j = 0; j < renderCount; ++j)
-        {
-            xsAnyURI cameraNodeURI = renders[i]->getCamera_node();
-            domNode* nodeRef = daeSafeCast<domNode>(cameraNodeURI.getElement());
-            if (nodeRef)
-            {
-                std::string id = nodeRef->getId();
-                Node* node = _gamePlayFile.getNode(id.c_str());
-                if (node)
-                {
-                    return node;
-                }
-            }
-        }
-    }
-    // Find the first node in the scene that contains a camera.
-    return scene->getFirstCameraNode();
-}
-
-Node* DAESceneEncoder::loadNode(domNode* n, Node* parent)
-{
-    Node* node = NULL;
-
-    // Check if this node has already been loaded
-    const char* id = n->getID();
-    if (id && strlen(id) > 0)
-    {
-        node = _gamePlayFile.getNode(n->getID());
-        if (node)
-        {
-            return node;
-        }
-    }
-    
-    // Load the node
-    node = new Node();
-
-    if (parent)
-    {
-        parent->addChild(node);
-    }
-    
-    if (n->getType() == NODETYPE_JOINT)
-    {
-        node->setIsJoint(true);
-    }
-
-    // Set node id
-    node->setId(n->getId());
-
-    // If this node has an id then add it to the ref table
-    _gamePlayFile.addNode(node);
-
-    transformNode(n, node);
-    loadControllerInstance(n, node);
-    loadCameraInstance(n, node);
-    loadLightInstance(n, node);
-    loadGeometryInstance(n, node);
-    
-    // Load child nodes
-    const domNode_Array& childNodes = n->getNode_array();
-    size_t childCount = childNodes.getCount();
-    for (size_t i = 0; i < childCount; ++i)
-    {
-        loadNode(childNodes.get(i), node);
-    }
-    return node;
-}
-
-void DAESceneEncoder::transformNode(domNode* domNode, Node* node)
-{
-    // Apply the transform.
-    // Note that we only honor the first matrix transform specified for the DOM node.
-    const domMatrix_Array& matrixArray = domNode->getMatrix_array();
-    if (matrixArray.getCount() > 0)
-    {
-        const domMatrixRef& matrix = matrixArray.get(0);
-        if (!matrix)
-        {
-            return;
-        }
-        const domFloat4x4& tx = matrix->getValue();
-        float transform[] = {(float)tx.get(0), (float)tx.get(4), (float)tx.get(8), (float)tx.get(12),
-                              (float)tx.get(1), (float)tx.get(5), (float)tx.get(9), (float)tx.get(13),
-                              (float)tx.get(2), (float)tx.get(6), (float)tx.get(10), (float)tx.get(14),
-                              (float)tx.get(3), (float)tx.get(7), (float)tx.get(11), (float)tx.get(15)};
-        node->setTransformMatrix(transform);
-    }
-    else
-    {
-        Matrix transform;
-        calcTransform(domNode, transform);
-        node->setTransformMatrix(transform.m);
-    }
-
-    // TODO: Handle transforming by other types (SRT, etc) (see "Node" child elements spec)
-
-    /*Vector3 scale;
-    Quaternion rotation;
-    Vector3 translation;
-
-    localTransform.Decompose(&scale, &rotation, &translation);
-
-    node->SetScale(scale);
-    node->SetRotation(rotation);
-    node->SetTranslation(translation);*/
-}
-
-void DAESceneEncoder::calcTransform(domNode* domNode, Matrix& dstTransform)
-{
-    daeTArray<daeSmartRef<daeElement> > children;
-    domNode->getChildren(children);
-    size_t childCount = children.getCount();
-    for (size_t i = 0; i < childCount; ++i)
-    {
-        daeElementRef childElement = children[i];
-        switch (childElement->getElementType())
-        {
-            case COLLADA_TYPE::TRANSLATE:
-            {
-                domTranslateRef translateNode = daeSafeCast<domTranslate>(childElement);
-                float x = (float)translateNode->getValue().get(0);
-                float y = (float)translateNode->getValue().get(1);
-                float z = (float)translateNode->getValue().get(2);
-                dstTransform.translate(x, y, z);
-                break;
-            }
-            case COLLADA_TYPE::ROTATE:
-            {
-                domRotateRef rotateNode = daeSafeCast<domRotate>(childElement);
-                float x = (float)rotateNode->getValue().get(0);
-                float y = (float)rotateNode->getValue().get(1);
-                float z = (float)rotateNode->getValue().get(2);
-                float angle = MATH_DEG_TO_RAD((float)rotateNode->getValue().get(3)); // COLLADA uses degrees, gameplay uses radians
-                if (x == 1.0f && y == 0.0f && z == 0.0f)
-                {
-                    dstTransform.rotateX(angle);
-                }
-                else if (x == 0.0f && y == 1.0f && z == 0.0f)
-                {
-                    dstTransform.rotateY(angle);
-                }
-                else if (x == 0.0f && y == 0.0f && z == 1.0f)
-                {
-                    dstTransform.rotateZ(angle);
-                }
-                else
-                {
-                    dstTransform.rotate(x, y, z, angle);
-                }
-                break;
-            }
-            case COLLADA_TYPE::SCALE:
-            {
-                domScaleRef scaleNode = daeSafeCast<domScale>(childElement);
-                float x = (float)scaleNode->getValue().get(0);
-                float y = (float)scaleNode->getValue().get(1);
-                float z = (float)scaleNode->getValue().get(2);
-                dstTransform.scale(x, y, z);
-                break;
-            }
-            case COLLADA_TYPE::SKEW:
-                warning("Skew transform found but not supported.");
-                break;
-            case COLLADA_TYPE::LOOKAT:
-                warning("Lookat transform found but not supported.");
-                break;
-            default:
-                break;
-        }
-    }
-}
-
-void DAESceneEncoder::loadCameraInstance(const domNode* n, Node* node)
-{
-    // Does this node have any camera instances?
-    const domInstance_camera_Array& instanceCameras = n->getInstance_camera_array();
-    size_t instanceCameraCount = instanceCameras.getCount();
-    for (size_t i = 0; i < instanceCameraCount; ++i)
-    {
-        // Get the camrea object
-        const domInstance_camera* cameraInstanceRef = instanceCameras.get(i);
-        xsAnyURI cameraURI = cameraInstanceRef->getUrl();
-        domCamera* cameraRef = daeSafeCast<domCamera>(cameraURI.getElement());
-
-        if (cameraRef)
-        {
-            Camera* camera = loadCamera(cameraRef);
-            if (camera)
-            {
-                node->setCamera(camera);
-            }
-        }
-        else
-        {
-            // warning
-        }
-    }
-}
-
-void DAESceneEncoder::loadLightInstance(const domNode* n, Node* node)
-{
-    // Does this node have any light instances?
-    const domInstance_light_Array& instanceLights = n->getInstance_light_array();
-    size_t instanceLightCount = instanceLights.getCount();
-    for (size_t i = 0; i < instanceLightCount; ++i)
-    {
-        // Get the camrea object
-        const domInstance_light* lightInstanceRef = instanceLights.get(i);
-        xsAnyURI lightURI = lightInstanceRef->getUrl();
-        domLight* lightRef = daeSafeCast<domLight>(lightURI.getElement());
-
-        if (lightRef)
-        {
-            Light* light = loadLight(lightRef);
-            if (light)
-            {
-                node->setLight(light);
-            }
-        }
-        else
-        {
-            // warning
-        }
-    }
-}
-
-void DAESceneEncoder::loadGeometryInstance(const domNode* n, Node* node)
-{
-    // Does this node have any geometry instances?
-    const domInstance_geometry_Array& instanceGeometries = n->getInstance_geometry_array();
-    size_t instanceGeometryCount = instanceGeometries.getCount();
-    for (size_t i = 0; i < instanceGeometryCount; ++i)
-    {
-        // Get the geometry object
-        const domInstance_geometryRef geometryInstanceRef = instanceGeometries.get(i);
-        xsAnyURI geometryURI = geometryInstanceRef->getUrl();
-        domGeometry* geometry = daeSafeCast<domGeometry>(geometryURI.getElement());
-
-        // Load the model from this geometry
-        if (geometry)
-        {
-            Model* model = loadGeometry(geometry, geometryInstanceRef->getBind_material());
-            if (model)
-            {
-                node->setModel(model);
-            }
-        }
-        else
-        {
-            warning(std::string("Failed to resolve geometry url: ") + geometryURI.getURI());
-        }
-    }
-}
-
-void DAESceneEncoder::loadControllerInstance(const domNode* n, Node* node)
-{
-    // Does this node have any controller instances?
-    const domInstance_controller_Array& instanceControllers = n->getInstance_controller_array();
-    size_t instanceControllerCount = instanceControllers.getCount();
-    for (size_t i = 0; i < instanceControllerCount; ++i)
-    {
-        const domInstance_controllerRef instanceControllerRef = instanceControllers.get(i);
-        xsAnyURI controllerURI = instanceControllerRef->getUrl();
-        domController* controllerRef = daeSafeCast<domController>(controllerURI.getElement());
-
-        if (controllerRef)
-        {
-            const domSkin* skinElement = controllerRef->getSkin();
-            if (skinElement)
-            {
-                Model* model = loadSkin(skinElement);
-                if (model)
-                {
-                    domInstance_controller::domSkeleton_Array& skeletons = instanceControllerRef->getSkeleton_array();
-                    if (skeletons.getCount() == 0)
-                    {
-                        warning("No skeletons found for instance controller: ");
-                        delete model;
-                        continue;
-                    }
-                    // Load the skeleton for this skin
-                    domInstance_controller::domSkeletonRef skeleton = getSkeleton(instanceControllerRef);
-                    assert(skeleton);
-                    loadSkeleton(skeleton, model->getSkin());
-
-                    node->setModel(model);
-                }
-            }
-        }
-        else
-        {
-            // warning
-        }
-        _jointLookupTable.clear();
-        _jointInverseBindPoseMatrices.clear();
-    }
-}
-
-Camera* DAESceneEncoder::loadCamera(const domCamera* cameraRef)
-{
-    Camera* camera = new Camera();
-    camera->setId(cameraRef->getId());
-
-    // Optics
-    const domCamera::domOpticsRef opticsRef = cameraRef->getOptics();
-    if (opticsRef.cast())
-    {
-        const domCamera::domOptics::domTechnique_commonRef techRef = opticsRef->getTechnique_common();
-
-        // Orthographics
-        const domCamera::domOptics::domTechnique_common::domOrthographicRef orthographicRef = techRef->getOrthographic();
-        if (orthographicRef.cast())
-        {
-            camera->setOrthographic();
-            camera->setAspectRatio((float)orthographicRef->getAspect_ratio()->getValue());
-            camera->setNearPlane((float)orthographicRef->getZnear()->getValue());
-            camera->setFarPlane((float)orthographicRef->getZfar()->getValue());
-
-            const domTargetableFloatRef xmag = orthographicRef->getXmag();
-            const domTargetableFloatRef ymag = orthographicRef->getYmag();
-            // Viewport width
-            if (xmag.cast())
-            {
-                camera->setViewportWidth((float)xmag->getValue());
-            }
-            // Viewport height
-            if (ymag.cast())
-            {
-                camera->setViewportHeight((float)ymag->getValue());
-            }
-            // TODO: Viewport x and y?
-        }
-
-        // Perspective
-        const domCamera::domOptics::domTechnique_common::domPerspectiveRef perspectiveRef = techRef->getPerspective();
-        if (perspectiveRef.cast())
-        {
-            camera->setPerspective();
-            camera->setNearPlane((float)perspectiveRef->getZnear()->getValue());
-            camera->setFarPlane((float)perspectiveRef->getZfar()->getValue());
-
-            float aspectRatio = -1.0f;
-            if (perspectiveRef->getAspect_ratio().cast())
-            {
-                aspectRatio = (float)perspectiveRef->getAspect_ratio()->getValue();
-                camera->setAspectRatio(aspectRatio);
-            }
-            if (perspectiveRef->getYfov().cast())
-            {
-                camera->setFieldOfView((float)perspectiveRef->getYfov()->getValue());
-            }
-            else if (perspectiveRef->getXfov().cast() && aspectRatio > 0.0f)
-            {
-                // The gameplaybinary stores the yfov but collada might have specified
-                // an xfov and an aspect ratio. So use those to calculate the yfov.
-                float xfov = (float)perspectiveRef->getXfov()->getValue();
-                float yfov = xfov / aspectRatio;
-                camera->setFieldOfView(yfov);
-            }
-        }
-    }
-    _gamePlayFile.addCamera(camera);
-    return camera;
-}
-
-Light* DAESceneEncoder::loadLight(const domLight* lightRef)
-{
-    Light* light = new Light();
-    light->setId(lightRef->getId());
-
-    const domLight::domTechnique_commonRef techRef = lightRef->getTechnique_common();
-
-    // Ambient light
-    {
-        const domLight::domTechnique_common::domAmbientRef ambientRef = techRef->getAmbient();
-        if (ambientRef.cast())
-        {
-            light->setAmbientLight();
-            // color
-            const domTargetableFloat3Ref float3Ref = ambientRef->getColor();
-            const domFloat3& color3 = float3Ref->getValue();
-            light->setColor((float)color3.get(0), (float)color3.get(1), (float)color3.get(2));
-        }
-    }
-
-    // Directional light
-    {
-        const domLight::domTechnique_common::domDirectionalRef direcitonalRef = techRef->getDirectional();
-        if (direcitonalRef.cast())
-        {
-            light->setDirectionalLight();
-            // color
-            const domTargetableFloat3Ref float3Ref = direcitonalRef->getColor();
-            const domFloat3& color3 = float3Ref->getValue();
-            light->setColor((float)color3.get(0), (float)color3.get(1), (float)color3.get(2));
-        }
-    }
-
-    // Spot light
-    {
-        const domLight::domTechnique_common::domSpotRef spotRef = techRef->getSpot();
-        if (spotRef.cast())
-        {
-            light->setSpotLight();
-            // color
-            const domTargetableFloat3Ref float3Ref = spotRef->getColor();
-            const domFloat3& color3 = float3Ref->getValue();
-            light->setColor((float)color3.get(0), (float)color3.get(1), (float)color3.get(2));
-                
-            const domTargetableFloatRef& constAtt = spotRef->getConstant_attenuation();
-            if (constAtt.cast())
-            {
-                light->setConstantAttenuation((float)constAtt->getValue());
-            }
-
-            const domTargetableFloatRef& linearAtt = spotRef->getLinear_attenuation();
-            if (linearAtt.cast())
-            {
-                light->setLinearAttenuation((float)linearAtt->getValue());
-            }
-
-            const domTargetableFloatRef& quadAtt = spotRef->getQuadratic_attenuation();
-            if (quadAtt.cast())
-            {
-                light->setQuadraticAttenuation((float)quadAtt->getValue());
-            }
-
-            const domTargetableFloatRef& falloffAngle = spotRef->getFalloff_angle();
-            if (falloffAngle.cast())
-            {
-                light->setFalloffAngle((float)falloffAngle->getValue());
-            }
-
-            const domTargetableFloatRef& falloffExp = spotRef->getFalloff_exponent();
-            if (falloffExp.cast())
-            {
-                light->setFalloffExponent((float)falloffExp->getValue());
-            }
-        }
-    }
-
-    // Point light
-    {
-        const domLight::domTechnique_common::domPointRef pointRef = techRef->getPoint();
-        if (pointRef.cast())
-        {
-            light->setPointLight();
-            // color
-            const domTargetableFloat3Ref float3Ref = pointRef->getColor();
-            const domFloat3& color3 = float3Ref->getValue();
-            light->setColor((float)color3.get(0), (float)color3.get(1), (float)color3.get(2));
-
-            const domTargetableFloatRef& constAtt = pointRef->getConstant_attenuation();
-            if (constAtt.cast())
-            {
-                light->setConstantAttenuation((float)constAtt->getValue());
-            }
-
-            const domTargetableFloatRef& linearAtt = pointRef->getLinear_attenuation();
-            if (linearAtt.cast())
-            {
-                light->setLinearAttenuation((float)linearAtt->getValue());
-            }
-
-            const domTargetableFloatRef& quadAtt = pointRef->getQuadratic_attenuation();
-            if (quadAtt.cast())
-            {
-                light->setQuadraticAttenuation((float)quadAtt->getValue());
-            }
-        }
-    }
-    _gamePlayFile.addLight(light);
-    return light;
-}
-
-void DAESceneEncoder::loadSkeleton(domInstance_controller::domSkeleton* skeletonElement, MeshSkin* skin)
-{
-    xsAnyURI skeletonUri = skeletonElement->getValue();
-    daeString skeletonId = skeletonUri.getID();
-    daeSIDResolver resolver(skeletonUri.getElement(), skeletonId);
-    domNode* rootNode = daeSafeCast<domNode>(resolver.getElement());
-    
-    // Get the lookup scene id (sid) and joint index.
-    std::string id = std::string(skeletonId);
-
-    // Has the skeleton (root joint) been loaded yet?
-    Node* skeleton = (Node*)_gamePlayFile.getFromRefTable(id);
-
-    // The skeleton node is not loaded yet, so let's load it now
-    if (skeleton == NULL)
-    {
-        // Find the top most parent of rootNode that has not yet been loaded
-        domNode* topLevelParent = rootNode;
-        while (
-            topLevelParent->getParent() &&
-            topLevelParent->getParent()->getElementType() == COLLADA_TYPE::NODE &&
-            _gamePlayFile.getFromRefTable(topLevelParent->getParent()->getID()) == NULL)
-        {
-            topLevelParent = (domNode*)topLevelParent->getParent();
-        }
-
-        // Is the parent of this node loaded yet?
-        Node* parentNode = NULL;
-        if (topLevelParent->getParent() &&
-            topLevelParent->getParent()->getElementType() == COLLADA_TYPE::NODE &&
-            _gamePlayFile.getFromRefTable(topLevelParent->getParent()->getID()) != NULL)
-        {
-            parentNode = (Node*)_gamePlayFile.getFromRefTable(topLevelParent->getParent()->getID());
-        }
-
-        // Finally, load the node hierarchy that includes the skeleton
-        skeleton = loadNode(topLevelParent, parentNode);
-    }
-
-    if (skeleton == NULL)
-    {
-        // This shouldn't really happen..
-        skeleton = new Node();
-        skeleton->setId(id);
-        _gamePlayFile.addNode(skeleton);
-    }
-
-    // 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++)
-    {
-        Object* obj = _gamePlayFile.getFromRefTable(*i);
-        if (obj && obj->getTypeId() == Object::NODE_ID)
-        {
-            Node* node = static_cast<Node*>(obj);
-            _joints.push_back(node);
-        }
-    }
-    skin->setJoints(_joints);
-}
-
-Model* DAESceneEncoder::loadSkin(const domSkin* skinElement)
-{
-    ///////////////////////////// SKIN
-    Model* model = new Model();
-    MeshSkin* skin = new MeshSkin();
-
-    // Bind Shape Matrix
-    const domSkin::domBind_shape_matrix* bindShapeMatrix = skinElement->getBind_shape_matrix();
-    if (bindShapeMatrix)
-    {
-        const domFloat4x4& m = bindShapeMatrix->getValue();
-        float transform[] = {(float)m.get(0), (float)m.get(4), (float)m.get(8),  (float)m.get(12),
-                             (float)m.get(1), (float)m.get(5), (float)m.get(9),  (float)m.get(13),
-                             (float)m.get(2), (float)m.get(6), (float)m.get(10), (float)m.get(14),
-                             (float)m.get(3), (float)m.get(7), (float)m.get(11), (float)m.get(15)};
-        skin->setBindShape(transform);
-    }
-
-    // Read and set our joints
-    domSkin::domJointsRef _joints = skinElement->getJoints();
-    domInputLocal_Array& jointInputs = _joints->getInput_array();
-
-    // Process "JOINT" input semantic first (we need to do this to set the joint count)
-    unsigned int jointCount = 0;
-    for (unsigned int i = 0; i < jointInputs.getCount(); ++i)
-    {
-        domInputLocalRef input = jointInputs.get(i);
-        std::string inputSemantic = std::string(input->getSemantic());
-        domURIFragmentType* sourceURI = &input->getSource();
-        sourceURI->resolveElement();
-        const domSourceRef source = (domSource*)(daeElement*)sourceURI->getElement();
-
-        if (equals(inputSemantic, "JOINT"))
-        {
-            // Get the joint Ids's
-            std::vector<std::string> list;
-            getJointNames(source, list);
-
-            // Go through the joint list and conver 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++)
-            {
-                daeSIDResolver resolver(source->getDocument()->getDomRoot(), i->c_str());
-                daeElement* element = resolver.getElement();
-                if (element && element->getElementType() == COLLADA_TYPE::NODE)
-                {
-                    domNodeRef node = daeSafeCast<domNode>(element);
-                    const char* nodeId = node->getId();
-                    if (nodeId && !equals(*i, nodeId))
-                    {
-                        *i = nodeId;
-                    }
-                }
-            }
-
-            // Get the joint count and set the capacities for both the
-            jointCount = list.size();
-            _jointInverseBindPoseMatrices.reserve(jointCount);
-            unsigned int j = 0;
-            for (std::vector<std::string>::const_iterator i = list.begin(); i != list.end(); i++)
-            {
-                _jointLookupTable[*i] = j++;
-            }
-            skin->setJointNames(list);
-        }
-    }
-
-    // Make sure we have some joints
-    if (jointCount == 0)
-    {
-        warning("No joints found for skin: ");
-        return NULL;
-    }
-
-    // Process "INV_BIND_MATRIX" next
-    for (unsigned int i = 0; i < jointInputs.getCount(); ++i)
-    {
-        domInputLocalRef input = jointInputs.get(i);
-        std::string inputSemantic = std::string(input->getSemantic());
-        domURIFragmentType* sourceURI = &input->getSource();
-        sourceURI->resolveElement();
-        domSource* source = (domSource*)(daeElement*)sourceURI->getElement();
-
-        if (equals(inputSemantic, "INV_BIND_MATRIX"))
-        {
-            domListOfFloats& matrixFloats = source->getFloat_array()->getValue();
-            //unsigned int matrixFloatsCount = (unsigned int)source->getFloat_array()->getCount();
-            unsigned int jointIndex = 0;
-
-            for (unsigned int j = 0; j < jointCount; ++j)
-            {
-                Matrix matrix((float)matrixFloats.get(jointIndex + 0), (float)matrixFloats.get(jointIndex + 4), (float)matrixFloats.get(jointIndex + 8), (float)matrixFloats.get(jointIndex + 12),
-                              (float)matrixFloats.get(jointIndex + 1), (float)matrixFloats.get(jointIndex + 5), (float)matrixFloats.get(jointIndex + 9), (float)matrixFloats.get(jointIndex + 13),
-                              (float)matrixFloats.get(jointIndex + 2), (float)matrixFloats.get(jointIndex + 6), (float)matrixFloats.get(jointIndex + 10), (float)matrixFloats.get(jointIndex + 14),
-                              (float)matrixFloats.get(jointIndex + 3), (float)matrixFloats.get(jointIndex + 7), (float)matrixFloats.get(jointIndex + 11), (float)matrixFloats.get(jointIndex + 15));
-
-                _jointInverseBindPoseMatrices.push_back(matrix);
-                jointIndex += 16;
-            }
-        }
-    }
-
-    skin->setBindPoses(_jointInverseBindPoseMatrices);
-
-    // Get the vertex weights inputs
-    domSkin::domVertex_weights* vertexWeights =  skinElement->getVertex_weights();
-    domInputLocalOffset_Array& vertexWeightsInputs = vertexWeights->getInput_array();
-    unsigned int vertexWeightsCount = (unsigned int)vertexWeights->getCount();
-    domListOfFloats jointWeights;
-
-    for (unsigned int i = 0; i < jointInputs.getCount(); ++i)
-    {
-        domInputLocalOffsetRef input = vertexWeightsInputs.get(i);
-        std::string inputSemantic = std::string(input->getSemantic());
-        domURIFragmentType* sourceURI = &input->getSource();
-        sourceURI->resolveElement();
-        domSource* source = (domSource*)(daeElement*)sourceURI->getElement();
-
-        if (equals(inputSemantic, "WEIGHT"))
-        {
-            domFloat_array* weights = source->getFloat_array();
-            if (weights)
-            {
-                jointWeights = weights->getValue();
-            }
-        }
-    }
-    
-    // Get the number of joint influences per vertex
-    domSkin::domVertex_weights::domVcount* vCountElement = vertexWeights->getVcount();
-    domListOfUInts skinVertexInfluenceCounts = vCountElement->getValue();
-    // Get the joint/weight pair data.
-    domSkin::domVertex_weights::domV* vElement = vertexWeights->getV();
-    domListOfInts skinVertexJointWeightPairIndices = vElement->getValue();
-        
-    // Get the vertex influence count for any given vertex (up to max of 4)
-    unsigned int maxVertexInfluencesCount = SCENE_SKIN_VERTEXINFLUENCES_MAX;
-    skin->setVertexInfluenceCount(maxVertexInfluencesCount);
-
-    // Get the vertex blend weights and joint indices and
-    // allocate our vertex blend weights and blend indices arrays.
-    // These will be used and cleaned up later in LoadMesh
-    int skinVertexInfluenceCountTotal = skinVertexInfluenceCounts.getCount();
-    int totalVertexInfluencesCount = vertexWeightsCount * maxVertexInfluencesCount;
-    _vertexBlendWeights = new float[totalVertexInfluencesCount];
-    _vertexBlendIndices = new unsigned int[totalVertexInfluencesCount];
-
-    // Preset the default blend weights to 0.0f (no effect) and blend indices to 0 (uses the first which when multiplied
-    // will have no effect anyhow.
-    memset(_vertexBlendWeights, 0, totalVertexInfluencesCount * sizeof(float));
-    memset(_vertexBlendIndices , 0, totalVertexInfluencesCount * sizeof(unsigned int));
-    
-    int vOffset = 0;
-    int weightOffset = 0;
-
-    // Go through all the skin vertex influence weights from the indexed data.
-    for (int i = 0; i < skinVertexInfluenceCountTotal; ++i)
-    {
-        // Get the influence count and directly get the vertext blend weights and indices.
-        unsigned int vertexInfluenceCount = (unsigned int)skinVertexInfluenceCounts.get(i);
-        float vertexInfluencesTotalWeights = 0.0f;
-        std::vector<SkinnedVertexWeightPair> vertexInfluences;
-        //vertexInfluences.SetCapacity(vertexInfluenceCount);
-
-        // Get the index/weight pairs and some the weight totals while at it.
-        for (unsigned int j = 0; j < vertexInfluenceCount; ++j)
-        {
-            float weight = (float)jointWeights.get((unsigned int)skinVertexJointWeightPairIndices[vOffset + 1]);
-            int index = (int)skinVertexJointWeightPairIndices[vOffset];
-            
-            // Set invalid index corresponding weights to zero
-            if (index < 0 || index > (int)vertexWeightsCount)
-            {
-                weight = 0.0f;
-                index = 0;
-            }
-
-            SkinnedVertexWeightPair pair(weight, index);
-            vertexInfluences.push_back(pair);
-            vertexInfluencesTotalWeights += weight;
-
-            vOffset+=2;
-        }
-
-        // Get up the the maximum vertex weight influence count.
-         for (unsigned int j = 0; j < maxVertexInfluencesCount; ++j)
-        {
-            if (j < vertexInfluenceCount)
-            {
-                SkinnedVertexWeightPair pair = vertexInfluences[j];
-                _vertexBlendIndices[weightOffset] = pair.BlendIndex;
-                    
-                if (vertexInfluencesTotalWeights > 0.0f)
-                {
-                    _vertexBlendWeights[weightOffset] = pair.BlendWeight;
-                }
-                else
-                {
-                    if (j == 0)
-                    {
-                        _vertexBlendWeights[weightOffset] = 1.0f;
-                    }
-                    else
-                    {
-                        _vertexBlendWeights[weightOffset] = 0.0f;
-                    }
-                }
-            }
-
-            weightOffset++;
-        }
-    }
-
-    model->setSkin(skin);
-
-    ///////////////////////////////////////////////////////////
-    // get geometry
-    xsAnyURI geometryURI = skinElement->getSource();
-    domGeometry* geometry = daeSafeCast<domGeometry>(geometryURI.getElement());
-    if (geometry)
-    {
-        const domMesh* meshElement = geometry->getMesh();
-        if (meshElement)
-        {
-            Mesh* mesh = loadMesh(meshElement, geometry->getId());
-            if (mesh)
-            {
-                model->setMesh(mesh);
-            }
-        }
-    }
-    ///////////////////////////////////////////////////////////
-
-    return model;
-}
-
-Model* DAESceneEncoder::loadGeometry(const domGeometry* geometry, const domBind_materialRef bindMaterial)
-{
-    // Does this geometry have a valid mesh?
-    // Get the mesh for the geometry (if it has one)
-    const domMesh* meshElement = geometry->getMesh();
-    if (meshElement == NULL)
-    {
-        warning(std::string("No mesh found for geometry: ") + geometry->getId());
-        return NULL;
-    }
-
-    ///////////////////////////// GEOMETRY
-
-    // Load the mesh for this model
-    Mesh* mesh = loadMesh(meshElement, geometry->getId());
-    if (mesh == NULL)
-    {
-        return NULL;
-    }
-
-    // Mesh instance
-    Model* model = new Model();
-    model->setMesh(mesh);
-    return model;
-}
-
-Mesh* DAESceneEncoder::loadMesh(const domMesh* meshElement, const std::string& geometryId)
-{
-    const domTriangles_Array& trianglesArray = meshElement->getTriangles_array();
-    unsigned int trianglesArrayCount = (unsigned int)trianglesArray.getCount();
-
-    // Ensure the data is exported as triangles.
-    if (trianglesArrayCount == 0)
-    {
-        warning(std::string("Geometry mesh has no triangles: ") + geometryId);
-        return NULL;
-    }
-
-    // Check if this mesh already exists
-    Mesh* mesh = _gamePlayFile.getMesh(geometryId.c_str());
-    if (mesh)
-    {
-        return mesh;
-    }
-    mesh = new Mesh();
-    mesh->setId(geometryId.c_str());
-    
-    std::vector<DAEPolygonInput*> polygonInputs;
-
-    // Quickly just go through each triangles array and make sure they have the same number of inputs
-    // with the same layout.
-    // const domSource_Array& sourceArray = meshElement->getSource_array();
-    const domInputLocal_Array& vertexArray = meshElement->getVertices()->getInput_array();
-
-    unsigned int inputCount = (unsigned int)-1;
-
-    // Loop through our set of triangle lists (each list of triangles corresponds to a single MeshPart)
-    for (unsigned int i = 0; i < trianglesArrayCount; ++i)
-    {
-        const domTrianglesRef& triangles = trianglesArray.get(i);
-        const domInputLocalOffset_Array& inputArray = triangles->getInput_array();
-
-        // If not set then determine the number of input for all the triangles.
-        if (inputCount == -1)
-        {
-            inputCount = (unsigned int)inputArray.getCount();
-
-            int texCoordCount = 0;
-            for (unsigned int j = 0; j < inputCount; ++j)
-            {
-                const domInputLocalOffsetRef& input = inputArray.get(j);
-                std::string inputSemantic = input->getSemantic();
-
-                // If its a vertex first do an extra lookup for the inclusive inputs
-                if (equals(inputSemantic, "VERTEX"))
-                {
-                    unsigned int vertexArrayCount = (unsigned int)vertexArray.getCount();
-                    for (unsigned int k = 0; k < vertexArrayCount; ++k)
-                    {
-                        const domInputLocalRef& vertexInput = vertexArray.get(k);
-                        
-                        std::string semantic = std::string(vertexInput->getSemantic());
-                        int type = getVertexUsageType(semantic);
-                        if (type == -1)
-                        {
-                            warning(std::string("Vertex semantic (") + semantic + ") is invalid/unsupported for geometry mesh: " + geometryId);
-                        }
-
-                        DAEPolygonInput* polygonInput = new DAEPolygonInput();
-                        domURIFragmentType& sourceURI = vertexInput->getSource();
-                        sourceURI.resolveElement();
-                        domSource* source = (domSource*)(daeElement*)sourceURI.getElement();
-                        polygonInput->offset = 0;
-                        polygonInput->sourceValues = source->getFloat_array()->getValue();
-                        polygonInput->type = type;
-                        polygonInputs.push_back(polygonInput);
-                    }
-                }
-                else
-                {
-                    std::string semantic = input->getSemantic();
-                    int type = getVertexUsageType(semantic);
-                    if (type == -1)
-                    {
-                        warning(std::string("Semantic (") + semantic + ") is invalid/unsupported for geometry mesh: " + geometryId);
-                        break;
-                    }
-                    if (type == TEXCOORD0)
-                    {
-                        // Some meshes have multiple texture coordinates
-                        assert(texCoordCount <= 7);
-                        type += texCoordCount;
-                        ++texCoordCount;
-                    }
-
-                    DAEPolygonInput* polygonInput = new DAEPolygonInput();
-                    domURIFragmentType& sourceURI = input->getSource();
-                    sourceURI.resolveElement();
-                    domSource* source = (domSource*)(daeElement*)sourceURI.getElement();
-                    polygonInput->offset = (unsigned int)input->getOffset();
-                    polygonInput->sourceValues = source->getFloat_array()->getValue();
-                    polygonInput->type = type;
-
-                    // Get the accessor info
-                    const domSource::domTechnique_commonRef& technique = source->getTechnique_common();
-                    if (technique.cast())
-                    {
-                        const domAccessorRef& accessor = technique->getAccessor();
-                        polygonInput->accessor = accessor;
-                    }
-
-                    polygonInputs.push_back(polygonInput);
-                }
-            }
-        }
-        else
-        {
-            // If there is a triangle array with a different number of inputs, this is not supported.
-            if (inputCount != (unsigned int)inputArray.getCount())
-            {
-                for (size_t j = 0; j < polygonInputs.size(); ++j)
-                {
-                    delete polygonInputs[j];
-                }
-                warning(std::string("Triangles do not all have the same number of input sources for geometry mesh: ") + geometryId);
-                return NULL;
-            }
-            else
-            {
-                // TODO: Check if they are in the same order...
-            }
-        }
-    }
-    
-    // Now we have validated that all input in all triangles are the same and in the same input layout.
-    // Lets start to read them and build our subsets.
-    for (unsigned int i = 0; i < trianglesArrayCount; ++i)
-    {
-        // Subset to be built.
-        MeshPart* subset = new MeshPart();
-
-        // All of the information about the triangles and the sources to access the data from.
-        domTriangles* triangles = daeSafeCast<domTriangles>(trianglesArray.get(i));
-
-        // Parse the material for this subset
-        //string materialName = triangles->getMaterial() == NULL ? _T("") : triangles->getMaterial();
-        //if (materialName.size() > 0)
-        ///    subset->material = ParseMaterial(bindMaterial, materialName);
-
-        //const domInputLocalOffset_Array& inputArray = triangles->getInput_array();
-        const domListOfUInts& polyInts = triangles->getP()->getValue();
-        unsigned int polyIntsCount = (unsigned int)polyInts.getCount();
-        unsigned int poly = 0;
-        unsigned int inputSourceCount = (unsigned int)polygonInputs.size();
-        unsigned int maxOffset = 0;
-
-        // Go through the polygon indices for each input source retrieve the values
-        // and iterate by its offset.
-
-        Vertex vertex;
-        for (unsigned int k = 0; k < inputSourceCount && poly < polyIntsCount;)
-        {
-            const domListOfFloats& source = polygonInputs[k]->sourceValues;
-            unsigned int offset = polygonInputs[k]->offset;
-            if (offset > maxOffset)
-            {
-                maxOffset = offset;
-            }
-            unsigned int polyIndex = (unsigned int) polyInts.get(poly + offset);
-
-            switch (polygonInputs[k]->type)
-            {
-            case POSITION:
-                vertex = Vertex(); // TODO
-                if (_vertexBlendWeights && _vertexBlendIndices)
-                {
-                    vertex.hasWeights = true;
-
-                    vertex.blendWeights.x =  _vertexBlendWeights[polyIndex * 4];
-                    vertex.blendWeights.y =  _vertexBlendWeights[polyIndex * 4 + 1];
-                    vertex.blendWeights.z =  _vertexBlendWeights[polyIndex * 4 + 2];
-                    vertex.blendWeights.w =  _vertexBlendWeights[polyIndex * 4 + 3];
-
-                    vertex.blendIndices.x =  (float)_vertexBlendIndices[polyIndex * 4];
-                    vertex.blendIndices.y =  (float)_vertexBlendIndices[polyIndex * 4 + 1];
-                    vertex.blendIndices.z =  (float)_vertexBlendIndices[polyIndex * 4 + 2];
-                    vertex.blendIndices.w =  (float)_vertexBlendIndices[polyIndex * 4 + 3];
-                }
-
-                vertex.position.x = (float)source.get(polyIndex * 3);
-                vertex.position.y = (float)source.get(polyIndex * 3 + 1);
-                vertex.position.z = (float)source.get(polyIndex * 3 + 2);
-                break;
-        
-            case NORMAL:
-                vertex.hasNormal = true;
-                vertex.normal.x = (float)source.get(polyIndex * 3);
-                vertex.normal.y = (float)source.get(polyIndex * 3 + 1);
-                vertex.normal.z = (float)source.get(polyIndex * 3 + 2);
-                break;
-
-            // TODO: We must examine the Collada input accessor and read the stride/count to verify this - not ONLY for Color, but we should be doing this for ALL components (i.e. Position, Normal, etc).
-            case COLOR:
-            {
-                domAccessor* accessor = polygonInputs[k]->accessor;
-                if (accessor)
-                {
-                    vertex.hasDiffuse = true;
-                    vertex.diffuse.w = 1.0f;
-                    unsigned int stride = (unsigned int)polygonInputs[k]->accessor->getStride();
-                    unsigned int index = polyIndex * stride;
-
-                    const domParam_Array& paramArray = accessor->getParam_array();
-                    const size_t paramArrayCount = paramArray.getCount();
-
-                    for (size_t i = 0; i < paramArrayCount; ++i)
-                    {
-                        const domParamRef& param = paramArray.get(i);
-                        const char* name = param->getName();
-                        if (name)
-                        {
-                            switch (name[0])
-                            {
-                            case 'r':
-                            case 'R':
-                                vertex.diffuse.x = (float)source.get(index + i); // red
-                                break;
-                            case 'g':
-                            case 'G':
-                                vertex.diffuse.y = (float)source.get(index + i); // green
-                                break;
-                            case 'b':
-                            case 'B':
-                                vertex.diffuse.z = (float)source.get(index + i); // blue
-                                break;
-                            case 'a':
-                            case 'A':
-                                vertex.diffuse.w = (float)source.get(index + i); // alpha
-                                break;
-                            default:
-                                break;
-                            }
-                        }
-                    }
-                }
-                break;
-            }
-
-            case TANGENT:
-                vertex.hasTangent = true;
-                vertex.tangent.x = (float)source.get(polyIndex * 3);
-                vertex.tangent.y = (float)source.get(polyIndex * 3 + 1);
-                vertex.tangent.z = (float)source.get(polyIndex * 3 + 2);
-                break;
-
-            case BINORMAL:
-                vertex.hasBinormal = true;
-                vertex.binormal.x = (float)source.get(polyIndex * 3);
-                vertex.binormal.y = (float)source.get(polyIndex * 3 + 1);
-                vertex.binormal.z = (float)source.get(polyIndex * 3 + 2);
-                break;
-
-            case TEXCOORD0:
-                vertex.hasTexCoord = true;
-                if (polygonInputs[k]->accessor)
-                {
-                    // TODO: This assumes (s, t) are first
-                    unsigned int stride = (unsigned int)polygonInputs[k]->accessor->getStride();
-                    vertex.texCoord.x = (float)source.get(polyIndex * stride);
-                    vertex.texCoord.y = (float)source.get(polyIndex * stride + 1);
-                }
-                else
-                {
-                    vertex.texCoord.x = (float)source.get(polyIndex * 2);
-                    vertex.texCoord.y = (float)source.get(polyIndex * 2 + 1);
-                }
-                break;
-
-            case TEXCOORD1:
-                // TODO
-                break;
-
-            default:
-                break;
-            }
-
-            // On the last input source attempt to add the vertex or index an existing one.
-            if (k == (inputSourceCount - 1))
-            {
-                // Only add unique vertices, use a hashtable and compare the hash functions of the
-                // vertices. If they exist simply lookup the index of the existing ones.
-                // otherwise add and new one and index it.
-                unsigned int index;
-                if (mesh->contains(vertex))
-                {
-                    index = mesh->getVertexIndex(vertex);
-                }
-                else
-                {
-                    index = mesh->addVertex(vertex);
-                }
-                subset->addIndex(index);
-
-                poly += (maxOffset+1);
-                k = 0;
-            }
-            else
-            {
-                k++;
-            }
-        }
-        // Add our new subset for the mesh.
-        mesh->addMeshPart(subset);
-    }
-    
-    bool hasNormals = mesh->vertices[0].hasNormal;
-    bool hasDiffuses = mesh->vertices[0].hasDiffuse;
-    bool hasTangents = mesh->vertices[0].hasTangent;
-    bool hasBinormals = mesh->vertices[0].hasBinormal;
-    bool hasTexCoords = mesh->vertices[0].hasTexCoord;
-    bool hasWeights = mesh->vertices[0].hasWeights;
-
-    // The order that the vertex elements are add to the list matters.
-    // It should be the same order as how the Vertex data is written.
-
-    // Position
-    mesh->addVetexAttribute(POSITION, Vertex::POSITION_COUNT);
-    
-    // Normals
-    if (hasNormals)
-    {
-        mesh->addVetexAttribute(NORMAL, Vertex::NORMAL_COUNT);
-    }
-    // Tangents
-    if (hasTangents)
-    {
-        mesh->addVetexAttribute(TANGENT, Vertex::TANGENT_COUNT);
-    }
-    // Binormals
-    if (hasBinormals)
-    {
-        mesh->addVetexAttribute(BINORMAL, Vertex::BINORMAL_COUNT);
-    }
-    // Texture Coordinates
-    if (hasTexCoords)
-    {
-        mesh->addVetexAttribute(TEXCOORD0, Vertex::TEXCOORD_COUNT);
-    }
-    // Diffuse Color
-    if (hasDiffuses)
-    {
-        mesh->addVetexAttribute(COLOR, Vertex::DIFFUSE_COUNT);
-    }
-    // Skinning BlendWeights BlendIndices
-    if (hasWeights)
-    {
-        mesh->addVetexAttribute(BLENDWEIGHTS, Vertex::BLEND_WEIGHTS_COUNT);
-        mesh->addVetexAttribute(BLENDINDICES, Vertex::BLEND_INDICES_COUNT);
-    }
-
-    _gamePlayFile.addMesh(mesh);
-    return mesh;
-}
-
-void DAESceneEncoder::warning(const std::string& message)
-{
-    printf("Warning: %s\n", message.c_str());
-}
-
-void DAESceneEncoder::warning(const char* message)
-{
-    printf("Warning: %s\n", message);
-}
-
-int DAESceneEncoder::getVertexUsageType(const std::string& semantic)
-{
-    if (semantic.length() > 0)
-    {
-        switch (semantic[0])
-        {
-        case 'P':
-            if (equals(semantic, "POSITION"))
-            {
-                return POSITION;
-            }
-        case 'N':
-            if (equals(semantic, "NORMAL"))
-            {
-                return NORMAL;
-            }
-        case 'C':
-            if (equals(semantic, "COLOR"))
-            {
-                return COLOR;
-            }
-        case 'T':
-            if (equals(semantic, "TANGENT"))
-            {
-                return TANGENT;
-            }
-            else if (equals(semantic, "TEXCOORD"))
-            {
-                return TEXCOORD0;
-            }
-            else if (equals(semantic, "TEXTANGENT"))
-            {
-                // Treat TEXTANGENT as TANGENT
-                return TANGENT;
-            }
-            else if (equals(semantic, "TEXBINORMAL"))
-            {
-                // Treat TEXBINORMAL as BINORMAL
-                return BINORMAL;
-            }
-        case 'B':
-            if (equals(semantic, "BINORMAL"))
-            {
-                return BINORMAL;
-            }
-        default:
-            return -1;
-        }
-    }
-    return -1;
-}
-
-DAESceneEncoder::DAEPolygonInput::DAEPolygonInput(void) :
-    offset(0),
-    type(0),
-    accessor(NULL)
-{
-}
-
-DAESceneEncoder::DAEPolygonInput::~DAEPolygonInput(void)
-{
-}
-
-}

+ 0 - 210
gameplay-encoder/src/DAESceneEncoder.h

@@ -1,210 +0,0 @@
-#ifndef DAESCENEEENCODER_H_
-#define DAESCENEEENCODER_H_
-
-#include "StringUtil.h"
-#include "Object.h"
-#include "Node.h"
-#include "Camera.h"
-#include "Light.h"
-#include "Mesh.h"
-#include "MeshPart.h"
-#include "MeshSkin.h"
-#include "Model.h"
-#include "Scene.h"
-#include "Animation.h"
-#include "AnimationChannel.h"
-#include "Vertex.h"
-#include "Matrix.h"
-#include "Transform.h"
-#include "DAEChannelTarget.h"
-#include "GPBFile.h"
-#include "DAEUtil.h"
-#include "EncoderArguments.h"
-
-namespace gameplay
-{
-
-/**
- * Class for binary encoding a Collada (DAE) file.
- */
-class DAESceneEncoder
-{
-public:
-
-    static const unsigned int SCENE_SKIN_VERTEXINFLUENCES_MAX = 4;
-    
-    /**
-     * Constructor.
-     */
-    DAESceneEncoder();
-    
-    /**
-     * Destructor.
-     */
-    ~DAESceneEncoder();
-    
-    /**
-     * Writes out encoded Collada 1.4 file.
-     */
-    void write(const std::string& filepath, const EncoderArguments& arguments);
-
-private:
-
-    class DAEPolygonInput
-    {
-    public:
-        DAEPolygonInput(void);
-        /**
-         * Destructor.
-         */
-        virtual ~DAEPolygonInput(void);
-
-        unsigned int offset;
-        int type;
-        domListOfFloats sourceValues;
-        domAccessor* accessor;
-    };
-
-    class SkinnedVertexWeightPair
-    {
-    public:
-        float BlendWeight;
-        unsigned int BlendIndex;
-
-        SkinnedVertexWeightPair(float blendWeight, unsigned int blendIndex) : BlendWeight(blendWeight), BlendIndex(blendIndex)
-        {
-        }
-
-        bool operator < (const SkinnedVertexWeightPair& value) const
-        {
-            return value.BlendWeight < BlendWeight;
-        }
-    };
-
-    /**
-     * Optimizes the COLLADA dom based on the arguments passed to the encoder.
-     * 
-     * @param arguments The command line arguments passed to the encoder.
-     * @param dom The COLLADA dom.
-     */
-    void optimizeCOLLADA(const EncoderArguments& arguments, domCOLLADA* dom);
-    
-    void triangulate(DAE* dae);
-    
-    void createTrianglesFromPolygons(domMesh* domMesh, domPolygons* domPolygons);
-    void createTrianglesFromPolylist(domMesh* domMesh, domPolylist* domPolylist);
-
-    Node* loadNode(domNode* node, Node* parent);
-
-    void loadScene(const domVisual_scene* visualScene);
-    void loadCameraInstance(const domNode* n, Node* node);
-    void loadControllerInstance(const domNode* n, Node* node);
-    void loadLightInstance(const domNode* n, Node* node);
-    void loadGeometryInstance(const domNode* n, Node* node);
-
-    /**
-     * Loads all animations from the given COLLADA dom into the GamePlayFile.
-     */
-    void loadAnimations(const domCOLLADA* dom);
-
-    /**
-     * Loads a COLLADA animation element.
-     * 
-     * @param animationRef The animation dom element to load from.
-     */
-    void loadAnimation(const domAnimationRef animationRef);
-
-    Camera* loadCamera(const domCamera* cameraRef);
-    Light* loadLight(const domLight* lightRef);
-    Model* loadSkin(const domSkin* skinElement);
-    Model* loadGeometry(const domGeometry* geometry, const domBind_materialRef bindMaterial);
-
-    void loadSkeleton(domInstance_controller::domSkeleton* skeletonElement, MeshSkin* skin);
-    
-    /**
-     * Loads interpolation curve data from the given source into the animation.
-     * 
-     * @param source The source dom element to load interpolation curves from.
-     * @param animation The destination animation to copy to.
-     */
-    void loadInterpolation(const domSourceRef source, AnimationChannel* animation);
-
-    /**
-     * Returns the active camera node for the given scene.
-     * 
-     * @param visualScene The collada visual scene node.
-     * @param scene The gameplay scene node.
-     * 
-     * @return The active camera node or NULL if one was not found.
-     */
-    Node* findSceneActiveCameraNode(const domVisual_scene* visualScene, Scene* scene);
-
-    /**
-     * Loads and returns a mesh (geometry). If the mesh has already been loaded, it is simply returned.
-     */
-    Mesh* loadMesh(const domMesh* meshElement, const std::string& geometryId);
-
-    /**
-     * Sets the transform of node from the domNode transform.
-     */
-    void transformNode(domNode* domNode, Node* node);
-
-    /**
-     * Calculates the transform from a domNode. (<translate>, <rotate>, <scale>)
-     */
-    void calcTransform(domNode* domNode, Matrix& dstTransform);
-
-    void warning(const std::string& message);
-    void warning(const char* message);
-
-    /**
-     * Loads the target data into the animation from the given channel's target.
-     * Example: <channel target="Cube/location.X" />
-     * Target ID is "Cube"
-     * The target attribute is "location.X"
-     * 
-     * @param channelRef The channel dom element.
-     * @param animationChannel The animation to copy to.
-     * 
-     * @return True if the animation channel data was loaded without error; false if there was an error.
-     */
-    bool loadTarget(const domChannelRef& channelRef, AnimationChannel* animationChannel);
-
-    void begin();
-    void end(const char* str);
-
-    /**
-     * Copies float values from a domFloat_array to a std::vector<float>.
-     * 
-     * @param source Source of float values to copy from.
-     * @param target Destination float vector to copy to.
-     */
-    static void copyFloats(const domFloat_array* source, std::vector<float>* target);
-
-    /**
-     * Returns the VertexUsage value for the given semantic string.
-     * 
-     * @param semantic The semantic attribute string from the COLLADA <input> element.
-     * 
-     * @return The VertexUsage or -1 if the string was not recognized.
-     */
-    static int getVertexUsageType(const std::string& semantic);
-    
-private:
-    
-    DAE* _collada;        // Collada datastore in memory to read from.
-    domCOLLADA* _dom;
-    FILE* file;        // Output file to write to.
-    GPBFile _gamePlayFile;
-
-    std::map<std::string, int> _jointLookupTable;
-    std::vector<Matrix>_jointInverseBindPoseMatrices;
-    float* _vertexBlendWeights;
-    unsigned int* _vertexBlendIndices;
-
-    clock_t _begin;
-};
-
-}
-
-#endif

+ 0 - 358
gameplay-encoder/src/DAEUtil.cpp

@@ -1,358 +0,0 @@
-#include "Base.h"
-#include "DAEUtil.h"
-#include "StringUtil.h"
-
-namespace gameplay
-{
-
-/**
- * Returns the index of the skeleton in skeletonArray that points to the given node.
- * 
- * @param skeletonArray The array of skeletons to search.
- * @param node The target node.
- * 
- * @return The index in skeletonArray or -1 if not found.
- */
-int getIndex(const domInstance_controller::domSkeleton_Array& skeletonArray, const domNodeRef& node);
-
-void getAnimationChannels(const domNodeRef& node, std::list<domChannelRef>& channels)
-{
-    assert(node->getId());
-    std::string nodeIdSlash (node->getId());
-    nodeIdSlash.append("/");
-
-    domCOLLADA* root = (domCOLLADA*)node->getDocument()->getDomRoot();
-
-    domLibrary_animations_Array& animationLibrary = root->getLibrary_animations_array();
-    size_t animationLibraryCount = animationLibrary.getCount();
-    for (size_t i = 0; i < animationLibraryCount; ++i)
-    {
-        domLibrary_animationsRef& animationsRef = animationLibrary.get(i);
-        domAnimation_Array& animationArray = animationsRef->getAnimation_array();
-        size_t animationCount = animationArray.getCount();
-        for (size_t j = 0; j < animationCount; ++j)
-        {
-            domAnimationRef& animationRef = animationArray.get(j);
-            domChannel_Array& channelArray = animationRef->getChannel_array();
-            size_t channelArrayCount = channelArray.getCount();
-            for (size_t k = 0; k < channelArrayCount; ++k)
-            {
-                domChannelRef& channel = channelArray.get(k);
-                const char* target = channel->getTarget();
-
-                // TODO: Assumes only one target per channel?
-                if (startsWith(target, nodeIdSlash.c_str()))
-                {
-                    channels.push_back(channel);
-                }
-            }
-        }
-    }
-
-    // Recursively do the same for all nodes
-    daeTArray< daeSmartRef<daeElement> > children;
-    node->getChildren(children);
-    size_t childCount = children.getCount();
-    for (size_t i = 0; i < childCount; ++i)
-    {
-        daeElementRef childElement = children[i];
-        if (childElement->getElementType() == COLLADA_TYPE::NODE)
-        {
-            domNodeRef childNode = daeSafeCast<domNode>(childElement);
-            getAnimationChannels(childNode, channels);
-        }
-    }
-}
-
-void getJointNames(const domSourceRef source, std::vector<std::string>& list)
-{
-    // BLENDER used name_array
-    const domName_arrayRef& nameArray = source->getName_array();
-    if (nameArray.cast())
-    {
-        domListOfNames& ids = nameArray->getValue();
-        size_t jointCount = (size_t)nameArray->getCount();
-        for (size_t j = 0; j < jointCount; ++j)
-        {
-            list.push_back(std::string(ids.get(j)));
-        }
-    }
-    else
-    {
-        // Seymour used IDREF_array
-        const domIDREF_arrayRef& idArray = source->getIDREF_array();
-        if (idArray.cast())
-        {
-            xsIDREFS& ids = idArray->getValue();
-            size_t jointCount = (size_t)idArray->getCount();
-            for (size_t j = 0; j < jointCount; ++j)
-            {
-                list.push_back(std::string(ids.get(j).getID()));
-            }
-        }
-    }
-}
-
-void getJointNames(const domSkin* skin, std::vector<std::string>& list)
-{
-    const domSkin::domJointsRef& joints = skin->getJoints();
-    const domInputLocal_Array& inputArray = joints->getInput_array();
-    size_t inputCount = inputArray.getCount();
-    for (size_t i = 0; i < inputCount; ++i)
-    {
-        const domInputLocalRef input = inputArray.get(i);
-        const char* semantic = input->getSemantic();
-        if (strcmp(semantic, "JOINT") == 0)
-        {
-            daeElement* sourceElement = input->getSource().getElement();
-            if (sourceElement)
-            {
-                const domSourceRef source = daeSafeCast<domSource>(sourceElement);
-                getJointNames(source, list);
-            }
-        }
-    }
-}
-
-domSource* getInputSource(const domChannelRef& channel)
-{
-    daeElement* element = channel->getSource().getElement();
-    if (element && element->getElementType() == COLLADA_TYPE::SAMPLER)
-    {
-        domSampler* sampler = daeSafeCast<domSampler>(element);
-        const domInputLocal_Array& inputArray = sampler->getInput_array();
-        size_t inputArrayCount = inputArray.getCount();
-        for (size_t i = 0; i < inputArrayCount; ++i)
-        {
-            const domInputLocalRef& input = inputArray.get(i);
-            if (strcmp(input->getSemantic(), "INPUT") == 0)
-            {
-                daeElement* e = input->getSource().getElement();
-                if (e && e->getElementType() == COLLADA_TYPE::SOURCE)
-                {
-                    domSource* source = daeSafeCast<domSource>(e);
-                    assert(source);
-                    return source;
-                }
-            }
-        }
-    }
-    return NULL;
-}
-
-const domSamplerRef getSampler(const domChannelRef& channel)
-{
-    const domURIFragmentType& uri = channel->getSource();
-    daeElementRef element = uri.getElement();
-    if (element && element->getElementType() == COLLADA_TYPE::SAMPLER)
-    {
-        const domSamplerRef sampler = daeSafeCast<domSampler>(element);
-        return sampler;
-    }
-    // resolve the source manually by searching for the sampler in the animation that the channel is a child of.
-    const std::string& id = uri.id();
-    const daeElementRef& parent = channel->getParent();
-    if (parent && parent->getElementType() == COLLADA_TYPE::ANIMATION)
-    {
-        const domAnimationRef animation = daeSafeCast<domAnimation>(parent);
-        
-        const domSampler_Array& samplerArray = animation->getSampler_array();
-        size_t count = samplerArray.getCount();
-        for (size_t i = 0; i < count; ++i)
-        {
-            const domSamplerRef& sampler = samplerArray.get(i);
-            if (id.compare(sampler->getId()) == 0)
-            {
-                return sampler;
-            }
-        }
-    }
-    return NULL;
-}
-
-const domSourceRef getSource(const domInputLocalRef& inputLocal, const domAnimationRef& animation)
-{
-    const domURIFragmentType& uri = inputLocal->getSource();
-    daeElementRef element = uri.getElement();
-    if (element && element->getElementType() == COLLADA_TYPE::SAMPLER)
-    {
-        const domSourceRef source = daeSafeCast<domSource>(element);
-        return source;
-    }
-    // Resolve the URI by searching through the animation's list of sources
-    const std::string& id = uri.id();
-    const domSource_Array& sourceArray = animation->getSource_array();
-    size_t count = sourceArray.getCount();
-    for (size_t i = 0; i < count; ++i)
-    {
-        const domSourceRef source = sourceArray.get(i);
-        if (id.compare(source->getId()) == 0)
-        {
-            return source;
-        }
-    }
-    return NULL;
-}
-
-const domName_arrayRef getSourceNameArray(const domSourceRef& source)
-{
-    const domName_arrayRef& nameArray = source->getName_array();
-    if (nameArray)
-    {
-        return nameArray;
-    }
-    daeTArray<daeSmartRef<daeElement> > children;
-    source->getChildren(children);
-    size_t childCount = children.getCount();
-    for (size_t i = 0; i < childCount; ++i)
-    {
-        const daeElementRef element = children.get(i);
-        if (element->getElementType() == COLLADA_TYPE::NAME_ARRAY)
-        {
-            return daeSafeCast<domName_array>(element);
-        }
-    }
-    return NULL;
-}
-
-const domInstance_controller::domSkeletonRef getSkeleton(const domInstance_controllerRef& instanceController)
-{
-    domInstance_controller::domSkeleton_Array& skeletonArray = instanceController->getSkeleton_array();
-    size_t count = skeletonArray.getCount();
-    if (count == 0)
-    {
-        return NULL;
-    }
-    if (count == 1)
-    {
-        return skeletonArray.get(0);
-    }
-    // Maya sometimes outputs multiple skeleton elements.
-    // Find the skeleton element that points to the root most node.
-    const domInstance_controller::domSkeletonRef& currentSkeleton = skeletonArray.get(0);
-    const daeElementRef element = currentSkeleton->getValue().getElement();
-    if (element && element->getElementType() == COLLADA_TYPE::NODE)
-    {
-        domNode* node = daeSafeCast<domNode>(element);
-        int index = 0;
-        bool loop = true;
-        do
-        {
-            daeElementRef parent = node->getParent();
-            if (parent && parent->getElementType() == COLLADA_TYPE::NODE)
-            {
-                domNodeRef parentNode = daeSafeCast<domNode>(parent);
-                int result = getIndex(skeletonArray, parentNode);
-                if (result >= 0)
-                {
-                    index = result;
-                }
-                node = parentNode;
-            }
-            else
-            {
-                loop = false;
-            }
-        } while (loop);
-        if (index >= 0)
-        {
-            return skeletonArray.get(index);
-        }
-    }
-    return NULL;
-}
-
-bool equalKeyTimes(const domSource* s1, const domSource* s2)
-{
-    // TODO: shouldn't assume that the source has a float array.
-    const domFloat_arrayRef& f1 = s1->getFloat_array();
-    const domFloat_arrayRef& f2 = s2->getFloat_array();
-    if (f1->getCount() == f2->getCount())
-    {
-        const domListOfFloats& list1 = f1->getValue();
-        const domListOfFloats& list2 = f2->getValue();
-
-        size_t count = (size_t)f1->getCount();
-        for (size_t i = 0; i < count; ++i)
-        {
-            if (list1.get(i) != list2.get(i))
-            {
-                return false;
-            }
-        }
-        return true;
-    }
-    return false;
-}
-
-bool equalKeyTimes(const domChannelRef& c1, const domChannelRef& c2)
-{
-    domSource* s1 = getInputSource(c1);
-    domSource* s2 = getInputSource(c2);
-    assert(s1);
-    assert(s2);
-    return equalKeyTimes(s1, s2);
-}
-
-void moveChannelAndSouresToAnimation(domChannelRef& channel, domAnimationRef& animation)
-{
-    assert(channel);
-    assert(animation);
-
-    daeElement::removeFromParent(channel);
-    animation->add(channel); // move channel
-
-    daeElementRef element = channel->getSource().getElement();
-    if (element)
-    {
-        domSamplerRef sampler = daeSafeCast<domSampler>(element);
-
-        domInputLocal_Array& inputArray = sampler->getInput_array();
-        size_t inputArrayCount = inputArray.getCount();
-        for (size_t i = 0; i < inputArrayCount; ++i)
-        {
-            inputArray = sampler->getInput_array();
-            const domInputLocalRef& input = inputArray.get(i);
-            daeElementRef element = input->getSource().getElement();
-            if (element && element->getElementType() == COLLADA_TYPE::SOURCE)
-            {
-                domSourceRef source = daeSafeCast<domSource>(element);
-                assert(source);
-                daeElement::removeFromParent(source);
-                animation->add(source); // move source
-            }
-        }
-        daeElement::removeFromParent(sampler);
-        animation->add(sampler); // move sampler
-    }
-}
-
-bool isEmptyAnimation(domAnimationRef& animation)
-{
-    return animation->getAnimation_array().getCount() == 0 &&
-           animation->getChannel_array().getCount() == 0 &&
-           animation->getSampler_array().getCount() == 0 &&
-           animation->getSource_array().getCount() == 0;
-}
-
-int getIndex(const domInstance_controller::domSkeleton_Array& skeletonArray, const domNodeRef& node)
-{
-    const std::string nodeId = node->getId();
-    size_t count = skeletonArray.getCount();
-    for (size_t i = 0; i < count; ++i)
-    {
-        const domInstance_controller::domSkeletonRef& skeleton = skeletonArray.get(i);
-        daeElementRef element = skeleton->getValue().getElement();
-        if (element->getElementType() == COLLADA_TYPE::NODE)
-        {
-            domNodeRef targetNode = daeSafeCast<domNode>(element);
-            if (nodeId.compare(targetNode->getId()) == 0)
-            {
-                return i;
-            }
-        }
-    }
-    return -1;
-}
-
-}

+ 0 - 119
gameplay-encoder/src/DAEUtil.h

@@ -1,119 +0,0 @@
-#ifndef DAEUTIL_H_
-#define DAEUTIL_H_
-
-namespace gameplay
-{
-
-/**
- * Gets all of the animation channels that target the given node and appends them to the list.
- * 
- * @param node The node that the animation channels target.
- * @param channels The list of channels to append to.
- */
-void getAnimationChannels(const domNodeRef& node, std::list<domChannelRef>& channels);
-
-/**
- * Gets the joint names for the given source and appends them to the given list.
- * 
- * @param source The source element to search in.
- * @param list The list to append the joint names to.
- */
-void getJointNames(const domSourceRef source, std::vector<std::string>& list);
-
-/**
- * Gets the joint names for the given skin and appends them to the given list.
- * 
- * @param skin The skin element to search in.
- * @param list The list to append the joint names to.
- */
-void getJointNames(const domSkin* skin, std::vector<std::string>& list);
-
-/**
- * Gets the input source from the given channel.
- * 
- * @param channel The channel to search in.
- * 
- * @return The source element or NULL if not found.
- */
-domSource* getInputSource(const domChannelRef& channel);
-
-/**
- * Returns the sampler from the given channel.
- * 
- * @param channel The channel dom element.
- * 
- * @return The sampler or NULL if not found.
- */
-const domSamplerRef getSampler(const domChannelRef& channel);
-
-/**
- * Returns the source from the given sampler input.
- * Searchs within the given animation.
- * 
- * @param inputLocal The input element within a sampler.
- * @param animation The animation to search within.
- * 
- * @return The source or NULL if not found.
- */
-const domSourceRef getSource(const domInputLocalRef& inputLocal, const domAnimationRef& animation);
-
-/**
- * Returns the name array from the given source.
- * 
- * @param source The source element.
- * 
- * @return The name array or NULL if not found.
- */
-const domName_arrayRef getSourceNameArray(const domSourceRef& source);
-
-/**
- * Returns one skeleton from the given instance controller.
- * The COLLADA spec says that instance_controller can have multiple skeletons but we only need one.
- * Maya sometimes exports multiple skeleton nodes so this function will try to find the correct one.
- * 
- * @param instanceController The instance_controller element.
- * 
- * @return The skeleton or NULL if not found.
- */
-const domInstance_controller::domSkeletonRef getSkeleton(const domInstance_controllerRef& instanceController);
-
-/**
- * Returns true if the two given animation channels have equal key time input source.
- * 
- * @param c1 Channel one to compare.
- * @param c2 Channel two to compare.
- * 
- * @return True if the channels have the same key times, false otherwise.
- */
-bool equalKeyTimes(const domChannelRef& c1, const domChannelRef& c2);
-
-/**
- * Returns true if the two sources have the same key times.
- * 
- * @param s1 Source one.
- * @param s2 Source two.
- * 
- * @return True true if the key times are equal, false otherwise.
- */
-bool equalKeyTimes(const domSource* s1, const domSource* s2);
-
-/**
- * Moves a channel and the sources it uses to the destination animation.
- * 
- * @param channel The channel to move.
- * @param animation The destination animation to copy to.
- */
-void moveChannelAndSouresToAnimation(domChannelRef& channel, domAnimationRef& animation);
-
-/**
- * Returns true if the given animation is empty and contains no children.
- * 
- * @param animation The animation element to check.
- * 
- * @return True if the animation has no children, false otherwise.
- */
-bool isEmptyAnimation(domAnimationRef& animation);
-
-}
-
-#endif

+ 0 - 40
gameplay-encoder/src/Effect.cpp

@@ -1,40 +0,0 @@
-#include "Base.h"
-#include "Effect.h"
-
-namespace gameplay
-{
-
-Effect::Effect(void)
-{
-}
-
-Effect::~Effect(void)
-{
-}
-
-unsigned int Effect::getTypeId(void) const
-{
-    return EFFECT_ID;
-}
-
-const char* Effect::getElementName(void) const
-{
-    return "Effect";
-}
-
-void Effect::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_vertexShader, file);
-    write(_fragmentShader, file);
-}
-
-void Effect::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "vertexShader", _vertexShader);
-    fprintfElement(file, "fragmentShader", _fragmentShader);
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 39
gameplay-encoder/src/Effect.h

@@ -1,39 +0,0 @@
-#ifndef EFFECT_H_
-#define EFFECT_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class Effect : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Effect(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Effect(void);
-
-    virtual unsigned int getTypeId(void) const;
-
-    virtual const char* getElementName(void) const;
-
-    virtual void writeBinary(FILE* file);
-
-    virtual void writeText(FILE* file);
-
-private:
-    
-    std::string _vertexShader;
-    std::string _fragmentShader;
-};
-
-}
-
-#endif

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

@@ -1,365 +0,0 @@
-#include "Base.h"
-
-#include "EncoderArguments.h"
-#include "StringUtil.h"
-
-#ifdef WIN32
-    #define PATH_MAX    _MAX_PATH
-    #define realpath(A,B)    _fullpath(B,A,PATH_MAX)
-#endif
-
-namespace gameplay
-{
-
-static EncoderArguments* __instance;
-
-EncoderArguments::EncoderArguments(size_t argc, const char** argv) :
-    _fontSize(0),
-    _parseError(false),
-    _fontPreview(false),
-    _textOutput(false),
-    _daeOutput(false)
-{
-    __instance = this;
-
-    if (argc > 1)
-    {
-        size_t filePathIndex = argc - 1;
-        if (argv[filePathIndex])
-        {
-            _filePath.assign(getRealPath(argv[filePathIndex]));
-        }
-        
-        // read the options
-        std::vector<std::string> options;
-        for (size_t i = 1; i < filePathIndex; ++i)
-        {
-            options.push_back(argv[i]);
-        }
-        
-        for (size_t i = 0; i < options.size(); ++i)
-        {
-            if (options[i][0] == '-')
-            {
-                readOption(options, &i);
-            }
-        }
-    }
-    else
-    {
-        _parseError = true;
-    }
-}
-
-EncoderArguments::~EncoderArguments(void)
-{
-}
-
-EncoderArguments* EncoderArguments::getInstance()
-{
-    return __instance;
-}
-
-const std::string& EncoderArguments::getFilePath() const
-{
-    return _filePath;
-}
-
-const char* EncoderArguments::getFilePathPointer() const
-{
-    return _filePath.c_str();
-}
-
-std::string EncoderArguments::getOutputPath() const
-{
-    int pos = _filePath.find_last_of('/');
-    return (pos == -1 ? _filePath : _filePath.substr(0, pos));
-}
-
-const std::string& EncoderArguments::getDAEOutputPath() const
-{
-    return _daeOutputPath;
-}
-
-const std::vector<std::string>& EncoderArguments::getGroupAnimationNodeId() const
-{
-    return _groupAnimationNodeId;
-}
-
-const std::vector<std::string>& EncoderArguments::getGroupAnimationAnimationId() const
-{
-    return _groupAnimationAnimationId;
-}
-
-bool EncoderArguments::containsGroupNodeId(const std::string& nodeId) const
-{
-    return find(_groupAnimationNodeId.begin(), _groupAnimationNodeId.end(), nodeId) != _groupAnimationNodeId.end();
-}
-
-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)
-        {
-            return _groupAnimationAnimationId[i];
-        }
-    }
-    return "";
-}
-
-const std::vector<std::string>& EncoderArguments::getHeightmapNodeIds() const
-{
-    return _heightmapNodeIds;
-}
-
-bool EncoderArguments::parseErrorOccured() const
-{
-    return _parseError;
-}
-
-bool EncoderArguments::fileExists() const
-{
-    if (_filePath.length() > 0)
-    {
-        struct stat buf;
-        if (stat(_filePath.c_str(), &buf) != -1)
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
-void EncoderArguments::printUsage() const
-{
-    fprintf(stderr,"Usage: gameplay-encoder [options] <filepath>\n\n");
-    fprintf(stderr,"Supported file extensions:\n");
-    fprintf(stderr,"  .dae\t(COLLADA)\n");
-    fprintf(stderr,"  .fbx\t(FBX)\n");
-    fprintf(stderr,"  .ttf\t(TrueType Font)\n");
-    fprintf(stderr,"\n");
-    fprintf(stderr,"COLLADA and FBX file options:\n");
-    fprintf(stderr,"  -i <id>\t\tFilter by node ID.\n");
-    fprintf(stderr,"  -t\t\t\tWrite text/xml.\n");
-    fprintf(stderr,"  -groupAnimations <node id> <animation id>\n" \
-        "\t\t\tGroup all animation channels targetting the nodes into a new animation.\n");
-    fprintf(stderr,"  -heightmaps \"<node ids>\"\n" \
-        "\t\t\tList of nodes to generate heightmaps for.\n" \
-        "\t\t\tNode id list should be in quotes with a space between each id.\n" \
-        "\t\t\tHeightmaps will be saved in files named <nodeid>.png.\n");
-    fprintf(stderr,"\n");
-    fprintf(stderr,"COLLADA file options:\n");
-    fprintf(stderr,"  -dae <filepath>\tOutput optimized DAE.\n");
-    fprintf(stderr,"\n");
-    fprintf(stderr,"TTF file options:\n");
-    fprintf(stderr,"  -s <size of font>\tSize of the font.\n");
-    fprintf(stderr,"  -p\t\t\tOutput font preview.\n");
-    exit(8);
-}
-
-bool EncoderArguments::fontPreviewEnabled() const
-{
-    return _fontPreview;
-}
-
-bool EncoderArguments::textOutputEnabled() const
-{
-    return _textOutput;
-}
-
-bool EncoderArguments::DAEOutputEnabled() const
-{
-    return _daeOutput;
-}
-
-const char* EncoderArguments::getNodeId() const
-{
-    if (_nodeId.length() == 0)
-    {
-        return NULL;
-    }
-    return _nodeId.c_str();
-}
-
-unsigned int EncoderArguments::getFontSize() const
-{
-    return _fontSize;
-}
-
-EncoderArguments::FileFormat EncoderArguments::getFileFormat() const
-{
-    if (_filePath.length() < 5)
-    {
-        return FILEFORMAT_UNKNOWN;
-    }
-    // Extract the extension
-    std::string ext = "";
-    size_t pos = _filePath.find_last_of(".");
-    if (pos != std::string::npos)
-    {
-        ext = _filePath.substr(pos + 1);
-    }
-    
-    // Match every supported extension with its format constant
-    if (ext.compare("dae") == 0 || ext.compare("DAE") == 0)
-    {
-        return FILEFORMAT_DAE;
-    }
-    if (ext.compare("fbx") == 0 || ext.compare("FBX") == 0)
-    {
-        return FILEFORMAT_FBX;
-    }
-    if (ext.compare("ttf") == 0 || ext.compare("TTF") == 0)
-    {
-        return FILEFORMAT_TTF;
-    }
-    if (ext.compare("gpb") == 0 || ext.compare("GPB") == 0)
-    {
-        return FILEFORMAT_GPB;
-    }
-
-    return FILEFORMAT_UNKNOWN;
-}
-
-void EncoderArguments::readOption(const std::vector<std::string>& options, size_t* index)
-{
-    const std::string& str = options[*index];
-    if (str.length() == 0 && str[0] != '-')
-    {
-        return;
-    }
-    switch (str[1])
-    {
-    case 'd':
-        if (str.compare("-dae") == 0)
-        {
-            // read one string, make sure not to go out of bounds
-            if ((*index + 1) >= options.size())
-            {
-                fprintf(stderr, "Error: -dae requires 1 argument.\n");
-                _parseError = true;
-                return;
-            }
-            (*index)++;
-            _daeOutputPath = options[*index];
-            _daeOutput = true;
-        }
-        break;
-    case 'g':
-        if (str.compare("-groupAnimations") == 0)
-        {
-            // read two strings, make sure not to go out of bounds
-            if ((*index + 2) >= options.size())
-            {
-                fprintf(stderr, "Error: -groupAnimations requires 2 arguments.\n");
-                _parseError = true;
-                return;
-            }
-            (*index)++;
-            _groupAnimationNodeId.push_back(options[*index]);
-            (*index)++;
-            _groupAnimationAnimationId.push_back(options[*index]);
-        }
-        break;
-    case 'i':
-    case 'o':
-        // Node ID
-        (*index)++;
-        if (*index < options.size())
-        {
-            _nodeId.assign(options[*index]);
-        }
-        else
-        {
-            fprintf(stderr, "Error: missing arguemnt for -%c.\n", str[1]);
-            _parseError = true;
-            return;
-        }
-        break;
-    case 'h':
-        {
-            if (str.compare("-heightmaps") == 0)
-            {
-                (*index)++;
-                if (*index < options.size())
-                {
-                    // Split node id list into tokens
-                    unsigned int length = options[*index].size() + 1;
-                    char* nodeIds = new char[length];
-                    strcpy(nodeIds, options[*index].c_str());
-                    nodeIds[length-1] = 0;
-                    char* id = strtok(nodeIds, " ");
-                    while (id)
-                    {
-                        _heightmapNodeIds.push_back(id);
-                        id = strtok(NULL, " ");
-                    }
-                    delete[] nodeIds;
-                }
-                else
-                {
-                    fprintf(stderr, "Error: missing argument for -heightmaps.\n");
-                }
-            }
-        }
-        break;
-    case 'p':
-        _fontPreview = true;
-        break;
-    case 's':
-        // Font Size
-
-        // old format was -s##
-        if (str.length() > 2)
-        {
-            char n = str[2];
-            if (n > '0' && n <= '9')
-            {
-                const char* number = str.c_str() + 2;
-                _fontSize = atoi(number);
-                break;
-            }
-        }
-
-        (*index)++;
-        if (*index < options.size())
-        {
-            _fontSize = atoi(options[*index].c_str());
-        }
-        else
-        {
-            fprintf(stderr, "Error: missing arguemnt for -%c.\n", str[1]);
-            _parseError = true;
-            return;
-        }
-        break;
-    case 't':
-        _textOutput = true;
-        break;
-    default:
-        break;
-    }
-}
-
-std::string EncoderArguments::getRealPath(const std::string& filepath)
-{
-    char path[PATH_MAX + 1]; /* not sure about the "+ 1" */
-    realpath(filepath.c_str(), path);
-    replace_char(path, '\\', '/');
-    return std::string(path);
-}
-
-void EncoderArguments::replace_char(char* str, char oldChar, char newChar)
-{
-    for (; *str != '\0'; ++str)
-    {
-        if (*str == oldChar)
-        {
-            *str = newChar;
-        }
-    }
-}
-
-}

+ 0 - 134
gameplay-encoder/src/EncoderArguments.h

@@ -1,134 +0,0 @@
-#ifndef ENCODERARGUMENTS_H_
-#define ENCODERARGUMENTS_H_
-
-namespace gameplay
-{
-
-/**
- * EncoderArguments handles parsing the command line arguments for the GamePlay Encoder.
- */
-class EncoderArguments
-{
-public:
-
-    enum FileFormat
-    {
-        FILEFORMAT_UNKNOWN,
-        FILEFORMAT_DAE,
-        FILEFORMAT_FBX,
-        FILEFORMAT_TTF,
-        FILEFORMAT_GPB
-    };
-
-    /**
-     * Constructor.
-     */
-    EncoderArguments(size_t argc, const char** argv);
-
-    /**
-     * Destructor.
-     */
-    ~EncoderArguments(void);
-
-    /**
-     * Gets the EncoderArguments instance.
-     */
-    static EncoderArguments* getInstance();
-
-    /**
-     * Gets the file format from the file path based on the extension.
-     */
-    FileFormat getFileFormat() const;
-
-    /**
-     * Returns the file path.
-     */
-    const std::string& getFilePath() const;
-
-    /**
-     * Returns the char pointer to the file path string.
-     */
-    const char* getFilePathPointer() const;
-
-    /**
-     * Returns the path to where the DAE output should be written to.
-     */
-    const std::string& getDAEOutputPath() const;
-
-    /**
-     * Returns the output path/folder.
-     */
-    std::string getOutputPath() const;
-
-    const std::vector<std::string>& getGroupAnimationNodeId() const;
-    const std::vector<std::string>& getGroupAnimationAnimationId() const;
-
-    bool containsGroupNodeId(const std::string& nodeId) const;
-    const std::string getAnimationId(const std::string& nodeId) const;
-
-    const std::vector<std::string>& getHeightmapNodeIds() const;
-
-    /**
-     * Returns true if an error occured while parsing the command line arguments.
-     */
-    bool parseErrorOccured() const;
-
-    /**
-     * Tests if a file exists on the file system.
-     * 
-     * @return True if the file exists; false otherwise.
-     */
-    bool fileExists() const;
-
-    /**
-     * Prints the usage information.
-     */
-    void printUsage() const;
-
-    bool fontPreviewEnabled() const;
-    bool textOutputEnabled() const;
-    bool DAEOutputEnabled() const;
-
-    const char* getNodeId() const;
-    unsigned int getFontSize() const;
-
-private:
-
-    /**
-     * Reads the command line option from the list of options starting at the given index.
-     * 
-     * @param options The list of command line options.
-     * @param index Pointer to the index within the options list. The index will be changed
-     *              if an option takes multiple arguments.
-     */
-    void readOption(const std::vector<std::string>& options, size_t *index);
-
-    static std::string getRealPath(const std::string& filepath);
-
-    /**
-     * Replaces all instance of oldChar with newChar in str.
-     */
-    static void replace_char(char* str, char oldChar, char newChar);
-
-private:
-    
-    std::string _filePath;
-    std::string _nodeId;
-    std::string _daeOutputPath;
-
-    unsigned int _fontSize;
-
-    bool _parseError;
-    bool _fontPreview;
-    bool _textOutput;
-    bool _daeOutput;
-
-    std::vector<std::string> _groupAnimationNodeId;
-    std::vector<std::string> _groupAnimationAnimationId;
-    std::vector<std::string> _heightmapNodeIds;
-
-};
-
-}
-
-#endif

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

@@ -1,1437 +0,0 @@
-#ifdef USE_FBX
-
-#include <algorithm>
-#include <string>
-
-#include "FBXSceneEncoder.h"
-#include "EncoderArguments.h"
-
-using namespace gameplay;
-
-/**
- * Returns the aspect ratio from the given camera.
- * 
- * @param fbxCamera The FBX camera to get the aspect ratio from.
- * 
- * @return The aspect ratio from the camera.
- */
-static float getAspectRatio(KFbxCamera* fbxCamera);
-
-/**
- * Returns the field of view Y from the given camera.
- * 
- * @param fbxCamera The camera to get the fiew of view from.
- * 
- * @return The field of view Y.
- */
-static float getFieldOfView(KFbxCamera* fbxCamera);
-
-/**
- * Loads the texture coordinates from given mesh's polygon part into the vertex.
- * 
- * @param fbxMesh The mesh to get the polygon from.
- * @param polyIndex The index of the polygon.
- * @param posInPoly The position in the polygon.
- * @param vertex The vertex to copy the texture coordinates to.
- */
-static void loadTextureCoords(KFbxMesh* fbxMesh, int polyIndex, int posInPoly, Vertex* vertex);
-
-/**
- * Loads the normal from the mesh and adds it to the given vertex.
- * 
- * @param fbxMesh The mesh to get the polygon from.
- * @param vertexIndex The vertex index in the mesh.
- * @param vertex The vertex to copy to.
- */
-static void loadNormal(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex);
-
-/**
- * Loads the tangent from the mesh and adds it to the given vertex.
- * 
- * @param fbxMesh The mesh to load from.
- * @param vertexIndex The index of the vertex within fbxMesh.
- * @param vertex The vertex to copy to.
- */
-static void loadTangent(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex);
-
-/**
- * Loads the binormal from the mesh and adds it to the given vertex.
- * 
- * @param fbxMesh The mesh to load from.
- * @param vertexIndex The index of the vertex within fbxMesh.
- * @param vertex The vertex to copy to.
- */
-static void loadBinormal(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex);
-
-/**
- * Loads the vertex diffuse color from the mesh and adds it to the given vertex.
- * 
- * @param fbxMesh The mesh to load from.
- * @param vertexIndex The index of the vertex within fbxMesh.
- * @param vertex The vertex to copy to.
- */
-static void loadVertexColor(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex);
-
-/**
- * Loads the blend weight and blend indices data into the vertex.
- * 
- * @param vertexWeights List of vertex weights. The x member contains the blendIndices. The y member contains the blendWeights.
- * @param vertex The vertex to copy the blend data to.
- */
-static void loadBlendData(const std::vector<Vector2>& vertexWeights, Vertex* vertex);
-
-/**
- * Loads the blend weights and blend indices from the given mesh.
- * 
- * Each element of weights is a list of Vector2s where "x" is the blend index and "y" is the blend weight.
- * 
- * @param fbxMesh The mesh to load from.
- * @param weights List of blend weights and blend indices for each vertex.
- * 
- * @return True if this mesh has a mesh skin, false otherwise.
- */
-static bool loadBlendWeights(KFbxMesh* fbxMesh, std::vector<std::vector<Vector2> >& weights);
-
-/**
- * Copies from an FBX matrix to a float[16] array.
- */
-static void copyMatrix(const KFbxMatrix& fbxMatrix, float* matrix);
-
-/**
- * Copies from an FBX matrix to a gameplay matrix.
- */
-static void copyMatrix(const KFbxMatrix& fbxMatrix, Matrix& matrix);
-
-/**
- * Finds the min and max start time and stop time of the given animation curve.
- * 
- * startTime is updated if the animation curve contains a start time that is less than startTime.
- * stopTime is updated if the animation curve contains a stop time that is greater than stopTime.
- * frameRate is updated if the animation curve contains a frame rate that is greater than frameRate.
- * 
- * @param animCurve The animation curve to read from.
- * @param startTime The min start time. (in/out)
- * @param stopTime The max stop time. (in/out)
- * @param frameRate The frame rate. (in/out)
- */
-static void findMinMaxTime(KFbxAnimCurve* animCurve, float* startTime, float* stopTime, float* frameRate);
-
-/**
- * Appends a key frame of the given node's transform at the given time.
- * 
- * @param fbxNode The node to get the matrix transform from.
- * @param time The key time to add and the time to get the transform from.
- * @param keyTimes The list of key times to append to.
- * @param keyValues The list of key values to append to.
- */
-static void appendKeyFrame(KFbxNode* fbxNode, float time, std::vector<float>* keyTimes, std::vector<float>* keyValues);
-
-/**
- * Decomposes the given node's matrix transform at the given time and copies to scale, rotation and translation.
- * 
- * @param fbxNode The node to get the matrix transform from.
- * @param time The time to get the matrix transform from.
- * @param scale The scale to copy to.
- * @param rotation The rotation to copy to.
- * @param translation The translation to copy to.
- */
-static void decompose(KFbxNode* fbxNode, float time, Vector3* scale, Quaternion* rotation, Vector3* translation);
-
-/**
- * Creates an animation channel that targets the given node and target attribute using the given key times and key values.
- * 
- * @param fbxNode The node to target.
- * @param targetAttrib The attribute type to target.
- * @param keyTimes The key times for the animation channel.
- * @param keyValues The key values for the animation channel.
- * 
- * @return The newly created animation channel.
- */
-static AnimationChannel* createAnimationChannel(KFbxNode* fbxNode, unsigned int targetAttrib, const std::vector<float>& keyTimes, const std::vector<float>& keyValues);
-
-void addScaleChannel(Animation* animation, KFbxNode* fbxNode, float startTime, float stopTime);
-
-void addTranslateChannel(Animation* animation, KFbxNode* fbxNode, float startTime, float stopTime);
-
-
-////////////////////////////////////
-// Member Functions
-////////////////////////////////////
-
-FBXSceneEncoder::FBXSceneEncoder()
-    : _groupAnimation(NULL)
-{
-}
-
-FBXSceneEncoder::~FBXSceneEncoder()
-{
-}
-
-void FBXSceneEncoder::write(const std::string& filepath, const EncoderArguments& arguments)
-{
-    KFbxSdkManager* sdkManager = KFbxSdkManager::Create();
-    KFbxIOSettings *ios = KFbxIOSettings::Create(sdkManager, IOSROOT);
-    sdkManager->SetIOSettings(ios);
-    KFbxImporter* importer = KFbxImporter::Create(sdkManager,"");
-    
-    if (!importer->Initialize(filepath.c_str(), -1, sdkManager->GetIOSettings()))
-    {
-        printf("Call to KFbxImporter::Initialize() failed.\n");
-        printf("Error returned: %s\n\n", importer->GetLastErrorString());
-        exit(-1);
-    }
-    
-    KFbxScene* fbxScene = KFbxScene::Create(sdkManager,"__FBX_SCENE__");
-
-    print("Loading FBX file.");
-    importer->Import(fbxScene);
-    importer->Destroy();
-    print("Loading Scene.");
-    loadScene(fbxScene);
-    print("Loading animations.");
-    loadAnimations(fbxScene, arguments);
-    sdkManager->Destroy();
-
-    print("Optimizing GamePlay Binary.");
-    _gamePlayFile.adjust();
-    
-    std::string filenameOnly = getFilenameFromFilePath(filepath);
-    std::string dstFilename = filepath.substr(0, filepath.find_last_of('/'));
-    dstFilename.append(1, '/');
-    dstFilename.append(getFilenameNoExt(filenameOnly));
-    
-    if (arguments.textOutputEnabled())
-    {
-        std::string outFile = dstFilename + ".xml";
-        fprintf(stderr, "Saving debug file: %s\n", outFile.c_str());
-        _gamePlayFile.saveText(outFile);
-    }
-    else
-    {
-        std::string outFile = dstFilename + ".gpb";
-        fprintf(stderr, "Saving binary file: %s\n", outFile.c_str());
-        _gamePlayFile.saveBinary(outFile);
-    }
-}
-
-void FBXSceneEncoder::loadScene(KFbxScene* fbxScene)
-{
-    Scene* scene = new Scene();
-    scene->setId(fbxScene->GetName());
-    if (scene->getId().length() == 0)
-    {
-        scene->setId("__SCENE__");
-    }
-
-    // Load all of the nodes and their contents.
-    KFbxNode* rootNode = fbxScene->GetRootNode();
-    if (rootNode)
-    {
-        print("Triangulate.");
-        triangulateRecursive(rootNode);
-
-        print("Load nodes.");
-        // Don't include the FBX root node in the GPB.
-        const int childCount = rootNode->GetChildCount();
-        for (int i = 0; i < childCount; ++i)
-        {
-            Node* node = loadNode(rootNode->GetChild(i));
-            if (node)
-            {
-                scene->add(node);
-            }
-        }
-    }
-
-    // Load the MeshSkin information from the scene's poses.
-    loadBindShapes(fbxScene);
-
-    // Find the ambient light of the scene
-    KFbxColor ambientColor = fbxScene->GetGlobalSettings().GetAmbientColor();
-    scene->setAmbientColor((float)ambientColor.mRed, (float)ambientColor.mGreen, (float)ambientColor.mBlue);
-    
-    // Assign the first camera node (if there is one) in the scene as the active camera
-    // This ensures that if there's a camera in the scene that it is assigned as the 
-    // active camera.
-    // TODO: add logic to find the "active" camera node in the fbxScene
-    scene->setActiveCameraNode(scene->getFirstCameraNode());
-    
-    _gamePlayFile.addScene(scene);
-}
-
-void FBXSceneEncoder::loadAnimationChannels(KFbxAnimLayer* animLayer, KFbxNode* fbxNode, Animation* animation)
-{
-    const std::string* targetId = NULL;
-
-    const char* name = fbxNode->GetName();
-    Node* node = _gamePlayFile.getNode(name);
-    if (node)
-    {
-        targetId = &node->getId();
-    }
-    
-    // Determine which properties are animated on this node
-    // Find the transform at each key frame
-    // TODO: Ignore properties that are not animated (scale, rotation, translation)
-    // This should result in only one animation channel per animated node.
-
-    float startTime = FLT_MAX, stopTime = -1.0f, frameRate = -FLT_MAX;
-    bool tx = false, ty = false, tz = false, rx = false, ry = false, rz = false, sx = false, sy = false, sz = false;
-    KFbxAnimCurve* animCurve = NULL;
-    animCurve = fbxNode->LclTranslation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_T_X);
-    if (animCurve)
-    {
-        tx = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclTranslation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_T_Y);
-    if (animCurve)
-    {
-        ty = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclTranslation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_T_Z);
-    if (animCurve)
-    {
-        tz = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclRotation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_R_X);
-    if (animCurve)
-    {
-        rx = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclRotation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_R_Y);
-    if (animCurve)
-    {
-        ry = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclRotation.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_R_Z);
-    if (animCurve)
-    {
-        rz = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclScaling.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_S_X);
-    if (animCurve)
-    {
-        sx = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclScaling.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_S_Y);
-    if (animCurve)
-    {
-        sy = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-    animCurve = fbxNode->LclScaling.GetCurve<KFbxAnimCurve>(animLayer, KFCURVENODE_S_Z);
-    if (animCurve)
-    {
-        sz = true;
-        findMinMaxTime(animCurve, &startTime, &stopTime, &frameRate);
-    }
-
-    bool translate = tx | ty | tz;
-    bool scale = sx | sy | sz;
-    bool rotate = rx | ry | rz;
-
-    if (translate || rotate || scale)
-    {
-        assert(startTime != FLT_MAX);
-        assert(stopTime >= 0.0f);
-        AnimationChannel* channel = new AnimationChannel();
-        channel->setTargetId(name);
-        channel->setTargetAttribute(Transform::ANIMATE_SCALE_ROTATE_TRANSLATE);
-        
-        float increment = 1000.0f / frameRate;
-        std::vector<float> keyTimes;
-        std::vector<float> keyValues;
-        for (float time = startTime; time < stopTime; time += increment)
-        {
-            appendKeyFrame(fbxNode, time, &keyTimes, &keyValues);
-        }
-        // Add the last key frame at exactly stopTime
-        appendKeyFrame(fbxNode, stopTime, &keyTimes, &keyValues);
-
-        channel->setKeyTimes(keyTimes);
-        /*
-        std::vector<float> newKeyValues;
-        for (size_t i = 0, size = keyValues.size(); i < size; i += 10)
-        {
-            if (translate)
-            {
-                newKeyValues.push_back(keyValues[i+0]);
-                newKeyValues.push_back(keyValues[i+1]);
-                newKeyValues.push_back(keyValues[i+2]);
-            }
-            if (rotate)
-            {
-                newKeyValues.push_back(keyValues[i+3]);
-                newKeyValues.push_back(keyValues[i+4]);
-                newKeyValues.push_back(keyValues[i+5]);
-                newKeyValues.push_back(keyValues[i+6]);
-            }
-            if (scale)
-            {
-                newKeyValues.push_back(keyValues[i+7]);
-                newKeyValues.push_back(keyValues[i+8]);
-                newKeyValues.push_back(keyValues[i+9]);
-            }
-        }
-        channel->setKeyValues(newKeyValues);
-        */
-        channel->setKeyValues(keyValues);
-        channel->setInterpolation(AnimationChannel::LINEAR);
-        animation->add(channel);
-        /*
-        if (!translate)
-        {
-            addTranslateChannel(animation, fbxNode, startTime, stopTime);
-        }
-        if (!rotate)
-        {
-            printf("rotate?\n"); // TODO
-        }
-        if (!scale)
-        {
-            addScaleChannel(animation, fbxNode, startTime, stopTime);
-        }
-        */
-        if (_groupAnimation != animation)
-        {
-            // TODO explains
-            _gamePlayFile.addAnimation(animation);
-        }
-    }
-}
-
-void FBXSceneEncoder::loadAnimationLayer(KFbxAnimLayer* fbxAnimLayer, KFbxNode* fbxNode, const EncoderArguments& arguments)
-{
-    bool animationGroupId = false;
-    const char* name = fbxNode->GetName();
-    // Check if this node's animations are supposed to be grouped
-    if (name)
-    {
-        std::string str = name;
-        if (arguments.containsGroupNodeId(str))
-        {
-            animationGroupId = true;
-            _groupAnimation = new Animation();
-            _groupAnimation->setId(arguments.getAnimationId(str));
-        }
-    }
-    Animation* animation = _groupAnimation;
-    if (!_groupAnimation)
-    {
-        animation = new Animation();
-        animation->setId(name);
-    }
-    loadAnimationChannels(fbxAnimLayer, fbxNode, animation);
-
-    const int childCount = fbxNode->GetChildCount();
-    for (int modelCount = 0; modelCount < childCount; ++modelCount)
-    {
-        loadAnimationLayer(fbxAnimLayer, fbxNode->GetChild(modelCount), arguments);
-    }
-    if (animationGroupId)
-    {
-        _gamePlayFile.addAnimation(_groupAnimation);
-        _groupAnimation = NULL;
-    }
-}
-
-void FBXSceneEncoder::loadAnimations(KFbxScene* fbxScene, const EncoderArguments& arguments)
-{
-    KFbxAnimEvaluator* evaluator = fbxScene->GetEvaluator();
-    if (!evaluator)
-        return;
-    KFbxAnimStack* animStack = evaluator->GetContext();
-    if (!animStack)
-        return;
-
-    for (int i = 0; i < fbxScene->GetSrcObjectCount(FBX_TYPE(KFbxAnimStack)); ++i)
-    {
-        KFbxAnimStack* animStack = KFbxCast<KFbxAnimStack>(fbxScene->GetSrcObject(FBX_TYPE(KFbxAnimStack), i));
-        int nbAnimLayers = animStack->GetMemberCount(FBX_TYPE(KFbxAnimLayer));
-        for (int l = 0; l < nbAnimLayers; ++l)
-        {
-            KFbxAnimLayer* animLayer = animStack->GetMember(FBX_TYPE(KFbxAnimLayer), l);
-            loadAnimationLayer(animLayer, fbxScene->GetRootNode(), arguments);
-        }
-    }
-}
-
-Node* FBXSceneEncoder::loadNode(KFbxNode* fbxNode)
-{
-    Node* node = NULL;
-
-    // Check if this node has already been loaded
-    const char* id = fbxNode->GetName();
-    if (id && strlen(id) > 0)
-    {
-        node = _gamePlayFile.getNode(fbxNode->GetName());
-        if (node)
-        {
-            return node;
-        }
-    }
-    node = new Node();
-    if (id)
-    {
-        node->setId(id);
-    }
-    _gamePlayFile.addNode(node);
-
-    transformNode(fbxNode, node);
-    
-    loadCamera(fbxNode, node);
-    loadLight(fbxNode, node);
-    loadModel(fbxNode, node);
-
-    if (fbxNode->GetSkeleton())
-    {
-        // Indicate that this is a joint node for the purpose of debugging.
-        // The XML debug output will print that this node is a joint.
-        node->setIsJoint(true);
-    }
-
-    // Load child nodes
-    const int childCount = fbxNode->GetChildCount();
-    for (int i = 0; i < childCount; ++i)
-    {
-        Node* child = loadNode(fbxNode->GetChild(i));
-        if (child)
-        {
-            node->addChild(child);
-        }
-    }
-    return node;
-}
-
-Mesh* FBXSceneEncoder::getMesh(size_t meshId)
-{
-    // Check if this mesh was already loaded.
-    std::map<size_t, Mesh*>::iterator it = _meshes.find(meshId);
-    if (it != _meshes.end())
-    {
-        return it->second;
-    }
-    return NULL;
-}
-
-void FBXSceneEncoder::saveMesh(size_t meshId, Mesh* mesh)
-{
-    assert(mesh);
-    if (!getMesh(meshId))
-    {
-        _meshes[meshId] = mesh;
-    }
-}
-
-void FBXSceneEncoder::print(const char* str)
-{
-    fprintf(stderr,"%s\n", str);
-}
-
-void FBXSceneEncoder::transformNode(KFbxNode* fbxNode, Node* node)
-{
-    KFbxXMatrix matrix;
-    if (fbxNode->GetCamera() || fbxNode->GetLight())
-    {
-        // TODO: Why is this necessary for Camera and Light?
-        matrix.SetTRS(fbxNode->LclTranslation.Get(), fbxNode->LclRotation.Get(), fbxNode->LclScaling.Get());
-    }
-    else
-    {
-        matrix = fbxNode->EvaluateLocalTransform();
-    }
-
-    float m[16];
-    copyMatrix(matrix, m);
-    int i = 0;
-    for (int row = 0; row < 4; ++row)
-    {
-        for (int col = 0; col < 4; ++col)
-        {
-            m[i++] = (float)matrix.Get(row, col);
-        }
-    }
-    node->setTransformMatrix(m);
-}
-
-void FBXSceneEncoder::loadBindShapes(KFbxScene* fbxScene)
-{
-    float m[16];
-    const int poseCount = fbxScene->GetPoseCount();
-    for (int i = 0; i < poseCount; ++i)
-    {
-        KFbxPose* pose = fbxScene->GetPose(i);
-        assert(pose);
-        if (pose->IsBindPose() && pose->GetCount() > 0)
-        {
-            KFbxNode* fbxNode = pose->GetNode(0);
-            if (fbxNode->GetMesh() != NULL)
-            {
-                Node* node = _gamePlayFile.getNode(fbxNode->GetName());
-                assert(node && node->getModel());
-
-                Model* model = node->getModel();
-                if (model && model->getSkin())
-                {
-                    MeshSkin* skin = model->getSkin();
-                    copyMatrix(pose->GetMatrix(0), m);
-                    skin->setBindShape(m);
-                }
-            }
-        }
-    }
-}
-
-void FBXSceneEncoder::loadCamera(KFbxNode* fbxNode, Node* node)
-{
-    KFbxCamera* fbxCamera = fbxNode->GetCamera();
-    if (!fbxCamera)
-    {
-        return;
-    }
-    Camera* camera = new Camera();
-    const char* name = fbxNode->GetName();
-    if (name)
-    {
-        std::string id(name);
-        id.append("_Camera");
-        camera->setId(id);
-    }
-    camera->setAspectRatio(getAspectRatio(fbxCamera));
-    camera->setNearPlane((float)fbxCamera->NearPlane.Get());
-    camera->setFarPlane((float)fbxCamera->FarPlane.Get());
-
-    if (fbxCamera->ProjectionType.Get() == KFbxCamera::eORTHOGONAL)
-    {
-        camera->setOrthographic();
-        camera->setViewportWidth((float)fbxCamera->GetApertureWidth());
-        camera->setViewportWidth((float)fbxCamera->GetApertureHeight());
-        // xmag in FBX can be calculated from: OrthoZoom * 30.0 / 2.0
-        camera->setViewportWidth((float)fbxCamera->OrthoZoom.Get() * 15.0f);
-    }
-    else if (fbxCamera->ProjectionType.Get() == KFbxCamera::ePERSPECTIVE)
-    {
-        camera->setPerspective();
-        camera->setFieldOfView(getFieldOfView(fbxCamera));
-    }
-    else
-    {
-        warning("Unknown camera type in node");
-        return;
-    }
-    _gamePlayFile.addCamera(camera);
-    node->setCamera(camera);
-}
-
-void FBXSceneEncoder::loadLight(KFbxNode* fbxNode, Node* node)
-{
-    KFbxLight* fbxLight = fbxNode->GetLight();
-    if (!fbxLight)
-    {
-        return;
-    }
-    Light* light = new Light();
-    const char* name = fbxNode->GetName();
-    if (name)
-    {
-        std::string id(name);
-        id.append("_Light");
-        light->setId(id);
-    }
-
-    fbxDouble3 color = fbxLight->Color.Get();
-    light->setColor((float)color[0], (float)color[1], (float)color[2]);
-    
-    switch (fbxLight->LightType.Get())
-    {
-    case KFbxLight::ePOINT:
-    {
-        KFbxLight::EDecayType decayType = fbxLight->DecayType.Get();
-        switch (decayType)
-        {
-        case KFbxLight::eNONE:
-            // No decay. Can assume we have an ambient light, because ambient lights in the scene are 
-            // converted to point lights with no decay when exporting to FBX.
-            light->setAmbientLight();
-            break;
-        case KFbxLight::eLINEAR:
-            light->setPointLight();
-            light->setLinearAttenuation((float)fbxLight->DecayStart.Get());
-            break;
-        case KFbxLight::eQUADRATIC:
-            light->setPointLight();
-            light->setQuadraticAttenuation((float)fbxLight->DecayStart.Get());
-            break;
-        case KFbxLight::eCUBIC:
-        default:
-            // Not supported..
-            break;
-        }
-        break;
-    }
-    case KFbxLight::eDIRECTIONAL:
-    {
-        light->setDirectionalLight();
-        break;
-    }
-    case KFbxLight::eSPOT:
-    {
-        light->setSpotLight();
-
-        KFbxLight::EDecayType decayType = fbxLight->DecayType.Get();
-        switch (decayType)
-        {
-        case KFbxLight::eNONE:
-            // No decay.
-            break;
-        case KFbxLight::eLINEAR:
-            light->setLinearAttenuation((float)fbxLight->DecayStart.Get());
-            break;  
-        case KFbxLight::eQUADRATIC:
-            light->setQuadraticAttenuation((float)fbxLight->DecayStart.Get());
-            break;
-        case KFbxLight::eCUBIC:
-            // Not supported..
-            break;
-        }
-
-        light->setFalloffAngle(MATH_DEG_TO_RAD((float)fbxLight->ConeAngle.Get())); // fall off angle
-        break;
-    }
-    default:
-    {
-        warning("Unknown light type in node.");
-        return;
-    }
-    }
-
-    _gamePlayFile.addLight(light);
-    node->setLight(light);
-}
-
-void FBXSceneEncoder::loadModel(KFbxNode* fbxNode, Node* node)
-{
-    KFbxMesh* fbxMesh = fbxNode->GetMesh();
-    if (!fbxMesh)
-    {
-        return;
-    }
-    if (fbxMesh->IsTriangleMesh())
-    {
-        Mesh* mesh = loadMesh(fbxMesh);
-        Model* model = new Model();
-        model->setMesh(mesh);
-        node->setModel(model);
-        loadSkin(fbxMesh, model);
-        if (model->getSkin())
-        {
-            // TODO: explain
-            node->resetTransformMatrix();
-        }
-    }
-}
-
-void FBXSceneEncoder::loadSkin(KFbxMesh* fbxMesh, Model* model)
-{
-    const int deformerCount = fbxMesh->GetDeformerCount();
-    for (int i = 0; i < deformerCount; ++i)
-    {
-        KFbxDeformer* deformer = fbxMesh->GetDeformer(i);
-        if (deformer->GetDeformerType() == KFbxDeformer::eSKIN)
-        {
-            KFbxSkin* fbxSkin = static_cast<KFbxSkin*>(deformer);
-
-            MeshSkin* skin = new MeshSkin();
-
-            std::vector<std::string> jointNames;
-            std::vector<Node*> joints;
-            std::vector<Matrix> bindPoses;
-
-            const int clusterCount = fbxSkin->GetClusterCount();
-            for (int j = 0; j < clusterCount; ++j)
-            {
-                KFbxCluster* cluster = fbxSkin->GetCluster(j);
-                assert(cluster);
-                KFbxNode* linkedNode = cluster->GetLink();
-                assert(linkedNode);
-                if (linkedNode->GetSkeleton())
-                {
-                    const char* jointName = linkedNode->GetName();
-                    assert(jointName);
-                    jointNames.push_back(jointName);
-                    Node* joint = loadNode(linkedNode);
-                    assert(joint);
-                    joints.push_back(joint);
-
-                    KFbxXMatrix matrix;
-                    cluster->GetTransformLinkMatrix(matrix);
-                    Matrix m;
-                    copyMatrix(matrix.Inverse(), m);
-                    bindPoses.push_back(m);
-                }
-            }
-            skin->setJointNames(jointNames);
-            skin->setJoints(joints);
-            skin->setBindPoses(bindPoses);
-            model->setSkin(skin);
-            break;
-        }
-    }
-}
-
-Mesh* FBXSceneEncoder::loadMesh(KFbxMesh* fbxMesh)
-{
-    // Check if this mesh has already been loaded.
-    Mesh* mesh = getMesh(fbxMesh->GetUniqueID());
-    if (mesh)
-    {
-        return mesh;
-    }
-    mesh = new Mesh();
-    // GamePlay requires that a mesh have a unique ID but KFbxMesh doesn't have a string ID.
-    const char* name = fbxMesh->GetNode()->GetName();
-    if (name)
-    {
-        std::string id(name);
-        id.append("_Mesh");
-        mesh->setId(id);
-    }
-
-    // The number of mesh parts is equal to the number of materials that affect this mesh.
-    // There is always at least one mesh part.
-    std::vector<MeshPart*> meshParts;
-    const int materialCount = fbxMesh->GetNode()->GetMaterialCount();
-    int meshPartSize = (materialCount > 0) ? materialCount : 1;
-    for (int i = 0; i < meshPartSize; ++i)
-    {
-        meshParts.push_back(new MeshPart());
-    }
-
-    // Find the blend weights and blend indices if this mesh is skinned.
-    std::vector<std::vector<Vector2> > weights;
-    bool hasSkin = loadBlendWeights(fbxMesh, weights);
-    
-    int vertexIndex = 0;
-    KFbxVector4* controlPoints = fbxMesh->GetControlPoints();
-    const int polygonCount = fbxMesh->GetPolygonCount();
-    for (int polyIndex = 0; polyIndex < polygonCount; ++polyIndex)
-    {
-        const int polygonSize = fbxMesh->GetPolygonSize(polyIndex);
-        for (int posInPoly = 0; posInPoly < polygonSize; ++posInPoly)
-        {
-            int controlPointIndex = fbxMesh->GetPolygonVertex(polyIndex, posInPoly);
-            Vertex vertex;
-
-            KFbxVector4& position = controlPoints[controlPointIndex];
-            vertex.position.x = (float)position[0];
-            vertex.position.y = (float)position[1];
-            vertex.position.z = (float)position[2];
-
-            loadTextureCoords(fbxMesh, polyIndex, posInPoly, &vertex);
-            loadNormal(fbxMesh, vertexIndex, &vertex);
-            loadTangent(fbxMesh, vertexIndex, &vertex);
-            loadBinormal(fbxMesh, vertexIndex, &vertex);
-            loadVertexColor(fbxMesh, vertexIndex, &vertex);
-
-            if (hasSkin)
-            {
-                loadBlendData(weights[controlPointIndex], &vertex);
-            }
-
-            // Determine which mesh part this vertex index should be added to based on the material that affects it.
-            int meshPartIndex = 0;
-            const int elementMatrialCount = fbxMesh->GetElementMaterialCount();
-            for (int k = 0; k < elementMatrialCount; ++k)
-            {
-                KFbxGeometryElementMaterial* elementMaterial = fbxMesh->GetElementMaterial(k);
-                meshPartIndex = elementMaterial->GetIndexArray().GetAt(polyIndex);
-            }
-
-            // Add the vertex to the mesh if it hasn't already been added and find the vertex index.
-            unsigned int index;
-            if (mesh->contains(vertex))
-            {
-                index = mesh->getVertexIndex(vertex);
-            }
-            else
-            {
-                index = mesh->addVertex(vertex);
-            }
-            meshParts[meshPartIndex]->addIndex(index);
-            vertexIndex++;
-        }
-    }
-
-    const size_t meshpartsSize = meshParts.size();
-    for (size_t i = 0; i < meshpartsSize; ++i)
-    {
-        mesh->addMeshPart(meshParts[i]);
-    }
-
-    // The order that the vertex elements are add to the list matters.
-    // It should be the same order as how the Vertex data is written.
-
-    // Position
-    mesh->addVetexAttribute(POSITION, Vertex::POSITION_COUNT);
-
-    const Vertex& vertex = mesh->vertices[0];
-    // Normals
-    if (vertex.hasNormal)
-    {
-        mesh->addVetexAttribute(NORMAL, Vertex::NORMAL_COUNT);
-    }
-    // Tangents
-    if (vertex.hasTangent)
-    {
-        mesh->addVetexAttribute(TANGENT, Vertex::TANGENT_COUNT);
-    }
-    // Binormals
-    if (vertex.hasBinormal)
-    {
-        mesh->addVetexAttribute(BINORMAL, Vertex::BINORMAL_COUNT);
-    }
-    // Texture Coordinates
-    if (vertex.hasTexCoord)
-    {
-        mesh->addVetexAttribute(TEXCOORD0, Vertex::TEXCOORD_COUNT);
-    }
-    // Diffuse Color
-    if (vertex.hasDiffuse)
-    {
-        mesh->addVetexAttribute(COLOR, Vertex::DIFFUSE_COUNT);
-    }
-    // Skinning BlendWeights BlendIndices
-    if (vertex.hasWeights)
-    {
-        mesh->addVetexAttribute(BLENDWEIGHTS, Vertex::BLEND_WEIGHTS_COUNT);
-        mesh->addVetexAttribute(BLENDINDICES, Vertex::BLEND_INDICES_COUNT);
-    }
-
-    _gamePlayFile.addMesh(mesh);
-    saveMesh(fbxMesh->GetUniqueID(), mesh);
-    return mesh;
-}
-
-void FBXSceneEncoder::triangulateRecursive(KFbxNode* fbxNode)
-{
-    // Triangulate all NURBS, patch and mesh under this node recursively.
-    KFbxNodeAttribute* nodeAttribute = fbxNode->GetNodeAttribute();
-
-    if (nodeAttribute)
-    {
-        if (nodeAttribute->GetAttributeType() == KFbxNodeAttribute::eMESH ||
-            nodeAttribute->GetAttributeType() == KFbxNodeAttribute::eNURB ||
-            nodeAttribute->GetAttributeType() == KFbxNodeAttribute::eNURBS_SURFACE ||
-            nodeAttribute->GetAttributeType() == KFbxNodeAttribute::ePATCH)
-        {
-            KFbxGeometryConverter converter(fbxNode->GetFbxSdkManager());
-            converter.TriangulateInPlace(fbxNode);
-        }
-    }
-
-    const int childCount = fbxNode->GetChildCount();
-    for (int childIndex = 0; childIndex < childCount; ++childIndex)
-    {
-        triangulateRecursive(fbxNode->GetChild(childIndex));
-    }
-}
-
-void FBXSceneEncoder::warning(const std::string& message)
-{
-    printf("Warning: %s\n", message.c_str());
-}
-
-void FBXSceneEncoder::warning(const char* message)
-{
-    printf("Warning: %s\n", message);
-}
-
-////////////////////////////////////
-// Functions
-////////////////////////////////////
-
-float getAspectRatio(KFbxCamera* fbxCamera)
-{
-    return (float)fbxCamera->FilmAspectRatio.Get();
-    /*
-    KFbxCamera::ECameraAspectRatioMode camAspectRatioMode = fbxCamera->GetAspectRatioMode();
-    double aspectX = fbxCamera->AspectWidth.Get();
-    double aspectY = fbxCamera->AspectHeight.Get();
-    double aspectRatio = 1.333333;
-    switch ( camAspectRatioMode)
-    {
-    case KFbxCamera::eWINDOW_SIZE:
-        aspectRatio = aspectX / aspectY;
-        break;
-    case KFbxCamera::eFIXED_RATIO:
-        aspectRatio = aspectX;
-        break;
-    case KFbxCamera::eFIXED_RESOLUTION:
-        aspectRatio = aspectX / aspectY * fbxCamera->GetPixelRatio();
-        break;
-    case KFbxCamera::eFIXED_WIDTH:
-        aspectRatio = fbxCamera->GetPixelRatio() / aspectY;
-        break;
-    case KFbxCamera::eFIXED_HEIGHT:
-        aspectRatio = fbxCamera->GetPixelRatio() * aspectX;
-        break;
-    default:
-        break;
-    }
-    return (float)aspectRatio;
-    */
-}
-
-inline double vfov(double hfov, double aspect)
-{
-    static const double MATH_PI_180 = 0.01745329251994329576923690768489;
-    static const double MATH_180_PI = 57.295779513082320876798154814105;
-    return (2.0 * atan((aspect) * tan( (hfov * MATH_PI_180) * 0.5)) * MATH_180_PI);
-}
-
-float getFieldOfView(KFbxCamera* fbxCamera)
-{
-    double fieldOfViewX = 0.0;
-    double fieldOfViewY = 0.0;
-    double filmHeight = fbxCamera->GetApertureHeight();
-    double filmWidth = fbxCamera->GetApertureWidth() * fbxCamera->GetSqueezeRatio();
-    double apertureRatio = filmHeight / filmWidth;
-    if ( fbxCamera->GetApertureMode() == KFbxCamera::eVERTICAL)
-    {
-        fieldOfViewY = fbxCamera->FieldOfView.Get();
-    }
-    else if (fbxCamera->GetApertureMode() == KFbxCamera::eHORIZONTAL)
-    {
-        fieldOfViewX = fbxCamera->FieldOfView.Get();
-        fieldOfViewY = vfov( fieldOfViewX, apertureRatio);
-    }
-    else if (fbxCamera->GetApertureMode() == KFbxCamera::eFOCAL_LENGTH)
-    {
-        fieldOfViewX = fbxCamera->ComputeFieldOfView(fbxCamera->FocalLength.Get());
-        fieldOfViewY = vfov( fieldOfViewX, apertureRatio);
-    }
-    else if (fbxCamera->GetApertureMode() == KFbxCamera::eHORIZONTAL_AND_VERTICAL)
-    {
-        fieldOfViewY = fbxCamera->FieldOfViewY.Get();
-    }
-    else
-    {
-        fieldOfViewY = 45.0;
-    }
-    return (float)fieldOfViewY;
-}
-
-void loadTextureCoords(KFbxMesh* fbxMesh, int polyIndex, int posInPoly, Vertex* vertex)
-{
-    assert(fbxMesh && polyIndex >=0 && posInPoly >= 0);
-    if (fbxMesh->GetElementUVCount() > 0)
-    {
-        // Get only the first UV coordinates.
-        KFbxGeometryElementUV* uv = fbxMesh->GetElementUV(0);
-        switch (uv->GetMappingMode())
-        {
-        case KFbxGeometryElement::eBY_CONTROL_POINT:
-            switch (uv->GetReferenceMode())
-            {
-            case KFbxGeometryElement::eDIRECT:
-                vertex->hasTexCoord = true;
-                vertex->texCoord.x = (float)uv->GetDirectArray().GetAt(polyIndex)[0];
-                vertex->texCoord.y = (float)uv->GetDirectArray().GetAt(polyIndex)[1];
-                break;
-            case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                {
-                    int id = uv->GetIndexArray().GetAt(polyIndex);
-                    vertex->hasTexCoord = true;
-                    vertex->texCoord.x = (float)uv->GetDirectArray().GetAt(id)[0];
-                    vertex->texCoord.y = (float)uv->GetDirectArray().GetAt(id)[1];
-                }
-                break;
-            default:
-                break;
-            }
-            break;
-        case KFbxGeometryElement::eBY_POLYGON_VERTEX:
-            {
-                int lTextureUVIndex = fbxMesh->GetTextureUVIndex(polyIndex, posInPoly);
-                switch (uv->GetReferenceMode())
-                {
-                case KFbxGeometryElement::eDIRECT:
-                case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                    vertex->hasTexCoord = true;
-                    vertex->texCoord.x = (float)uv->GetDirectArray().GetAt(lTextureUVIndex)[0];
-                    vertex->texCoord.y = (float)uv->GetDirectArray().GetAt(lTextureUVIndex)[1];
-                    break;
-                default:
-                    break;
-                }
-            }
-            break;
-        default:
-            break;
-        }
-    }
-}
-
-void loadNormal(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex)
-{
-    if (fbxMesh->GetElementNormalCount() > 0)
-    {
-        // Get only the first
-        KFbxGeometryElementNormal* normal = fbxMesh->GetElementNormal(0);
-        if (normal->GetMappingMode() == KFbxGeometryElement::eBY_POLYGON_VERTEX)
-        {
-            switch (normal->GetReferenceMode())
-            {
-            case KFbxGeometryElement::eDIRECT:
-                {
-                    KFbxVector4 vec4 = normal->GetDirectArray().GetAt(vertexIndex);
-                    vertex->hasNormal = true;
-                    vertex->normal.x = (float)vec4[0];
-                    vertex->normal.y = (float)vec4[1];
-                    vertex->normal.z = (float)vec4[2];
-                }
-                break;
-            case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                {
-                    int id = normal->GetIndexArray().GetAt(vertexIndex);
-                    KFbxVector4 vec4 = normal->GetDirectArray().GetAt(id);
-                    vertex->hasNormal = true;
-                    vertex->normal.x = (float)vec4[0];
-                    vertex->normal.y = (float)vec4[1];
-                    vertex->normal.z = (float)vec4[2];
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void loadTangent(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex)
-{
-    if (fbxMesh->GetElementTangentCount() > 0)
-    {
-        // Get only the first tangent
-        KFbxGeometryElementTangent* tangent = fbxMesh->GetElementTangent(0);
-        if (tangent->GetMappingMode() == KFbxGeometryElement::eBY_POLYGON_VERTEX)
-        {
-            switch (tangent->GetReferenceMode())
-            {
-            case KFbxGeometryElement::eDIRECT:
-                {
-                    KFbxVector4 vec4 = tangent->GetDirectArray().GetAt(vertexIndex);
-                    vertex->hasTangent = true;
-                    vertex->tangent.x = (float)vec4[0];
-                    vertex->tangent.y = (float)vec4[1];
-                    vertex->tangent.z = (float)vec4[2];
-                }
-                break;
-            case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                {
-                    int id = tangent->GetIndexArray().GetAt(vertexIndex);
-                    KFbxVector4 vec4 = tangent->GetDirectArray().GetAt(id);
-                    vertex->hasTangent = true;
-                    vertex->tangent.x = (float)vec4[0];
-                    vertex->tangent.y = (float)vec4[1];
-                    vertex->tangent.z = (float)vec4[2];
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void loadBinormal(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex)
-{
-    if (fbxMesh->GetElementBinormalCount() > 0)
-    {
-        // Get only the first binormal.
-        KFbxGeometryElementBinormal* binormal = fbxMesh->GetElementBinormal(0);
-        if (binormal->GetMappingMode() == KFbxGeometryElement::eBY_POLYGON_VERTEX)
-        {
-            switch (binormal->GetReferenceMode())
-            {
-            case KFbxGeometryElement::eDIRECT:
-                {
-                    KFbxVector4 vec4 = binormal->GetDirectArray().GetAt(vertexIndex);
-                    vertex->hasBinormal = true;
-                    vertex->binormal.x = (float)vec4[0];
-                    vertex->binormal.y = (float)vec4[1];
-                    vertex->binormal.z = (float)vec4[2];
-                }
-                break;
-            case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                {
-                    int id = binormal->GetIndexArray().GetAt(vertexIndex);
-                    KFbxVector4 vec4 = binormal->GetDirectArray().GetAt(id);
-                    vertex->hasBinormal = true;
-                    vertex->binormal.x = (float)vec4[0];
-                    vertex->binormal.y = (float)vec4[1];
-                    vertex->binormal.z = (float)vec4[2];
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void loadVertexColor(KFbxMesh* fbxMesh, int vertexIndex, Vertex* vertex)
-{
-    if (fbxMesh->GetElementVertexColorCount() > 0)
-    {
-        // Get only the first vertex color.
-        KFbxGeometryElementVertexColor* vertexColor = fbxMesh->GetElementVertexColor(0);
-        if (vertexColor->GetMappingMode() == KFbxGeometryElement::eBY_POLYGON_VERTEX)
-        {
-            switch (vertexColor->GetReferenceMode())
-            {
-            case KFbxGeometryElement::eDIRECT:
-                {
-                    KFbxColor color = vertexColor->GetDirectArray().GetAt(vertexIndex);
-
-                    vertex->hasDiffuse = true;
-                    vertex->diffuse.x = (float)color.mRed;
-                    vertex->diffuse.y = (float)color.mGreen;
-                    vertex->diffuse.z = (float)color.mBlue;
-                    vertex->diffuse.w = (float)color.mAlpha;
-                }
-                break;
-            case KFbxGeometryElement::eINDEX_TO_DIRECT:
-                {
-                    int id = vertexColor->GetIndexArray().GetAt(vertexIndex);
-                    KFbxColor color = vertexColor->GetDirectArray().GetAt(id);
-
-                    vertex->hasDiffuse = true;
-                    vertex->diffuse.x = (float)color.mRed;
-                    vertex->diffuse.y = (float)color.mGreen;
-                    vertex->diffuse.z = (float)color.mBlue;
-                    vertex->diffuse.w = (float)color.mAlpha;
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void loadBlendData(const std::vector<Vector2>& vertexWeights, Vertex* vertex)
-{
-    size_t size = vertexWeights.size();
-
-    if (size >= 1)
-    {
-        vertex->hasWeights= true;
-        vertex->blendIndices.x = vertexWeights[0].x;
-        vertex->blendWeights.x = vertexWeights[0].y;
-    }
-    if (size >= 2)
-    {
-        vertex->blendIndices.y = vertexWeights[1].x;
-        vertex->blendWeights.y = vertexWeights[1].y;
-    }
-    if (size >= 3)
-    {
-        vertex->blendIndices.z = vertexWeights[2].x;
-        vertex->blendWeights.z = vertexWeights[2].y;
-    }
-    if (size >= 4)
-    {
-        vertex->blendIndices.w = vertexWeights[3].x;
-        vertex->blendWeights.w = vertexWeights[3].y;
-    }
-    //vertex->normalizeBlendWeight();
-}
-
-bool loadBlendWeights(KFbxMesh* fbxMesh, std::vector<std::vector<Vector2> >& weights)
-{
-    assert(fbxMesh);
-    const int vertexCount = fbxMesh->GetControlPointsCount();
-
-    KFbxSkin* fbxSkin = NULL;
-    const int deformerCount = fbxMesh->GetDeformerCount();
-    for (int i = 0; i < deformerCount; ++i)
-    {
-        KFbxDeformer* deformer = fbxMesh->GetDeformer(i);
-        if (deformer->GetDeformerType() == KFbxDeformer::eSKIN)
-        {
-            fbxSkin = static_cast<KFbxSkin*>(deformer);
-            weights.resize(vertexCount);
-
-            const int clusterCount = fbxSkin->GetClusterCount();
-            for (int j = 0; j < clusterCount; ++j)
-            {
-                KFbxCluster* cluster = fbxSkin->GetCluster(j);
-                assert(cluster);
-                KFbxNode* linkedNode = cluster->GetLink();
-                assert(linkedNode);
-
-                const int vertexIndexCount = cluster->GetControlPointIndicesCount();
-                for (int k = 0; k < vertexIndexCount; ++k)
-                {
-                    int index = cluster->GetControlPointIndices()[k];
-                    if (index >= vertexCount)
-                    {
-                        continue;
-                    }
-
-                    double weight = cluster->GetControlPointWeights()[k];
-                    if (weight == 0.0)
-                    {
-                        continue;
-                    }
-                    weights[index].push_back(Vector2((float)j, (float)weight));
-                }
-            }
-            // Only the first skin deformer will be loaded.
-            // There probably won't be more than one.
-            break;
-        }
-    }
-    return fbxSkin != NULL;
-}
-
-void findMinMaxTime(KFbxAnimCurve* animCurve, float* startTime, float* stopTime, float* frameRate)
-{
-    KTime start, stop;
-    animCurve->GetTimeInterval(start, stop);
-    *startTime = std::min(*startTime, (float)start.GetMilliSeconds());
-    *stopTime = std::max(*stopTime, (float)stop.GetMilliSeconds());
-    *frameRate = std::max(*frameRate, (float)stop.GetFrameRate(KTime::eDEFAULT_MODE));
-}
-
-void appendKeyFrame(KFbxNode* fbxNode, float time, std::vector<float>* keyTimes, std::vector<float>* keyValues)
-{
-    KFbxXMatrix fbxMatrix;
-    Matrix matrix;
-    KTime kTime;
-    kTime.SetMilliSeconds((kLongLong)time);
-    fbxMatrix = fbxNode->EvaluateLocalTransform(kTime);
-    copyMatrix(fbxMatrix, matrix);
-
-    Vector3 scale;
-    Quaternion rotation;
-    Vector3 translation;
-    matrix.decompose(&scale, &rotation, &translation);
-    rotation.normalize();
-
-    keyTimes->push_back(time);
-    keyValues->push_back(scale.x);
-    keyValues->push_back(scale.y);
-    keyValues->push_back(scale.z);
-    keyValues->push_back(rotation.x);
-    keyValues->push_back(rotation.y);
-    keyValues->push_back(rotation.z);
-    keyValues->push_back(rotation.w);
-    keyValues->push_back(translation.x);
-    keyValues->push_back(translation.y);
-    keyValues->push_back(translation.z);
-}
-
-void decompose(KFbxNode* fbxNode, float time, Vector3* scale, Quaternion* rotation, Vector3* translation)
-{
-    KFbxXMatrix fbxMatrix;
-    Matrix matrix;
-    KTime kTime;
-    kTime.SetMilliSeconds((kLongLong)time);
-    fbxMatrix = fbxNode->EvaluateLocalTransform(kTime);
-    copyMatrix(fbxMatrix, matrix);
-    matrix.decompose(scale, rotation, translation);
-}
-
-AnimationChannel* createAnimationChannel(KFbxNode* fbxNode, unsigned int targetAttrib, const std::vector<float>& keyTimes, const std::vector<float>& keyValues)
-{
-    AnimationChannel* channel = new AnimationChannel();
-    channel->setTargetId(fbxNode->GetName());
-    channel->setKeyTimes(keyTimes);
-    channel->setKeyValues(keyValues);
-    channel->setInterpolation(AnimationChannel::LINEAR);
-    channel->setTargetAttribute(targetAttrib);
-    return channel;
-}
-
-void addScaleChannel(Animation* animation, KFbxNode* fbxNode, float startTime, float stopTime)
-{
-    std::vector<float> keyTimes;
-    std::vector<float> keyValues;
-    Vector3 scale;
-    Quaternion rotation;
-    Vector3 translation;
-
-    decompose(fbxNode, startTime, &scale, &rotation, &translation);
-    keyTimes.push_back(startTime);
-    keyValues.push_back(scale.x);
-    keyValues.push_back(scale.y);
-    keyValues.push_back(scale.z);
-
-    decompose(fbxNode, stopTime, &scale, &rotation, &translation);
-    keyTimes.push_back(stopTime);
-    keyValues.push_back(scale.x);
-    keyValues.push_back(scale.y);
-    keyValues.push_back(scale.z);
-
-    AnimationChannel* channel = createAnimationChannel(fbxNode, Transform::ANIMATE_SCALE, keyTimes, keyValues);
-    animation->add(channel);
-}
-
-void addTranslateChannel(Animation* animation, KFbxNode* fbxNode, float startTime, float stopTime)
-{
-    std::vector<float> keyTimes;
-    std::vector<float> keyValues;
-    Vector3 scale;
-    Quaternion rotation;
-    Vector3 translation;
-
-    decompose(fbxNode, startTime, &scale, &rotation, &translation);
-    keyTimes.push_back(startTime);
-    keyValues.push_back(translation.x);
-    keyValues.push_back(translation.y);
-    keyValues.push_back(translation.z);
-
-    decompose(fbxNode, stopTime, &scale, &rotation, &translation);
-    keyTimes.push_back(stopTime);
-    keyValues.push_back(translation.x);
-    keyValues.push_back(translation.y);
-    keyValues.push_back(translation.z);
-
-    AnimationChannel* channel = createAnimationChannel(fbxNode, Transform::ANIMATE_TRANSLATE, keyTimes, keyValues);
-    animation->add(channel);
-}
-
-void copyMatrix(const KFbxMatrix& fbxMatrix, float* matrix)
-{
-    int i = 0;
-    for (int row = 0; row < 4; ++row)
-    {
-        for (int col = 0; col < 4; ++col)
-        {
-            matrix[i++] = (float)fbxMatrix.Get(row, col);
-        }
-    }
-}
-
-void copyMatrix(const KFbxMatrix& fbxMatrix, Matrix& matrix)
-{
-    int i = 0;
-    for (int row = 0; row < 4; ++row)
-    {
-        for (int col = 0; col < 4; ++col)
-        {
-            matrix.m[i++] = (float)fbxMatrix.Get(row, col);
-        }
-    }
-}
-
-#endif

+ 0 - 222
gameplay-encoder/src/FBXSceneEncoder.h

@@ -1,222 +0,0 @@
-#ifndef FBXSCENEEENCODER_H_
-#define FBXSCENEEENCODER_H_
-
-#ifdef USE_FBX
-
-#include <iostream>
-#include <list>
-#include <vector>
-#include <ctime>
-#ifdef WIN32
-    #pragma warning( disable : 4100 )
-    #pragma warning( disable : 4512 )
-#endif
-#include <fbxsdk.h>
-
-#include "Base.h"
-#include "StringUtil.h"
-#include "Object.h"
-#include "Node.h"
-#include "Camera.h"
-#include "Light.h"
-#include "Mesh.h"
-#include "MeshPart.h"
-#include "MeshSkin.h"
-#include "Model.h"
-#include "Scene.h"
-#include "Animation.h"
-#include "AnimationChannel.h"
-#include "Vertex.h"
-#include "Matrix.h"
-#include "Transform.h"
-#include "GPBFile.h"
-#include "EncoderArguments.h"
-
-using namespace gameplay;
-
-/**
- * Class for binary encoding an FBX file.
- */
-class FBXSceneEncoder
-{
-public:
-
-    static const unsigned int SCENE_SKIN_VERTEXINFLUENCES_MAX = 4;
-    
-    /**
-     * Constructor.
-     */
-    FBXSceneEncoder();
-
-    /**
-     * Destructor.
-     */
-    ~FBXSceneEncoder();
-    
-    /**
-     * Writes out encoded FBX file.
-     */
-    void write(const std::string& filepath, const EncoderArguments& arguments);
-
-private:
-
-    /**
-     * Loads the scene.
-     * 
-     * @param fbxScene The FBX scene to load.
-     */
-    void loadScene(KFbxScene* fbxScene);
-
-    /**
-     * Loads all of the animatiosn from the given FBX scene.
-     * 
-     * @param fbxScene The scene to load animations from.
-     * @param arguments The command line arguments passed to the encoder.
-     */
-    void loadAnimations(KFbxScene* fbxScene, const EncoderArguments& arguments);
-
-    /**
-     * Loads the animations from the given FBX animation layer recursively starting from fbxNode.
-     * 
-     * @param fbxAnimLayer The FBX animation layer to load from.
-     * @param fbxNode The node to start loading animations from.
-     * @param arguments The command line arguments passed to the encoder.
-     */
-    void loadAnimationLayer(KFbxAnimLayer* fbxAnimLayer, KFbxNode* fbxNode, const EncoderArguments& arguments);
-
-    /**
-     * Loads animation channels from the given node and adds the channels to the given animation.
-     * 
-     * @param pAnimLayer The FBX animation layer to load from.
-     * @param fbxNode The node to load animation channels from.
-     * @param animation The animation to add the channels to.
-     */
-    void loadAnimationChannels(KFbxAnimLayer* pAnimLayer, KFbxNode* fbxNode, Animation* animation);
-
-    /**
-     * Loads the bind shape for all mesh skins that have be loaded so far.
-     * 
-     * @param fbxScene The FBX scene to read the bind shapes from.
-     */
-    void loadBindShapes(KFbxScene* fbxScene);
-
-    /**
-     * Loads the camera from the given FBX node and adds to it to the given GamePlay node.
-     * 
-     * @param fbxNode The FBX node to load from.
-     * @param node The GamePlay node to add to.
-     */
-    void loadCamera(KFbxNode* fbxNode, Node* node);
-
-    /**
-     * Loads the light from the given FBX node and adds to it to the given GamePlay node.
-     * 
-     * @param fbxNode The FBX node to load from.
-     * @param node The GamePlay node to add to.
-     */
-    void loadLight(KFbxNode* fbxNode, Node* node);
-    
-    /**
-     * Loads the model from the given FBX node and adds to it to the given GamePlay node.
-     *
-     * @param fbxNode The FBX node to load from.
-     * @param node The GamePlay node to add to.
-     */
-    void loadModel(KFbxNode* fbxNode, Node* node);
-
-    /**
-     * Loads the mesh skin from the given FBX mesh and adds it to the given GamePlay model.
-     *
-     * @param fbxMesh The FBX mesh to load the skin from.
-     * @param model The model to add the skin to.
-     */
-    void loadSkin(KFbxMesh* fbxMesh, Model* model);
-    
-    /**
-     * Loads the FBX Node and creates a GamePlay Node.
-     * 
-     * @param fbxNode The FBX Node to load.
-     * 
-     * @return The newly created Node or NULL if the node could not be loaded.
-     */
-    Node* loadNode(KFbxNode* fbxNode);
-    
-    /**
-     * Loads the FbxMesh and returns a GamePlay mesh.
-     * If the fbxMesh has already been loaded then the same instance of mesh will be returned.
-     * 
-     * @param fbxMesh The FBX Mesh to load.
-     * 
-     * @return The GamePlay mesh that was loaded from the FBX Mesh.
-     */
-    Mesh* loadMesh(KFbxMesh* fbxMesh);
-
-    /**
-     * Gets the Mesh that was saved with the given ID. Returns NULL if a match is not found.
-     * 
-     * @param meshId The ID of the FbxMesh to search for.
-     * 
-     * @return The mesh that was saved with the ID or NULL if none was found.
-     */
-    Mesh* getMesh(size_t meshId);
-
-    /**
-     * Saves the Mesh with the given id.
-     * 
-     * @param meshId The ID of the FbxMesh to use as a key.
-     * @param mesh The mesh to save.
-     */
-    void saveMesh(size_t meshId, Mesh* mesh);
-    
-    /**
-     * Prints a message.
-     *
-     * @param str The string to print.
-     */
-    void print(const char* str);
-
-    /**
-     * Transforms the GamePlay Node using the transform data from the FBX Node.
-     * 
-     * @param fbxNode The FBX node to get the transfrom data from
-     * @param node The GamePlay Node to copy the transform to.
-     */
-    void transformNode(KFbxNode* fbxNode, Node* node);
-
-    /**
-     * Recursively triangules the meshes starting from the given node.
-     * 
-     * @param fbxNode The node to start triangulating from.
-     */
-    static void triangulateRecursive(KFbxNode* fbxNode);
-
-    /**
-     * Prints a warning message.
-     */
-    static void warning(const std::string& message);
-
-    /**
-     * Prints a warning message.
-     */
-    static void warning(const char* message);
-
-private:
-
-    /**
-     * The GamePlay file that is populated while reading the FBX file.
-     */
-    GPBFile _gamePlayFile;
-
-    /**
-     * The collection of meshes for the purpose of making sure that the same model is not loaded twice. (Mesh instancing)
-     */
-    std::map<size_t, Mesh*> _meshes;
-
-    /**
-     * The animation that channels should be added to it the user is using the -groupAnimation command line argument. May be NULL.
-     */
-    Animation* _groupAnimation;
-};
-
-#endif
-#endif

+ 0 - 187
gameplay-encoder/src/FileIO.cpp

@@ -1,187 +0,0 @@
-#include "Base.h"
-#include "FileIO.h"
-
-namespace gameplay
-{
-
-// Writing out a binary file //
-
-void write(unsigned char value, FILE* file)
-{
-    size_t r = fwrite(&value, sizeof(unsigned char), 1, file);
-    assert(r == 1);
-}
-
-void write(char value, FILE* file)
-{
-    size_t r = fwrite(&value, sizeof(char), 1, file);
-    assert(r == 1);
-}
-
-void write(const char* str, FILE* file)
-{
-    size_t length = strlen(str);
-    size_t r = fwrite(str, 1, length, file);
-    assert(r == length);
-}
-
-void write(unsigned int value, FILE* file)
-{
-    size_t r = fwrite(&value, sizeof(unsigned int), 1, file);
-    assert(r == 1);
-}
-
-void write(unsigned long value, FILE* file)
-{
-    size_t r = fwrite(&value, sizeof(unsigned long), 1, file);
-    assert(r == 1);
-}
-
-void write(unsigned short value, FILE* file)
-{
-    size_t r = fwrite(&value, sizeof(unsigned short), 1, file);
-    assert(r == 1);
-}
-
-void write(bool value, FILE* file)
-{
-    // write booleans as a unsigned char
-    unsigned char b = value;
-    write(b, file);
-}
-void write(float value, FILE* file)
-{
-    fwrite(&value, sizeof(float), 1, file);
-}
-void write(const float* values, int length, FILE* file)
-{
-    for (int i = 0; i < length; ++i)
-    {
-        write(values[i], file);
-    }
-}
-void write(const std::string& str, FILE* file)
-{
-    // Write the length of the string
-    write(str.size(), file);
-    
-    if (str.size() > 0)
-    {
-        // Write the array of characters of the string
-        write(str.c_str(), file);
-    }
-}
-
-void writeZero(FILE* file)
-{
-    write((unsigned int)0, file);
-}
-
-// Writing to a text file //
-
-void fprintfElement(FILE* file, const char* elementName, const float values[], int length)
-{
-    fprintf(file, "<%s count=\"%d\">", elementName, length);
-    for (int i = 0; i < length; ++i)
-    {
-        fprintf(file, "%f ", values[i]);
-    }
-    fprintf(file, "</%s>\n", elementName);
-}
-void fprintfElement(FILE* file, const char* elementName, const char* value)
-{
-    fprintf(file, "<%s>%s</%s>\n", elementName, value, elementName);
-}
-void fprintfElement(FILE* file, const char* elementName, const std::string& value)
-{
-    fprintf(file, "<%s>%s</%s>\n", elementName, value.c_str(), elementName);
-}
-void fprintfElement(FILE* file, const char* elementName, float value)
-{
-    fprintf(file, "<%s>%f</%s>\n", elementName, value, elementName);
-}
-void fprintfElement(FILE* file, const char* elementName, unsigned int value)
-{
-    fprintf(file, "<%s>%u</%s>\n", elementName, value, elementName);
-}
-void fprintfElement(FILE* file, const char* elementName, unsigned char value)
-{
-    fprintf(file, "<%s>%u</%s>\n", elementName, value, elementName);
-}
-
-void fprintfMatrix4f(FILE* file, const float* m)
-{
-    for (size_t i = 0; i < 16; i ++)
-    {
-        float v = m[i];
-        if (v == 1.0f)
-        {
-            fprintf(file, "1.0 ");
-        }
-        else if (v == 0.0)
-        {
-            fprintf(file, "0.0 ");
-        }
-        else
-        {
-            fprintf(file, "%f ",v);
-        }
-    }
-}
-void skipString(FILE* file)
-{
-    // get the size of the char array
-    unsigned int length = 0;
-    fread(&length, sizeof(unsigned int), 1, file);
-    // skip over the unsigned int length
-    fseek(file, sizeof(unsigned int), SEEK_CUR);
-    if (length > 0)
-    {
-        // Skip over the array of chars
-        long seek = (long)(length * sizeof(char));
-        fseek(file, seek, SEEK_CUR);
-    }
-}
-
-void skipUint(FILE* file)
-{
-    fseek(file, sizeof(unsigned int), SEEK_CUR);
-}
-
-void writeVectorBinary(const Vector2& v, FILE* file)
-{
-    write(v.x, file);
-    write(v.y, file);
-}
-
-void writeVectorText(const Vector2& v, FILE* file)
-{
-    fprintf(file, "%f %f\n", v.x, v.y);
-}
-
-void writeVectorBinary(const Vector3& v, FILE* file)
-{
-    write(v.x, file);
-    write(v.y, file);
-    write(v.z, file);
-}
-
-void writeVectorText(const Vector3& v, FILE* file)
-{
-    fprintf(file, "%f %f %f\n", v.x, v.y, v.z);
-}
-
-void writeVectorBinary(const Vector4& v, FILE* file)
-{
-    write(v.x, file);
-    write(v.y, file);
-    write(v.z, file);
-    write(v.w, file);
-}
-
-void writeVectorText(const Vector4& v, FILE* file)
-{
-    fprintf(file, "%f %f %f %f\n", v.x, v.y, v.z, v.w);
-}
-
-}

+ 0 - 141
gameplay-encoder/src/FileIO.h

@@ -1,141 +0,0 @@
-#ifndef FILEIO_H_
-#define FILEIO_H_
-
-#include <cstdio>
-#include <list>
-#include <vector>
-
-#include "Vector2.h"
-#include "Vector3.h"
-#include "Vector4.h"
-
-namespace gameplay
-{
-
-/**
- * Writes an XML element to the specified file stream.
- * 
- * @param file Pointer to a FILE object that identifies the stream.
- * @param elementName Name of the XML element to write.
- * @param value Value to write.
- */
-void fprintfElement(FILE* file, const char* elementName, float value);
-void fprintfElement(FILE* file, const char* elementName, unsigned int value);
-void fprintfElement(FILE* file, const char* elementName, unsigned char value);
-void fprintfElement(FILE* file, const char* elementName, const char* value);
-void fprintfElement(FILE* file, const char* elementName, const std::string& value);
-void fprintfElement(FILE* file, const char* elementName, const float values[], int length);
-
-template <class T>
-void fprintfElement(FILE* file, const char* format, const char* elementName, std::vector<T> list)
-{
-    fprintf(file, "<%s count=\"%lu\">", elementName, list.size());
-    typename std::vector<T>::const_iterator i;
-    for (i = list.begin(); i != list.end(); ++i)
-    {
-        fprintf(file, format, *i);
-    }
-    fprintf(file, "</%s>\n", elementName);
-}
-
-template <class T>
-void fprintfElement(FILE* file, const char* format, const char* elementName, std::list<T> list)
-{
-    fprintf(file, "<%s count=\"%lu\">", elementName, list.size());
-    typename std::list<T>::const_iterator i;
-    for (i = list.begin(); i != list.end(); ++i)
-    {
-        fprintf(file, format, *i);
-    }
-    fprintf(file, "</%s>\n", elementName);
-}
-
-void fprintfMatrix4f(FILE* file, const float* m);
-
-/**
- * Writes binary data to the given file stream.
- * 
- * @param value The value to be written
- * @param file The binary file stream.
- */
-void write(unsigned char value, FILE* file);
-void write(char value, FILE* file);
-void write(const char* str, FILE* file);
-void write(unsigned int value, FILE* file);
-void write(unsigned long value, FILE* file);
-void write(unsigned short value, FILE* file);
-void write(bool value, FILE* file);
-void write(float value, FILE* file);
-void write(const float* values, int length, FILE* file);
-
-/**
- * Writes the length of the string and the string bytes to the binary file stream.
- */
-void write(const std::string& str, FILE* file);
-
-void writeZero(FILE* file);
-
-/**
- * Writes the length of the list and writes each element value to the binary file stream.
- * 
- * @param list The list to write.
- * @param file The binary file stream.
- */
-template <class T>
-void write(std::list<T> list, FILE* file)
-{
-    // First write the size of the list
-    write(list.size(), file);
-    // Then write each element
-    typename std::list<T>::const_iterator i;
-    for (i = list.begin(); i != list.end(); ++i)
-    {
-        write(*i, file);
-    }
-}
-
-/**
- * Writes the length of the vector and writes each element value to the binary file stream.
- * 
- * @param vector The vector to write.
- * @param file The binary file stream.
- */
-template <class T>
-void write(std::vector<T> vector, FILE* file)
-{
-    // First write the size of the vector
-    write(vector.size(), file);
-    // Then write each element
-    typename std::vector<T>::const_iterator i;
-    for (i = vector.begin(); i != vector.end(); ++i)
-    {
-        write(*i, file);
-    }
-}
-
-/**
- * Skips over the string at the current file stream offset by moving the file position.
- * Assumes the current position points to the unsigned int length of the string.
- * The string is assumed to be a char array.
- * 
- * @param file The file stream.
- */
-void skipString(FILE* file);
-
-void skipUint(FILE* file);
-
-void writeVectorBinary(const Vector2& v, FILE* file);
-
-void writeVectorText(const Vector2& v, FILE* file);
-
-void writeVectorBinary(const Vector3& v, FILE* file);
-
-void writeVectorText(const Vector3& v, FILE* file);
-
-void writeVectorBinary(const Vector4& v, FILE* file);
-
-void writeVectorText(const Vector4& v, FILE* file);
-
-}
-
-#endif

+ 0 - 54
gameplay-encoder/src/Font.cpp

@@ -1,54 +0,0 @@
-#include "Base.h"
-#include "Font.h"
-
-namespace gameplay
-{
-
-Font::Font(void) :
-    style(0),
-    size(0),
-    texMapWidth(0),
-    texMapHeight(0)
-{
-}
-
-Font::~Font(void)
-{
-}
-
-unsigned int Font::getTypeId(void) const
-{
-    return FONT_ID;
-}
-const char* Font::getElementName(void) const
-{
-    return "Font";
-}
-
-void Font::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(family, file);
-    write(style, file);
-    write(size, file);
-    write(charset, file);
-    writeBinaryObjects(glyphs, file);
-    write(texMapWidth, file);
-    write(texMapHeight, file);
-    write(texMap, file);
-}
-void Font::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "family", family);
-    fprintfElement(file, "style", style);
-    fprintfElement(file, "size", size);
-    fprintfElement(file, "alphabet", charset);
-    //fprintfElement(file, "glyphs", glyphs);
-    fprintfElement(file, "texMapWidth", texMapWidth);
-    fprintfElement(file, "texMapHeight", texMapHeight);
-    //fprintfElement(file, "texMap", texMap);
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 49
gameplay-encoder/src/Font.h

@@ -1,49 +0,0 @@
-#ifndef FONT_H_
-#define FONT_H_
-
-#include "Object.h"
-#include "Glyph.h"
-
-namespace gameplay
-{
-
-class Font : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Font(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Font(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    std::string family;
-    unsigned int style;
-    unsigned int size;
-    std::string  charset;
-    std::list<Glyph*> glyphs;
-    unsigned int texMapWidth;
-    unsigned int texMapHeight;
-    std::list<unsigned char> texMap;
-
-    enum FontStyle
-    {
-        PLAIN = 0,
-        BOLD = 1,
-        ITALIC = 2,
-        BOLD_ITALIC = 4
-    };
-};
-
-}
-
-#endif

+ 0 - 117
gameplay-encoder/src/GPBDecoder.cpp

@@ -1,117 +0,0 @@
-#include "Base.h"
-#include "GPBDecoder.h"
-
-namespace gameplay
-{
-
-GPBDecoder::GPBDecoder(void) : _file(NULL), _outFile(NULL)
-{
-}
-
-
-GPBDecoder::~GPBDecoder(void)
-{
-}
-
-void GPBDecoder::readBinary(const std::string& filepath)
-{
-    // open files
-    _file = fopen(filepath.c_str(), "rb");
-    std::string outfilePath = filepath;
-    outfilePath += ".xml";
-    _outFile = fopen(outfilePath.c_str(), "w");
-
-    // read and write files
-    assert(validateHeading());
-
-    fprintf(_outFile, "<root>\n");
-    readRefs();
-    fprintf(_outFile, "</root>\n");
-
-
-    // close files
-    fclose(_outFile);
-    _outFile = NULL;
-
-    fclose(_file);
-    _file = NULL;
-}
-
-bool GPBDecoder::validateHeading()
-{
-    const size_t HEADING_SIZE = 9;
-    const char identifier[] = { '«', 'G', 'P', 'B', '»', '\r', '\n', '\x1A', '\n' };
-
-    char heading[HEADING_SIZE];
-    for (size_t i = 0; i < HEADING_SIZE; ++i)
-    {
-        if (heading[i] != identifier[i])
-        {
-            return false;
-        }
-    }
-    // read version
-    unsigned char version[2];
-    fread(version, sizeof(unsigned char), 2, _file);
-    // don't care about version
-
-    return true;
-}
-
-void GPBDecoder::readRefs()
-{
-    fprintf(_outFile, "<RefTable>\n");
-    // read number of refs
-    unsigned int refCount;
-    assert(read(&refCount));
-    for (size_t i = 0; i < refCount; ++i)
-    {
-        readRef();
-    }
-    fprintf(_outFile, "</RefTable>\n");
-}
-
-void GPBDecoder::readRef()
-{
-    std::string xref = readString(_file);
-    unsigned int type, offset;
-    assert(read(&type));
-    assert(read(&offset));
-    
-    fprintf(_outFile, "<Reference>\n");
-    fprintfElement(_outFile, "xref", xref);
-    fprintfElement(_outFile, "type", type);
-    fprintfElement(_outFile, "offset", offset);
-    fprintf(_outFile, "</Reference>\n");
-}
-
-bool GPBDecoder::read(unsigned int* ptr)
-{
-    return fread(ptr, sizeof(unsigned int), 1, _file) == 1;
-}
-
-std::string GPBDecoder::readString(FILE* fp)
-{
-    unsigned int length;
-    if (fread(&length, 4, 1, fp) != 1)
-    {
-        return std::string();
-    }
-
-    char* str = new char[length + 1];
-    if (length > 0)
-    {
-        if (fread(str, 1, length, fp) != length)
-        {
-            delete[] str;
-            return std::string();
-        }
-    }
-
-    str[length] = '\0';
-    std::string result(str);
-    delete[] str;
-    return result;
-}
-
-}

+ 0 - 42
gameplay-encoder/src/GPBDecoder.h

@@ -1,42 +0,0 @@
-#ifndef GPBDECODER_H_
-#define GPBDECODER_H_
-
-#include "FileIO.h"
-
-namespace gameplay
-{
-/**
- * This class is used for decoding a GPB file for the purpose of debugging.
- */
-class GPBDecoder
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    GPBDecoder(void);
-
-    /**
-     * Destructor.
-     */
-    ~GPBDecoder(void);
-
-    void readBinary(const std::string& filepath);
-    bool validateHeading();
-
-    void readRefs();
-    void readRef();
-
-    bool read(unsigned int* ptr);
-    std::string readString(FILE* fp);
-
-private:
-
-    FILE* _file;
-    FILE* _outFile;
-};
-
-}
-
-#endif

+ 0 - 406
gameplay-encoder/src/GPBFile.cpp

@@ -1,406 +0,0 @@
-#include "Base.h"
-#include "GPBFile.h"
-#include "Transform.h"
-
-#define EPSILON 1.2e-7f;
-
-namespace gameplay
-{
-
-static GPBFile* __instance = NULL;
-
-/**
- * Returns true if the given value is close to one.
- */
-static bool isAlmostOne(float value);
-
-GPBFile::GPBFile(void)
-    : _file(NULL), _animationsAdded(false)
-{
-    __instance = this;
-}
-
-GPBFile::~GPBFile(void)
-{
-}
-
-GPBFile* GPBFile::getInstance()
-{
-    return __instance;
-}
-
-void GPBFile::saveBinary(const std::string& filepath)
-{
-    _file = fopen(filepath.c_str(), "w+b");
-
-    // identifier
-    char identifier[] = { '«', 'G', 'P', 'B', '»', '\r', '\n', '\x1A', '\n' };
-    fwrite(identifier, 1, sizeof(identifier), _file);
-
-    // version
-    fwrite(GPB_VERSION, 1, sizeof(GPB_VERSION), _file);
-
-    // write refs
-    _refTable.writeBinary(_file);
-
-    // meshes
-    write(_geometry.size(), _file);
-    for (std::list<Mesh*>::const_iterator i = _geometry.begin(); i != _geometry.end(); ++i)
-    {
-        (*i)->writeBinary(_file);
-    }
-
-    // Objects
-    write(_objects.size(), _file);
-    for (std::list<Object*>::const_iterator i = _objects.begin(); i != _objects.end(); ++i)
-    {
-        (*i)->writeBinary(_file);
-    }
-
-    _refTable.updateOffsets(_file);
-    
-    fclose(_file);
-}
-
-void GPBFile::saveText(const std::string& filepath)
-{
-    _file = fopen(filepath.c_str(), "w");
-
-    fprintf(_file, "<root>\n");
-
-    // write refs
-    _refTable.writeText(_file);
-
-    // meshes
-    for (std::list<Mesh*>::const_iterator i = _geometry.begin(); i != _geometry.end(); ++i)
-    {
-        (*i)->writeText(_file);
-    }
-
-    // Objects
-    for (std::list<Object*>::const_iterator i = _objects.begin(); i != _objects.end(); ++i)
-    {
-        (*i)->writeText(_file);
-    }
-
-    fprintf(_file, "</root>");
-
-    fclose(_file);
-}
-
-void GPBFile::add(Object* obj)
-{
-    _objects.push_back(obj);
-}
-
-void GPBFile::addScene(Scene* scene)
-{
-    addToRefTable(scene);
-    _objects.push_back(scene);
-}
-
-void GPBFile::addCamera(Camera* camera)
-{
-    addToRefTable(camera);
-    _cameras.push_back(camera);
-}
-
-void GPBFile::addLight(Light* light)
-{
-    addToRefTable(light);
-    _lights.push_back(light);
-}
-
-void GPBFile::addMesh(Mesh* mesh)
-{
-    addToRefTable(mesh);
-    _geometry.push_back(mesh);
-}
-
-void GPBFile::addNode(Node* node)
-{
-    addToRefTable(node);
-    _nodes.push_back(node);
-}
-
-void GPBFile::addScenelessNode(Node* node)
-{
-    addToRefTable(node);
-    _nodes.push_back(node);
-    // Nodes are normally written to file as part of a scene. 
-    // Nodes that don't belong to a scene need to be written on their own (outside a scene).
-    // That is why node is added to the list of objects here.
-    _objects.push_back(node);
-}
-
-void GPBFile::addAnimation(Animation* animation)
-{
-    _animations.add(animation);
-
-    if (!_animationsAdded)
-    {
-        // The animations container should only be added once and only if the file has at least one animation.
-        _animationsAdded = true;
-        addToRefTable(&_animations);
-        add(&_animations);
-    }
-}
-
-void GPBFile::addToRefTable(Object* obj)
-{
-    if (obj)
-    {
-        const std::string& id = obj->getId();
-        if (id.length() > 0)
-        {
-            if (_refTable.get(id) == NULL)
-            {
-                _refTable.add(id, obj);
-            }
-        }
-    }
-}
-
-Object* GPBFile::getFromRefTable(const std::string& id)
-{
-    return _refTable.get(id);
-}
-
-bool GPBFile::idExists(const std::string& id)
-{
-    return _refTable.get(id) != NULL;
-}
-
-Camera* GPBFile::getCamera(const char* id)
-{
-    if (!id)
-        return NULL;
-    // TODO: O(n) search is not ideal
-    for (std::list<Camera*>::const_iterator i = _cameras.begin(); i != _cameras.end(); ++i)
-    {
-        const std::string& _id = (*i)->getId();
-        if (_id.length() > 0 && strncmp(id, _id.c_str(), 255) == 0)
-        {
-            return *i;
-        }
-    }
-    return NULL;
-}
-
-Light* GPBFile::getLight(const char* id)
-{
-    if (!id)
-        return NULL;
-    // TODO: O(n) search is not ideal
-    for (std::list<Light*>::const_iterator i = _lights.begin(); i != _lights.end(); ++i)
-    {
-        const std::string& _id = (*i)->getId();
-        if (_id.length() > 0 && strncmp(id, _id.c_str(), 255) == 0)
-        {
-            return *i;
-        }
-    }
-    return NULL;
-}
-
-Mesh* GPBFile::getMesh(const char* id)
-{
-    if (!id)
-        return NULL;
-    // TODO: O(n) search is not ideal
-    for (std::list<Mesh*>::const_iterator i = _geometry.begin(); i != _geometry.end(); ++i)
-    {
-        const std::string& _id = (*i)->getId();
-        if (_id.length() > 0 && strncmp(id, _id.c_str(), 255) == 0)
-        {
-            return *i;
-        }
-    }
-    return NULL;
-}
-
-Node* GPBFile::getNode(const char* id)
-{
-    if (!id)
-        return NULL;
-    // TODO: O(n) search is not ideal
-    for (std::list<Node*>::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i)
-    {
-        const std::string& _id = (*i)->getId();
-        if (_id.length() > 0 && strncmp(id, _id.c_str(), 255) == 0)
-        {
-            return *i;
-        }
-    }
-    return NULL;
-}
-
-Animations* GPBFile::getAnimations()
-{
-    return &_animations;
-}
-
-void GPBFile::adjust()
-{
-    // calculate the ambient color for each scene
-    for (std::list<Object*>::iterator i = _objects.begin(); i != _objects.end(); ++i)
-    {
-        Object* obj = *i;
-        if (obj->getTypeId() == Object::SCENE_ID)
-        {
-            Scene* scene = dynamic_cast<Scene*>(obj);
-            scene->calcAmbientColor();
-        }
-    }
-
-    for (std::list<Node*>::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i)
-    {
-        computeBounds(*i);
-    }
-
-    // try to convert joint transform animations into rotation animations
-    //optimizeTransformAnimations();
-
-    // TODO:
-    // remove ambient _lights
-    // for each node
-    //   if node has ambient light
-    //     if node has no camera, mesh or children but 1 ambient light
-    //       delete node and remove from ref table
-    //     delete light and remove from ref table
-    //
-    // merge animations if possible
-    //   Search for animations that have the same target and key times and see if they can be merged.
-    //   Blender will output a simple translation animation to 3 separate animations with the same key times but targetting X, Y and Z.
-    //   This can be merged into one animation. Same for scale animations.
-}
-
-void GPBFile::computeBounds(Node* node)
-{
-    assert(node);
-    if (Model* model = node->getModel())
-    {
-        if (Mesh* mesh = model->getMesh())
-        {
-            mesh->computeBounds();
-        }
-        if (MeshSkin* skin = model->getSkin())
-        {
-            skin->computeBounds();
-        }
-    }
-    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
-    {
-        computeBounds(child);
-    }
-}
-
-void GPBFile::optimizeTransformAnimations()
-{
-    const unsigned int animationCount = _animations.getAnimationCount();
-    for (unsigned int animationIndex = 0; animationIndex < animationCount; ++animationIndex)
-    {
-        Animation* animation = _animations.getAnimation(animationIndex);
-        assert(animation);
-        const int channelCount = animation->getAnimationChannelCount();
-        // loop backwards because we will be adding and removing channels
-        for (int channelIndex = channelCount -1; channelIndex >= 0 ; --channelIndex)
-        {
-            AnimationChannel* channel = animation->getAnimationChannel(channelIndex);
-            assert(channel);
-            // get target node
-            const Object* obj = _refTable.get(channel->getTargetId());
-            if (obj && obj->getTypeId() == Object::NODE_ID)
-            {
-                const Node* node = static_cast<const Node*>(obj);
-                if (node->isJoint() && channel->getTargetAttribute() == Transform::ANIMATE_SCALE_ROTATE_TRANSLATE)
-                {
-                    decomposeTransformAnimationChannel(animation, channel);
-
-                    animation->remove(channel);
-                    SAFE_DELETE(channel);
-                }
-            }
-        }
-    }
-}
-
-
-void GPBFile::decomposeTransformAnimationChannel(Animation* animation, const AnimationChannel* channel)
-{
-    const std::vector<float>& keyTimes = channel->getKeyTimes();
-    const std::vector<float>& keyValues = channel->getKeyValues();
-    const size_t keyTimesSize = keyTimes.size();
-    const size_t keyValuesSize = keyValues.size();
-
-    std::vector<float> scaleKeyValues;
-    std::vector<float> rotateKeyValues;
-    std::vector<float> translateKeyValues;
-                    
-    scaleKeyValues.reserve(keyTimesSize * 3);
-    rotateKeyValues.reserve(keyTimesSize * 4);
-    translateKeyValues.reserve(keyTimesSize * 3);
-
-    for (size_t kv = 0; kv < keyValuesSize; kv += 10)
-    {
-        scaleKeyValues.push_back(keyValues[kv]);
-        scaleKeyValues.push_back(keyValues[kv+1]);
-        scaleKeyValues.push_back(keyValues[kv+2]);
-
-        rotateKeyValues.push_back(keyValues[kv+3]);
-        rotateKeyValues.push_back(keyValues[kv+4]);
-        rotateKeyValues.push_back(keyValues[kv+5]);
-        rotateKeyValues.push_back(keyValues[kv+6]);
-
-        translateKeyValues.push_back(keyValues[kv+7]);
-        translateKeyValues.push_back(keyValues[kv+8]);
-        translateKeyValues.push_back(keyValues[kv+9]);
-    }
-
-    // replace transform animation channel with translate, rotate and scale animation channels
-
-    // Don't add the scale channel if all the key values are close to 1.0
-    size_t oneCount = (size_t)std::count_if(scaleKeyValues.begin(), scaleKeyValues.end(), isAlmostOne);
-    if (scaleKeyValues.size() != oneCount)
-    {
-        AnimationChannel* scaleChannel = new AnimationChannel();
-        scaleChannel->setTargetId(channel->getTargetId());
-        scaleChannel->setKeyTimes(channel->getKeyTimes());
-        scaleChannel->setTangentsIn(channel->getTangentsIn());
-        scaleChannel->setTangentsOut(channel->getTangentsOut());
-        scaleChannel->setInterpolations(channel->getInterpolationTypes());
-        scaleChannel->setTargetAttribute(Transform::ANIMATE_SCALE);
-        scaleChannel->setKeyValues(scaleKeyValues);
-        scaleChannel->removeDuplicates();
-        animation->add(scaleChannel);
-    }
-
-    AnimationChannel* rotateChannel = new AnimationChannel();
-    rotateChannel->setTargetId(channel->getTargetId());
-    rotateChannel->setKeyTimes(channel->getKeyTimes());
-    rotateChannel->setTangentsIn(channel->getTangentsIn());
-    rotateChannel->setTangentsOut(channel->getTangentsOut());
-    rotateChannel->setInterpolations(channel->getInterpolationTypes());
-    rotateChannel->setTargetAttribute(Transform::ANIMATE_ROTATE);
-    rotateChannel->setKeyValues(rotateKeyValues);
-    rotateChannel->removeDuplicates();
-    animation->add(rotateChannel);
-
-    AnimationChannel* translateChannel = new AnimationChannel();
-    translateChannel->setTargetId(channel->getTargetId());
-    translateChannel->setKeyTimes(channel->getKeyTimes());
-    translateChannel->setTangentsIn(channel->getTangentsIn());
-    translateChannel->setTangentsOut(channel->getTangentsOut());
-    translateChannel->setInterpolations(channel->getInterpolationTypes());
-    translateChannel->setTargetAttribute(Transform::ANIMATE_TRANSLATE);
-    translateChannel->setKeyValues(translateKeyValues);
-    translateChannel->removeDuplicates();
-    animation->add(translateChannel);
-}
-
-static bool isAlmostOne(float value)
-{
-    return std::abs(value - 1.0f) < EPSILON;
-}
-
-}

+ 0 - 132
gameplay-encoder/src/GPBFile.h

@@ -1,132 +0,0 @@
-#ifndef GPBFILE_H_
-#define GPBFILE_H_
-
-#include "FileIO.h"
-#include "Object.h"
-#include "Scene.h"
-#include "Node.h"
-#include "Camera.h"
-#include "Light.h"
-#include "Mesh.h"
-#include "Reference.h"
-#include "ReferenceTable.h"
-#include "Animations.h"
-#include "Animation.h"
-#include "AnimationChannel.h"
-
-namespace gameplay
-{
-
-/**
- * Increment the version number when making a change that break binary compatibility.
- * [0] is major, [1] is minor.
- */
-const unsigned char GPB_VERSION[2] = {1, 2};
-
-/**
- * The GamePlay Binary file class handles writing the GamePlay Binary file.
- */
-class GPBFile
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    GPBFile(void);
-
-    /**
-     * Destructor.
-     */
-    ~GPBFile(void);
-
-    /**
-     * Returns the GPBFile instance.
-     */
-    static GPBFile* getInstance();
-
-    /**
-     * Saves the GPBFile as a binary file at filepath.
-     *
-     * @param filepath The file name and path to save to.
-     */
-    void saveBinary(const std::string& filepath);
-
-    /**
-     * Saves the GPBFile as a text file at filepath. Useful for debugging.
-     *
-     * @param filepath The file name and path to save to.
-     */
-    void saveText(const std::string& filepath);
-    
-    void add(Object* obj);
-    void addScene(Scene* scene);
-    void addCamera(Camera* camera);
-    void addLight(Light* light);
-    void addMesh(Mesh* mesh);
-    void addNode(Node* node);
-    /**
-     * Adds a node that does not belong to a scene.
-     */
-    void addScenelessNode(Node* node);
-    void addAnimation(Animation* animation);
-
-    /**
-     * Adds the given object to the ref table.
-     */
-    void addToRefTable(Object* obj);
-
-    /**
-     * Returns the object with the given id. Returns NULL if not found.
-     */
-    Object* getFromRefTable(const std::string& id);
-
-    /**
-    * Returns true if the id was found in the ref table.
-    */
-    bool idExists(const std::string& id);
-
-    Camera* getCamera(const char* id);
-    Light* getLight(const char* id);
-    Mesh* getMesh(const char* id);
-    Node* getNode(const char* id);
-
-    Animations* getAnimations();
-
-    /**
-     * Adjusts the game play binary file before it is written.
-     */
-    void adjust();
-
-private:
-    /**
-     * Computes the bounds of all meshes in the node hierarchy.
-     */
-    void computeBounds(Node* node);
-    void optimizeTransformAnimations();
-
-    /**
-     * Decomposes an ANIMATE_SCALE_ROTATE_TRANSLATE channel into 3 new channels. (Scale, Rotate and Translate)
-     * 
-     * @param animation The animation that the channel belongs to.
-     * @param channel The animation channel to decompose.
-     */
-    void decomposeTransformAnimationChannel(Animation* animation, const AnimationChannel* channel);
-
-private:
-
-    FILE* _file;
-    std::list<Object*> _objects;
-    std::list<Camera*> _cameras;
-    std::list<Light*> _lights;
-    std::list<Mesh*> _geometry;
-    std::list<Node*> _nodes;
-    Animations _animations;
-    bool _animationsAdded;
-
-    ReferenceTable _refTable;
-};
-
-}
-
-#endif

+ 0 - 42
gameplay-encoder/src/Glyph.cpp

@@ -1,42 +0,0 @@
-#include "Base.h"
-#include "Glyph.h"
-
-namespace gameplay
-{
-
-Glyph::Glyph(void) :
-    index(0),
-    width(0)
-{
-    fillArray(uvCoords, 0.0f, 4);
-}
-
-    Glyph::~Glyph(void)
-{
-}
-
-const char* Glyph::getElementName(void) const
-{
-    return "Glyph";
-}
-
-void Glyph::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-
-    write(index, file);
-    write(width, file);
-    write(uvCoords, 4, file);
-
-}
-
-void Glyph::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "index", index);
-    fprintfElement(file, "width", width);
-    fprintfElement(file, "uvCoords", uvCoords, 4);
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 34
gameplay-encoder/src/Glyph.h

@@ -1,34 +0,0 @@
-#ifndef GLYPH_H_
-#define GLYPH_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class Glyph : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Glyph(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Glyph(void);
-
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    unsigned int index;
-    unsigned int width;
-    float uvCoords[4];
-};
-
-}
-
-#endif

+ 0 - 231
gameplay-encoder/src/Light.cpp

@@ -1,231 +0,0 @@
-#include "Base.h"
-#include "Light.h"
-#include "DAESceneEncoder.h"
-
-namespace gameplay
-{
-
-Light::Light(void) :
-    _lightType(0),
-    _constantAttenuation(0.0f),
-    _linearAttenuation(0.0f),
-    _quadraticAttenuation(0.0f),
-    _falloffAngle(0.0f),
-    _falloffExponent(0.0f),
-    _range(-1.0f),
-    _innerAngle(-1.0f),
-    _outerAngle(0.0f)
-{
-    fillArray(_color, 0.0f, COLOR_SIZE);
-}
-
-Light::~Light(void)
-{
-}
-
-unsigned int Light::getTypeId(void) const
-{
-    return LIGHT_ID;
-}
-const char* Light::getElementName(void) const
-{
-    return "Light";
-}
-
-float Light::computeRange(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
-{
-    if (constantAttenuation == 0.0f && linearAttenuation == 0.0f && quadraticAttenuation == 0.0f)
-    {
-        return 0.0f;
-    }
-
-    // Constant Attenuation is currently not supported.
-    if (constantAttenuation == 1.0f)
-    {
-        return 1.0f;
-    }
-
-    const float step = 0.01f;
-    float range = 0.01f;
-    float att = 1.0f;
-    while (att > 0.01f)
-    {
-        att = 1 / (constantAttenuation + (range * linearAttenuation) + (range * range * quadraticAttenuation));
-        range += step;
-    }
-    return range;
-}
-
-float lerpstep( float lower, float upper, float s)
-{
-    float lerpstep = ( s - lower ) / ( upper - lower );
-    
-    if (lerpstep < 0.0f)
-        lerpstep = 0.0f;
-    else if (lerpstep > 1.0f)
-        lerpstep = 1.0f;
-    
-    return lerpstep;
-}
-
-float Light::computeInnerAngle(float outerAngle)
-{
-    const float epsilon = 0.15f;
-
-    // Set inner angle to half of outer angle.
-    float innerAngle = outerAngle / 2.0f;
-
-    // Try to find the inner angle by sampling the attenuation with steps of angle.
-    for (float angle = 0.0; angle < outerAngle; angle += epsilon)
-    {
-        float outerCosAngle = cos(MATH_DEG_TO_RAD(outerAngle));
-        float innerCosAngle = cos(MATH_DEG_TO_RAD(innerAngle));
-            
-        float cosAngle = cos(MATH_DEG_TO_RAD(angle));
-        float att = lerpstep(outerCosAngle, innerCosAngle, cosAngle);
-        
-        if (att < 1.0f)
-        {
-            innerAngle = angle;
-            break;
-        }
-    }
-
-    return innerAngle;
-}
-
-void Light::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_lightType, file);
-    write(_color, COLOR_SIZE, file);
-
-    // Compute an approximate light range with Collada's attenuation parameters.
-    // This facilitates bringing in the light nodes directly from maya to gameplay.
-    if (_range == -1.0f)
-    {
-        _range = computeRange(_constantAttenuation, _linearAttenuation, _quadraticAttenuation);
-    }
-
-    if (_lightType == SpotLight)
-    {
-        // Compute an approximate inner angle of the spot light using Collada's outer angle.
-        _outerAngle = _falloffAngle / 2.0f;
-        
-        if (_innerAngle == -1.0f)
-        {
-            _innerAngle = computeInnerAngle(_outerAngle);
-        }
-
-        write(_range, file);
-        write(MATH_DEG_TO_RAD(_innerAngle), file);
-        write(MATH_DEG_TO_RAD(_outerAngle), file);
-    }
-    else if (_lightType == PointLight)
-    {
-        write(_range, file);
-    }
-}
-
-void Light::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "lightType", _lightType);
-    fprintfElement(file, "color", _color, COLOR_SIZE);
-
-    // Compute an approximate light range with Collada's attenuation parameters.
-    // This facilitates bringing in the light nodes directly from maya to gameplay.
-    if (_range == -1.0f)
-    {
-        _range = computeRange(_constantAttenuation, _linearAttenuation, _quadraticAttenuation);
-    }
-
-    if (_lightType == SpotLight)
-    {
-        // Compute an approximate inner angle of the spot light using Collada's outer angle.
-        _outerAngle = _falloffAngle / 2.0f;
-        if (_innerAngle == -1.0f)
-        {
-            _innerAngle = computeInnerAngle(_outerAngle);
-        }
-
-        fprintfElement(file, "range", _range);
-        fprintfElement(file, "innerAngle", MATH_DEG_TO_RAD(_innerAngle));
-        fprintfElement(file, "outerAngle", MATH_DEG_TO_RAD(_outerAngle));
-    }
-    else if (_lightType == PointLight)
-    {
-        fprintfElement(file, "range", _range);
-    }
-
-    fprintElementEnd(file);
-}
-
-float Light::getRed() const
-{
-    return _color[0];
-}
-float Light::getGreen() const
-{
-    return _color[1];
-}
-float Light::getBlue() const
-{
-    return _color[2];
-}
-
-bool Light::isAmbient() const
-{
-    return _lightType == AmbientLight;
-}
-
-void Light::setAmbientLight()
-{
-    _lightType = AmbientLight;
-}
-void Light::setDirectionalLight()
-{
-    _lightType = DirectionalLight;
-}
-void Light::setPointLight()
-{
-    _lightType = PointLight;
-}
-void Light::setSpotLight()
-{
-    _lightType = SpotLight;
-}
-
-void Light::setColor(float r, float g, float b)
-{
-    _color[0] = r;
-    _color[1] = g;
-    _color[2] = b;
-}
-
-void Light::setConstantAttenuation(float value)
-{
-    _constantAttenuation = value;
-}
-void Light::setLinearAttenuation(float value)
-{
-    _linearAttenuation = value;
-}
-void Light::setQuadraticAttenuation(float value)
-{
-    _quadraticAttenuation = value;
-}
-void Light::setFalloffAngle(float value)
-{
-    _falloffAngle = value;
-}
-void Light::setFalloffExponent(float value)
-{
-    _falloffExponent = value;
-    if ( value != 1.0)
-    {
-        printf("Warning: spot light falloff_exponent must be 1.0. \n");
-    }
-}
-
-}

+ 0 - 82
gameplay-encoder/src/Light.h

@@ -1,82 +0,0 @@
-#ifndef LIGHT_H_
-#define LIGHT_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class Light : public Object
-{
-public:
-
-    static const int COLOR_SIZE = 3;
-
-    /**
-     * Constructor.
-     */
-    Light(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Light(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    float getRed() const;
-    float getGreen() const;
-    float getBlue() const;
-
-    bool isAmbient() const;
-
-    /**
-     * Sets the light type to ambient.
-     */
-    void setAmbientLight();
-    void setDirectionalLight();
-    void setPointLight();
-    void setSpotLight();
-
-    void setColor(float r, float g, float b);
-    void setColor(float r, float g, float b, float a);
-
-    void setConstantAttenuation(float value);
-    void setLinearAttenuation(float value);
-    void setQuadraticAttenuation(float value);
-    void setFalloffAngle(float value);
-    void setFalloffExponent(float value);
-
-    enum LightType
-    {
-        DirectionalLight = 1,
-        PointLight = 2,
-        SpotLight = 3,
-        AmbientLight = 255
-    };
-
-private:
-
-    static float computeRange(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
-    static float computeInnerAngle(float outerAngle);
-    
-    unsigned char _lightType;
-    float _color[COLOR_SIZE];
-
-    float _constantAttenuation;
-    float _linearAttenuation;
-    float _quadraticAttenuation;
-    float _falloffAngle;
-    float _falloffExponent;
-
-    float _range;
-    float _innerAngle;
-    float _outerAngle;
-};
-
-}
-
-#endif

+ 0 - 39
gameplay-encoder/src/Material.cpp

@@ -1,39 +0,0 @@
-#include "Base.h"
-#include "Material.h"
-
-namespace gameplay
-{
-
-Material::Material(void) :
-    _effect(NULL)
-{
-}
-
-Material::~Material(void)
-{
-}
-
-unsigned int Material::getTypeId(void) const
-{
-    return MATERIAL_ID;
-}
-const char* Material::getElementName(void) const
-{
-    return "Material";
-}
-
-void Material::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    //write(_parameters, file);
-    //write(_effect, file);
-}
-void Material::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    //fprintfElement(file, "parameters", _parameters);
-    //fprintfElement(file, "effect", _effect);
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 37
gameplay-encoder/src/Material.h

@@ -1,37 +0,0 @@
-#ifndef MATERIAL_H_
-#define MATERIAL_H_
-
-#include "Object.h"
-#include "MaterialParameter.h"
-#include "Effect.h"
-
-namespace gameplay
-{
-
-class Material : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Material(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Material(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-private:
-    std::list<MaterialParameter> _parameters;
-    Effect* _effect;
-};
-
-}
-
-#endif

+ 0 - 39
gameplay-encoder/src/MaterialParameter.cpp

@@ -1,39 +0,0 @@
-#include "Base.h"
-#include "MaterialParameter.h"
-
-namespace gameplay
-{
-
-MaterialParameter::MaterialParameter(void) :
-    _type(0)
-{
-}
-
-MaterialParameter::~MaterialParameter(void)
-{
-}
-
-unsigned int MaterialParameter::getTypeId(void) const
-{
-    return MATERIAL_ID;
-}
-const char* MaterialParameter::getElementName(void) const
-{
-    return "MaterialParameter";
-}
-
-void MaterialParameter::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_value, file);
-    write(_type, file);
-}
-void MaterialParameter::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "%f ", "value", _value);
-    fprintfElement(file, "type", _type);
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 35
gameplay-encoder/src/MaterialParameter.h

@@ -1,35 +0,0 @@
-#ifndef MATERIALPARAMETER_H_
-#define MATERIALPARAMETER_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class MaterialParameter : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    MaterialParameter(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~MaterialParameter(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-private:
-    std::vector<float> _value;
-    unsigned int _type;
-};
-
-}
-
-#endif

+ 0 - 407
gameplay-encoder/src/Matrix.cpp

@@ -1,407 +0,0 @@
-#include "Base.h"
-#include "Matrix.h"
-
-namespace gameplay
-{
-
-Matrix::Matrix(void)
-{
-    setIdentity(m);
-}
-
-Matrix::Matrix(float m0, float m1, float m2, float m3,
-               float m4, float m5, float m6, float m7,
-               float m8, float m9, float m10, float m11,
-               float m12, float m13, float m14, float m15)
-{
-    m[0] = m0;
-    m[1] = m1;
-    m[2] = m2;
-    m[3] = m3;
-    m[4] = m4;
-    m[5] = m5;
-    m[6] = m6;
-    m[7] = m7;
-    m[8] = m8;
-    m[9] = m9;
-    m[10] = m10;
-    m[11] = m11;
-    m[12] = m12;
-    m[13] = m13;
-    m[14] = m14;
-    m[15] = m15;
-}
-
-Matrix::~Matrix(void)
-{
-}
-
-void Matrix::setIdentity(float* matrix)
-{
-    memcpy(matrix, MATRIX4F_IDENTITY, MATRIX4F_SIZE);
-}
-
-void Matrix::createRotation(const Quaternion& q, float* dst)
-{
-    assert(dst);
-
-    float x2 = q.x + q.x;
-    float y2 = q.y + q.y;
-    float z2 = q.z + q.z;
-
-    float xx2 = q.x * x2;
-    float yy2 = q.y * y2;
-    float zz2 = q.z * z2;
-    float xy2 = q.x * y2;
-    float xz2 = q.x * z2;
-    float yz2 = q.y * z2;
-    float wx2 = q.w * x2;
-    float wy2 = q.w * y2;
-    float wz2 = q.w * z2;
-
-    dst[0] = 1.0f - yy2 - zz2;
-    dst[1] = xy2 + wz2;
-    dst[2] = xz2 - wy2;
-    dst[3] = 0.0f;
-
-    dst[4] = xy2 - wz2;
-    dst[5] = 1.0f - xx2 - zz2;
-    dst[6] = yz2 + wx2;
-    dst[7] = 0.0f;
-
-    dst[8] = xz2 + wy2;
-    dst[9] = yz2 - wx2;
-    dst[10] = 1.0f - xx2 - yy2;
-    dst[11] = 0.0f;
-
-    dst[12] = 0.0f;
-    dst[13] = 0.0f;
-    dst[14] = 0.0f;
-    dst[15] = 1.0f;
-}
-
-void Matrix::createRotation(float x, float y, float z, float angle, float* dst)
-{
-    // Make sure the input axis is normalized
-    float n = x*x + y*y + z*z;
-    if (n != 1.0f)
-    {
-        // Not normalized
-        n = sqrt(n);
-        if (n > 0.000001f) // prevent divide too close to zero
-        {
-            n = 1.0f / n;
-            x *= n;
-            y *= n;
-            z *= n;
-        }
-    }
-
-    float c = cos(angle);
-    float s = sin(angle);
-
-    float t = 1.0f - c;
-    float tx = t * x;
-    float ty = t * y;
-    float tz = t * z;
-    float txy = tx * y;
-    float txz = tx * z;
-    float tyz = ty * z;
-    float sx = s * x;
-    float sy = s * y;
-    float sz = s * z;
-    
-    dst[0] = c + tx*x;
-    dst[1] = txy + sz;
-    dst[2] = txz - sy;
-    dst[3] = 0.0f;
-
-    dst[4] = txy - sz;
-    dst[5] = c + ty*y;
-    dst[6] = tyz + sx;
-    dst[7] = 0.0f;
-
-    dst[8] = txz + sy;
-    dst[9] = tyz - sx;
-    dst[10] = c + tz*z;
-    dst[11] = 0.0f;
-
-    dst[12] = 0.0f;
-    dst[13] = 0.0f;
-    dst[14] = 0.0f;
-    dst[15] = 1.0f;
-}
-
-void Matrix::createRotationX(float angle, float* dst)
-{
-    setIdentity(dst);
-
-    float c = cos(angle);
-    float s = sin(angle);
-
-    dst[5]  = c;
-    dst[6]  = s;
-    dst[9]  = -s;
-    dst[10] = c;
-}
-
-void Matrix::createRotationY(float angle, float* dst)
-{
-    setIdentity(dst);
-
-    float c = cos(angle);
-    float s = sin(angle);
-
-    dst[0]  = c;
-    dst[2]  = -s;
-    dst[8]  = s;
-    dst[10] = c;
-}
-
-void Matrix::createRotationZ(float angle, float* dst)
-{
-    setIdentity(dst);
-
-    float c = cos(angle);
-    float s = sin(angle);
-
-    dst[0] = c;
-    dst[1] = s;
-    dst[4] = -s;
-    dst[5] = c;
-}
-
-void Matrix::createTranslation(float x, float y, float z, float* dst)
-{
-    setIdentity(dst);
-    dst[12] = x;
-    dst[13] = y;
-    dst[14] = z;
-}
-
-void Matrix::createScale(float x, float y, float z, float* dst)
-{
-    setIdentity(dst);
-    dst[0]  = x;
-    dst[5]  = y;
-    dst[10] = z;
-}
-
-float* Matrix::getArray()
-{
-    return m;
-}
-
-void Matrix::translate(float x, float y, float z)
-{
-    float t[16];
-    createTranslation(x, y, z, t);
-    multiply(m, t, m);
-}
-
-void Matrix::scale(float x, float y, float z)
-{
-    float s[16];
-    createScale(x, y, z, s);
-    multiply(m, s, m);
-}
-
-void Matrix::rotate(const Quaternion& q)
-{
-    float r[16];
-    createRotation(q, r);
-    multiply(m, r, m);
-}
-
-void Matrix::rotate(float x, float y, float z, float angle)
-{
-    float r[16];
-    createRotation(x, y, z, angle, r);
-    multiply(m, r, m);
-}
-
-void Matrix::rotateX(float angle)
-{
-    float r[16];
-    createRotationX(angle, r);
-    multiply(m, r, m);
-}
-
-void Matrix::rotateY(float angle)
-{
-    float r[16];
-    createRotationY(angle, r);
-    multiply(m, r, m);
-}
-
-void Matrix::rotateZ(float angle)
-{
-    float r[16];
-    createRotationZ(angle, r);
-    multiply(m, r, m);
-}
-
-void Matrix::multiply(const float* m1, const float* m2, float* dst)
-{
-    // Support the case where m1 or m2 is the same array as dst.
-    float product[16];
-    product[0]  = m1[0] * m2[0]  + m1[4] * m2[1] + m1[8]   * m2[2]  + m1[12] * m2[3];
-    product[1]  = m1[1] * m2[0]  + m1[5] * m2[1] + m1[9]   * m2[2]  + m1[13] * m2[3];
-    product[2]  = m1[2] * m2[0]  + m1[6] * m2[1] + m1[10]  * m2[2]  + m1[14] * m2[3];
-    product[3]  = m1[3] * m2[0]  + m1[7] * m2[1] + m1[11]  * m2[2]  + m1[15] * m2[3];
-
-    product[4]  = m1[0] * m2[4]  + m1[4] * m2[5] + m1[8]   * m2[6]  + m1[12] * m2[7];
-    product[5]  = m1[1] * m2[4]  + m1[5] * m2[5] + m1[9]   * m2[6]  + m1[13] * m2[7];
-    product[6]  = m1[2] * m2[4]  + m1[6] * m2[5] + m1[10]  * m2[6]  + m1[14] * m2[7];
-    product[7]  = m1[3] * m2[4]  + m1[7] * m2[5] + m1[11]  * m2[6]  + m1[15] * m2[7];
-
-    product[8]  = m1[0] * m2[8]  + m1[4] * m2[9] + m1[8]   * m2[10] + m1[12] * m2[11];
-    product[9]  = m1[1] * m2[8]  + m1[5] * m2[9] + m1[9]   * m2[10] + m1[13] * m2[11];
-    product[10] = m1[2] * m2[8]  + m1[6] * m2[9] + m1[10]  * m2[10] + m1[14] * m2[11];
-    product[11] = m1[3] * m2[8]  + m1[7] * m2[9] + m1[11]  * m2[10] + m1[15] * m2[11];
-
-    product[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8]  * m2[14] + m1[12] * m2[15];
-    product[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9]  * m2[14] + m1[13] * m2[15];
-    product[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];
-    product[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];
-    memcpy(dst, product, MATRIX4F_SIZE);
-}
-
-bool Matrix::decompose(Vector3* scale, Quaternion* rotation, Vector3* translation) const
-{
-    if (translation)
-    {
-        // Extract the translation
-        translation->x = m[12];
-        translation->y = m[13];
-        translation->z = m[14];
-    }
-
-    // nothing left to do
-    if (scale == NULL && rotation == NULL)
-    {
-        return true;
-    }
-
-    // Extract the scale.
-    // This is simply the length of each axis (row/column) in the matrix.
-    Vector3 xaxis(m[0], m[1], m[2]);
-    float scaleX = xaxis.length();
-
-    Vector3 yaxis(m[4], m[5], m[6]);
-    float scaleY = yaxis.length();
-
-    Vector3 zaxis(m[8], m[9], m[10]);
-    float scaleZ = zaxis.length();
-
-    // Determine if we have a negative scale (true if determinant is less than zero).
-    // In this case, we simply negate a single axis of the scale.
-    float det = determinant();
-    if (det < 0)
-    {
-        scaleZ = -scaleZ;
-    }
-
-    if (scale)
-    {
-        scale->x = scaleX;
-        scale->y = scaleY;
-        scale->z = scaleZ;
-    }
-
-    // nothing left to do
-    if (rotation == NULL)
-        return true;
-
-    // scale too close to zero, can't decompose rotation
-    if (scaleX < MATH_TOLERANCE || scaleY < MATH_TOLERANCE || fabs(scaleZ) < MATH_TOLERANCE)
-        return false;
-
-    float rn;
-
-    // Factor the scale out of the matrix axes
-    rn = 1.0f / scaleX;
-    xaxis.x *= rn;
-    xaxis.y *= rn;
-    xaxis.z *= rn;
-
-    rn = 1.0f / scaleY;
-    yaxis.x *= rn;
-    yaxis.y *= rn;
-    yaxis.z *= rn;
-
-    rn = 1.0f / scaleZ;
-    zaxis.x *= rn;
-    zaxis.y *= rn;
-    zaxis.z *= rn;
-
-    // Now calculate the rotation from the resulting matrix (axes)
-    float trace = xaxis.x + yaxis.y + zaxis.z + 1.0f;
-
-    if (trace > MATH_TOLERANCE)
-    {
-        float s = 0.5f / sqrt(trace);
-        rotation->w = 0.25f / s;
-        rotation->x = ( yaxis.z - zaxis.y ) * s;
-        rotation->y = ( zaxis.x - xaxis.z ) * s;
-        rotation->z = ( xaxis.y - yaxis.x ) * s;
-    }
-    else
-    {
-        if (xaxis.x > yaxis.y && xaxis.x > zaxis.z)
-        {
-            float s = 2.0f * sqrt(1.0f + xaxis.x - yaxis.y - zaxis.z);
-            rotation->w = (yaxis.z - zaxis.y ) / s;
-            rotation->x = 0.25f * s;
-            rotation->y = (yaxis.x + xaxis.y ) / s;
-            rotation->z = (zaxis.x + xaxis.z ) / s;
-        }
-        else if (yaxis.y > zaxis.z)
-        {
-            float s = 2.0f * sqrt(1.0f + yaxis.y - xaxis.x - zaxis.z);
-            rotation->w = (zaxis.x - xaxis.z ) / s;
-            rotation->x = (yaxis.x + xaxis.y ) / s;
-            rotation->y = 0.25f * s;
-            rotation->z = (zaxis.y + yaxis.z ) / s;
-        }
-        else
-        {
-            float s = 2.0f * sqrt(1.0f + zaxis.z - xaxis.x - yaxis.y );
-            rotation->w = (xaxis.y - yaxis.x ) / s;
-            rotation->x = (zaxis.x + xaxis.z ) / s;
-            rotation->y = (zaxis.y + yaxis.z ) / s;
-            rotation->z = 0.25f * s;
-        }
-    }
-
-    return true;
-}
-
-float Matrix::determinant() const
-{
-    float a0 = m[0] * m[5] - m[1] * m[4];
-    float a1 = m[0] * m[6] - m[2] * m[4];
-    float a2 = m[0] * m[7] - m[3] * m[4];
-    float a3 = m[1] * m[6] - m[2] * m[5];
-    float a4 = m[1] * m[7] - m[3] * m[5];
-    float a5 = m[2] * m[7] - m[3] * m[6];
-    float b0 = m[8] * m[13] - m[9] * m[12];
-    float b1 = m[8] * m[14] - m[10] * m[12];
-    float b2 = m[8] * m[15] - m[11] * m[12];
-    float b3 = m[9] * m[14] - m[10] * m[13];
-    float b4 = m[9] * m[15] - m[11] * m[13];
-    float b5 = m[10] * m[15] - m[11] * m[14];
-
-    // Calculate the determinant
-    return (a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0);
-}
-
-void Matrix::transformPoint(const Vector3& p, Vector3* dst) const
-{
-    dst->set(
-        p.x * m[0] + p.y * m[4] + p.z * m[8] +  m[12],
-        p.x * m[1] + p.y * m[5] + p.z * m[9] +  m[13],
-        p.x * m[2] + p.y * m[6] + p.z * m[10] + m[14] );
-}
-
-}

+ 0 - 169
gameplay-encoder/src/Matrix.h

@@ -1,169 +0,0 @@
-#ifndef MATRIX_H_
-#define MATRIX_H_
-
-#include "Vector4.h"
-#include "Vector3.h"
-#include "Vector2.h"
-#include "Quaternion.h"
-#include "FileIO.h"
-
-#define MATRIX4F_SIZE   (sizeof(float) * 16)
-#define PI 3.14159265f
-#define TORADIANS(degrees) (degrees * (PI / 180.0f))
-#define TODEGREES(radians) (radians * (180.0f / PI))
-
-namespace gameplay
-{
-
-/**
- * The identify matrix.
- */
-static const float MATRIX4F_IDENTITY[16] =
-{
-    1.0f, 0.0f, 0.0f, 0.0f,
-    0.0f, 1.0f, 0.0f, 0.0f,
-    0.0f, 0.0f, 1.0f, 0.0f,
-    0.0f, 0.0f, 0.0f, 1.0f
-};
-
-class Matrix
-{
-public:
-
-    /**
-     * Matrix colums.
-     */
-    float m[16];
-
-    /**
-     * Constructor.
-     */
-    Matrix(void);
-
-    /**
-     * Constructor.
-     */
-    Matrix(float m0, float m1, float m2, float m3,
-           float m4, float m5, float m6, float m7,
-           float m8, float m9, float m10, float m11,
-           float m12, float m13, float m14, float m15);
-
-    /**
-     * Destructor.
-     */
-    ~Matrix(void);
-
-    /**
-     * Computes the determinant of this matrix.
-     *
-     * @return The determinant.
-     */
-    float determinant() const;
-
-    /**
-     * Decomposes the scale, rotation and translation components of this matrix.
-     *
-     * @param scale The scale.
-     * @param rotation The rotation.
-     * @param translation The translation.
-     */
-    bool decompose(Vector3* scale, Quaternion* rotation, Vector3* translation) const;
-
-    /**
-     * Sets the given matrix to be the identity matrix.
-     */
-    static void setIdentity(float* matrix);
-
-    /**
-     * Multiplies two matrices and stores the results in dst.
-     * m1 and m2 may be the same as dst.
-     */
-    static void multiply(const float* m1, const float* m2, float* dst);
-
-    /**
-     * Creates a scale matrix for the givent x,y,z scale factors.
-     */
-    static void createScale(float x, float y, float z, float* dst);
-
-    /**
-     * Creates a rotation matrix from the given quaternion.
-     */
-    static void createRotation(const Quaternion& q, float* dst);
-
-    /**
-     * Creates a rotation matrix from the given axis and angle in degrees.
-     */
-    static void createRotation(float x, float y, float z, float angle, float* dst);
-    
-    /**
-     * Creates a rotation matrix for the given angle in the x axis and angle in degrees
-     */
-    void createRotationX(float angle, float* dst);
-    
-    /**
-     * Creates a rotation matrix for the given angle in the y axis and angle in degrees
-     */
-    void createRotationY(float angle, float* dst);
-        
-    /**
-     * Creates a rotation matrix for the given angle in the z axis and angle in degrees
-     */
-    void createRotationZ(float angle, float* dst);
-    
-    /**
-     * Creates a translation matrix for the given x, y ,x values.
-     */
-    static void createTranslation(float x, float y, float z, float* dst);
-
-    /**
-     * Returns the pointer to the float array.
-     */
-    float* getArray();
-
-    /**
-     * Translates the matrix by the x, y, z values.
-     */
-    void translate(float x, float y, float z);
-
-    /**
-     * Scales the matrix by the x, y, z factors.
-     */
-    void scale(float x, float y, float z);
-
-    /**
-     * Rotates the matrix by the given Quaternion.
-     */
-    void rotate(const Quaternion& q);
-
-    /**
-     * Rotates the matrix by the axies specified and angle.
-     */
-    void rotate(float x, float y, float z, float angle);
-
-    /**
-     * Rotates the matrix on the y-axis by the specified angle in degrees.
-     */
-    void rotateX(float angle);
-    
-    /**
-     * Rotates the matrix on the y-axis by the specified angle in degrees.
-     */
-    void rotateY(float angle);
-
-    /**
-     * Rotates the matrix on the z-axis by the specified angle in degrees.
-     */
-    void rotateZ(float angle);
-
-    /**
-     * Transforms the specified point by this matrix.
-     *
-     * Note that the input vector is treated as a point and NOT a vector.
-     */
-    void transformPoint(const Vector3& p, Vector3* dst) const;
-
-};
-
-}
-
-#endif

+ 0 - 433
gameplay-encoder/src/Mesh.cpp

@@ -1,433 +0,0 @@
-#include "Base.h"
-#include "Mesh.h"
-#include "Model.h"
-
-namespace gameplay
-{
-
-Mesh::Mesh(void) : model(NULL)
-{
-}
-
-Mesh::~Mesh(void)
-{
-}
-
-unsigned int Mesh::getTypeId(void) const
-{
-    return MESH_ID;
-}
-
-const char* Mesh::getElementName(void) const
-{
-    return "Mesh";
-}
-
-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++)
-    {
-        i->writeBinary(file);
-    }
-    // vertices
-    writeBinaryVertices(file);
-    // parts
-    writeBinaryObjects(parts, file);
-}
-
-/////////////////////////////////////////////////////////////
-// 
-// Fast, Minimum Storage Ray-Triangle Intersection
-// 
-// Authors: Tomas Möller, Ben Trumbore
-// http://jgt.akpeters.com/papers/MollerTrumbore97
-//
-// Implementation of algorithm from Real-Time Rendering (vol 1), pg. 305.
-//
-// Adapted slightly for use here.
-// 
-#define EPSILON 0.000001
-#define CROSS(dest,v1,v2) \
-          dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \
-          dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \
-          dest[2]=v1[0]*v2[1]-v1[1]*v2[0];
-#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
-#define SUB(dest,v1,v2) \
-          dest[0]=v1[0]-v2[0]; \
-          dest[1]=v1[1]-v2[1]; \
-          dest[2]=v1[2]-v2[2]; 
-
-int
-intersect_triangle(const float orig[3], const float dir[3],
-                   const float vert0[3], const float vert1[3], const float vert2[3],
-                   float *t, float *u, float *v)
-{
-   float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
-   float det,inv_det;
-
-   /* find vectors for two edges sharing vert0 */
-   SUB(edge1, vert1, vert0);
-   SUB(edge2, vert2, vert0);
-
-   /* begin calculating determinant - also used to calculate U parameter */
-   CROSS(pvec, dir, edge2);
-
-   /* if determinant is near zero, ray lies in plane of triangle */
-   det = DOT(edge1, pvec);
-
-   if (det > -EPSILON && det < EPSILON)
-     return 0;
-   inv_det = 1.0f / det;
-
-   /* calculate distance from vert0 to ray origin */
-   SUB(tvec, orig, vert0);
-
-   /* calculate U parameter and test bounds */
-   *u = DOT(tvec, pvec) * inv_det;
-   if (*u < 0.0 || *u > 1.0)
-     return 0;
-
-   /* prepare to test V parameter */
-   CROSS(qvec, tvec, edge1);
-
-   /* calculate V parameter and test bounds */
-   *v = DOT(dir, qvec) * inv_det;
-   if (*v < 0.0 || *u + *v > 1.0)
-     return 0;
-
-   /* calculate t, ray intersects triangle */
-   *t = DOT(edge2, qvec) * inv_det;
-
-   return 1;
-}
-
-// Performs an intersection test between a ray and the given mesh part
-// and stores the result in "point".
-bool intersect(const Vector3& rayOrigin, const Vector3& rayDirection, const std::vector<Vertex>& vertices, const std::vector<MeshPart*>& parts, Vector3* point)
-{
-    const float* orig = &rayOrigin.x;
-    const float* dir = &rayDirection.x;
-
-    for (unsigned int i = 0, partCount = parts.size(); i < partCount; ++i)
-    {
-        MeshPart* part = parts[i];
-
-        for (unsigned int j = 0, indexCount = part->getIndicesCount(); j < indexCount; j += 3)
-        {
-            const float* v0 = &vertices[part->getIndex( j )].position.x;
-            const float* v1 = &vertices[part->getIndex(j+1)].position.x;
-            const float* v2 = &vertices[part->getIndex(j+2)].position.x;
-
-            float t, u, v;
-            if (intersect_triangle(orig, dir, v0, v1, v2, &t, &u, &v))
-            {
-                // Found an intersection!
-                if (point)
-                {
-                    Vector3 rd(rayDirection);
-                    rd.scale(t);
-                    Vector3::add(rayOrigin, rd, point);
-                }
-                return true;
-            }
-        }
-    }
-
-    return false;
-}
-
-void Mesh::generateHeightmap(const char* filename)
-{
-    // Shoot rays down from a point just above the max Y position of the mesh.
-    // Compute ray-triangle intersection tests against the ray and this mesh to 
-    // generate heightmap data.
-    Vector3 rayOrigin(0, bounds.max.y + 10, 0);
-    Vector3 rayDirection(0, -1, 0);
-    Vector3 intersectionPoint;
-    int minX = (int)ceil(bounds.min.x);
-    int maxX = (int)floor(bounds.max.x);
-    int minZ = (int)ceil(bounds.min.z);
-    int maxZ = (int)floor(bounds.max.z);
-    int width = maxX - minX + 1;
-    int height = maxZ - minZ + 1;
-    float* heights = new float[width * height];
-    int index = 0;
-    float minHeight = FLT_MAX;
-    float maxHeight = -FLT_MAX;
-    for (int z = minZ; z <= maxZ; z++)
-    {
-        rayOrigin.z = (float)z;
-        for (int x = minX; x <= maxX; x++)
-        {
-            float h;
-            rayOrigin.x = (float)x;
-            if (intersect(rayOrigin, rayDirection, vertices, parts, &intersectionPoint))
-            {
-                h = intersectionPoint.y;
-            }
-            else
-            {
-                h = 0;
-                fprintf(stderr, "Warning: Heightmap triangle intersection failed for (%d, %d).\n", x, z);
-            }
-            if (h < minHeight)
-                minHeight = h;
-            if (h > maxHeight)
-                maxHeight = h;
-            heights[index++] = h;
-        }
-    }
-    
-    // Normalize the max height value
-    maxHeight = maxHeight - minHeight;
-
-    png_structp png_ptr = NULL;
-    png_infop info_ptr = NULL;
-    png_bytep row = NULL;
-
-    FILE* fp = fopen(filename, "wb");
-    if (fp == NULL)
-    {
-        fprintf(stderr, "Error: Failed to open file for writing: %s\n", filename);
-        goto error;
-    }
-
-    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-    if (png_ptr == NULL)
-    {
-        fprintf(stderr, "Error: Write struct creation failed: %s\n", filename);
-        goto error;
-    }
-
-    info_ptr = png_create_info_struct(png_ptr);
-    if (info_ptr == NULL)
-    {
-        fprintf(stderr, "Error: Info struct creation failed: %s\n", filename);
-        goto error;
-    }
-
-    png_init_io(png_ptr, fp);
-
-    png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
-
-    png_write_info(png_ptr, info_ptr);
-
-    // Allocate memory for a single row of image data
-    row = (png_bytep)malloc(3 * width * sizeof(png_byte));
-
-    for (int y = 0; y < height; y++)
-    {
-        for (int x = 0; x < width; x++)
-        {
-            // Write height value normalized between 0-255 (between min and max height)
-            float h = heights[y*width + x];
-            float nh = (h - minHeight) / maxHeight;
-            png_byte b = (png_byte)(nh * 255.0f);
-            
-            int pos = x*3;
-            row[pos] = row[pos+1] = row[pos+2] = b;
-        }
-        png_write_row(png_ptr, row);
-    }
-
-    png_write_end(png_ptr, NULL);
-    DEBUGPRINT_VARG("> Saved heightmap: %s\n", filename);
-
-error:
-    if (heights)
-        delete[] heights;
-    if (fp)
-        fclose(fp);
-    if (row)
-        free(row);
-    if (info_ptr)
-        png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
-    if (png_ptr)
-        png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
-
-}
-
-void Mesh::writeBinaryVertices(FILE* file)
-{
-    if (vertices.size() > 0)
-    {
-        // Assumes that all vertices are the same size.
-        // Write the number of bytes for the vertex data
-        const Vertex& vertex = vertices.front();
-        write(vertices.size() * vertex.byteSize(), file); // (vertex count) * (vertex size)
-
-        // for each vertex
-        for (std::vector<Vertex>::const_iterator i = vertices.begin(); i != vertices.end(); ++i)
-        {
-            // Write this vertex
-            i->writeBinary(file);
-        }
-    }
-    else
-    {
-        // No vertex data
-        write((unsigned int)0, file);
-    }
-
-    // Write bounds
-    write(&bounds.min.x, 3, file);
-    write(&bounds.max.x, 3, file);
-    write(&bounds.center.x, 3, file);
-    write(bounds.radius, file);
-}
-
-void Mesh::writeText(FILE* file)
-{
-    fprintElementStart(file);
-
-    // for each VertexFormat
-    if (vertices.size() > 0 )
-    {
-        for (std::vector<VertexElement>::iterator i = _vertexFormat.begin(); i != _vertexFormat.end(); i++)
-        {
-            i->writeText(file);
-        }
-    }
-
-    // for each Vertex
-    fprintf(file, "<vertices count=\"%lu\">\n", vertices.size());
-    for (std::vector<Vertex>::iterator i = vertices.begin(); i != vertices.end(); ++i)
-    {
-        i->writeText(file);
-    }
-    fprintf(file, "</vertices>\n");
-
-    // write bounds
-    fprintf(file, "<bounds>\n");
-    fprintf(file, "<min>\n");
-    writeVectorText(bounds.min, file);
-    fprintf(file, "</min>\n");
-    fprintf(file, "<max>\n");
-    writeVectorText(bounds.max, file);
-    fprintf(file, "</max>\n");
-    fprintf(file, "<center>\n");
-    writeVectorText(bounds.center, file);
-    fprintf(file, "</center>\n");
-    fprintf(file, "<radius>%f</radius>\n", bounds.radius);
-    fprintf(file, "</bounds>\n");
-
-    // for each MeshPart
-    for (std::vector<MeshPart*>::iterator i = parts.begin(); i != parts.end(); ++i)
-    {
-        (*i)->writeText(file);
-    }
-
-    fprintElementEnd(file);
-}
-
-void Mesh::addMeshPart(MeshPart* part)
-{
-    parts.push_back(part);
-}
-
-void Mesh::addMeshPart(Vertex* vertex)
-{
-    vertices.push_back(*vertex);
-}
-
-void Mesh::addVetexAttribute(unsigned int usage, unsigned int count)
-{
-    _vertexFormat.push_back(VertexElement(usage, count));
-}
-
-size_t Mesh::getVertexCount() const
-{
-    return vertices.size();
-}
-
-const Vertex& Mesh::getVertex(unsigned int index) const
-{
-    return vertices[index];
-}
-
-size_t Mesh::getVertexElementCount() const
-{
-    return _vertexFormat.size();
-}
-
-const VertexElement& Mesh::getVertexElement(unsigned int index) const
-{
-    return _vertexFormat[index];
-}
-
-bool Mesh::contains(const Vertex& vertex) const
-{
-    return vertexLookupTable.count(vertex) > 0;
-}
-
-unsigned int Mesh::addVertex(const Vertex& vertex)
-{
-    unsigned int index = getVertexCount();
-    vertices.push_back(vertex);
-    vertexLookupTable[vertex] = index;
-    return index;
-}
-
-unsigned int Mesh::getVertexIndex(const Vertex& vertex)
-{
-    std::map<Vertex,unsigned int>::iterator it;
-    it = vertexLookupTable.find(vertex);
-    return it->second;
-}
-
-void Mesh::computeBounds()
-{
-    // If we have a Model with a MeshSkin associated with it,
-    // compute the bounds from the skin - otherwise compute
-    // it from the local mesh data.
-    if (model && model->getSkin())
-    {
-        model->getSkin()->computeBounds();
-        return;
-    }
-
-    bounds.min.x = bounds.min.y = bounds.min.z = FLT_MAX;
-    bounds.max.x = bounds.max.y = bounds.max.z = -FLT_MAX;
-    bounds.center.x = bounds.center.y = bounds.center.z = 0.0f;
-    bounds.radius = 0.0f;
-
-    for (std::vector<Vertex>::const_iterator i = vertices.begin(); i != vertices.end(); ++i)
-    {
-        // Update min/max for this vertex
-        if (i->position.x < bounds.min.x)
-            bounds.min.x = i->position.x;
-        if (i->position.y < bounds.min.y)
-            bounds.min.y = i->position.y;
-        if (i->position.z < bounds.min.z)
-            bounds.min.z = i->position.z;
-        if (i->position.x > bounds.max.x)
-            bounds.max.x = i->position.x;
-        if (i->position.y > bounds.max.y)
-            bounds.max.y = i->position.y;
-        if (i->position.z > bounds.max.z)
-            bounds.max.z = i->position.z;
-    }
-
-    // Compute center point
-    Vector3::add(bounds.min, bounds.max, &bounds.center);
-    bounds.center.scale(0.5f);
-
-    // Compute radius by looping through all points again and finding the max
-    // distance between the center point and each vertex position
-    for (std::vector<Vertex>::const_iterator i = vertices.begin(); i != vertices.end(); ++i)
-    {
-        float d = bounds.center.distanceSquared(i->position);
-        if (d > bounds.radius)
-        {
-            bounds.radius = d;
-        }
-    }
-
-    // Convert squared distance to distance for radius
-    bounds.radius = sqrt(bounds.radius);
-}
-
-}

+ 0 - 83
gameplay-encoder/src/Mesh.h

@@ -1,83 +0,0 @@
-#ifndef MESH_H_
-#define MESH_H_
-
-#include "Base.h"
-#include "Object.h"
-#include "MeshPart.h"
-#include "VertexElement.h"
-#include "BoundingVolume.h"
-
-namespace gameplay
-{
-
-class Model;
-
-class Mesh : public Object
-{
-    friend class Model;
-
-public:
-
-    /**
-     * Constructor.
-     */
-    Mesh(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Mesh(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-
-    virtual void writeBinary(FILE* file);
-    void writeBinaryVertices(FILE* file);
-
-    virtual void writeText(FILE* file);
-    void writeText(FILE* file, const Vertex& vertex);
-    void writeText(FILE* file, const Vector3& v);
-
-    void addMeshPart(MeshPart* part);
-    void addMeshPart(Vertex* vertex);
-    void addVetexAttribute(unsigned int usage, unsigned int count);
-
-    size_t getVertexCount() const;
-    const Vertex& getVertex(unsigned int index) const;
-
-    size_t getVertexElementCount() const;
-    const VertexElement& getVertexElement(unsigned int index) const;
-
-    /**
-     * Returns true if this MeshPart contains the given Vertex.
-     */
-    bool contains(const Vertex& vertex) const;
-
-    /**
-     * Adds a vertex to this MeshPart and returns the index.
-     */
-    unsigned int addVertex(const Vertex& vertex);
-
-    unsigned int getVertexIndex(const Vertex& vertex);
-
-    /**
-     * Generates a heightmap with the given filename for this mesh.
-     */
-    void generateHeightmap(const char* filename);
-
-    void computeBounds();
-
-    Model* model;
-    std::vector<Vertex> vertices;
-    std::vector<MeshPart*> parts;
-    BoundingVolume bounds;
-    std::map<Vertex, unsigned int> vertexLookupTable;
-
-private:
-    std::vector<VertexElement> _vertexFormat;
-
-};
-
-}
-
-#endif

+ 0 - 114
gameplay-encoder/src/MeshPart.cpp

@@ -1,114 +0,0 @@
-#include "Base.h"
-#include "MeshPart.h"
-
-namespace gameplay
-{
-
-MeshPart::MeshPart(void) :
-    _primitiveType(TRIANGLES),
-    _indexFormat(INDEX16)
-{
-}
-
-MeshPart::~MeshPart(void)
-{
-}
-
-unsigned int MeshPart::getTypeId(void) const
-{
-    return MESHPART_ID;
-}
-
-const char* MeshPart::getElementName(void) const
-{
-    return "MeshPart";
-}
-
-void MeshPart::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-
-    write(_primitiveType, file);
-    write((unsigned int)_indexFormat, file);
-
-    // write the number of bytes
-    write(indicesByteSize(), file);
-    // for each index
-    for (std::vector<unsigned int>::const_iterator i = _indices.begin(); i != _indices.end(); ++i)
-    {
-        writeBinaryIndex(*i, file);
-    }
-}
-
-void MeshPart::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "primitiveType", _primitiveType);
-    fprintfElement(file, "indexFormat", (unsigned int)_indexFormat);
-    fprintfElement(file, "%d ", "indices", _indices);
-    fprintElementEnd(file);
-}
-
-void MeshPart::addIndex(unsigned int index)
-{
-    updateIndexFormat(index);
-    _indices.push_back(index);
-}
-
-size_t MeshPart::getIndicesCount() const
-{
-    return _indices.size();
-}
-
-unsigned int MeshPart::indicesByteSize() const
-{
-    return _indices.size() * indexFormatSize();
-}
-
-unsigned int MeshPart::indexFormatSize() const
-{
-    switch (_indexFormat)
-    {
-    case INDEX32:
-        return 4;
-    default: // INDEX16
-        return 2;
-    }
-}
-
-MeshPart::IndexFormat MeshPart::getIndexFormat() const
-{
-    return _indexFormat;
-}
-
-unsigned int MeshPart::getIndex(unsigned int i) const
-{
-    return _indices[i];
-}
-
-void MeshPart::writeBinaryIndex(unsigned int index, FILE* file)
-{
-    switch (_indexFormat)
-    {
-    case INDEX32:
-        write(index, file);
-        break;
-    default: // INDEX16
-        write((unsigned short)index, file);
-        break;
-    }
-}
-
-void MeshPart::updateIndexFormat(unsigned int newIndex)
-{
-    if (newIndex >= 65536)
-    {
-        _indexFormat = INDEX32;
-    }
-    else if (newIndex >= 256 && _indexFormat != INDEX32)
-    {
-        _indexFormat = INDEX16;
-    }
-}
-
-}

+ 0 - 97
gameplay-encoder/src/MeshPart.h

@@ -1,97 +0,0 @@
-#ifndef MESHPART_H_
-#define MESHPART_H_
-
-#include "Base.h"
-#include "Object.h"
-#include "Vertex.h"
-
-namespace gameplay
-{
-
-class MeshPart : public Object
-{
-public:
-
-    enum PrimitiveType
-    {
-        TRIANGLES = 4,      // GL_TRIANGLES
-        TRIANGLE_STRIP = 5, // GL_TRIANGLE_STRIP
-        LINES = 1,          // GL_LINES
-        LINE_STRIP = 3,     // GL_LINE_STRIP
-        POINTS = 0          // GL_POINTS
-    };
-
-    enum IndexFormat
-    {
-        INDEX16 = 0x1403, // GL_UNSIGNED_SHORT
-        INDEX32 = 0x1405  // GL_UNSIGNED_INT
-    };
-
-    /**
-     * Constructor.
-     */
-    MeshPart(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~MeshPart(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    /**
-     * Adds an index to the list of indices.
-     */
-    void addIndex(unsigned int index);
-
-    /**
-     * Returns the number of indices.
-     */
-    size_t getIndicesCount() const;
-
-    /**
-     * Returns the index format.
-     */
-    IndexFormat getIndexFormat() const;
-
-    /**
-     * Gets the value of the index at the specificied location.
-     */
-    unsigned int getIndex(unsigned int i) const;
-
-private:
-
-    /**
-     * Returns the size of the indices array in bytes.
-     */
-    unsigned int indicesByteSize() const;
-
-    /**
-     * Returns the size of an index.
-     */
-    unsigned int indexFormatSize() const;
-
-    /**
-     * Updates the index format if newIndex is larger than 256 or 65536.
-     */
-    void updateIndexFormat(unsigned int newIndex);
-
-    /**
-     * Writes the index to the binary file stream.
-     * The number of bytes written depends on indexFormat.
-     */
-    void writeBinaryIndex(unsigned int index, FILE* file);
-
-private:
-
-    unsigned int _primitiveType;
-    IndexFormat _indexFormat;
-    std::vector<unsigned int> _indices;
-};
-
-}
-
-#endif

+ 0 - 442
gameplay-encoder/src/MeshSkin.cpp

@@ -1,442 +0,0 @@
-#include "Base.h"
-#include "MeshSkin.h"
-#include "Node.h"
-#include "StringUtil.h"
-#include "Mesh.h"
-#include "GPBFile.h"
-#include "Animations.h"
-#include "Transform.h"
-#include "Curve.h"
-#include "Matrix.h"
-
-namespace gameplay
-{
-
-MeshSkin::MeshSkin(void) :
-    _vertexInfluenceCount(0)
-{
-    Matrix::setIdentity(_bindShape);
-}
-
-MeshSkin::~MeshSkin(void)
-{
-}
-
-unsigned int MeshSkin::getTypeId(void) const
-{
-    return MESHPART_ID;
-}
-
-const char* MeshSkin::getElementName(void) const
-{
-    return "MeshSkin";
-}
-
-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++)
-    {
-        (*i)->writeBinaryXref(file);
-    }
-    write(_bindPoses.size() * 16, file);
-    for (std::vector<Matrix>::const_iterator i = _bindPoses.begin(); i != _bindPoses.end(); i++)
-    {
-        write(i->m, 16, file);
-    }
-
-    /*
-    // Write joint bounding spheres
-    write((unsigned int)_jointBounds.size(), file);
-    for (unsigned int i = 0; i < _jointBounds.size(); ++i)
-    {
-        BoundingVolume& v = _jointBounds[i];
-        write(v.center.x, file);
-        write(v.center.y, file);
-        write(v.center.z, file);
-        write(v.radius, file);
-    }
-    */
-}
-
-void MeshSkin::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintf(file, "<bindShape>");
-    fprintfMatrix4f(file, _bindShape);
-    fprintf(file, "</bindShape>");
-    fprintf(file, "<joints>");
-    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 (unsigned int j = 0; j < 16; ++j)
-        {
-            fprintf(file, "%f ", i->m[j]);
-        }
-    }
-    fprintf(file, "</bindPoses>\n");
-
-    fprintElementEnd(file);
-}
-
-void MeshSkin::setBindShape(const float data[])
-{
-    for (int i = 0; i < 16; ++i)
-    {
-        _bindShape[i] = data[i];
-    }
-}
-
-void MeshSkin::setVertexInfluenceCount(unsigned int count)
-{
-    _vertexInfluenceCount = count;
-}
-
-void MeshSkin::setJointNames(const std::vector<std::string>& list)
-{
-    _jointNames = list;
-}
-
-const std::vector<std::string>& MeshSkin::getJointNames()
-{
-    return _jointNames;
-}
-
-void MeshSkin::setJoints(const std::vector<Node*>& list)
-{
-    _joints = list;
-}
-
-void MeshSkin::setBindPoses(std::vector<Matrix>& list)
-{
-    for (std::vector<Matrix>::iterator i = list.begin(); i != list.end(); ++i)
-    {
-        _bindPoses.push_back(*i);
-    }
-}
-
-bool MeshSkin::hasJoint(const char* id)
-{
-    for (std::vector<std::string>::iterator i = _jointNames.begin(); i != _jointNames.end(); i++)
-    {
-        if (equals(*i, id))
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
-void MeshSkin::computeBounds()
-{
-    // Find the offset of the blend indices and blend weights within the mesh vertices
-    int blendIndexOffset = -1;
-    int blendWeightOffset = -1;
-    for (unsigned int i = 0, count = _mesh->getVertexElementCount(); i < count; ++i)
-    {
-        const VertexElement& e = _mesh->getVertexElement(i);
-        switch (e.usage)
-        {
-        case BLENDINDICES:
-            blendIndexOffset = i;
-            break;
-        case BLENDWEIGHTS:
-            blendWeightOffset = i;
-            break;
-        }
-    }
-    if (blendIndexOffset == -1 || blendWeightOffset == -1)
-    {
-        // Need blend indices and blend weights to calculate skinned bounding volume
-        return;
-    }
-
-    DEBUGPRINT_VARG("\nComputing 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();
-    while (parent)
-    {
-        // Is this parent in the list of joints that form the skeleton?
-        // If not, then it's simply a parent node to the root joint
-        if (find(_joints.begin(), _joints.end(), parent) != _joints.end())
-        {
-            rootJoint = parent;
-        }
-        parent = parent->getParent();
-    }
-
-    // If the root joint has a parent node, temporarily detach it so that its transform is
-    // not included in the bounding volume calculation below
-    Node* rootJointParent = rootJoint->getParent();
-    if (rootJointParent)
-    {
-        rootJointParent->removeChild(rootJoint);
-    }
-
-    unsigned int jointCount = _joints.size();
-    unsigned int vertexCount = _mesh->getVertexCount();
-
-    DEBUGPRINT_VARG("> %d joints found.\n", jointCount);
-
-    std::vector<AnimationChannel*> channels;
-    std::vector<Node*> channelTargets;
-    std::vector<Curve*> curves;
-    std::vector<Vector3> vertices;
-    _jointBounds.resize(jointCount);
-
-    // Construct a list of all animation channels that target the joints affecting this mesh skin
-    DEBUGPRINT("> Collecting animations...\n");
-    DEBUGPRINT("> 0%%\r");
-    for (unsigned int i = 0; i < jointCount; ++i)
-    {
-        joint = _joints[i];
-
-        // Find all animations that target this joint
-        Animations* animations = GPBFile::getInstance()->getAnimations();
-        for (unsigned int j = 0, animationCount = animations->getAnimationCount(); j < animationCount; ++j)
-        {
-            Animation* animation = animations->getAnimation(j);
-            for (unsigned int k = 0, channelCount = animation->getAnimationChannelCount(); k < channelCount; ++k)
-            {
-                AnimationChannel* channel = animation->getAnimationChannel(k);
-                if (channel->getTargetId() == joint->getId())
-                {
-                    if (find(channels.begin(), channels.end(), channel) == channels.end())
-                    {
-                        channels.push_back(channel);
-                        channelTargets.push_back(joint);
-                    }
-                }
-            }
-        }
-
-        // Calculate the local bounding volume for this joint
-        vertices.clear();
-        BoundingVolume jointBounds;
-        jointBounds.min.set(FLT_MAX, FLT_MAX, FLT_MAX);
-        jointBounds.max.set(-FLT_MAX, -FLT_MAX, -FLT_MAX);
-        for (unsigned int j = 0; j < vertexCount; ++j)
-        {
-            const Vertex& v = _mesh->getVertex(j);
-
-            if ((v.blendIndices.x == i && !ISZERO(v.blendWeights.x)) ||
-                (v.blendIndices.y == i && !ISZERO(v.blendWeights.y)) ||
-                (v.blendIndices.z == i && !ISZERO(v.blendWeights.z)) ||
-                (v.blendIndices.w == i && !ISZERO(v.blendWeights.w)))
-            {
-                vertices.push_back(v.position);
-                // Update box min/max
-                if (v.position.x < jointBounds.min.x)
-                    jointBounds.min.x = v.position.x;
-                if (v.position.y < jointBounds.min.y)
-                    jointBounds.min.y = v.position.y;
-                if (v.position.z < jointBounds.min.z)
-                    jointBounds.min.z = v.position.z;
-                if (v.position.x > jointBounds.max.x)
-                    jointBounds.max.x = v.position.x;
-                if (v.position.y > jointBounds.max.y)
-                    jointBounds.max.y = v.position.y;
-                if (v.position.z > jointBounds.max.z)
-                    jointBounds.max.z = v.position.z;
-            }
-        }
-        if (vertices.size() > 0)
-        {
-            // Compute center point
-            Vector3::add(jointBounds.min, jointBounds.max, &jointBounds.center);
-            jointBounds.center.scale(0.5f);
-            // Compute radius
-            for (unsigned int j = 0, jointVertexCount = vertices.size(); j < jointVertexCount; ++j)
-            {
-                float d = jointBounds.center.distanceSquared(vertices[j]);
-                if (d > jointBounds.radius)
-                    jointBounds.radius = d;
-            }
-            jointBounds.radius = sqrt(jointBounds.radius);
-        }
-        _jointBounds[i] = jointBounds;
-
-        DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)jointCount * 100.0f));
-    }
-    DEBUGPRINT("\n");
-
-    unsigned int channelCount = channels.size();
-
-    // Create a Curve for each animation channel
-    float maxDuration = 0.0f;
-    DEBUGPRINT("> Building animation curves...\n");
-    DEBUGPRINT("> 0%%\r");
-    for (unsigned int i = 0; i < channelCount; ++i)
-    {
-        AnimationChannel* channel = channels[i];
-
-        const std::vector<float>& keyTimes = channel->getKeyTimes();
-        unsigned int keyCount = keyTimes.size();
-        if (keyCount == 0)
-            continue;
-
-        // Create a curve for this animation channel
-        Curve* curve = NULL;
-        switch (channel->getTargetAttribute())
-        {
-        case Transform::ANIMATE_SCALE_ROTATE_TRANSLATE:
-            curve = new Curve(keyCount, 10);
-            curve->setQuaternionOffset(3);
-            break;
-        }
-        if (curve == NULL)
-        {
-            // Unsupported/not implemented curve type 
-            continue;
-        }
-
-        // Copy key values into a temporary array
-        unsigned int keyValuesCount = channel->getKeyValues().size();
-        float* keyValues = new float[keyValuesCount];
-        for (unsigned int j = 0; j < keyValuesCount; ++j)
-            keyValues[j] = channel->getKeyValues()[j];
-
-        // Determine animation duration
-        float startTime = keyTimes[0];
-        float duration = keyTimes[keyCount-1] - startTime;
-        if (duration > maxDuration)
-            maxDuration = duration;
-
-        if (duration > 0.0f)
-        {
-            // Set curve points
-            float* keyValuesPtr = keyValues;
-            for (unsigned int j = 0; j < keyCount; ++j)
-            {
-                // Store time normalized, between 0-1
-                float t = (keyTimes[j] - startTime) / duration;
-
-                // Set the curve point
-                // TODO: Handle other interpolation types
-                curve->setPoint(j, t, keyValuesPtr, gameplay::Curve::LINEAR);
-
-                // Move to the next point on the curve
-                keyValuesPtr += curve->getComponentCount();
-            }
-            curves.push_back(curve);
-        }
-
-        delete[] keyValues;
-        keyValues = NULL;
-
-        DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)channelCount * 100.0f));
-    }
-    DEBUGPRINT("\n");
-
-    // Compute a total combined bounding volume for the MeshSkin that contains all possible
-    // vertex positions for all animations targetting the skin. This rough approximation allows
-    // us to store a volume that can be used for rough intersection tests (such as for visibility
-    // determination) efficiently at runtime.
-
-    // Backup existing node transforms so we can restore them when we are finished
-    Matrix* oldTransforms = new Matrix[jointCount];
-    for (unsigned int i = 0; i < jointCount; ++i)
-    {
-        memcpy(oldTransforms[i].m, _joints[i]->getTransformMatrix().m, 16 * sizeof(float));
-    }
-
-    float time = 0.0f;
-    float srt[10];
-    Matrix temp;
-    Matrix* jointTransforms = new Matrix[jointCount];
-    _mesh->bounds.min.set(FLT_MAX, FLT_MAX, FLT_MAX);
-    _mesh->bounds.max.set(-FLT_MAX, -FLT_MAX, -FLT_MAX);
-    _mesh->bounds.center.set(0, 0, 0);
-    _mesh->bounds.radius = 0;
-    Vector3 skinnedPos;
-    Vector3 tempPos;
-    DEBUGPRINT("> Evaluating joints...\n");
-    DEBUGPRINT("> 0%%\r");
-    BoundingVolume finalBounds;
-    while (time <= maxDuration)
-    {
-        // Evaluate joint transforms at this time interval
-        for (unsigned int i = 0, curveCount = curves.size(); i < curveCount; ++i)
-        {
-            Node* joint = channelTargets[i];
-            Curve* curve = curves[i];
-
-            // Evalulate the curve at this time to get the new value
-            float tn = time / maxDuration;
-            if (tn > 1.0f)
-                tn = 1.0f;
-            curve->evaluate(tn, srt);
-
-            // Update the joint's local transform
-            Matrix::createTranslation(srt[7], srt[8], srt[9], temp.m);
-            temp.rotate(*((Quaternion*)&srt[3]));
-            temp.scale(srt[0], srt[1], srt[2]);
-            joint->setTransformMatrix(temp.m);
-        }
-
-        // Store the final matrix pallette of resovled world space joint matrices
-        std::vector<Matrix>::const_iterator bindPoseItr = _bindPoses.begin();
-        for (unsigned int i = 0; i < jointCount; ++i, bindPoseItr++)
-        {
-            BoundingVolume bounds = _jointBounds[i];
-            if (ISZERO(bounds.radius))
-                continue;
-
-            Matrix& m = jointTransforms[i];
-            Matrix::multiply(_joints[i]->getWorldMatrix().m, bindPoseItr->m, m.m);
-            Matrix::multiply(m.m, _bindShape, m.m);
-
-            // Get a world-space bounding volume for this joint
-            bounds.transform(m);
-            if (ISZERO(finalBounds.radius))
-                finalBounds = bounds;
-            else
-                finalBounds.merge(bounds);
-        }
-
-        // Increment time by 1/30th of second (~ 33 ms)
-        if (time < maxDuration && (time + 33.0f) > maxDuration)
-            time = maxDuration;
-        else
-            time += 33.0f;
-
-        DEBUGPRINT_VARG("> %d%%\r", (int)(time / maxDuration * 100.0f));
-    }
-    DEBUGPRINT("\n");
-
-    // Update the bounding sphere for the mesh
-    _mesh->bounds = finalBounds;
-
-    // Restore original joint transforms
-    for (unsigned int i = 0; i < jointCount; ++i)
-    {
-        _joints[i]->setTransformMatrix(oldTransforms[i].m);
-    }
-
-    // Cleanup
-    for (unsigned int i = 0, curveCount = curves.size(); i < curveCount; ++i)
-    {
-        delete curves[i];
-    }
-    delete[] oldTransforms;
-    delete[] jointTransforms;
-
-    // Restore removed joints
-    if (rootJointParent)
-    {
-        rootJointParent->addChild(rootJoint);
-    }
-}
-
-}

+ 0 - 73
gameplay-encoder/src/MeshSkin.h

@@ -1,73 +0,0 @@
-#ifndef MESHSKIN_H_
-#define MESHSKIN_H_
-
-#include "Base.h"
-#include "Object.h"
-#include "Matrix.h"
-#include "Animation.h"
-#include "BoundingVolume.h"
-
-namespace gameplay
-{
-
-class Node;
-class Mesh;
-
-class MeshSkin : public Object
-{
-    friend class Model;
-
-public:
-
-    /**
-     * Constructor.
-     */
-    MeshSkin(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~MeshSkin(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    void setBindShape(const float data[]);
-
-    void setVertexInfluenceCount(unsigned int count);
-
-    void setJointNames(const std::vector<std::string>& list);
-
-    const std::vector<std::string>& getJointNames();
-
-    void setJoints(const std::vector<Node*>& list);
-
-    void setBindPoses(std::vector<Matrix>& list);
-
-    /**
-     * Returns true if the MeshSkin contains a joint with the given ID.
-     * 
-     * @param id The ID of the joint to search for.
-     * 
-     * @return True if the joint belongs to this skin, false otherwise.
-     */
-    bool hasJoint(const char* id);
-
-    void computeBounds();
-
-private:
-
-    Mesh* _mesh;
-    float _bindShape[16];
-    std::vector<Node*> _joints;
-    std::vector<Matrix> _bindPoses;
-    std::vector<std::string> _jointNames;
-    unsigned int _vertexInfluenceCount;
-    std::vector<BoundingVolume> _jointBounds;
-};
-
-}
-
-#endif

+ 0 - 40
gameplay-encoder/src/MeshSubSet.cpp

@@ -1,40 +0,0 @@
-#include "MeshSubSet.h"
-
-namespace gameplay
-{
-
-MeshSubSet::MeshSubSet(void)
-{
-    
-}
-
-
-MeshSubSet::~MeshSubSet(void)
-{
-}
-
-unsigned int MeshSubSet::getTypeId(void)
-{
-    return MESHPART_ID;
-}
-    
-const char* MeshSubSet::getElementName(void)
-{
-    return "MeshSubSet";
-}
-
-void MeshSubSet::writeBinary(FILE* file)
-{
-    write(getTypeId(), file);
-
-}
-void MeshSubSet::writeText(FILE* file)
-{
-    fprintElementStart(file);
-
-    fprintfElement(file, "%d ", "indices", indices);
-
-    fprintElementEnd(file);
-}
-
-}

+ 0 - 31
gameplay-encoder/src/MeshSubSet.h

@@ -1,31 +0,0 @@
-#ifndef MESHSUBSET_H_
-#define MESHSUBSET_H_
-
-#include "Base.h"
-#include "Object.h"
-#include "Vertex.h"
-
-namespace gameplay 
-{
-
-class MeshSubSet : public Object
-{
-public:
-    MeshSubSet(void);
-    virtual ~MeshSubSet(void);
-
-    virtual unsigned int getTypeId(void);
-    virtual const char* getElementName(void);
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    std::vector<Vertex*> vertices;
-    std::vector<int> indices;
-    //Set<Vertex*, int> vertexLookupTable;
-    std::map<Vertex, int> vertexLookupTable;
-};
-
-}
-
-#endif
-

+ 0 - 105
gameplay-encoder/src/Model.cpp

@@ -1,105 +0,0 @@
-#include "Base.h"
-#include "Model.h"
-
-namespace gameplay
-{
-
-Model::Model(void) :
-    _mesh(NULL),
-    _meshSkin(NULL)
-{
-}
-
-Model::~Model(void)
-{
-}
-
-unsigned int Model::getTypeId(void) const
-{
-    return MODEL_ID;
-}
-const char* Model::getElementName(void) const
-{
-    return "Model";
-}
-void Model::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-
-    // xref:Mesh
-    if (_mesh != NULL)
-    {
-        _mesh->writeBinaryXref(file);
-    }
-    else
-    {
-        write((unsigned int)0, file);
-    }
-    // _meshSkin
-    // Write one unsigned char to indicate if this model has a skin
-    if (_meshSkin != NULL)
-    {
-        write((bool)true, file); // has a skin
-        _meshSkin->writeBinary(file);
-    }
-    else
-    {
-        write((bool)false, file); // doesn't have a skin
-    }
-    // materials[]
-    writeBinaryObjects(_materials, file);
-
-}
-
-void Model::writeText(FILE* file)
-{
-    // Compute mesh bounds before writing
-
-    fprintElementStart(file);
-    if (_mesh != NULL)
-    {
-        fprintfElement(file, "ref", _mesh->getId());
-    }
-    if (_meshSkin != NULL)
-    {
-        _meshSkin->writeText(file);
-    }
-    fprintElementEnd(file);
-}
-
-MeshSkin* Model::getSkin()
-{
-    return _meshSkin;
-}
-
-Mesh* Model::getMesh()
-{
-    return _mesh;
-}
-
-void Model::setMesh(Mesh* mesh)
-{
-    _mesh = mesh;
-
-    if (mesh)
-    {
-        mesh->model = this;
-    }
-
-    if (_mesh && _meshSkin)
-    {
-        _meshSkin->_mesh = _mesh;
-    }
-}
-
-void Model::setSkin(MeshSkin* skin)
-{
-    _meshSkin = skin;
-
-    if (_meshSkin)
-    {
-        _meshSkin->_mesh = _mesh;
-    }
-}
-
-}

+ 0 - 45
gameplay-encoder/src/Model.h

@@ -1,45 +0,0 @@
-#ifndef MODEL_H_
-#define MODEL_H_
-
-#include "Object.h"
-#include "Mesh.h"
-#include "MeshSkin.h"
-#include "Material.h"
-
-namespace gameplay
-{
-
-class Model : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Model(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Model(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    Mesh* getMesh();
-    void setMesh(Mesh* mesh);
-    MeshSkin* getSkin();
-    void setSkin(MeshSkin* skin);
-
-private:
-
-    Mesh* _mesh;
-    MeshSkin* _meshSkin;
-    std::list<Material*> _materials;
-};
-
-}
-
-#endif

+ 0 - 354
gameplay-encoder/src/Node.cpp

@@ -1,354 +0,0 @@
-#include "Base.h"
-#include "Node.h"
-#include "Matrix.h"
-#include "EncoderArguments.h"
-
-#define NODE 1
-#define JOINT 2
-
-namespace gameplay
-{
-
-Node::Node(void) :
-    _childCount(0),
-    _nextSibling(NULL), _previousSibling(NULL),
-    _firstChild(NULL), _lastChild(NULL), _parent(NULL),
-    _camera(NULL), _light(NULL), _model(NULL), _joint(false)
-{
-}
-
-Node::~Node(void)
-{
-}
-
-unsigned int Node::getTypeId(void) const
-{
-    return NODE_ID;
-}
-
-const char* Node::getElementName(void) const
-{
-    return "Node";
-}
-
-void Node::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-
-    // node type
-    unsigned int type = _joint ? JOINT : NODE;
-    write(type, file);
-
-    write(_transform.m, 16, file);
-
-    // write parent's id
-    write((_parent) ? _parent->getId() : std::string(), file);
-
-    // children
-    write(getChildCount(), file); // write number of children
-    for (Node* node = getFirstChild(); node != NULL; node = node->getNextSibling())
-    {
-        node->writeBinary(file);
-    }
-
-    // camera
-    if (_camera != NULL)
-    {
-        _camera->writeBinary(file);
-    }
-    else
-    {
-        write((unsigned char)0, file);
-    }
-    // light
-    if (_light != NULL && !_light->isAmbient())
-    {
-        _light->writeBinary(file);
-    }
-    else
-    {
-        write((unsigned char)0, file);
-    }
-    // mesh
-    if (_model != NULL)
-    {
-        _model->writeBinary(file);
-    }
-    else
-    {
-        writeZero(file);
-    }
-
-    generateHeightmap();
-}
-
-void Node::writeText(FILE* file)
-{
-    if (isJoint())
-    {
-        fprintf(file, "<%s id=\"%s\" type=\"%s\">\n", getElementName(), getId().c_str(), "JOINT");
-    }
-    else
-    {
-        fprintElementStart(file);
-    }
-    fprintf(file, "<transform>");
-    fprintfMatrix4f(file, _transform.m);
-    fprintf(file, "</transform>\n");
-
-    // children
-    for (Node* node = getFirstChild(); node != NULL; node = node->getNextSibling())
-    {
-        node->writeText(file);
-    }
-    // camera
-    if (_camera != NULL)
-    {
-        _camera->writeText(file);
-    }
-    // light
-    if (_light != NULL && !_light->isAmbient())
-    {
-        _light->writeText(file);
-    }
-    // mesh
-    if (_model != NULL)
-    {
-        _model->writeText(file);
-    }
-    fprintElementEnd(file);
-
-    generateHeightmap();
-}
-
-void Node::generateHeightmap()
-{
-    // Is this node flagged to have a heightmap generated for it?
-    const std::vector<std::string>& heightmapNodes = EncoderArguments::getInstance()->getHeightmapNodeIds();
-    if (std::find(heightmapNodes.begin(), heightmapNodes.end(), getId()) != heightmapNodes.end())
-    {
-        Mesh* mesh = _model ? _model->getMesh() : NULL;
-        if (mesh)
-        {
-            DEBUGPRINT_VARG("> Generating heightmap for node: %s\n", getId().c_str());
-
-            std::string heightmapFilename(EncoderArguments::getInstance()->getOutputPath());
-            heightmapFilename += "/heightmap_";
-            heightmapFilename += getId();
-            heightmapFilename += ".png";
-
-            mesh->generateHeightmap(heightmapFilename.c_str());
-        }
-    }
-}
-
-void Node::addChild(Node* child)
-{
-    // If this child is already parented, remove it from its parent
-    if (child->_parent)
-    {
-        child->_parent->removeChild(child);
-    }
-
-    if (_firstChild == NULL)
-    {
-        // No children yet
-        _firstChild = child;
-        child->_previousSibling = NULL;
-    }
-    else
-    {
-        // We already have children, so append to them
-        child->_previousSibling = _lastChild;
-        _lastChild->_nextSibling = child;
-    }
-
-    child->_parent = this;
-    child->_nextSibling = NULL;
-    this->_lastChild = child;
-
-    ++_childCount;
-}
-
-
-void Node::removeChild(Node* child)
-{
-    // The child must have already been our child to remove it
-    if (child->_parent != this)
-    {
-        return;
-    }
-
-    // Remove the child by un-linking it from our child list
-    if (child->_nextSibling)
-    {
-        child->_nextSibling->_previousSibling = child->_previousSibling;
-    }
-    if (child->_previousSibling)
-    {
-        child->_previousSibling->_nextSibling = child->_nextSibling;
-    }
-
-    // Was this child our first or last child?
-    if (child == _firstChild)
-    {
-        _firstChild = child->_nextSibling;
-    }
-    if (child == _lastChild)
-    {
-        _lastChild = child->_previousSibling;
-    }
-
-    // Remove parent and sibling info from the child, now that it is no longer parented
-    child->_parent = NULL;
-    child->_nextSibling = NULL;
-    child->_previousSibling = NULL;
-
-    --_childCount;
-}
-
-void Node::removeChildren()
-{
-    Node* child;
-    while ((child = _firstChild) != NULL)
-    {
-        removeChild(child);
-    }
-}
-
-bool Node::hasChildren() const
-{
-    return (_firstChild != NULL);
-}
-
-unsigned int Node::getChildCount() const
-{
-    return _childCount;
-}
-
-Node* Node::getNextSibling() const
-{
-    return _nextSibling;
-}
-
-Node* Node::getPreviousSibling() const
-{
-    return _previousSibling;
-}
-
-Node* Node::getFirstChild() const
-{
-    return _firstChild;
-}
-
-Node* Node::getLastChild() const
-{
-    return _lastChild;
-}
-
-Node* Node::getParent() const
-{
-    return _parent;
-}
-
-void Node::setCamera(Camera* camera)
-{
-    _camera = camera;
-}
-
-void Node::setLight(Light* light)
-{
-    _light = light;
-}
-
-void Node::setModel(Model* model)
-{
-    _model = model;
-}
-
-const Matrix& Node::getTransformMatrix() const
-{
-    return _transform;
-}
-
-void Node::setTransformMatrix(float matrix[])
-{
-    memcpy(_transform.m, matrix, 16 * sizeof(float));
-}
-
-const Matrix& Node::getWorldMatrix() const
-{
-    if (_parent)
-    {
-        Matrix::multiply(_parent->getWorldMatrix().m, _transform.m, _worldTransform.m);
-    }
-    else
-    {
-        memcpy(_worldTransform.m, _transform.m, 16 * sizeof(float));
-    }
-
-    return _worldTransform;
-}
-
-void Node::resetTransformMatrix()
-{
-    Matrix::setIdentity(_transform.m);
-}
-
-void Node::setIsJoint(bool value)
-{
-    _joint = value;
-}
-
-bool Node::isJoint() const
-{
-    return _joint;
-}
-
-Camera* Node::getCamera() const
-{
-    return _camera;
-}
-
-Light* Node::getLight() const
-{
-    return _light;
-}
-
-Model* Node::getModel() const
-{
-    if (_model)
-    {
-        return _model;
-    }
-    return NULL;
-}
-
-Node* Node::getFirstCameraNode() const
-{
-    if (hasCamera())
-    {
-        return const_cast<Node*>(this);
-    }
-    for (Node* node = getFirstChild(); node != NULL; node = node->getNextSibling())
-    {
-        Node* n = node->getFirstCameraNode();
-        if (n)
-        {
-            return n;
-        }
-    }
-    return NULL;
-}
-
-bool Node::hasCamera() const
-{
-    return _camera != NULL;
-}
-
-bool Node::hasLight() const
-{
-    return _light != NULL;
-}
-
-}

+ 0 - 199
gameplay-encoder/src/Node.h

@@ -1,199 +0,0 @@
-#ifndef NODE_H_
-#define NODE_H_
-
-#include "Object.h"
-#include "Camera.h"
-#include "Light.h"
-#include "Model.h"
-
-namespace gameplay
-{
-
-class Node : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Node(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Node(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    /**
-     * Adds a child node.
-     *
-     * If the ownChild is true. The child is deleted when this
-     * node is deleted.
-     *
-     * @param child The child to add.
-     */
-    void addChild(Node* child);
-
-    /**
-     * Removes a child node.
-     *
-     * If no longer referenced it destroys the node.
-     * To avoid destroy on changing hierarchy, ensure you add first before removing.
-     *
-     * @param child The child to remove.
-     */
-    void removeChild(Node* child);
-
-    /**
-     * Removes all the child node.
-     */
-    void removeChildren();
-
-    /**
-     * Determines if this node has child nodes.
-     *
-     * @return true if it has 1 or more children; false if otherwise.
-     */
-    bool hasChildren() const;
-
-    /**
-     * Get the number of children for this node.
-     *
-     * @return The number of child nodes for this node.
-     */
-    unsigned int getChildCount() const;
-
-    /**
-     * Gets the next sibling node.
-     *
-     * @return The next sibling node.
-     */
-    Node* getNextSibling() const;
-
-    /**
-     * Gets the previous sibling node.
-     *
-     * @return The previous sibling node.
-     */
-    Node* getPreviousSibling() const;
-
-    /**
-     * Gets the first child node.
-     *
-     * @return The first child node.
-     */
-    Node* getFirstChild() const;
-
-    /**
-     * Gets the last child node.
-     *
-     * @return The last child node.
-     */
-    Node* getLastChild() const;
-
-    /**
-     * Gets the parent node.
-     *
-     * @return The parent node.
-     */
-    Node* getParent() const;
-
-    /**
-     * Returns the Camera for this node.
-     * 
-     * @return The camera for this node or NULL if no camera is set.
-     */
-    Camera* getCamera() const;
-
-    /**
-     * Returns the Light for this node.
-     * 
-     * @return The light for this node or NULL if no light is set.
-     */
-    Light* getLight() const;
-
-    /**
-     * Returns the Model of this node.
-     * 
-     * @return The model for this node or NULL if no model is set.
-     */
-    Model* getModel() const;
-
-    /**
-     * Returns the transform matrix for the node.
-     */
-    const Matrix& getTransformMatrix() const;
-
-    /**
-     * Sets the transform for this node.
-     */
-    void setTransformMatrix(float matrix[]);
-
-    /**
-     * Returns the resolved world matrix for the node.
-     */
-    const Matrix& getWorldMatrix() const;
-
-    /*
-     * Resets the node's transform matrix to the identity matrix.
-     */
-    void resetTransformMatrix();
-
-    void setCamera(Camera* camera);
-    void setLight(Light* light);
-    void setModel(Model* model);
-
-    /**
-     * Sets if this node is a joint node.
-     */
-    void setIsJoint(bool value);
-
-    /**
-     * Returns true if this is a joint node.
-     */
-    bool isJoint() const;
-
-    Node* getFirstCameraNode() const;
-
-    /**
-     * Returns true if this node has a camera.
-     */
-    bool hasCamera() const;
-
-    /**
-     * Returns true if this node has a light.
-     */
-    bool hasLight() const;
-    
-private:
-
-    /**
-     * Internal method to generate heightmap for a node's mesh data
-     * if the node was flagged as a heightmap via encoder arguments.
-     */
-    void generateHeightmap();
-
-    Matrix _transform;
-    mutable Matrix _worldTransform;
-
-    int _childCount;
-    Node* _nextSibling;
-    Node* _previousSibling;
-    Node* _firstChild;
-    Node* _lastChild;
-    Node* _parent;
-
-    Camera* _camera;
-    Light* _light;
-    Model* _model;
-
-    bool _joint;
-};
-
-}
-
-#endif

+ 0 - 80
gameplay-encoder/src/Object.cpp

@@ -1,80 +0,0 @@
-#include "Base.h"
-#include "Object.h"
-
-namespace gameplay
-{
-
-Object::Object(void) : _fposition(0)
-{
-}
-
-Object::~Object(void)
-{
-}
-
-unsigned int Object::getTypeId(void) const
-{
-    return 0;
-}
-
-void Object::writeBinary(FILE* file)
-{
-    saveFilePosition(file);
-}
-
-const std::string& Object::getId() const
-{
-    return _id;
-}
-
-void Object::setId(const char* idStr)
-{
-    if (idStr)
-    {
-        _id = idStr;
-    }
-}
-
-void Object::setId(const std::string& newId)
-{
-    if (newId.length() > 0)
-    {
-        _id = newId;
-    }
-}
-
-void Object::fprintElementStart(FILE* file)
-{
-    if (_id.length() > 0)
-    {
-        fprintf(file, "<%s id=\"%s\">\n", getElementName(), _id.c_str());
-    }
-    else
-    {
-        fprintf(file, "<%s>\n", getElementName());
-    }
-}
-
-void Object::fprintElementEnd(FILE* file)
-{
-    fprintf(file, "</%s>\n", getElementName());
-}
-
-unsigned int Object::getFilePosition()
-{
-    return (unsigned int)_fposition;
-}
-
-void Object::saveFilePosition(FILE* file)
-{
-    _fposition = ftell(file);
-}
-
-void Object::writeBinaryXref(FILE* file)
-{
-    std::string xref("#");
-    xref.append(getId());
-    write(xref, file);
-}
-
-}

+ 0 - 150
gameplay-encoder/src/Object.h

@@ -1,150 +0,0 @@
-#ifndef OBJ_H_
-#define OBJ_H_
-
-#include "FileIO.h"
-
-namespace gameplay
-{
-
-/**
- * Object is the abstract base class of all the objects that can be written in the GamePlay Binary file.
- */
-class Object
-{
-public:
-
-    // TypeID's
-    enum TypeID
-    {
-        SCENE_ID = 1,
-        NODE_ID = 2,
-        ANIMATIONS_ID = 3,
-        ANIMATION_ID = 4,
-        ANIMATIONCHANNEL_ID = 5,
-        NODEINSTANCE_ID = 8,
-        MODEL_ID = 11,
-        MATERIAL_ID = 16,
-        EFFECT_ID = 17,
-        CAMERA_ID = 32,
-        LIGHT_ID = 33,
-        MESH_ID = 34,
-        MESHPART_ID = 35,
-        MESHSKIN_ID = 36,
-        FONT_ID = 128,
-    };
-
-    /**
-     * Constructor.
-     */
-    Object(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Object(void);
-
-    /**
-     * Returns the Object TypeID.
-     */
-    virtual unsigned int getTypeId(void) const;
-
-    /**
-     * Returns the string element name of the object.
-     * Used for printing the gameplayfile as text.
-     */
-    virtual const char* getElementName(void) const = 0;
-
-    /**
-     * Writes this object to the file stream as binary.
-     */
-    virtual void writeBinary(FILE* file);
-
-    /**
-     * Writes this object to the file stream as text.
-     */
-    virtual void writeText(FILE* file) = 0;
-
-    /**
-     * Returns this objects id string.
-     */
-    const std::string& getId() const;
-
-    /**
-     * Sets this object's id string.
-     */
-    void setId(const char* id);
-
-    /**
-     * Sets this object's id string.
-     */
-    void setId(const std::string& id);
-
-    /**
-     * Prints an XML start element with the name of this object to the text file stream.
-     * Also prints the id as an attribute if the id length is greater than zero.
-     */
-    void fprintElementStart(FILE* file);
-
-    /**
-     * Prints an XML end element with the name of this object to the text file stream.
-     */
-    void fprintElementEnd(FILE* file);
-
-    /**
-     * Writes the xref of this object to the binary file stream.
-     */
-    void writeBinaryXref(FILE* file);
-
-    /**
-     * Returns the file position that this object was written to.
-     * An offset of zero means this object has not been written yet.
-     */
-    unsigned int getFilePosition();
-
-    /**
-     * Writes out a list of objects to a binary file stream.
-     */
-    template <class T>
-    static void writeBinaryObjects(std::list<T> list, FILE* file)
-    {
-        // First write the size of the list
-        write(list.size(), file);
-        // Then write each element
-        typename std::list<T>::const_iterator i;
-        for (i = list.begin(); i != list.end(); ++i)
-        {
-            (*i)->writeBinary(file);
-        }
-    }
-
-    /**
-     * Writes out a vector of objects to a binary file stream.
-     */
-    template <class T>
-    static void writeBinaryObjects(std::vector<T> vector, FILE* file)
-    {
-        // First write the size of the vector
-        write(vector.size(), file);
-        // Then write each element
-        typename std::vector<T>::const_iterator i;
-        for (i = vector.begin(); i != vector.end(); ++i)
-        {
-            (*i)->writeBinary(file);
-        }
-    }
-
-private:
-
-    /**
-     * Saves where this object was written to in the binary file.
-     */
-    void saveFilePosition(FILE* file);
-
-private:
-    std::string _id;
-    long _fposition;
-};
-
-}
-
-#endif

+ 0 - 400
gameplay-encoder/src/Quaternion.cpp

@@ -1,400 +0,0 @@
-#include "Base.h"
-#include "Quaternion.h"
-
-namespace gameplay
-{
-
-Quaternion::Quaternion()
-    : x(0.0f), y(0.0f), z(0.0f), w(1.0f)
-{
-}
-
-Quaternion::Quaternion(float x, float y, float z, float w)
-{
-    set(x, y, z, w);
-}
-
-Quaternion::Quaternion(float* array)
-{
-    set(array);
-}
-
-Quaternion::Quaternion(const Vector3& axis, float angle)
-{
-    set(axis, angle);
-}
-
-Quaternion::Quaternion(const Quaternion& copy)
-{
-    set(copy);
-}
-
-Quaternion::~Quaternion()
-{
-}
-
-const Quaternion& Quaternion::identity()
-{
-    static Quaternion value(0.0f, 0.0f, 0.0f, 1.0f);
-    return value;
-}
-
-const Quaternion& Quaternion::zero()
-{
-    static Quaternion value(0.0f, 0.0f, 0.0f, 0.0f);
-    return value;
-}
-
-bool Quaternion::isIdentity() const
-{
-    return x == 0.0f && y == 0.0f && z == 0.0f && w == 1.0f;
-}
-
-bool Quaternion::isZero() const
-{
-    return x == 0.0f && y == 0.0f && z == 0.0f && z == 0.0f;
-}
-
-void Quaternion::createFromAxisAngle(const Vector3& axis, float angle, Quaternion* dst)
-{
-    assert(dst);
-
-    float halfAngle = angle * 0.5f;
-    float sinHalfAngle = sinf(halfAngle);
-
-    Vector3 normal(axis);
-    normal.normalize();
-    dst->x = normal.x * sinHalfAngle;
-    dst->y = normal.y * sinHalfAngle;
-    dst->z = normal.z * sinHalfAngle;
-    dst->w = cosf(halfAngle);
-}
-
-void Quaternion::conjugate()
-{
-    conjugate(this);
-}
-
-void Quaternion::conjugate(Quaternion* dst) const
-{
-    dst->x = -x;
-    dst->y = -y;
-    dst->z = -z;
-    dst->w =  w;
-}
-
-bool Quaternion::inverse()
-{
-    return inverse(this);
-}
-
-bool Quaternion::inverse(Quaternion* dst) const
-{
-    float n = x * x + y * y + z * z + w * w;
-    if (n == 1.0f)
-    {
-        dst->x = -x;
-        dst->y = -y;
-        dst->z = -z;
-        dst->w = w;
-
-        return true;
-    }
-
-    // too close to zero
-    if (n < 0.000001f)
-        return false;
-
-    n = 1.0f / n;
-    dst->x = -x * n;
-    dst->y = -y * n;
-    dst->z = -z * n;
-    dst->w = w * n;
-
-    return true;
-}
-
-void Quaternion::multiply(const Quaternion& q)
-{
-    multiply(*this, q, this);
-}
-
-void Quaternion::multiply(const Quaternion& q1, const Quaternion& q2, Quaternion* dst)
-{
-    float x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y;
-    float y = q1.w * q2.y - q1.x * q2.z + q1.y * q2.w + q1.z * q2.x;
-    float z = q1.w * q2.z + q1.x * q2.y - q1.y * q2.x + q1.z * q2.w;
-    float w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z;
-
-    dst->x = x;
-    dst->y = y;
-    dst->z = z;
-    dst->w = w;
-}
-
-void Quaternion::normalize()
-{
-    normalize(this);
-}
-
-void Quaternion::normalize(Quaternion* dst) const
-{
-    assert(dst);
-
-    if (this != dst)
-    {
-        dst->x = x;
-        dst->y = y;
-        dst->z = z;
-        dst->w = w;
-    }
-
-    float n = x * x + y * y + z * z + w * w;
-
-    // Already normalized.
-    if (n == 1.0f)
-        return;
-
-    n = sqrt(n);
-    // Too close to zero.
-    if (n < 0.000001f)
-        return;
-
-    n = 1.0f / n;
-    dst->x *= n;
-    dst->y *= n;
-    dst->z *= n;
-    dst->w *= n;
-}
-
-void Quaternion::set(float x, float y, float z, float w)
-{
-    this->x = x;
-    this->y = y;
-    this->z = z;
-    this->w = w;
-}
-
-void Quaternion::set(float* array)
-{
-    assert(array);
-
-    x = array[0];
-    y = array[1];
-    z = array[2];
-    w = array[3];
-}
-
-void Quaternion::set(const Vector3& axis, float angle)
-{
-    Quaternion::createFromAxisAngle(axis, angle, this);
-}
-
-void Quaternion::set(const Quaternion& q)
-{
-    this->x = q.x;
-    this->y = q.y;
-    this->z = q.z;
-    this->w = q.w;
-}
-
-void Quaternion::setIdentity()
-{
-    x = 0.0f;
-    y = 0.0f;
-    z = 0.0f;
-    w = 1.0f;
-}
-
-float Quaternion::toAxisAngle(Vector3* axis) const
-{
-    assert(axis);
-
-    Quaternion q(x, y, z, w);
-    q.normalize();
-    axis->x = q.x;
-    axis->y = q.y;
-    axis->z = q.z;
-    axis->normalize();
-
-    return (2.0f * acos(q.w));
-}
-
-void Quaternion::lerp(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst)
-{
-    assert(dst);
-    assert(!(t < 0.0f || t > 1.0f));
-
-    if (t == 0.0f)
-    {
-        memcpy(dst, &q1, sizeof(float) * 4);
-        return;
-    }
-    else if (t == 1.0f)
-    {
-        memcpy(dst, &q2, sizeof(float) * 4);
-        return;
-    }
-
-    float t1 = 1.0f - t;
-
-    dst->x = t1 * q1.x + t * q2.x;
-    dst->y = t1 * q1.y + t * q2.y;
-    dst->z = t1 * q1.z + t * q2.z;
-    dst->w = t1 * q1.w + t * q2.w;
-}
-
-void Quaternion::slerp(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst)
-{
-    slerp(q1.x, q1.y, q1.z, q1.w, q2.x, q2.y, q2.z, q2.w, t, &dst->x, &dst->y, &dst->z, &dst->w);
-}
-
-void Quaternion::squad(const Quaternion& q1, const Quaternion& q2, const Quaternion& s1, const Quaternion& s2, float t, Quaternion* dst)
-{
-    assert(dst);
-    assert(!(t < 0.0f || t > 1.0f));
-
-    Quaternion dstQ(0.0f, 0.0f, 0.0f, 1.0f);
-    Quaternion dstS(0.0f, 0.0f, 0.0f, 1.0f);
-
-    slerpForSquad(q1, q2, t, &dstQ);
-    slerpForSquad(s1, s2, t, &dstS);
-    slerpForSquad(dstQ, dstS, 2.0f * t * (1.0f - t), dst);
-}
-
-void Quaternion::slerp(float q1x, float q1y, float q1z, float q1w, float q2x, float q2y, float q2z, float q2w, float t, float* dstx, float* dsty, float* dstz, float* dstw)
-{
-    // Fast slerp implementation by kwhatmough:
-    // It contains no division operations, no trig, no inverse trig
-    // and no sqrt. Not only does this code tolerate small constraint
-    // errors in the input quaternions, it actually corrects for them.
-    assert(dstx && dsty && dstz && dstw);
-    assert(!(t < 0.0f || t > 1.0f));
-
-    if (t == 0.0f)
-    {
-        *dstx = q1x;
-        *dsty = q1y;
-        *dstz = q1z;
-        *dstw = q1w;
-        return;
-    }
-    else if (t == 1.0f)
-    {
-        *dstx = q2x;
-        *dsty = q2y;
-        *dstz = q2z;
-        *dstw = q2w;
-        return;
-    }
-
-    if (q1x == q2x && q1y == q2y && q1z == q2z && q1w == q2w)
-    {
-        *dstx = q1x;
-        *dsty = q1y;
-        *dstz = q1z;
-        *dstw = q1w;
-        return;
-    }
-
-    float halfY, alpha, beta;
-    float u, f1, f2a, f2b;
-    float ratio1, ratio2;
-    float halfSecHalfTheta, versHalfTheta;
-    float sqNotU, sqU;
-
-    float cosTheta = q1w * q2w + q1x * q2x + q1y * q2y + q1z * q2z;
-
-    // As usual in all slerp implementations, we fold theta.
-    alpha = cosTheta >= 0 ? 1.0f : -1.0f;
-    halfY = 1.0f + alpha * cosTheta;
-
-    // Here we bisect the interval, so we need to fold t as well.
-    f2b = t - 0.5f;
-    u = f2b >= 0 ? f2b : -f2b;
-    f2a = u - f2b;
-    f2b += u;
-    u += u;
-    f1 = 1.0f - u;
-
-    // One iteration of Newton to get 1-cos(theta / 2) to good accuracy.
-    halfSecHalfTheta = 1.09f - (0.476537f - 0.0903321f * halfY) * halfY;
-    halfSecHalfTheta *= 1.5f - halfY * halfSecHalfTheta * halfSecHalfTheta;
-    versHalfTheta = 1.0f - halfY * halfSecHalfTheta;
-
-    // Evaluate series expansions of the coefficients.
-    sqNotU = f1 * f1;
-    ratio2 = 0.0000440917108f * versHalfTheta;
-    ratio1 = -0.00158730159f + (sqNotU - 16.0f) * ratio2;
-    ratio1 = 0.0333333333f + ratio1 * (sqNotU - 9.0f) * versHalfTheta;
-    ratio1 = -0.333333333f + ratio1 * (sqNotU - 4.0f) * versHalfTheta;
-    ratio1 = 1.0f + ratio1 * (sqNotU - 1.0f) * versHalfTheta;
-
-    sqU = u * u;
-    ratio2 = -0.00158730159f + (sqU - 16.0f) * ratio2;
-    ratio2 = 0.0333333333f + ratio2 * (sqU - 9.0f) * versHalfTheta;
-    ratio2 = -0.333333333f + ratio2 * (sqU - 4.0f) * versHalfTheta;
-    ratio2 = 1.0f + ratio2 * (sqU - 1.0f) * versHalfTheta;
-
-    // Perform the bisection and resolve the folding done earlier.
-    f1 *= ratio1 * halfSecHalfTheta;
-    f2a *= ratio2;
-    f2b *= ratio2;
-    alpha *= f1 + f2a;
-    beta = f1 + f2b;
-
-    // Apply final coefficients to a and b as usual.
-    float w = alpha * q1w + beta * q2w;
-    float x = alpha * q1x + beta * q2x;
-    float y = alpha * q1y + beta * q2y;
-    float z = alpha * q1z + beta * q2z;
-
-    // This final adjustment to the quaternion's length corrects for
-    // any small constraint error in the inputs q1 and q2 But as you
-    // can see, it comes at the cost of 9 additional multiplication
-    // operations. If this error-correcting feature is not required,
-    // the following code may be removed.
-    f1 = 1.5f - 0.5f * (w * w + x * x + y * y + z * z);
-    *dstw = w * f1;
-    *dstx = x * f1;
-    *dsty = y * f1;
-    *dstz = z * f1;
-}
-
-void Quaternion::slerpForSquad(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst)
-{
-    // cos(omega) = q1 * q2;
-    // slerp(q1, q2, t) = (q1*sin((1-t)*omega) + q2*sin(t*omega))/sin(omega);
-    // q1 = +- q2, slerp(q1,q2,t) = q1.
-    // This is a straight-foward implementation of the formula of slerp. It does not do any sign switching.
-    float c = q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
-
-    if (fabs(c) >= 1.0f)
-    {
-        dst->x = q1.x;
-        dst->y = q1.y;
-        dst->z = q1.z;
-        dst->w = q1.w;
-        return;
-    }
-
-    float omega = acos(c);
-    float s = sqrt(1.0f - c * c);
-    if (fabs(s) <= 0.00001f)
-    {
-        dst->x = q1.x;
-        dst->y = q1.y;
-        dst->z = q1.z;
-        dst->w = q1.w;
-        return;
-    }
-
-    float r1 = sin((1 - t) * omega) / s;
-    float r2 = sin(t * omega) / s;
-    dst->x = (q1.x * r1 + q2.x * r2);
-    dst->y = (q1.y * r1 + q2.y * r2);
-    dst->z = (q1.z * r1 + q2.z * r2);
-    dst->w = (q1.w * r1 + q2.w * r2);
-}
-
-}

+ 0 - 364
gameplay-encoder/src/Quaternion.h

@@ -1,364 +0,0 @@
-#ifndef QUATERNION_H_
-#define QUATERNION_H_
-
-#include "Vector3.h"
-#include "Matrix.h"
-
-namespace gameplay
-{
-
-class Matrix;
-
-/**
- * Defines a 4-element quaternion that represents the orientation of an object in space.
- *
- * Quaternions are typically used as a replacement for euler angles and rotation matrices as a way to achieve smooth interpolation and avoid gimbal lock.
- *
- * Note that this quaternion class does not automatically keep the quaternion normalized. Therefore, care must be taken to normalize the quaternion when neccessary, by calling the normalize method.
- * The package provides three methods for doing quaternion interpolation: lerp, slerp, and squad.
- *
- * lerp (linear interpolation): the interpolation curve gives a straight line in quaternion space. It is simple and fast to compute. The only problem is that it does not provide constant angular velocity. Note that a constant velocity is not necessarily a requirement for a curve;
- * slerp (spherical linear interpolation): the interpolation curve forms a great arc on the quaternion unit sphere. Slerp provides constant angular velocity;
- * squad (spherical spline interpolation): interpolating between a series of rotations using slerp leads to the following problems:
- * - the curve is not smooth at the control points;
- * - the angular velocity is not constant;
- * - the angular velocity is not continuous at the control points.
- *
- * Since squad is continuously differentiable, it remedies the first and third problems mentioned above.
- * The slerp method provided here is intended for interpolation of principal rotations. It treats +q and -q as the same principal rotation and is at liberty to use the negative of either input. The resulting path is always the shorter arc.
- *
- * The lerp method provided here interpolates strictly in quaternion space. Note that the resulting path may pass through the origin if interpolating between a quaternion and its exact negative.
- *
- * As an example, consider the following quaternions:
- *
- * q1 = (0.6, 0.8, 0.0, 0.0),
- * q2 = (0.0, 0.6, 0.8, 0.0),
- * q3 = (0.6, 0.0, 0.8, 0.0), and
- * q4 = (-0.8, 0.0, -0.6, 0.0).
- * For the point p = (1.0, 1.0, 1.0), the following figures show the trajectories of p using lerp, slerp, and squad.
- */
-class Quaternion
-{
-    friend class Curve;
-
-public:
-
-    /**
-     * The x-value of the quaternion's vector component.
-     */
-    float x;
-    /**
-     * The y-value of the quaternion's vector component.
-     */
-    float y;
-    /**
-     * The z-value of the quaternion's vector component.
-     */
-    float z;
-    /**
-     * The scalar component of the quaternion.
-     */
-    float w;
-
-    /**
-     * Constructs a quaternion initialized to (0, 0, 0, 1).
-     */
-    Quaternion();
-
-    /**
-     * Constructs a quaternion initialized to (0, 0, 0, 1).
-     *
-     * @param x The x component of the quaternion.
-     * @param y The y component of the quaternion.
-     * @param z The z component of the quaternion.
-     * @param w The w component of the quaternion.
-     */
-    Quaternion(float x, float y, float z, float w);
-
-    /**
-     * Constructs a new quaternion from the values in the specified array.
-     *
-     * @param array The values for the new quaternion.
-     */
-    Quaternion(float* array);
-
-    /**
-     * Constructs a quaternion equal to the rotation from the specified axis and angle.
-     *
-     * @param axis A vector describing the axis of rotation.
-     * @param angle The angle of rotation (in radians).
-     */
-    Quaternion(const Vector3& axis, float angle);
-
-    /**
-     * Constructs a new quaternion that is a copy of the specified one.
-     *
-     * @param copy The quaternion to copy.
-     */
-    Quaternion(const Quaternion& copy);
-
-    /**
-     * Destructor.
-     */
-    ~Quaternion();
-
-    /**
-     * Returns the identity quaternion.
-     *
-     * @return The identity quaternion.
-     */
-    static const Quaternion& identity();
-
-    /**
-     * Returns the quaternion with all zeros.
-     *
-     * @return The quaternion.
-     */
-    static const Quaternion& zero();
-
-    /**
-     * Determines if this quaternion is equal to the identity quaternion.
-     *
-     * @return true if it is the identity quaternion, false otherwise.
-     */
-    bool isIdentity() const;
-
-    /**
-     * Determines if this quaternion is all zeros.
-     *
-     * @return true if this quaternion is all zeros, false otherwise.
-     */
-    bool isZero() const;
-
-    /**
-     * Creates this quaternion equal to the rotation from the specified axis and angle
-     * and stores the result in dst.
-     *
-     * @param axis A vector describing the axis of rotation.
-     * @param angle The angle of rotation (in radians).
-     * @param dst A quaternion to store the conjugate in.
-     */
-    static void createFromAxisAngle(const Vector3& axis, float angle, Quaternion* dst);
-
-    /**
-     * Sets this quaternion to the conjugate of itself.
-     */
-    void conjugate();
-
-    /**
-     * Gets the conjugate of this quaternion in dst.
-     *
-     * @param dst A quaternion to store the conjugate in.
-     */
-    void conjugate(Quaternion* dst) const;
-
-    /**
-     * Sets this quaternion to the inverse of itself.
-     *
-     * Note that the inverse of a quaternion is equal to its conjugate
-     * when the quaternion is unit-length. For this reason, it is more
-     * efficient to use the conjugate method directly when you know your
-     * quaternion is already unit-length.
-     *
-     * @return true if the inverse can be computed, false otherwise.
-     */
-    bool inverse();
-
-    /**
-     * Gets the inverse of this quaternion in dst.
-     *
-     * Note that the inverse of a quaternion is equal to its conjugate
-     * when the quaternion is unit-length. For this reason, it is more
-     * efficient to use the conjugate method directly when you know your
-     * quaternion is already unit-length.
-     *
-     * @param dst A quaternion to store the inverse in.
-     * 
-     * @return true if the inverse can be computed, false otherwise.
-     */
-    bool inverse(Quaternion* dst) const;
-
-    /**
-     * Multiplies this quaternion by the specified one and stores the result in this quaternion.
-     *
-     * @param q The quaternion to multiply.
-     */
-    void multiply(const Quaternion& q);
-
-    /**
-     * Multiplies the specified quaternions and stores the result in dst.
-     *
-     * @param q1 The first quaternion.
-     * @param q2 The second quaternion.
-     * @param dst A quaternion to store the result in.
-     */
-    static void multiply(const Quaternion& q1, const Quaternion& q2, Quaternion* dst);
-
-    /**
-     * Normalizes this quaternion to have unit length.
-     *
-     * If the quaternion already has unit length or if the length
-     * of the quaternion is zero, this method does nothing.
-     */
-    void normalize();
-
-    /**
-     * Normalizes this quaternion and stores the result in dst.
-     *
-     * If the quaternion already has unit length or if the length
-     * of the quaternion is zero, this method simply copies
-     * this vector into dst.
-     *
-     * @param dst A quaternion to store the result in.
-     */
-    void normalize(Quaternion* dst) const;
-
-    /**
-     * Sets the elements of the quaternion to the specified values.
-     *
-     * @param x The new x-value.
-     * @param y The new y-value.
-     * @param z The new z-value.
-     * @param w The new w-value.
-     */
-    void set(float x, float y, float z, float w);
-
-    /**
-     * Sets the elements of the quaternion from the values in the specified array.
-     *
-     * @param array An array containing the elements of the quaternion in the order x, y, z, w.
-     */
-    void set(float* array);
-
-    /**
-     * Sets the quaternion equal to the rotation from the specified axis and angle.
-     * 
-     * @param axis The axis of rotation.
-     * @param angle The angle of rotation (in radians).
-     */
-    void set(const Vector3& axis, float angle);
-
-    /**
-     * Sets the elements of this quaternion to a copy of the specified quaternion.
-     *
-     * @param q The quaternion to copy.
-     */
-    void set(const Quaternion& q);
-
-    /**
-     * Sets this quaternion to be equal to the identity quaternion.
-     */
-    void setIdentity();
-
-    /**
-     * Converts this Quaternion4f to axis-angle notation. The axis is normalized.
-     *
-     * @param e The Vector3f which stores the axis.
-     * 
-     * @return The angle (in radians).
-     */
-    float toAxisAngle(Vector3* e) const;
-
-    /**
-     * Interpolates between two quaternions using linear interpolation.
-     *
-     * The interpolation curve for linear interpolation between
-     * quaternions gives a straight line in quaternion space.
-     *
-     * @param q1 The first quaternion.
-     * @param q2 The second quaternion.
-     * @param t The interpolation coefficient.
-     * @param dst A quaternion to store the result in.
-     */
-    static void lerp(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst);
-    
-    /**
-     * Interpolates between two quaternions using spherical linear interpolation.
-     *
-     * Spherical linear interpolation provides smooth transitions between different
-     * orientations and is often useful for animating models or cameras in 3D.
-     *
-     * Note: For accurate interpolation, the input quaternions must be at (or close to) unit length.
-     * This method does not automatically normalize the input quaternions, so it is up to the
-     * caller to ensure they call normalize beforehand, if necessary.
-     *
-     * @param q1 The first quaternion.
-     * @param q2 The second quaternion.
-     * @param t The interpolation coefficient.
-     * @param dst A quaternion to store the result in.
-     */
-    static void slerp(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst);
-    
-    /**
-     * Interpolates over a series of quaternions using spherical spline interpolation.
-     *
-     * Spherical spline interpolation provides smooth transitions between different
-     * orientations and is often useful for animating models or cameras in 3D.
-     *
-     * Note: For accurate interpolation, the input quaternions must be unit.
-     * This method does not automatically normalize the input quaternions,
-     * so it is up to the caller to ensure they call normalize beforehand, if necessary.
-     *
-     * @param q1 The first quaternion.
-     * @param q2 The second quaternion.
-     * @param s1 The first control point.
-     * @param s2 The second control point.
-     * @param t The interpolation coefficient.
-     * @param dst A quaternion to store the result in.
-     */
-    static void squad(const Quaternion& q1, const Quaternion& q2, const Quaternion& s1, const Quaternion& s2, float t, Quaternion* dst);
-
-    /**
-     * Calculates the quaternion product of this quaternion with the given quaternion.
-     * 
-     * Note: this does not modify this quaternion.
-     * 
-     * @param q The quaternion to multiply.
-     * @return The quaternion product.
-     */
-    inline Quaternion operator*(const Quaternion& q) const;
-
-    /**
-     * Multiplies this quaternion with the given quaternion.
-     * 
-     * @param q The quaternion to multiply.
-     * @return This quaternion, after the multiplication occurs.
-     */
-    inline Quaternion& operator*=(const Quaternion& q);
-
-private:
-
-    /**
-     * Interpolates between two quaternions using spherical linear interpolation.
-     *
-     * Spherical linear interpolation provides smooth transitions between different
-     * orientations and is often useful for animating models or cameras in 3D.
-     *
-     * Note: For accurate interpolation, the input quaternions must be at (or close to) unit length.
-     * This method does not automatically normalize the input quaternions, so it is up to the
-     * caller to ensure they call normalize beforehand, if necessary.
-     *
-     * @param q1x The x component of the first quaternion.
-     * @param q1y The y component of the first quaternion.
-     * @param q1z The z component of the first quaternion.
-     * @param q1w The w component of the first quaternion.
-     * @param q2x The x component of the second quaternion.
-     * @param q2y The y component of the second quaternion.
-     * @param q2z The z component of the second quaternion.
-     * @param q2w The w component of the second quaternion.
-     * @param t The interpolation coefficient.
-     * @param dstx A pointer to store the x component of the slerp in.
-     * @param dsty A pointer to store the y component of the slerp in.
-     * @param dstz A pointer to store the z component of the slerp in.
-     * @param dstw A pointer to store the w component of the slerp in.
-     */
-    static void slerp(float q1x, float q1y, float q1z, float q1w, float q2x, float q2y, float q2z, float q2w, float t, float* dstx, float* dsty, float* dstz, float* dstw);
-
-    static void slerpForSquad(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst);
-};
-
-}
-
-#include "Quaternion.inl"
-
-#endif

+ 0 - 19
gameplay-encoder/src/Quaternion.inl

@@ -1,19 +0,0 @@
-#include "Quaternion.h"
-
-namespace gameplay
-{
-
-inline Quaternion Quaternion::operator*(const Quaternion& q) const
-{
-    Quaternion result(*this);
-    result.multiply(q);
-    return result;
-}
-
-inline Quaternion& Quaternion::operator*=(const Quaternion& q)
-{
-    multiply(q);
-    return *this;
-}
-
-}

+ 0 - 87
gameplay-encoder/src/Reference.cpp

@@ -1,87 +0,0 @@
-#include "Base.h"
-#include "Reference.h"
-
-namespace gameplay
-{
-
-Reference::Reference(void) :
-    _type(0),
-    _offset(0),
-    _ref(NULL)
-{
-}
-
-Reference::Reference(std::string _xref, Object* _ref) :
-    _xref(_xref),
-    _type(_ref->getTypeId()),
-    _offset(0),
-    _ref(_ref)
-{
-}
-
-Reference::~Reference(void)
-{
-}
-
-const char* Reference::getElementName(void) const
-{
-    return "Reference";
-}
-
-void Reference::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(_xref, file);
-    write(_type, file);
-    write(_offset, file);
-}
-void Reference::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "xref", _xref);
-    fprintfElement(file, "type", _type);
-    fprintfElement(file, "offset", _offset);
-    fprintElementEnd(file);
-}
-
-bool Reference::updateOffset(FILE* file)
-{
-    long newOffset = _ref->getFilePosition();
-    return updateOffset(file, newOffset);
-}
-
-bool Reference::updateOffset(FILE* file, long newOffset)
-{
-    if (getFilePosition() > 0)
-    {
-        // save the current offset
-        long savedOffset = ftell(file);
-
-        // update the offset data for this
-        _offset = newOffset;
-        // seek this Reference object in the file
-        fseek(file, getFilePosition(), SEEK_SET);
-
-        // skip over the object type
-        //fseek(file, sizeof(unsigned int), SEEK_CUR);
-        // skip over the id string
-        skipString(file);
-        // skip over the type
-        //skipUint(file);
-
-        // write over the old offset
-        write(_offset, file);
-
-        // restore the offset
-        fseek(file, savedOffset, SEEK_SET);
-        return true;
-    }
-    return false;
-}
-
-Object* Reference::getObj()
-{
-    return _ref;
-}
-
-}

+ 0 - 57
gameplay-encoder/src/Reference.h

@@ -1,57 +0,0 @@
-#ifndef REFERENCE_H_
-#define REFERENCE_H_
-
-#include "Object.h"
-
-namespace gameplay
-{
-
-class Reference : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Reference(void);
-    Reference(std::string _xref, Object* _ref);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Reference(void);
-
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    /**
-     * Updates the offset of this Reference object if it has already need written to file.
-     * @param file The file stream.
-     * 
-     * @return True if the offset was updates, false otherwise.
-     */
-    bool updateOffset(FILE* file);
-
-    /**
-     * Updates the offset of this Reference object if it has already need written to file.
-     * @param file The file stream.
-     * @param newOffset The new file offset.
-     * 
-     * @return True if the offset in the binary file was updated. False if this ref hasn't been written to file yet.
-     */
-    bool updateOffset(FILE* file, long newOffset);
-
-    Object* getObj();
-
-private:
-    std::string _xref;
-    unsigned int _type;
-    unsigned int _offset;
-
-    Object* _ref;
-};
-
-}
-
-#endif

+ 0 - 69
gameplay-encoder/src/ReferenceTable.cpp

@@ -1,69 +0,0 @@
-#include "Base.h"
-#include "ReferenceTable.h"
-
-namespace gameplay
-{
-
-ReferenceTable::ReferenceTable(void)
-{
-}
-
-ReferenceTable::~ReferenceTable(void)
-{
-}
-
-void ReferenceTable::add(std::string xref, Object* obj)
-{
-    _table[xref] = Reference(xref, obj);
-}
-
-Object* ReferenceTable::get(const std::string& xref)
-{
-    std::map<std::string, Reference>::iterator it = _table.find(xref);
-    if (it != _table.end())
-    {
-        Reference ref = it->second;
-        return ref.getObj();
-    }
-    return NULL;
-}
-
-void ReferenceTable::writeBinary(FILE* file)
-{
-    write(_table.size(), file);
-    for ( std::map<std::string, Reference>::iterator i=_table.begin() ; i != _table.end(); ++i)
-    {
-        i->second.writeBinary(file);
-    }
-}
-
-void ReferenceTable::writeText(FILE* file)
-{
-    fprintf(file, "<RefTable>\n");
-    for ( std::map<std::string, Reference>::iterator i=_table.begin() ; i != _table.end(); ++i)
-    {
-        i->second.writeText(file);
-    }
-    fprintf(file, "</RefTable>\n");
-}
-
-void ReferenceTable::updateOffsets(FILE* file)
-{
-    for (std::map<std::string, Reference>::iterator i = _table.begin(); i != _table.end(); ++i)
-    {
-        Reference& ref = i->second;
-        ref.updateOffset(file);
-    }
-}
-
-std::map<std::string, Reference>::iterator ReferenceTable::begin()
-{
-    return _table.begin();
-}
-
-std::map<std::string, Reference>::iterator ReferenceTable::end()
-{
-    return _table.end();
-}
-
-}

+ 0 - 58
gameplay-encoder/src/ReferenceTable.h

@@ -1,58 +0,0 @@
-#ifndef REFTABLE_H_
-#define REFTABLE_H_
-
-#include "FileIO.h"
-#include "Reference.h"
-#include "Object.h"
-
-namespace gameplay
-{
-
-/**
- * Collection of unique Reference objects stored in a hashtable.
- */
-class ReferenceTable
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    ReferenceTable(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~ReferenceTable(void);
-
-    /**
-     * Adds an object to the reference table.
-     * 
-     * @param xref The xref for the object.
-     * @param obj The object to be added.
-     */
-    void add(std::string xref, Object* obj);
-
-    Object* get(const std::string& xref);
-
-    void writeBinary(FILE* file);
-    void writeText(FILE* file);
-
-    /**
-     * Updates the file positon offsets of the Reference objects in the GamePlay binary file.
-     * This needs to be called after all of the objects have been written.
-     * 
-     * @param file The file pointer.
-     */
-    void updateOffsets(FILE* file);
-
-    std::map<std::string, Reference>::iterator begin();
-    std::map<std::string, Reference>::iterator end();
-
-private:
-    std::map<std::string, Reference> _table;
-};
-
-}
-
-#endif

+ 0 - 123
gameplay-encoder/src/Scene.cpp

@@ -1,123 +0,0 @@
-#include "Base.h"
-#include "Scene.h"
-
-namespace gameplay
-{
-
-Scene::Scene(void) : _cameraNode(NULL)
-{
-    _ambientColor[0] = 0.0f;
-    _ambientColor[1] = 0.0f;
-    _ambientColor[2] = 0.0f;
-}
-
-Scene::~Scene(void)
-{
-}
-
-unsigned int Scene::getTypeId(void) const
-{
-    return SCENE_ID;
-}
-
-const char* Scene::getElementName(void) const
-{
-    return "Scene";
-}
-
-void Scene::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    writeBinaryObjects(_nodes, file);
-    if (_cameraNode)
-    {
-        _cameraNode->writeBinaryXref(file);
-    }
-    else
-    {
-        writeZero(file);
-    }
-    write(_ambientColor, Light::COLOR_SIZE, file);
-}
-
-void Scene::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    for (std::list<Node*>::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i)
-    {
-        (*i)->writeText(file);
-    }
-    if (_cameraNode)
-    {
-        fprintfElement(file, "activeCamera", _cameraNode->getId());
-    }
-    fprintfElement(file, "ambientColor", _ambientColor, Light::COLOR_SIZE);
-    fprintElementEnd(file);
-}
-
-void Scene::add(Node* node)
-{
-    _nodes.push_back(node);
-}
-
-void Scene::setActiveCameraNode(Node* node)
-{
-    _cameraNode = node;
-}
-
-Node* Scene::getFirstCameraNode() const
-{
-    for (std::list<Node*>::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i)
-    {
-        Node* n = (*i)->getFirstCameraNode();
-        if (n)
-        {
-            return n;
-        }
-    }
-    return NULL;
-}
-
-void Scene::calcAmbientColor()
-{
-    float values[3] = {0.0f, 0.0f, 0.0f};
-    for (std::list<Node*>::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i)
-    {
-        calcAmbientColor(*i, values);
-    }
-    
-    _ambientColor[0] = std::min(values[0], 1.0f);
-    _ambientColor[1] = std::min(values[1], 1.0f);
-    _ambientColor[2] = std::min(values[2], 1.0f);
-}
-
-void Scene::setAmbientColor(float red, float green, float blue)
-{
-    _ambientColor[0] = red;
-    _ambientColor[1] = green;
-    _ambientColor[2] = blue;
-}
-
-void Scene::calcAmbientColor(const Node* node, float* values) const
-{
-    if (!node)
-    {
-        return;
-    }
-    if (node->hasLight())
-    {
-        Light* light = node->getLight();
-        if (light->isAmbient())
-        {
-            values[0] += light->getRed();
-            values[1] += light->getGreen();
-            values[2] += light->getBlue();
-        }
-    }
-    for (Node* child = node->getFirstChild(); child != NULL; child = child->getNextSibling())
-    {
-        calcAmbientColor(child, values);
-    }
-}
-
-}

+ 0 - 77
gameplay-encoder/src/Scene.h

@@ -1,77 +0,0 @@
-#ifndef SCENE_H_
-#define SCENE_H_
-
-#include "Object.h"
-#include "Node.h"
-#include "FileIO.h"
-
-namespace gameplay
-{
-
-class Scene : public Object
-{
-public:
-
-    /**
-     * Constructor.
-     */
-    Scene(void);
-
-    /**
-     * Destructor.
-     */
-    virtual ~Scene(void);
-
-    virtual unsigned int getTypeId(void) const;
-    virtual const char* getElementName(void) const;
-    virtual void writeBinary(FILE* file);
-    virtual void writeText(FILE* file);
-
-    /**
-     * Adds the given node as a child of this scene.
-     * 
-     * @param node The node to add.
-     */
-    void add(Node* node);
-
-    /**
-     * Sets the activate camera node. This node should contain a camera.
-     */
-    void setActiveCameraNode(Node* node);
-
-    /**
-     * Returns the first node the this scene that contains a camera.
-     */
-    Node* getFirstCameraNode() const;
-
-    /**
-     * Calculates the ambient color of this scene by combining all of the ambient lights
-     * that are in this scene.
-     */
-    void calcAmbientColor();
-
-    /**
-     * Sets the scene's ambient color.
-     */
-    void setAmbientColor(float red, float green, float blue);
-
-private:
-
-    /**
-     * Recursively calculates the ambient color of the scene starting at the given node.
-     * The ambient light color is added to the givne float array.
-     * 
-     * @param node The node in this scene to traverse from.
-     * @param values Pointer to 3 floats that contains the calculated ambient color.
-     */
-    void calcAmbientColor(const Node* node, float* values) const;
-
-private:
-    std::list<Node*> _nodes;
-    Node* _cameraNode;
-    float _ambientColor[Light::COLOR_SIZE];
-};
-
-}
-
-#endif

+ 0 - 121
gameplay-encoder/src/StringUtil.cpp

@@ -1,121 +0,0 @@
-#include "Base.h"
-#include "StringUtil.h"
-
-namespace gameplay
-{
-
-inline char lowercase(char c)
-{
-    if (c >= 'A' && c <='Z')
-    {
-        c |= 0x20;
-    }
-    return c;
-}
-
-bool startsWith(const char* str, const char* prefix, bool ignoreCase)
-{
-    size_t length = strlen(str);
-    size_t prefixLength = strlen(prefix);
-
-    if (prefixLength > length)
-    {
-        return false;
-    }
-
-    const char* p = str;
-    while (*p != '\0' && *prefix != '\0')
-    {
-        if (ignoreCase)
-        {
-            if (lowercase(*p) != lowercase(*prefix))
-            {
-                return false;
-            }
-        }
-        else if (*p != *prefix)
-        {
-            return false;
-        }
-        
-        ++p;
-        ++prefix;
-    }
-    return true;
-}
-
-bool endsWith(const char* str, const char* suffix, bool ignoreCase)
-{
-    size_t length = strlen(str);
-    size_t suffixLength = strlen(suffix);
-
-    if (suffixLength > length)
-    {
-        return false;
-    }
-
-    size_t offset = length - suffixLength;
-
-    const char* p = str + offset;
-    while (*p != '\0' && *suffix != '\0')
-    {
-        if (ignoreCase)
-        {
-            if (lowercase(*p) != lowercase(*suffix))
-            {
-                return false;
-            }
-        }
-        else if (*p != *suffix)
-        {
-            return false;
-        }
-        
-        ++p;
-        ++suffix;
-    }
-    return true;
-}
-
-bool equals(const std::string& a, const char* b)
-{
-    return (a.compare(b) == 0);
-}
-
-bool equalsIgnoreCase(const std::string& a, const char* b)
-{
-    size_t bLength = strlen(b);
-    if (a.size() != bLength)
-    {
-        return false;
-    }
-    for (size_t i = 0; i < bLength; ++i)
-    {
-        if (lowercase(a[i]) != lowercase(b[i]))
-        {
-            return false;
-        }
-    }
-    return true;
-}
-
-std::string getFilenameFromFilePath(const std::string& filepath)
-{
-    if (filepath.find_last_of("/") != std::string::npos)
-    {
-        return filepath.substr(filepath.find_last_of("/")+1);
-    }
-    return "";
-}
-
-
-std::string getFilenameNoExt(const std::string& filename)
-{
-    if (filename.find_last_of(".") != std::string::npos)
-    {
-        return filename.substr(0, filename.find_last_of("."));
-    }
-    return filename;
-}
-
-}

+ 0 - 26
gameplay-encoder/src/StringUtil.h

@@ -1,26 +0,0 @@
-#ifndef STRINGUTIL_H_
-#define STRINGUTIL_H_
-
-namespace gameplay
-{
-
-bool startsWith(const char* str, const char* prefix, bool ignoreCase = true);
-bool endsWith(const char* str, const char* suffix, bool ignoreCase = true);
-
-/**
- * Return true if the strings are equal. Case sensitive.
- */
-bool equals(const std::string& a, const char* b);
-
-/**
- * Returns true if the strings are equal. Case insensitive.
- */
-bool equalsIgnoreCase(const std::string& a, const char* b);
-
-std::string getFilenameFromFilePath(const std::string& filepath);
-
-std::string getFilenameNoExt(const std::string& filename);
-
-}
-
-#endif

+ 0 - 334
gameplay-encoder/src/TTFFontEncoder.cpp

@@ -1,334 +0,0 @@
-#include "Base.h"
-#include "TTFFontEncoder.h"
-#include "GPBFile.h"
-
-namespace gameplay
-{
-
-void drawBitmap(unsigned char* dstBitmap, int x, int y, int dstWidth, unsigned char* srcBitmap, int srcWidth, int srcHeight)
-{
-    // offset dst bitmap by x,y.
-    dstBitmap +=  (x + (y * dstWidth));
-
-    for (int i = 0; i < srcHeight; ++i)
-    {
-        memcpy(dstBitmap, (const void*)srcBitmap, srcWidth);
-        srcBitmap += srcWidth;
-        dstBitmap += dstWidth;
-    }
-}
-
-void writeUint(FILE* fp, unsigned int i)
-{
-    fwrite(&i, sizeof(unsigned int), 1, fp);
-}
-
-void writeFloat(FILE* fp, float f)
-{
-    fwrite(&f, sizeof(float), 1, fp);
-}
-
-void writeString(FILE* fp, const char* str)
-{
-    unsigned int len = strlen(str);
-    fwrite(&len, sizeof(unsigned int), 1, fp);
-    if (len > 0)
-    {
-        fwrite(str, 1, len, fp);
-    }
-}
-
-int writeFont(const char* filename, unsigned int fontSize, const char* id, bool fontpreview = false)
-{
- 
-    Glyph glyphArray[END_INDEX - START_INDEX];
-    
-    // Initialize freetype library.
-    FT_Library library;
-    FT_Error error = FT_Init_FreeType(&library);
-    if (error)
-    {
-        fprintf(stderr, "FT_Init_FreeType error: %d \n", error);
-        return -1;
-    }
-    
-    // Initialize font face.
-    FT_Face face;
-    error = FT_New_Face(library, filename, 0, &face);
-    if (error)
-    {
-        fprintf(stderr, "FT_New_Face error: %d \n", error);
-        return -1;
-    }
-    
-    // Set the pixel size.
-    error = FT_Set_Char_Size(
-            face,           // handle to face object.
-            0,              // char_width in 1/64th of points.
-            fontSize * 64,   // char_height in 1/64th of points.
-            0,              // horizontal device resolution (defaults to 72 dpi if resolution (0, 0)).
-            0 );            // vertical device resolution.
-    
-    if (error)
-    {
-        fprintf(stderr, "FT_Set_Char_Size error: %d \n", error);
-        return -1;
-    }
-
-    /* 
-    error = FT_Set_Pixel_Sizes(face, FONT_SIZE, 0);
-    if (error)
-    {
-        fprintf(stderr, "FT_Set_Pixel_Sizes error : %d \n", error);
-        exit(1);
-    }
-    */
-
-    // Save glyph information (slot contains the actual glyph bitmap).
-    FT_GlyphSlot slot = face->glyph;
-    
-    int actualfontHeight = 0;
-    int rowSize = 0; // Stores the total number of rows required to all glyphs.
-    
-    // Find the width of the image.
-    for (unsigned char ascii = START_INDEX; ascii < END_INDEX; ++ascii)
-    {
-        // Load glyph image into the slot (erase previous one)
-        error = FT_Load_Char(face, ascii, FT_LOAD_RENDER);
-        if (error)
-        {
-            fprintf(stderr, "FT_Load_Char error : %d \n", error);
-        }
-        
-        int bitmapRows = slot->bitmap.rows;
-        actualfontHeight = (actualfontHeight < bitmapRows) ? bitmapRows : actualfontHeight;
-        
-        if (slot->bitmap.rows > slot->bitmap_top)
-        {
-            bitmapRows += (slot->bitmap.rows - slot->bitmap_top);
-        }
-        rowSize = (rowSize < bitmapRows) ? bitmapRows : rowSize;
-    }
-
-    // Include padding in the rowSize.
-    rowSize += GLYPH_PADDING;
-    
-    // Initialize with padding.
-    int penX = 0;
-    int penY = 0;
-    int row = 0;
-    
-    double powerOf2 = 2;
-    unsigned int imageWidth = 0;
-    unsigned int imageHeight = 0;
-    bool textureSizeFound = false;
-
-    int advance;
-    int i;
-
-    while (textureSizeFound == false)
-    {
-        imageWidth =  (unsigned int)pow(2.0, powerOf2);
-        imageHeight = (unsigned int)pow(2.0, powerOf2);
-        penX = 0;
-        penY = 0;
-        row = 0;
-
-        // Find out the squared texture size that would fit all the require font glyphs.
-        i = 0;
-        for (unsigned char ascii = START_INDEX; ascii < END_INDEX; ++ascii)
-        {
-            // Load glyph image into the slot (erase the previous one).
-            error = FT_Load_Char(face, ascii, FT_LOAD_RENDER);
-            if (error)
-            {
-                fprintf(stderr, "FT_Load_Char error : %d \n", error);
-            }
-
-            // Glyph image.
-            int glyphWidth = slot->bitmap.pitch;
-            int glyphHeight = slot->bitmap.rows;
-
-            advance = glyphWidth + GLYPH_PADDING; //((int)slot->advance.x >> 6) + GLYPH_PADDING;
-
-            // If we reach the end of the image wrap aroud to the next row.
-            if ((penX + advance) > (int)imageWidth)
-            {
-                penX = 0;
-                row += 1;
-                penY = row * rowSize;
-                if (penY + rowSize > (int)imageHeight)
-                {
-                    powerOf2++;
-                    break;
-                }
-            }
-
-            // penY should include the glyph offsets.
-            penY += (actualfontHeight - glyphHeight) + (glyphHeight - slot->bitmap_top);
-
-            // Set the pen position for the next glyph
-            penX += advance; // Move X to next glyph position
-            // Move Y back to the top of the row.
-            penY = row * rowSize;
-
-            if (ascii == (END_INDEX-1))
-            {
-                textureSizeFound = true;
-            }
-
-            i++;
-        }
-    }
-
-    // Try further to find a tighter texture size.
-    powerOf2 = 1;
-    for (;;)
-    {
-        if ((penY + rowSize) >= pow(2.0, powerOf2))
-        {
-            powerOf2++;
-        }
-        else
-        {
-            imageHeight = (int)pow(2.0, powerOf2);
-            break;
-        }
-    }
-    
-    // Allocate temporary image buffer to draw the glyphs into.
-    unsigned char* imageBuffer = (unsigned char *)malloc(imageWidth * imageHeight);
-    memset(imageBuffer, 0, imageWidth * imageHeight);
-    penX = 0;
-    penY = 0;
-    row = 0;
-    i = 0;
-    for (unsigned char ascii = START_INDEX; ascii < END_INDEX; ++ascii)
-    {
-        // Load glyph image into the slot (erase the previous one).
-        error = FT_Load_Char(face, ascii, FT_LOAD_RENDER);
-        if (error)
-        {
-            fprintf(stderr, "FT_Load_Char error : %d \n", error);
-        }
-
-        // Glyph image.
-        unsigned char* glyphBuffer =  slot->bitmap.buffer;
-        int glyphWidth = slot->bitmap.pitch;
-        int glyphHeight = slot->bitmap.rows;
-
-        advance = glyphWidth + GLYPH_PADDING;//((int)slot->advance.x >> 6) + GLYPH_PADDING;
-
-        // If we reach the end of the image wrap aroud to the next row.
-        if ((penX + advance) > (int)imageWidth)
-        {
-            penX = 0;
-            row += 1;
-            penY = row * rowSize;
-            if (penY + rowSize > (int)imageHeight)
-            {
-                fprintf(stderr, "Image size exceeded!");
-               return -1;
-            }
-
-        }
-        
-        // penY should include the glyph offsets.
-        penY += (actualfontHeight - glyphHeight) + (glyphHeight - slot->bitmap_top);
-
-        // Draw the glyph to the bitmap with a one pixel padding.
-        drawBitmap(imageBuffer, penX, penY, imageWidth, glyphBuffer, glyphWidth, glyphHeight);
-        
-        // Move Y back to the top of the row.
-        penY = row * rowSize;
-
-        glyphArray[i].index = ascii;
-        glyphArray[i].width = advance - GLYPH_PADDING;
-        
-        // Generate UV coords.
-        glyphArray[i].uvCoords[0] = (float)penX / (float)imageWidth;
-        glyphArray[i].uvCoords[1] = (float)penY / (float)imageHeight;
-        glyphArray[i].uvCoords[2] = (float)(penX + advance - GLYPH_PADDING) / (float)imageWidth;
-        glyphArray[i].uvCoords[3] = (float)(penY + rowSize) / (float)imageHeight;
-
-        // Set the pen position for the next glyph
-        penX += advance; // Move X to next glyph position
-        i++;
-    }
-    
-    unsigned int idlen = strlen(id);
-
-    // Write it to the id.gpb file.
-    char* fileName = (char*)malloc(idlen + 4);
-    strcpy(fileName, id);
-    strcat(fileName, ".gpb");
-
-    FILE *gpbFp = fopen(fileName, "wb");
-    
-    // File header and version.
-    char fileHeader[9]     = {'«', 'G', 'P', 'B', '»', '\r', '\n', '\x1A', '\n'};
-    fwrite(fileHeader, sizeof(char), 9, gpbFp);
-    fwrite(gameplay::GPB_VERSION, sizeof(char), 2, gpbFp);
-
-    // Write Ref table (for a single font)
-    writeUint(gpbFp, 1);                // Ref[] count
-    writeString(gpbFp, id);             // Ref id
-    writeUint(gpbFp, 128);              // Ref type
-    writeUint(gpbFp, ftell(gpbFp) + 4); // Ref offset (current pos + 4 bytes)
-    
-    // Write Font object.
-    
-    // Family name.
-    writeString(gpbFp, face->family_name);
-
-    // Style.
-    // TODO: Switch based on TTF style name and write appropriate font style unsigned int
-    // For now just hardcoding to 0.
-    //char* style = face->style_name;
-    writeUint(gpbFp, 0); // 0 == PLAIN
-
-    // Font size.
-    writeUint(gpbFp, rowSize);
-
-    // Character set.
-    // TODO: Empty for now
-    writeString(gpbFp, "");
-    
-    // Glyphs.
-    unsigned int glyphSetSize = END_INDEX - START_INDEX;
-    writeUint(gpbFp, glyphSetSize);
-    fwrite(&glyphArray, sizeof(Glyph), glyphSetSize, gpbFp);
-    
-    // Texture.
-    unsigned int textureSize = imageWidth * imageHeight;
-    writeUint(gpbFp, imageWidth);
-    writeUint(gpbFp, imageHeight);
-    writeUint(gpbFp, textureSize);
-    fwrite(imageBuffer, sizeof(unsigned char), textureSize, gpbFp);
-    
-    // Close file.
-    fclose(gpbFp);
-
-    printf("%s.gpb created successfully! \n", id);
-
-    if (fontpreview)
-    {
-        // Write out font map to an image.
-        strcpy(fileName, id);
-        strcat(fileName, ".pgm");
-
-        FILE *imageFp = fopen(fileName, "wb");
-        fprintf(imageFp, "P5 %d %d 255\n", imageWidth, imageHeight);
-        fwrite((const char *)imageBuffer, sizeof(unsigned char), imageWidth * imageHeight, imageFp);
-        fclose(imageFp);
-    }
-
-    // Cleanup resources.
-    free(imageBuffer);
-    
-    FT_Done_Face(face);
-    FT_Done_FreeType(library);
-    return 0;
-}
-
-}

+ 0 - 31
gameplay-encoder/src/TTFFontEncoder.h

@@ -1,31 +0,0 @@
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#define START_INDEX     32
-#define END_INDEX       127
-
-#define GLYPH_PADDING   4
-
-namespace gameplay
-{
-
-// Structure of Glyph.
-class Glyph
-{
-public:
-    unsigned int index;
-    unsigned int width;
-    float uvCoords[4];
-};
-
-void drawBitmap(unsigned char* dstBitmap, int x, int y, int dstWidth, unsigned char* srcBitmap, int srcWidth, int srcHeight);
-
-void writeUint(FILE* fp, unsigned int i);
-
-void writeFloat(FILE* fp, float f);
-
-void writeString(FILE* fp, const char* str);
-
-int writeFont(const char* filename, unsigned int fontSize, const char* id, bool fontpreview);
-
-}

+ 0 - 91
gameplay-encoder/src/Transform.cpp

@@ -1,91 +0,0 @@
-#include "Base.h"
-#include "Transform.h"
-
-namespace gameplay
-{
-
-const char* Transform::getPropertyString(unsigned int prop)
-{
-    switch (prop)
-    {
-        case ANIMATE_SCALE:
-            return "ANIMATE_SCALE";
-        case ANIMATE_SCALE_X:
-            return "ANIMATE_SCALE_X";
-        case ANIMATE_SCALE_Y: 
-            return "ANIMATE_SCALE_Y";
-        case ANIMATE_SCALE_Z:
-            return "ANIMATE_SCALE_Z";
-        case ANIMATE_SCALE_XY: 
-            return "ANIMATE_SCALE_XY";
-        case ANIMATE_SCALE_XZ: 
-            return "ANIMATE_SCALE_XZ";
-        case ANIMATE_SCALE_YZ:
-            return "ANIMATE_SCALE_YZ";
-        case ANIMATE_ROTATE:
-            return "ANIMATE_ROTATE";
-        case ANIMATE_TRANSLATE: 
-            return "ANIMATE_TRANSLATE";
-        case ANIMATE_TRANSLATE_X:
-            return "ANIMATE_TRANSLATE_X";
-        case ANIMATE_TRANSLATE_Y: 
-            return "ANIMATE_TRANSLATE_Y";
-        case ANIMATE_TRANSLATE_Z: 
-            return "ANIMATE_TRANSLATE_Z";
-        case ANIMATE_TRANSLATE_XY: 
-            return "ANIMATE_TRANSLATE_XY";
-        case ANIMATE_TRANSLATE_XZ: 
-            return "ANIMATE_TRANSLATE_XZ";
-        case ANIMATE_TRANSLATE_YZ: 
-            return "ANIMATE_TRANSLATE_YZ";
-        case ANIMATE_ROTATE_TRANSLATE: 
-            return "ANIMATE_ROTATE_TRANSLATE";
-        case ANIMATE_SCALE_ROTATE_TRANSLATE: 
-            return "ANIMATE_SCALE_ROTATE_TRANSLATE";
-        case ANIMATE_ROTATE_X: 
-            return "ANIMATE_ROTATE_X";
-        case ANIMATE_ROTATE_Y: 
-            return "ANIMATE_ROTATE_Y";
-        case ANIMATE_ROTATE_Z: 
-            return "ANIMATE_ROTATE_Z";
-        default:
-            return "";
-    }
-}
-
-unsigned int Transform::getPropertySize(unsigned int prop)
-{
-    switch (prop)
-    {
-        case ANIMATE_SCALE_ROTATE_TRANSLATE: 
-            return 10;
-        case ANIMATE_ROTATE_TRANSLATE: 
-            return 7;
-        case ANIMATE_ROTATE:
-            return 4;
-        case ANIMATE_SCALE:
-        case ANIMATE_TRANSLATE: 
-            return 3;   
-        case ANIMATE_SCALE_XY: 
-        case ANIMATE_SCALE_XZ: 
-        case ANIMATE_SCALE_YZ:
-        case ANIMATE_TRANSLATE_XY: 
-        case ANIMATE_TRANSLATE_XZ: 
-        case ANIMATE_TRANSLATE_YZ: 
-            return 2;
-        case ANIMATE_SCALE_X:
-        case ANIMATE_SCALE_Y:
-        case ANIMATE_SCALE_Z:
-        case ANIMATE_TRANSLATE_X:
-        case ANIMATE_TRANSLATE_Y:
-        case ANIMATE_TRANSLATE_Z:
-        case ANIMATE_ROTATE_X: 
-        case ANIMATE_ROTATE_Y: 
-        case ANIMATE_ROTATE_Z: 
-            return 1;
-        default:
-            return 0;
-    }
-}
-
-}

+ 0 - 68
gameplay-encoder/src/Transform.h

@@ -1,68 +0,0 @@
-#ifndef TRANSFORM_H_
-#define TRANSFORM_H_
-
-namespace gameplay
-{
-
-class Transform
-{
-public:
-
-    enum TransformProperties
-    {
-        /**
-         * Scale animation property. Data=sx,sy,sz
-         */
-        ANIMATE_SCALE = 1,
-        ANIMATE_SCALE_X = 2,
-        ANIMATE_SCALE_Y = 3,
-        ANIMATE_SCALE_Z = 4,
-        ANIMATE_SCALE_XY = 5,
-        ANIMATE_SCALE_XZ = 6,
-        ANIMATE_SCALE_YZ = 7,
-
-        /**
-         * Rotation animation property. Data=qx,qy,qz,qw (as quaternion).
-         */
-        ANIMATE_ROTATE = 8,
-
-        /**
-         * Translation animation property. Data=tx,ty,tz
-         */
-        ANIMATE_TRANSLATE = 9,
-        ANIMATE_TRANSLATE_X = 10,
-        ANIMATE_TRANSLATE_Y = 11,
-        ANIMATE_TRANSLATE_Z = 12,
-        ANIMATE_TRANSLATE_XY = 13,
-        ANIMATE_TRANSLATE_XZ = 14,
-        ANIMATE_TRANSLATE_YZ = 15,
-
-        /**
-         * Rotation + Translation animation property(Rigid Body). Data=qx,qy,qz,qw,tx,ty,tz
-         */
-        ANIMATE_ROTATE_TRANSLATE = 16,
-        /**
-         * Scale, Rotation + Translation animation property. Data=sx,sy,sz,qx,qy,qz,qw,tx,ty,tz
-         */
-        ANIMATE_SCALE_ROTATE_TRANSLATE = 17,
-
-        ANIMATE_ROTATE_X = 18,
-        ANIMATE_ROTATE_Y = 19,
-        ANIMATE_ROTATE_Z = 20
-    };
-
-    /**
-     * Returns the string representation of the given TransformProperty.
-     */
-    static const char* getPropertyString(unsigned int prop);
-
-    /**
-     * Returns the number of floats for the given property or zero if not a valid property.
-     */
-    static unsigned int getPropertySize(unsigned int prop);
-
-};
-
-}
-
-#endif

+ 0 - 271
gameplay-encoder/src/Vector2.cpp

@@ -1,271 +0,0 @@
-#include "Base.h"
-#include "Vector2.h"
-
-namespace gameplay
-{
-
-Vector2::Vector2()
-    : x(0.0f), y(0.0f)
-{
-}
-
-Vector2::Vector2(float x, float y)
-{
-    set(x, y);
-}
-
-Vector2::Vector2(float* array)
-{
-    set(array);
-}
-
-Vector2::Vector2(const Vector2& p1, const Vector2& p2)
-{
-    set(p1, p2);
-}
-
-Vector2::Vector2(const Vector2& copy)
-{
-    set(copy);
-}
-
-Vector2::~Vector2()
-{
-}
-
-const Vector2& Vector2::zero()
-{
-    static Vector2 value(0.0f, 0.0f);
-    return value;
-}
-
-const Vector2& Vector2::one()
-{
-    static Vector2 value(1.0f, 1.0f);
-    return value;
-}
-
-const Vector2& Vector2::unitX()
-{
-    static Vector2 value(1.0f, 0.0f);
-    return value;
-}
-
-const Vector2& Vector2::unitY()
-{
-    static Vector2 value(0.0f, 1.0f);
-    return value;
-}
-
-bool Vector2::isZero() const
-{
-    return x == 0.0f && y == 0.0f;
-}
-
-bool Vector2::isOne() const
-{
-    return x == 1.0f && y == 1.0f;
-}
-
-float Vector2::angle(const Vector2& v1, const Vector2& v2)
-{
-    float dz = v1.x * v2.y - v1.y * v2.x;
-    return atan2f(fabsf(dz) + MATH_FLOAT_SMALL, dot(v1, v2));
-}
-
-void Vector2::add(const Vector2& v)
-{
-    x += v.x;
-    y += v.y;
-}
-
-void Vector2::add(const Vector2& v1, const Vector2& v2, Vector2* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x + v2.x;
-    dst->y = v1.y + v2.y;
-}
-
-void Vector2::clamp(const Vector2& min, const Vector2& max)
-{
-    assert(!( min.x > max.x || min.y > max.y ));
-
-    // Clamp the x value.
-    if ( x < min.x )
-        x = min.x;
-    if ( x > max.x )
-        x = max.x;
-
-    // Clamp the y value.
-    if ( y < min.y )
-        y = min.y;
-    if ( y > max.y )
-        y = max.y;
-}
-
-void Vector2::clamp(const Vector2& v, const Vector2& min, const Vector2& max, Vector2* dst)
-{
-    assert(dst);
-    assert(!( min.x > max.x || min.y > max.y ));
-
-    // Clamp the x value.
-    dst->x = v.x;
-    if ( dst->x < min.x )
-        dst->x = min.x;
-    if ( dst->x > max.x )
-        dst->x = max.x;
-
-    // Clamp the y value.
-    dst->y = v.y;
-    if ( dst->y < min.y )
-        dst->y = min.y;
-    if ( dst->y > max.y )
-        dst->y = max.y;
-}
-
-float Vector2::distance(const Vector2& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-
-    return sqrt(dx * dx + dy * dy);
-}
-
-float Vector2::distanceSquared(const Vector2& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-    return (dx * dx + dy * dy);
-}
-
-float Vector2::dot(const Vector2& v)
-{
-    return (x * v.x + y * v.y);
-}
-
-float Vector2::dot(const Vector2& v1, const Vector2& v2)
-{
-    return (v1.x * v2.x + v1.y * v2.y);
-}
-
-float Vector2::length() const
-{
-    return sqrt(x * x + y * y);
-}
-
-float Vector2::lengthSquared() const
-{
-    return (x * x + y * y);
-}
-
-void Vector2::negate()
-{
-    x = -x;
-    y = -y;
-}
-
-void Vector2::normalize()
-{
-    normalize(this);
-}
-
-void Vector2::normalize(Vector2* dst)
-{
-    assert(dst);
-
-    if (dst != this)
-    {
-        dst->x = x;
-        dst->y = y;
-    }
-
-    float n = x * x + y * y;
-    // Already normalized.
-    if (n == 1.0f)
-        return;
-
-    n = sqrt(n);
-    // Too close to zero.
-    if (n < MATH_TOLERANCE)
-        return;
-
-    n = 1.0f / n;
-    dst->x *= n;
-    dst->y *= n;
-}
-
-void Vector2::scale(float scalar)
-{
-    x *= scalar;
-    y *= scalar;
-}
-
-void Vector2::scale(const Vector2& scale)
-{
-    x *= scale.x;
-    y *= scale.y;
-}
-
-void Vector2::rotate(const Vector2& point, float angle)
-{
-    float sinAngle = sin(angle);
-    float cosAngle = cos(angle);
-
-    if (point.isZero())
-    {
-        float tempX = x * cosAngle - y * sinAngle;
-        y = y * cosAngle + x * sinAngle;
-        x = tempX;
-    }
-    else
-    {
-        float tempX = x - point.x;
-        float tempY = y - point.y;
-
-        x = tempX * cosAngle - tempY * sinAngle + point.x;
-        y = tempY * cosAngle + tempX * sinAngle + point.y;
-    }
-}
-
-void Vector2::set(float x, float y)
-{
-    this->x = x;
-    this->y = y;
-}
-
-void Vector2::set(float* array)
-{
-    assert(array);
-
-    x = array[0];
-    y = array[1];
-}
-
-void Vector2::set(const Vector2& v)
-{
-    this->x = v.x;
-    this->y = v.y;
-}
-
-void Vector2::set(const Vector2& p1, const Vector2& p2)
-{
-     x = p2.x - p1.x;
-     y = p2.y - p1.y;
-}
-
-void Vector2::subtract(const Vector2& v)
-{
-    x -= v.x;
-    y -= v.y;
-}
-
-void Vector2::subtract(const Vector2& v1, const Vector2& v2, Vector2* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x - v2.x;
-    dst->y = v1.y - v2.y;
-}
-
-}

+ 0 - 413
gameplay-encoder/src/Vector2.h

@@ -1,413 +0,0 @@
-#ifndef VECTOR2_H_
-#define VECTOR2_H_
-
-namespace gameplay
-{
-
-class Matrix;
-
-/**
- * Defines a 2-element floating point vector.
- */
-class Vector2
-{
-public:
-
-    /**
-     * The x coordinate.
-     */
-    float x;
-
-    /**
-     * The y coordinate.
-     */
-    float y;
-
-    /**
-     * Constructs a new vector initialized to all zeros.
-     */
-    Vector2();
-
-    /**
-     * Constructs a new vector initialized to the specified values.
-     *
-     * @param x The x coordinate.
-     * @param y The y coordinate.
-     */
-    Vector2(float x, float y);
-
-    /**
-     * Constructs a new vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y.
-     */
-    Vector2(float* array);
-
-    /**
-     * Constructs a vector that describes the direction between the specified points.
-     *
-     * @param p1 The first point.
-     * @param p2 The second point.
-     */
-    Vector2(const Vector2& p1, const Vector2& p2);
-
-    /**
-     * Constructs a new vector that is a copy of the specified vector.
-     *
-     * @param copy The vector to copy.
-     */
-    Vector2(const Vector2& copy);
-
-    /**
-     * Destructor.
-     */
-    ~Vector2();
-
-    /**
-     * Returns the zero vector.
-     *
-     * @return The 2-element vector of 0s.
-     */
-    static const Vector2& zero();
-
-    /**
-     * Returns the one vector.
-     *
-     * @return The 2-element vector of 1s.
-     */
-    static const Vector2& one();
-
-    /**
-     * Returns the unit x vector.
-     *
-     * @return The 2-element unit vector along the x axis.
-     */
-    static const Vector2& unitX();
-
-    /**
-     * Returns the unit y vector.
-     *
-     * @return The 2-element unit vector along the y axis.
-     */
-    static const Vector2& unitY();
-
-    /**
-     * Indicates whether this vector contains all zeros.
-     *
-     * @return true if this vector contains all zeros, false otherwise.
-     */
-    bool isZero() const;
-
-    /**
-     * Indicates whether this vector contains all ones.
-     *
-     * @return true if this vector contains all ones, false otherwise.
-     */
-    bool isOne() const;
-
-    /**
-     * Returns the angle (in radians) between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The angle between the two vectors (in radians).
-     */
-    static float angle(const Vector2& v1, const Vector2& v2);
-
-    /**
-     * Adds the elements of the specified vector to this one.
-     *
-     * @param v The vector to add.
-     */
-    void add(const Vector2& v);
-
-    /**
-     * Adds the specified vectors and stores the result in dst.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst A vector to store the result in.
-     */
-    static void add(const Vector2& v1, const Vector2& v2, Vector2* dst);
-
-    /**
-     * Clamps this vector within the specified range.
-     *
-     * @param min The minimum value.
-     * @param max The maximum value.
-     */
-    void clamp(const Vector2& min, const Vector2& max);
-
-    /**
-     * Clamps the specified vector within the specified range and returns it in dst.
-     *
-     * @param v The vector to clamp.
-     * @param min The minimum value.
-     * @param max The maximum value.
-     * @param dst A vector to store the result in.
-     */
-    static void clamp(const Vector2& v, const Vector2& min, const Vector2& max, Vector2* dst);
-
-    /**
-     * Returns the distance between this vector and v.
-     *
-     * @param v The other vector.
-     * 
-     * @return The distance between this vector and v.
-     * 
-     * @see distanceSquared
-     */
-    float distance(const Vector2& v) const;
-
-    /**
-     * Returns the squared distance between this vector and v.
-     *
-     * When it is not neccessary to get the exact distance between
-     * two vectors (for example, when simply comparing the
-     * distance between different vectors), it is advised to use
-     * this method instead of distance.
-     *
-     * @param v The other vector.
-     * 
-     * @return The squared distance between this vector and v.
-     * 
-     * @see distance
-     */
-    float distanceSquared(const Vector2& v) const;
-
-    /**
-     * Returns the dot product of this vector and the specified vector.
-     *
-     * @param v The vector to compute the dot product with.
-     * 
-     * @return The dot product.
-     */
-    float dot(const Vector2& v);
-
-    /**
-     * Returns the dot product between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The dot product between the vectors.
-     */
-    static float dot(const Vector2& v1, const Vector2& v2);
-
-    /**
-     * Computes the length of this vector.
-     *
-     * @return The length of the vector.
-     * 
-     * @see lengthSquared
-     */
-    float length() const;
-
-    /**
-     * Returns the squared length of this vector.
-     *
-     * When it is not neccessary to get the exact length of a
-     * vector (for example, when simply comparing the lengths of
-     * different vectors), it is advised to use this method
-     * instead of length.
-     *
-     * @return The squared length of the vector.
-     * 
-     * @see length
-     */
-    float lengthSquared() const;
-
-    /**
-     * Negates this vector.
-     */
-    void negate();
-
-    /**
-     * Normalizes this vector.
-     *
-     * This method normalizes this Vector2 so that it is of
-     * unit length (in other words, the length of the vector
-     * after calling this method will be 1.0f). If the vector
-     * already has unit length or if the length of the vector
-     * is zero, this method does nothing.
-     */
-    void normalize();
-
-    /**
-     * Normalizes this vector and stores the result in dst.
-     *
-     * If the vector already has unit length or if the length
-     * of the vector is zero, this method simply copies the
-     * current vector into dst.
-     *
-     * @param dst The destination vector.
-     */
-    void normalize(Vector2* dst);
-
-    /**
-     * Scales all elements of this vector by the specified value.
-     *
-     * @param scalar The scalar value.
-     */
-    void scale(float scalar);
-
-    /**
-     * Scales each element of this vector by the matching component of scale.
-     *
-     * @param scale The vector to scale by.
-     */
-    void scale(const Vector2& scale);
-
-    /**
-     * Rotates this vector by angle (specified in radians) around the given point.
-     *
-     * @param point The point to rotate around.
-     * @param angle The angle to rotate by (in radians).
-     */
-    void rotate(const Vector2& point, float angle);
-
-    /**
-     * Sets the elements of this vector to the specified values.
-     *
-     * @param x The new x coordinate.
-     * @param y The new y coordinate.
-     */
-    void set(float x, float y);
-
-    /**
-     * Sets the elements of this vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y.
-     */
-    void set(float* array);
-
-    /**
-     * Sets the elements of this vector to those in the specified vector.
-     *
-     * @param v The vector to copy.
-     */
-    void set(const Vector2& v);
-
-    /**
-     * Sets this vector to the directional vector between the specified points.
-     * 
-     * @param p1 The first point.
-     * @param p2 The second point.
-     */
-    void set(const Vector2& p1, const Vector2& p2);
-
-    /**
-     * Subtracts this vector and the specified vector as (this - v)
-     * and stores the result in this vector.
-     *
-     * @param v The vector to subtract.
-     */
-    void subtract(const Vector2& v);
-
-    /**
-     * Subtracts the specified vectors and stores the result in dst.
-     * The resulting vector is computed as (v1 - v2).
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst The destination vector.
-     */
-    static void subtract(const Vector2& v1, const Vector2& v2, Vector2* dst);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector2 operator+(const Vector2& v);
-
-    /**
-     * Adds the given vector to this vector.
-     * 
-     * @param v The vector to add.
-     * @return This vector, after the addition occurs.
-     */
-    inline Vector2& operator+=(const Vector2& v);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector2 operator-(const Vector2& v);
-
-    /**
-     * Subtracts the given vector from this vector.
-     * 
-     * @param v The vector to subtract.
-     * @return This vector, after the subtraction occurs.
-     */
-    inline Vector2& operator-=(const Vector2& v);
-
-    /**
-     * Calculates the negation of this vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @return The negation of this vector.
-     */
-    inline Vector2 operator-();
-
-    /**
-     * Calculates the scalar product of this vector with the given value.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param x The value to scale by.
-     * @return The scaled vector.
-     */
-    inline Vector2 operator*(float x);
-
-    /**
-     * Scales this vector by the given value.
-     * 
-     * @param x The value to scale by.
-     * @return This vector, after the scale occurs.
-     */
-    inline Vector2& operator*=(float x);
-
-    /**
-     * Determines if this vector is less than the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is less than the given vector, false otherwise.
-     */
-    inline bool operator<(const Vector2& v) const;
-
-    /**
-     * Determines if this vector is equal to the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is equal to the given vector, false otherwise.
-     */
-    inline bool operator==(const Vector2& v) const;
-};
-
-/**
- * Calculates the scalar product of the given vector with the given value.
- * 
- * @param x The value to scale by.
- * @param v The vector to scale.
- * @return The scaled vector.
- */
-inline Vector2 operator*(float x, const Vector2& v);
-
-}
-
-#include "Vector2.inl"
-
-#endif

+ 0 - 77
gameplay-encoder/src/Vector2.inl

@@ -1,77 +0,0 @@
-/** 
- * Vector2.inl
- */
-
-#include "Vector2.h"
-
-namespace gameplay
-{
-
-inline Vector2 Vector2::operator+(const Vector2& v)
-{
-    Vector2 result(*this);
-    result.add(v);
-    return result;
-}
-
-inline Vector2& Vector2::operator+=(const Vector2& v)
-{
-    add(v);
-    return *this;
-}
-
-inline Vector2 Vector2::operator-(const Vector2& v)
-{
-    Vector2 result(*this);
-    result.subtract(v);
-    return result;
-}
-
-inline Vector2& Vector2::operator-=(const Vector2& v)
-{
-    subtract(v);
-    return *this;
-}
-
-inline Vector2 Vector2::operator-()
-{
-    Vector2 result(*this);
-    result.negate();
-    return result;
-}
-
-inline Vector2 Vector2::operator*(float x)
-{
-    Vector2 result(*this);
-    result.scale(x);
-    return result;
-}
-
-inline Vector2& Vector2::operator*=(float x)
-{
-    scale(x);
-    return *this;
-}
-
-inline bool Vector2::operator<(const Vector2& v) const
-{
-    if (x == v.x)
-    {
-        return y < v.y;
-    }
-    return x < v.x;
-}
-
-inline bool Vector2::operator==(const Vector2& v) const
-{
-    return x==v.x && y==v.y;
-}
-
-inline Vector2 operator*(float x, const Vector2& v)
-{
-    Vector2 result(v);
-    result.scale(x);
-    return result;
-}
-
-}

+ 0 - 318
gameplay-encoder/src/Vector3.cpp

@@ -1,318 +0,0 @@
-#include "Base.h"
-#include "Vector3.h"
-
-namespace gameplay
-{
-
-Vector3::Vector3()
-    : x(0.0f), y(0.0f), z(0.0f)
-{
-}
-
-Vector3::Vector3(float x, float y, float z)
-{
-    set(x, y, z);
-}
-
-Vector3::Vector3(float* array)
-{
-    set(array);
-}
-
-Vector3::Vector3(const Vector3& p1, const Vector3& p2)
-{
-    set(p1, p2);
-}
-
-Vector3::Vector3(const Vector3& copy)
-{
-    set(copy);
-}
-
-Vector3 Vector3::fromColor(unsigned int color)
-{
-    float components[3];
-    int componentIndex = 0;
-    for (int i = 2; i >= 0; --i)
-    {
-        int component = (color >> i*8) & 0x0000ff;
-
-        components[componentIndex++] = static_cast<float>(component) / 255.0f;
-    }
-
-    Vector3 value(components);
-    return value;
-}
-
-Vector3::~Vector3()
-{
-}
-
-const Vector3& Vector3::zero()
-{
-    static Vector3 value(0.0f, 0.0f, 0.0f);
-    return value;
-}
-
-const Vector3& Vector3::one()
-{
-    static Vector3 value(1.0f, 1.0f, 1.0f);
-    return value;
-}
-
-const Vector3& Vector3::unitX()
-{
-    static Vector3 value(1.0f, 0.0f, 0.0f);
-    return value;
-}
-
-const Vector3& Vector3::unitY()
-{
-    static Vector3 value(0.0f, 1.0f, 0.0f);
-    return value;
-}
-
-const Vector3& Vector3::unitZ()
-{
-    static Vector3 value(0.0f, 0.0f, 1.0f);
-    return value;
-}
-
-bool Vector3::isZero() const
-{
-    return x == 0.0f && y == 0.0f && z == 0.0f;
-}
-
-bool Vector3::isOne() const
-{
-    return x == 1.0f && y == 1.0f && z == 1.0f;
-}
-
-float Vector3::angle(const Vector3& v1, const Vector3& v2)
-{
-    float dx = v1.y * v2.z - v1.z * v2.y;
-    float dy = v1.z * v2.x - v1.x * v2.z;
-    float dz = v1.x * v2.y - v1.y * v2.x;
-
-    return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
-}
-
-void Vector3::add(const Vector3& v)
-{
-    x += v.x;
-    y += v.y;
-    z += v.z;
-}
-
-void Vector3::add(const Vector3& v1, const Vector3& v2, Vector3* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x + v2.x;
-    dst->y = v1.y + v2.y;
-    dst->z = v1.z + v2.z;
-}
-
-void Vector3::clamp(const Vector3& min, const Vector3& max)
-{
-    assert(!( min.x > max.x || min.y > max.y || min.z > max.z));
-
-    // Clamp the x value.
-    if ( x < min.x )
-        x = min.x;
-    if ( x > max.x )
-        x = max.x;
-
-    // Clamp the y value.
-    if ( y < min.y )
-        y = min.y;
-    if ( y > max.y )
-        y = max.y;
-
-    // Clamp the z value.
-    if ( z < min.z )
-        z = min.z;
-    if ( z > max.z )
-        z = max.z;
-}
-
-void Vector3::clamp(const Vector3& v, const Vector3& min, const Vector3& max, Vector3* dst)
-{
-    assert(dst);
-    assert(!( min.x > max.x || min.y > max.y || min.z > max.z));
-
-    // Clamp the x value.
-    dst->x = v.x;
-    if ( dst->x < min.x )
-        dst->x = min.x;
-    if ( dst->x > max.x )
-        dst->x = max.x;
-
-    // Clamp the y value.
-    dst->y = v.y;
-    if ( dst->y < min.y )
-        dst->y = min.y;
-    if ( dst->y > max.y )
-        dst->y = max.y;
-
-    // Clamp the z value.
-    dst->z = v.z;
-    if ( dst->z < min.z )
-        dst->z = min.z;
-    if ( dst->z > max.z )
-        dst->z = max.z;
-}
-
-void Vector3::cross(const Vector3& v)
-{
-    float tx = (y * v.z) - (z * v.y);
-    float ty = (z * v.x) - (x * v.z);
-    float tz = (x * v.y) - (y * v.x);
-    x = tx;
-    y = ty;
-    z = tz;
-}
-
-void Vector3::cross(const Vector3& v1, const Vector3& v2, Vector3* dst)
-{
-    assert(dst);
-
-    float x = (v1.y * v2.z) - (v1.z * v2.y);
-    float y = (v1.z * v2.x) - (v1.x * v2.z);
-    float z = (v1.x * v2.y) - (v1.y * v2.x);
-    dst->x = x;
-    dst->y = y;
-    dst->z = z;
-}
-
-float Vector3::distance(const Vector3& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-    float dz = v.z - z;
-
-    return sqrt(dx * dx + dy * dy + dz * dz);
-}
-
-float Vector3::distanceSquared(const Vector3& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-    float dz = v.z - z;
-
-    return (dx * dx + dy * dy + dz * dz);
-}
-
-float Vector3::dot(const Vector3& v)
-{
-    return (x * v.x + y * v.y + z * v.z);
-}
-
-float Vector3::dot(const Vector3& v1, const Vector3& v2)
-{
-    return (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z);
-}
-
-float Vector3::length() const
-{
-    return sqrt(x * x + y * y + z * z);
-}
-
-float Vector3::lengthSquared() const
-{
-    return (x * x + y * y + z * z);
-}
-
-void Vector3::negate()
-{
-    x = -x;
-    y = -y;
-    z = -z;
-}
-
-void Vector3::normalize()
-{
-    normalize(this);
-}
-
-void Vector3::normalize(Vector3* dst) const
-{
-    assert(dst);
-
-    if (dst != this)
-    {
-        dst->x = x;
-        dst->y = y;
-        dst->z = z;
-    }
-
-    float n = x * x + y * y + z * z;
-    // Already normalized.
-    if (n == 1.0f)
-        return;
-
-    n = sqrt(n);
-    // Too close to zero.
-    if (n < MATH_TOLERANCE)
-        return;
-
-    n = 1.0f / n;
-    dst->x *= n;
-    dst->y *= n;
-    dst->z *= n;
-}
-
-void Vector3::scale(float scalar)
-{
-    x *= scalar;
-    y *= scalar;
-    z *= scalar;
-}
-
-void Vector3::set(float x, float y, float z)
-{
-    this->x = x;
-    this->y = y;
-    this->z = z;
-}
-
-void Vector3::set(float* array)
-{
-    assert(array);
-
-    x = array[0];
-    y = array[1];
-    z = array[2];
-}
-
-void Vector3::set(const Vector3& v)
-{
-    this->x = v.x;
-    this->y = v.y;
-    this->z = v.z;
-}
-
-void Vector3::set(const Vector3& p1, const Vector3& p2)
-{
-    x = p2.x - p1.x;
-    y = p2.y - p1.y;
-    z = p2.z - p1.z;
-}
-
-void Vector3::subtract(const Vector3& v)
-{
-    x -= v.x;
-    y -= v.y;
-    z -= v.z;
-}
-
-void Vector3::subtract(const Vector3& v1, const Vector3& v2, Vector3* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x - v2.x;
-    dst->y = v1.y - v2.y;
-    dst->z = v1.z - v2.z;
-}
-
-}

+ 0 - 443
gameplay-encoder/src/Vector3.h

@@ -1,443 +0,0 @@
-#ifndef VECTOR3_H_
-#define VECTOR3_H_
-
-namespace gameplay
-{
-
-class Matrix;
-class Quaternion;
-
-/**
- * Defines a 3-element floating point vector.
- *
- * When using a vector to represent a surface normal,
- * the vector should typically be normalized.
- * Other uses of directional vectors may wish to leave
- * the magnitude of the vector intact. When used as a point,
- * the elements of the vector represent a position in 3D space.
- */
-class Vector3
-{
-public:
-
-    /**
-     * The x-coordinate.
-     */
-    float x;
-
-    /**
-     * The y-coordinate.
-     */
-    float y;
-
-    /**
-     * The z-coordinate.
-     */
-    float z;
-
-    /**
-     * Constructs a new vector initialized to all zeros.
-     */
-    Vector3();
-
-    /**
-     * Constructs a new vector initialized to the specified values.
-     *
-     * @param x The x coordinate.
-     * @param y The y coordinate.
-     * @param z The z coordinate.
-     */
-    Vector3(float x, float y, float z);
-
-    /**
-     * Constructs a new vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y, z.
-     */
-    Vector3(float* array);
-
-    /**
-     * Constructs a vector that describes the direction between the specified points.
-     *
-     * @param p1 The first point.
-     * @param p2 The second point.
-     */
-    Vector3(const Vector3& p1, const Vector3& p2);
-
-    /**
-     * Constructs a new vector that is a copy of the specified vector.
-     *
-     * @param copy The vector to copy.
-     */
-    Vector3(const Vector3& copy);
-
-    /**
-     * Creates a new vector from an integer interpreted as an RGB value.
-     * E.g. 0xff0000 represents red or the vector (1, 0, 0).
-     *
-     * @param color The integer to interpret as an RGB value.
-     *
-     * @return A vector corresponding to the interpreted RGB color.
-     */
-    static Vector3 fromColor(unsigned int color);
-
-    /**
-     * Destructor.
-     */
-    ~Vector3();
-
-    /**
-     * Returns the zero vector.
-     *
-     * @return The 3-element vector of 0s.
-     */
-    static const Vector3& zero();
-
-    /**
-     * Returns the one vector.
-     *
-     * @return The 3-element vector of 1s.
-     */
-    static const Vector3& one();
-
-    /**
-     * Returns the unit x vector.
-     *
-     * @return The 3-element unit vector along the x axis.
-     */
-    static const Vector3& unitX();
-
-    /**
-     * Returns the unit y vector.
-     *
-     * @return The 3-element unit vector along the y axis.
-     */
-    static const Vector3& unitY();
-
-    /**
-     * Returns the unit z vector.
-     *
-     * @return The 3-element unit vector along the z axis.
-     */
-    static const Vector3& unitZ();
-
-    /**
-     * Indicates whether this vector contains all zeros.
-     *
-     * @return true if this vector contains all zeros, false otherwise.
-     */
-    bool isZero() const;
-
-    /**
-     * Indicates whether this vector contains all ones.
-     *
-     * @return true if this vector contains all ones, false otherwise.
-     */
-    bool isOne() const;
-
-    /**
-     * Returns the angle (in radians) between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The angle between the two vectors (in radians).
-     */
-    static float angle(const Vector3& v1, const Vector3& v2);
-
-
-    /**
-     * Adds the elements of the specified vector to this one.
-     *
-     * @param v The vector to add.
-     */
-    void add(const Vector3& v);
-
-    /**
-     * Adds the specified vectors and stores the result in dst.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst A vector to store the result in.
-     */
-    static void add(const Vector3& v1, const Vector3& v2, Vector3* dst);
-
-    /**
-     * Clamps this vector within the specified range.
-     *
-     * @param min The minimum value.
-     * @param max The maximum value.
-     */
-    void clamp(const Vector3& min, const Vector3& max);
-
-    /**
-     * Clamps the specified vector within the specified range and returns it in dst.
-     *
-     * @param v The vector to clamp.
-     * @param min The minimum value.
-     * @param max The maximum value.
-     * @param dst A vector to store the result in.
-     */
-    static void clamp(const Vector3& v, const Vector3& min, const Vector3& max, Vector3* dst);
-
-    /**
-     * Sets this vector to the cross product between itself and the specified vector.
-     *
-     * @param v The vector to compute the cross product with.
-     */
-    void cross(const Vector3& v);
-
-    /**
-     * Computes the cross product of the specified vectors and stores the result in dst.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst A vector to store the result in.
-     */
-    static void cross(const Vector3& v1, const Vector3& v2, Vector3* dst);
-
-    /**
-     * Returns the distance between this vector and v.
-     *
-     * @param v The other vector.
-     * 
-     * @return The distance between this vector and v.
-     * 
-     * @see distanceSquared
-     */
-    float distance(const Vector3& v) const;
-
-    /**
-     * Returns the squared distance between this vector and v.
-     *
-     * When it is not neccessary to get the exact distance between
-     * two vectors (for example, when simply comparing the
-     * distance between different vectors), it is advised to use
-     * this method instead of distance.
-     *
-     * @param v The other vector.
-     * 
-     * @return The squared distance between this vector and v.
-     * 
-     * @see distance
-     */
-    float distanceSquared(const Vector3& v) const;
-
-    /**
-     * Returns the dot product of this vector and the specified vector.
-     *
-     * @param v The vector to compute the dot product with.
-     * 
-     * @return The dot product.
-     */
-    float dot(const Vector3& v);
-
-    /**
-     * Returns the dot product between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The dot product between the vectors.
-     */
-    static float dot(const Vector3& v1, const Vector3& v2);
-
-    /**
-     * Computes the length of this vector.
-     *
-     * @return The length of the vector.
-     * 
-     * @see lengthSquared
-     */
-    float length() const;
-
-    /**
-     * Returns the squared length of this vector.
-     *
-     * When it is not neccessary to get the exact length of a
-     * vector (for example, when simply comparing the lengths of
-     * different vectors), it is advised to use this method
-     * instead of length.
-     *
-     * @return The squared length of the vector.
-     * 
-     * @see length
-     */
-    float lengthSquared() const;
-
-    /**
-     * Negates this vector.
-     */
-    void negate();
-
-    /**
-     * Normalizes this vector.
-     *
-     * This method normalizes this Vector3 so that it is of
-     * unit length (in other words, the length of the vector
-     * after calling this method will be 1.0f). If the vector
-     * already has unit length or if the length of the vector
-     * is zero, this method does nothing.
-     */
-    void normalize();
-
-    /**
-     * Normalizes this vector and stores the result in dst.
-     *
-     * If the vector already has unit length or if the length
-     * of the vector is zero, this method simply copies the
-     * current vector into dst.
-     *
-     * @param dst The destination vector.
-     */
-    void normalize(Vector3* dst) const;
-
-    /**
-     * Scales all elements of this vector by the specified value.
-     *
-     * @param scalar The scalar value.
-     */
-    void scale(float scalar);
-
-    /**
-     * Sets the elements of this vector to the specified values.
-     *
-     * @param x The new x coordinate.
-     * @param y The new y coordinate.
-     * @param z The new z coordinate.
-     */
-    void set(float x, float y, float z);
-
-    /**
-     * Sets the elements of this vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y, z.
-     */
-    void set(float* array);
-
-    /**
-     * Sets the elements of this vector to those in the specified vector.
-     *
-     * @param v The vector to copy.
-     */
-    void set(const Vector3& v);
-
-    /**
-     * Sets this vector to the directional vector between the specified points.
-     */
-    void set(const Vector3& p1, const Vector3& p2);
-
-    /**
-     * Subtracts this vector and the specified vector as (this - v)
-     * and stores the result in this vector.
-     *
-     * @param v The vector to subtract.
-     */
-    void subtract(const Vector3& v);
-
-    /**
-     * Subtracts the specified vectors and stores the result in dst.
-     * The resulting vector is computed as (v1 - v2).
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst The destination vector.
-     */
-    static void subtract(const Vector3& v1, const Vector3& v2, Vector3* dst);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector3 operator+(const Vector3& v);
-
-    /**
-     * Adds the given vector to this vector.
-     * 
-     * @param v The vector to add.
-     * @return This vector, after the addition occurs.
-     */
-    inline Vector3& operator+=(const Vector3& v);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector3 operator-(const Vector3& v);
-
-    /**
-     * Subtracts the given vector from this vector.
-     * 
-     * @param v The vector to subtract.
-     * @return This vector, after the subtraction occurs.
-     */
-    inline Vector3& operator-=(const Vector3& v);
-
-    /**
-     * Calculates the negation of this vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @return The negation of this vector.
-     */
-    inline Vector3 operator-();
-
-    /**
-     * Calculates the scalar product of this vector with the given value.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param x The value to scale by.
-     * @return The scaled vector.
-     */
-    inline Vector3 operator*(float x);
-
-    /**
-     * Scales this vector by the given value.
-     * 
-     * @param x The value to scale by.
-     * @return This vector, after the scale occurs.
-     */
-    inline Vector3& operator*=(float x);
-
-    /**
-     * Determines if this vector is less than the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is less than the given vector, false otherwise.
-     */
-    inline bool operator<(const Vector3& v) const;
-
-    /**
-     * Determines if this vector is equal to the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is equal to the given vector, false otherwise.
-     */
-    inline bool operator==(const Vector3& v) const;
-};
-
-/**
- * Calculates the scalar product of the given vector with the given value.
- * 
- * @param x The value to scale by.
- * @param v The vector to scale.
- * @return The scaled vector.
- */
-inline Vector3 operator*(float x, const Vector3& v);
-
-}
-
-#include "Vector3.inl"
-
-#endif

+ 0 - 82
gameplay-encoder/src/Vector3.inl

@@ -1,82 +0,0 @@
-/** 
- * Vector3.inl
- */
-
-#include "Vector3.h"
-#include "Matrix.h"
-
-namespace gameplay
-{
-
-inline Vector3 Vector3::operator+(const Vector3& v)
-{
-    Vector3 result(*this);
-    result.add(v);
-    return result;
-}
-
-inline Vector3& Vector3::operator+=(const Vector3& v)
-{
-    add(v);
-    return *this;
-}
-
-inline Vector3 Vector3::operator-(const Vector3& v)
-{
-    Vector3 result(*this);
-    result.subtract(v);
-    return result;
-}
-
-inline Vector3& Vector3::operator-=(const Vector3& v)
-{
-    subtract(v);
-    return *this;
-}
-
-inline Vector3 Vector3::operator-()
-{
-    Vector3 result(*this);
-    result.negate();
-    return result;
-}
-
-inline Vector3 Vector3::operator*(float x)
-{
-    Vector3 result(*this);
-    result.scale(x);
-    return result;
-}
-
-inline Vector3& Vector3::operator*=(float x)
-{
-    scale(x);
-    return *this;
-}
-
-inline bool Vector3::operator<(const Vector3& v) const
-{
-    if (x == v.x)
-    {
-        if (y == v.y)
-        {
-            return z < v.z;
-        }
-        return y < v.y;
-    }
-    return x < v.x;
-}
-
-inline bool Vector3::operator==(const Vector3& v) const
-{
-    return x==v.x && y==v.y && z==v.z;
-}
-
-inline Vector3 operator*(float x, const Vector3& v)
-{
-    Vector3 result(v);
-    result.scale(x);
-    return result;
-}
-
-}

+ 0 - 330
gameplay-encoder/src/Vector4.cpp

@@ -1,330 +0,0 @@
-#include "Base.h"
-#include "Vector4.h"
-
-namespace gameplay
-{
-
-Vector4::Vector4()
-    : x(0.0f), y(0.0f), z(0.0f), w(0.0f)
-{
-}
-
-Vector4::Vector4(float x, float y, float z, float w)
-{
-    set(x, y, z, w);
-}
-
-Vector4::Vector4(float* src)
-{
-    set(src);
-}
-
-Vector4::Vector4(const Vector4& p1, const Vector4& p2)
-{
-    set(p1, p2);
-}
-
-Vector4::Vector4(const Vector4& copy)
-{
-    set(copy);
-}
-
-Vector4 Vector4::fromColor(unsigned int color)
-{
-    float components[4];
-    int componentIndex = 0;
-    for (int i = 3; i >= 0; --i)
-    {
-        int component = (color >> i*8) & 0x000000ff;
-
-        components[componentIndex++] = static_cast<float>(component) / 255.0f;
-    }
-
-    Vector4 value(components);
-    return value;
-}
-
-Vector4::~Vector4()
-{
-}
-
-const Vector4& Vector4::zero()
-{
-    static Vector4 value(0.0f, 0.0f, 0.0f, 0.0f);
-    return value;
-}
-
-const Vector4& Vector4::one()
-{
-    static Vector4 value(1.0f, 1.0f, 1.0f, 1.0f);
-    return value;
-}
-
-const Vector4& Vector4::unitX()
-{
-    static Vector4 value(1.0f, 0.0f, 0.0f, 0.0f);
-    return value;
-}
-
-const Vector4& Vector4::unitY()
-{
-    static Vector4 value(0.0f, 1.0f, 0.0f, 0.0f);
-    return value;
-}
-
-const Vector4& Vector4::unitZ()
-{
-    static Vector4 value(0.0f, 0.0f, 1.0f, 0.0f);
-    return value;
-}
-
-const Vector4& Vector4::unitW()
-{
-    static Vector4 value(0.0f, 0.0f, 0.0f, 1.0f);
-    return value;
-}
-
-bool Vector4::isZero() const
-{
-    return x == 0.0f && y == 0.0f && z == 0.0f && w == 0.0f;
-}
-
-bool Vector4::isOne() const
-{
-    return x == 1.0f && y == 1.0f && z == 1.0f && z == 1.0f;
-}
-
-float Vector4::angle(const Vector4& v1, const Vector4& v2)
-{
-    float dx = v1.w * v2.x - v1.x * v2.w - v1.y * v2.z + v1.z * v2.y;
-    float dy = v1.w * v2.y - v1.y * v2.w - v1.z * v2.x + v1.x * v2.z;
-    float dz = v1.w * v2.z - v1.z * v2.w - v1.x * v2.y + v1.y * v2.x;
-
-    return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
-}
-
-void Vector4::add(const Vector4& v)
-{
-    x += v.x;
-    y += v.y;
-    z += v.z;
-    w += v.w;
-}
-
-void Vector4::add(const Vector4& v1, const Vector4& v2, Vector4* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x + v2.x;
-    dst->y = v1.y + v2.y;
-    dst->z = v1.z + v2.z;
-    dst->w = v1.w + v2.w;
-}
-
-void Vector4::clamp(const Vector4& min, const Vector4& max)
-{
-    assert(!( min.x > max.x || min.y > max.y || min.z > max.z || min.w > max.w));
-
-    // Clamp the x value.
-    if ( x < min.x )
-        x = min.x;
-    if ( x > max.x )
-        x = max.x;
-
-    // Clamp the y value.
-    if ( y < min.y )
-        y = min.y;
-    if ( y > max.y )
-        y = max.y;
-
-    // Clamp the z value.
-    if ( z < min.z )
-        z = min.z;
-    if ( z > max.z )
-        z = max.z;
-
-    // Clamp the z value.
-    if ( w < min.w )
-        w = min.w;
-    if ( w > max.w )
-        w = max.w;
-}
-
-void Vector4::clamp(const Vector4& v, const Vector4& min, const Vector4& max, Vector4* dst)
-{
-    assert(dst);
-    assert(!( min.x > max.x || min.y > max.y || min.z > max.z || min.w > max.w));
-
-    // Clamp the x value.
-    dst->x = v.x;
-    if ( dst->x < min.x )
-        dst->x = min.x;
-    if ( dst->x > max.x )
-        dst->x = max.x;
-
-    // Clamp the y value.
-    dst->y = v.y;
-    if ( dst->y < min.y )
-        dst->y = min.y;
-    if ( dst->y > max.y )
-        dst->y = max.y;
-
-    // Clamp the z value.
-    dst->z = v.z;
-    if ( dst->z < min.z )
-        dst->z = min.z;
-    if ( dst->z > max.z )
-        dst->z = max.z;
-
-    // Clamp the w value.
-    dst->w = v.w;
-    if ( dst->w < min.w )
-        dst->w = min.w;
-    if ( dst->w > max.w )
-        dst->w = max.w;
-}
-
-float Vector4::distance(const Vector4& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-    float dz = v.z - z;
-    float dw = v.w - w;
-
-    return sqrt(dx * dx + dy * dy + dz * dz + dw * dw);
-}
-
-float Vector4::distanceSquared(const Vector4& v) const
-{
-    float dx = v.x - x;
-    float dy = v.y - y;
-    float dz = v.z - z;
-    float dw = v.w - w;
-
-    return (dx * dx + dy * dy + dz * dz + dw * dw);
-}
-
-float Vector4::dot(const Vector4& v)
-{
-    return (x * v.x + y * v.y + z * v.z + w * v.w);
-}
-
-float Vector4::dot(const Vector4& v1, const Vector4& v2)
-{
-    return (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w);
-}
-
-float Vector4::length() const
-{
-    return sqrt(x * x + y * y + z * z + w * w);
-}
-
-
-float Vector4::lengthSquared() const
-{
-    return (x * x + y * y + z * z + w * w);
-}
-
-void Vector4::negate()
-{
-    x = -x;
-    y = -y;
-    z = -z;
-    w = -w;
-}
-
-void Vector4::normalize()
-{
-    normalize(this);
-}
-
-void Vector4::normalize(Vector4* dst)
-{
-    assert(dst);
-
-    if (dst != this)
-    {
-        dst->x = x;
-        dst->y = y;
-        dst->z = z;
-        dst->w = w;
-    }
-
-    float n = x * x + y * y + z * z + w * w;
-    // Already normalized.
-    if (n == 1.0f)
-        return;
-
-    n = sqrt(n);
-    // Too close to zero.
-    if (n < MATH_TOLERANCE)
-        return;
-
-    n = 1.0f / n;
-    dst->x *= n;
-    dst->y *= n;
-    dst->z *= n;
-    dst->w *= n;
-}
-
-void Vector4::scale(float scalar)
-{
-    x *= scalar;
-    y *= scalar;
-    z *= scalar;
-    w *= scalar;
-}
-
-void Vector4::set(float x, float y, float z, float w)
-{
-    this->x = x;
-    this->y = y;
-    this->z = z;
-    this->w = w;
-}
-
-void Vector4::set(float* array)
-{
-    assert(array);
-
-    x = array[0];
-    y = array[1];
-    z = array[2];
-    w = array[3];
-}
-
-void Vector4::set(const Vector4& v)
-{
-    this->x = v.x;
-    this->y = v.y;
-    this->z = v.z;
-    this->w = v.w;
-}
-
-void Vector4::set(const Vector4& p1, const Vector4& p2)
-{
-    x = p2.x - p1.x;
-    y = p2.y - p1.y;
-    z = p2.z - p1.z;
-    w = p2.w - p1.w;
-}
-
-void Vector4::subtract(const Vector4& v)
-{
-    x -= v.x;
-    y -= v.y;
-    z -= v.z;
-    w -= v.w;
-}
-
-void Vector4::subtract(const Vector4& v1, const Vector4& v2, Vector4* dst)
-{
-    assert(dst);
-
-    dst->x = v1.x - v2.x;
-    dst->y = v1.y - v2.y;
-    dst->z = v1.z - v2.z;
-    dst->w = v1.w - v2.w;
-}
-
-}

+ 0 - 438
gameplay-encoder/src/Vector4.h

@@ -1,438 +0,0 @@
-#ifndef VECTOR4_H_
-#define VECTOR4_H_
-
-namespace gameplay
-{
-
-class Matrix;
-
-/**
- * Defines 4-element floating point vector.
- */
-class Vector4
-{
-public:
-
-    /**
-     * The x-coordinate.
-     */
-    float x;
-
-    /**
-     * The y-coordinate.
-     */
-    float y;
-
-    /**
-     * The z-coordinate.
-     */
-    float z;
-
-    /**
-     * The w-coordinate.
-     */
-    float w;
-
-    /**
-     * Constructs a new vector initialized to all zeros.
-     */
-    Vector4();
-
-    /**
-     * Constructs a new vector initialized to the specified values.
-     *
-     * @param x The x coordinate.
-     * @param y The y coordinate.
-     * @param z The z coordinate.
-     * @param w The w coordinate.
-     */
-    Vector4(float x, float y, float z, float w);
-
-    /**
-     * Constructs a new vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y, z, w.
-     */
-    Vector4(float* array);
-
-    /**
-     * Constructs a vector that describes the direction between the specified points.
-     *
-     * @param p1 The first point.
-     * @param p2 The second point.
-     */
-    Vector4(const Vector4& p1, const Vector4& p2);
-
-    /**
-     * Constructor.
-     *
-     * Creates a new vector that is a copy of the specified vector.
-     *
-     * @param copy The vector to copy.
-     */
-    Vector4(const Vector4& copy);
-
-    /**
-     * Creates a new vector from an integer interpreted as an RGBA value.
-     * E.g. 0xff0000ff represents opaque red or the vector (1, 0, 0, 1).
-     *
-     * @param color The integer to interpret as an RGBA value.
-     *
-     * @return A vector corresponding to the interpreted RGBA color.
-     */
-    static Vector4 fromColor(unsigned int color);
-
-    /**
-     * Destructor.
-     */
-    ~Vector4();
-
-    /**
-     * Returns the zero vector.
-     *
-     * @return The 4-element vector of 0s.
-     */
-    static const Vector4& zero();
-
-    /**
-     * Returns the one vector.
-     *
-     * @return The 4-element vector of 1s.
-     */
-    static const Vector4& one();
-
-    /**
-     * Returns the unit x vector.
-     *
-     * @return The 4-element unit vector along the x axis.
-     */
-    static const Vector4& unitX();
-
-    /**
-     * Returns the unit y vector.
-     *
-     * @return The 4-element unit vector along the y axis.
-     */
-    static const Vector4& unitY();
-
-    /**
-     * Returns the unit z vector.
-     *
-     * @return The 4-element unit vector along the z axis.
-     */
-    static const Vector4& unitZ();
-
-    /**
-     * Returns the unit w vector.
-     *
-     * @return The 4-element unit vector along the w axis.
-     */
-    static const Vector4& unitW();
-
-    /**
-     * Indicates whether this vector contains all zeros.
-     *
-     * @return true if this vector contains all zeros, false otherwise.
-     */
-    bool isZero() const;
-
-    /**
-     * Indicates whether this vector contains all ones.
-     *
-     * @return true if this vector contains all ones, false otherwise.
-     */
-    bool isOne() const;
-
-    /**
-     * Returns the angle (in radians) between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The angle between the two vectors (in radians).
-     */
-    static float angle(const Vector4& v1, const Vector4& v2);
-
-    /**
-     * Adds the elements of the specified vector to this one.
-     *
-     * @param v The vector to add.
-     */
-    void add(const Vector4& v);
-
-    /**
-     * Adds the specified vectors and stores the result in dst.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst A vector to store the result in.
-     */
-    static void add(const Vector4& v1, const Vector4& v2, Vector4* dst);
-
-    /**
-     * Clamps this vector within the specified range.
-     *
-     * @param min The minimum value.
-     * @param max The maximum value.
-     */
-    void clamp(const Vector4& min, const Vector4& max);
-
-    /**
-     * Clamps the specified vector within the specified range and returns it in dst.
-     *
-     * @param v The vector to clamp.
-     * @param min The minimum value.
-     * @param max The maximum value.
-     * @param dst A vector to store the result in.
-     */
-    static void clamp(const Vector4& v, const Vector4& min, const Vector4& max, Vector4* dst);
-
-    /**
-     * Returns the distance between this vector and v.
-     *
-     * @param v The other vector.
-     * 
-     * @return The distance between this vector and v.
-     * 
-     * @see distanceSquared
-     */
-    float distance(const Vector4& v) const;
-
-    /**
-     * Returns the squared distance between this vector and v.
-     *
-     * When it is not neccessary to get the exact distance between
-     * two vectors (for example, when simply comparing the
-     * distance between different vectors), it is advised to use
-     * this method instead of distance.
-     *
-     * @param v The other vector.
-     * 
-     * @return The squared distance between this vector and v.
-     * 
-     * @see distance
-     */
-    float distanceSquared(const Vector4& v) const;
-
-    /**
-     * Returns the dot product of this vector and the specified vector.
-     *
-     * @param v The vector to compute the dot product with.
-     * 
-     * @return The dot product.
-     */
-    float dot(const Vector4& v);
-
-    /**
-     * Returns the dot product between the specified vectors.
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * 
-     * @return The dot product between the vectors.
-     */
-    static float dot(const Vector4& v1, const Vector4& v2);
-
-    /**
-     * Computes the length of this vector.
-     *
-     * @return The length of the vector.
-     * 
-     * @see lengthSquared
-     */
-    float length() const;
-
-    /**
-     * Returns the squared length of this vector.
-     *
-     * When it is not neccessary to get the exact length of a
-     * vector (for example, when simply comparing the lengths of
-     * different vectors), it is advised to use this method
-     * instead of length.
-     *
-     * @return The squared length of the vector.
-     * 
-     * @see length
-     */
-    float lengthSquared() const;
-
-    /**
-     * Negates this vector.
-     */
-    void negate();
-
-    /**
-     * Normalizes this vector.
-     *
-     * This method normalizes this Vector4 so that it is of
-     * unit length (in other words, the length of the vector
-     * after calling this method will be 1.0f). If the vector
-     * already has unit length or if the length of the vector
-     * is zero, this method does nothing.
-     */
-    void normalize();
-
-    /**
-     * Normalizes this vector and stores the result in dst.
-     *
-     * If the vector already has unit length or if the length
-     * of the vector is zero, this method simply copies the
-     * current vector into dst.
-     *
-     * @param dst The destination vector.
-     */
-    void normalize(Vector4* dst);
-
-    /**
-     * Scales all elements of this vector by the specified value.
-     *
-     * @param scalar The scalar value.
-     */
-    void scale(float scalar);
-
-    /**
-     * Sets the elements of this vector to the specified values.
-     *
-     * @param x The new x coordinate.
-     * @param y The new y coordinate.
-     * @param z The new z coordinate.
-     * @param w The new w coordinate.
-     */
-    void set(float x, float y, float z, float w);
-
-    /**
-     * Sets the elements of this vector from the values in the specified array.
-     *
-     * @param array An array containing the elements of the vector in the order x, y, z, w.
-     */
-    void set(float* array);
-
-    /**
-     * Sets the elements of this vector to those in the specified vector.
-     *
-     * @param v The vector to copy.
-     */
-    void set(const Vector4& v);
-
-    /**
-     * Sets this vector to the directional vector between the specified points.
-     * 
-     * @param p1 The first point.
-     * @param p2 The second point.
-     */
-    void set(const Vector4& p1, const Vector4& p2);
-
-    /**
-     * Subtracts this vector and the specified vector as (this - v)
-     * and stores the result in this vector.
-     *
-     * @param v The vector to subtract.
-     */
-    void subtract(const Vector4& v);
-
-    /**
-     * Subtracts the specified vectors and stores the result in dst.
-     * The resulting vector is computed as (v1 - v2).
-     *
-     * @param v1 The first vector.
-     * @param v2 The second vector.
-     * @param dst The destination vector.
-     */
-    static void subtract(const Vector4& v1, const Vector4& v2, Vector4* dst);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector4 operator+(const Vector4& v);
-
-    /**
-     * Adds the given vector to this vector.
-     * 
-     * @param v The vector to add.
-     * @return This vector, after the addition occurs.
-     */
-    inline Vector4& operator+=(const Vector4& v);
-
-    /**
-     * Calculates the sum of this vector with the given vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param v The vector to add.
-     * @return The vector sum.
-     */
-    inline Vector4 operator-(const Vector4& v);
-
-    /**
-     * Subtracts the given vector from this vector.
-     * 
-     * @param v The vector to subtract.
-     * @return This vector, after the subtraction occurs.
-     */
-    inline Vector4& operator-=(const Vector4& v);
-
-    /**
-     * Calculates the negation of this vector.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @return The negation of this vector.
-     */
-    inline Vector4 operator-();
-
-    /**
-     * Calculates the scalar product of this vector with the given value.
-     * 
-     * Note: this does not modify this vector.
-     * 
-     * @param x The value to scale by.
-     * @return The scaled vector.
-     */
-    inline Vector4 operator*(float x);
-
-    /**
-     * Scales this vector by the given value.
-     * 
-     * @param x The value to scale by.
-     * @return This vector, after the scale occurs.
-     */
-    inline Vector4& operator*=(float x);
-
-    /**
-     * Determines if this vector is less than the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is less than the given vector, false otherwise.
-     */
-    inline bool operator<(const Vector4& v) const;
-
-    /**
-     * Determines if this vector is equal to the given vector.
-     * 
-     * @param v The vector to compare against.
-     * 
-     * @return True if this vector is equal to the given vector, false otherwise.
-     */
-    inline bool operator==(const Vector4& v) const;
-};
-
-/**
- * Calculates the scalar product of the given vector with the given value.
- * 
- * @param x The value to scale by.
- * @param v The vector to scale.
- * @return The scaled vector.
- */
-inline Vector4 operator*(float x, const Vector4& v);
-
-}
-
-#include "Vector4.inl"
-
-#endif

+ 0 - 89
gameplay-encoder/src/Vector4.inl

@@ -1,89 +0,0 @@
-/** 
- * Vector4.inl
- */
-
-#include "Matrix.h"
-#include "Vector4.h"
-
-namespace gameplay
-{
-
-inline Vector4 Vector4::operator+(const Vector4& v)
-{
-    Vector4 result(*this);
-    result.add(v);
-    return result;
-}
-
-inline Vector4& Vector4::operator+=(const Vector4& v)
-{
-    add(v);
-    return *this;
-}
-
-inline Vector4 Vector4::operator-(const Vector4& v)
-{
-    Vector4 result(*this);
-    result.subtract(v);
-    return result;
-}
-
-inline Vector4& Vector4::operator-=(const Vector4& v)
-{
-    subtract(v);
-    return *this;
-}
-
-inline Vector4 Vector4::operator-()
-{
-    Vector4 result(*this);
-    result.negate();
-    return result;
-}
-
-inline Vector4 Vector4::operator*(float x)
-{
-    Vector4 result(*this);
-    result.scale(x);
-    return result;
-}
-
-inline Vector4& Vector4::operator*=(float x)
-{
-    scale(x);
-    return *this;
-}
-
-inline bool Vector4::operator<(const Vector4& v) const
-{
-    if (x == v.x)
-    {
-        if (y == v.y)
-        {
-            if (z < v.z)
-            {
-                if (w < v.w)
-                {
-                    return w < v.w;
-                }
-            }
-            return z < v.z;
-        }
-        return y < v.y;
-    }
-    return x < v.x;
-}
-
-inline bool Vector4::operator==(const Vector4& v) const
-{
-    return x==v.x && y==v.y && z==v.z && w==v.w;
-}
-
-inline Vector4 operator*(float x, const Vector4& v)
-{
-    Vector4 result(v);
-    result.scale(x);
-    return result;
-}
-
-}

+ 0 - 114
gameplay-encoder/src/Vertex.cpp

@@ -1,114 +0,0 @@
-#include "Base.h"
-#include "Vertex.h"
-
-namespace gameplay
-{
-
-Vertex::Vertex(void)
-    : hasNormal(false), hasTangent(false), hasBinormal(false), hasTexCoord(false), hasDiffuse(false), hasWeights(false)
-{
-}
-
-Vertex::~Vertex(void)
-{
-}
-
-unsigned int Vertex::byteSize() const
-{
-    unsigned int count = POSITION_COUNT;
-    if (hasNormal)
-        count += NORMAL_COUNT;
-    if (hasTangent)
-        count += TANGENT_COUNT;
-    if (hasBinormal)
-        count += BINORMAL_COUNT;
-    if (hasTexCoord)
-        count += TEXCOORD_COUNT;
-    if (hasWeights)
-        count += BLEND_WEIGHTS_COUNT + BLEND_INDICES_COUNT;
-    if (hasDiffuse)
-        count += DIFFUSE_COUNT;
-    return count * sizeof(float);
-}
-
-void Vertex::writeBinary(FILE* file) const
-{
-    writeVectorBinary(position, file);
-    if (hasNormal)
-    {
-        writeVectorBinary(normal, file);
-    }
-    if (hasTangent)
-    {
-        writeVectorBinary(tangent, file);
-    }
-    if (hasBinormal)
-    {
-        writeVectorBinary(binormal, file);
-    }
-    if (hasTexCoord)
-    {
-        writeVectorBinary(texCoord, file);
-    }
-    if (hasDiffuse)
-    {
-        writeVectorBinary(diffuse, file);
-    }
-    if (hasWeights)
-    {
-        writeVectorBinary(blendWeights, file);
-        writeVectorBinary(blendIndices, file);
-    }
-}
-
-void Vertex::writeText(FILE* file) const
-{
-    write("// position\n", file);
-    writeVectorText(position, file);
-    if (hasNormal)
-    {
-        write("// normal\n", file);
-        writeVectorText(normal, file);
-    }
-    if (hasTangent)
-    {
-        write("// tanget\n", file);
-        writeVectorText(tangent, file);
-    }
-    if (hasBinormal)
-    {
-        write("// binormal\n", file);
-        writeVectorText(binormal, file);
-    }
-    if (hasTexCoord)
-    {
-        write("// texCoord\n", file);
-        writeVectorText(texCoord, file);
-    }
-    if (hasDiffuse)
-    {
-        write("// diffuse\n", file);
-        writeVectorText(diffuse, file);
-    }
-    if (hasWeights)
-    {
-        write("// blendWeights\n", file);
-        writeVectorText(blendWeights, file);
-        write("// blendIndices\n", file);
-        writeVectorText(blendIndices, file);
-    }
-}
-
-void Vertex::normalizeBlendWeight()
-{
-    float total = blendWeights.x + blendWeights.y + blendWeights.z + blendWeights.w;
-    if (total > 0.0f)
-    {
-        blendWeights.x = blendWeights.x / total;
-        blendWeights.y = blendWeights.y / total;
-        blendWeights.z = blendWeights.z / total;
-        blendWeights.w = blendWeights.w / total;
-    }   
-}
-
-}

+ 0 - 112
gameplay-encoder/src/Vertex.h

@@ -1,112 +0,0 @@
-#ifndef VERTEX_H_
-#define VERTEX_H_
-
-#include "FileIO.h"
-#include "Vector2.h"
-#include "Vector3.h"
-#include "Vector4.h"
-
-namespace gameplay
-{
-
-class Vertex
-{
-public:
-
-    static const unsigned int POSITION_COUNT = 3;
-    static const unsigned int NORMAL_COUNT = 3;
-    static const unsigned int TANGENT_COUNT = 3;
-    static const unsigned int BINORMAL_COUNT = 3;
-    static const unsigned int TEXCOORD_COUNT = 2;
-    static const unsigned int DIFFUSE_COUNT = 4;
-    static const unsigned int BLEND_WEIGHTS_COUNT = 4;
-    static const unsigned int BLEND_INDICES_COUNT = 4;
-
-    /**
-     * Constructor.
-     */
-    Vertex(void);
-
-    /**
-     * Destructor.
-     */
-    ~Vertex(void);
-
-    Vector3 position;
-    Vector3 normal;
-    Vector3 tangent;
-    Vector3 binormal;
-    Vector2 texCoord;
-    Vector4 diffuse;
-
-    Vector4 blendWeights;
-    Vector4 blendIndices;
-
-    bool hasNormal, hasTangent, hasBinormal, hasTexCoord, hasDiffuse, hasWeights;
-
-    inline bool operator<(const Vertex& v) const
-    {
-        if (position == v.position)
-        {
-            if (normal == v.normal)
-            {
-                if (tangent == v.tangent)
-                {
-                    if (binormal == v.binormal)
-                    {
-                        if (texCoord == v.texCoord)
-                        {
-                            if (diffuse == v.diffuse)
-                            {
-                                if (blendWeights == v.blendWeights)
-                                {
-                                    if (blendIndices == v.blendIndices)
-                                    {
-                                        return false;
-                                    }
-                                    return blendIndices < v.blendIndices;
-                                }
-                                return blendWeights < v.blendWeights;
-                            }
-                            return diffuse < v.diffuse;
-                        }
-                        return texCoord < v.texCoord;
-                    }
-                    return binormal < v.binormal;
-                }
-                return tangent < v.tangent;
-            }
-            return normal < v.normal;
-        }
-        return position < v.position;
-    }
-
-    inline bool operator==(const Vertex& v) const
-    {
-        return position==v.position && normal==v.normal && tangent==v.tangent && binormal==v.binormal && texCoord==v.texCoord &&
-            diffuse==v.diffuse && blendWeights==v.blendWeights && blendIndices==v.blendIndices;
-    }
-
-    /**
-     * Returns the size of this vertex in bytes.
-     */
-    unsigned int byteSize() const;
-
-    /**
-     * Writes this vertex to the binary file stream.
-     */
-    void writeBinary(FILE* file) const;
-
-    /**
-     * Writes this vertex to a text file stream.
-     */
-    void writeText(FILE* file) const;
-
-    /**
-     * Normalizes the blend weights of this vertex so that they add up to 1.0.
-     */
-    void normalizeBlendWeight();
-};
-}
-
-#endif

+ 0 - 76
gameplay-encoder/src/VertexElement.cpp

@@ -1,76 +0,0 @@
-#include "Base.h"
-#include "VertexElement.h"
-
-namespace gameplay
-{
-
-VertexElement::VertexElement(unsigned int t, unsigned int c) :
-    usage(t),
-    size(c)
-{
-}
-
-VertexElement::~VertexElement(void)
-{
-}
-const char* VertexElement::getElementName(void) const
-{
-    return "VertexElement";
-}
-
-void VertexElement::writeBinary(FILE* file)
-{
-    Object::writeBinary(file);
-    write(usage, file);
-    write(size, file);
-}
-void VertexElement::writeText(FILE* file)
-{
-    fprintElementStart(file);
-    fprintfElement(file, "usage", usageStr(usage));
-    fprintfElement(file, "size", size);
-    fprintElementEnd(file);
-}
-
-const char* VertexElement::usageStr(unsigned int usage)
-{
-    switch (usage)
-    {
-        case UNKNOWN:
-            return "UNKNOWN";
-        case POSITION:
-            return "POSITION";
-        case NORMAL:
-            return "NORMAL";
-        case COLOR:
-            return "COLOR";
-        case TANGENT:
-            return "TANGENT";
-        case BINORMAL:
-            return "BINORMAL";
-        case BLENDWEIGHTS:
-            return "BLENDWEIGHTS";
-        case BLENDINDICES:
-            return "BLENDINDICES";
-        case TEXCOORD0:
-            return "TEXCOORD0";
-        case TEXCOORD1:
-            return "TEXCOORD1";
-        case TEXCOORD2:
-            return "TEXCOORD2";
-        case TEXCOORD3:
-            return "TEXCOORD3";
-        case TEXCOORD4:
-            return "TEXCOORD4";
-        case TEXCOORD5:
-            return "TEXCOORD5";
-        case TEXCOORD6:
-            return "TEXCOORD6";
-        case TEXCOORD7:
-            return "TEXCOORD7";
-        default:
-            return "";
-    }
-}
-
-}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini