Browse Source

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

Conflicts:
	gameplay-samples/sample01-longboard/.cproject
Sean Paul Taylor 14 years ago
parent
commit
4d2af2d31e
72 changed files with 5536 additions and 1001 deletions
  1. 18 3
      .gitignore
  2. 17 7
      gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj
  3. 13 0
      gameplay.sln
  4. 412 396
      gameplay/.cproject
  5. 37 3
      gameplay/gameplay.vcxproj
  6. 99 1
      gameplay/gameplay.vcxproj.filters
  7. 598 462
      gameplay/gameplay.xcodeproj/project.pbxproj
  8. 76 15
      gameplay/src/AudioBuffer.cpp
  9. 27 0
      gameplay/src/Base.h
  10. 19 0
      gameplay/src/BoundingBox.h
  11. 23 0
      gameplay/src/BoundingBox.inl
  12. 19 0
      gameplay/src/BoundingSphere.h
  13. 23 0
      gameplay/src/BoundingSphere.inl
  14. 18 5
      gameplay/src/Game.cpp
  15. 10 0
      gameplay/src/Game.h
  16. 4 4
      gameplay/src/Input.h
  17. 25 6
      gameplay/src/Joint.cpp
  18. 16 0
      gameplay/src/Joint.h
  19. 4 4
      gameplay/src/Material.cpp
  20. 1 1
      gameplay/src/MaterialParameter.h
  21. 13 8
      gameplay/src/Matrix.cpp
  22. 137 20
      gameplay/src/Matrix.h
  23. 82 0
      gameplay/src/Matrix.inl
  24. 2 1
      gameplay/src/MeshSkin.cpp
  25. 3 0
      gameplay/src/MeshSkin.h
  26. 2 1
      gameplay/src/Model.cpp
  27. 3 3
      gameplay/src/Model.h
  28. 18 3
      gameplay/src/Node.cpp
  29. 28 1
      gameplay/src/Node.h
  30. 166 0
      gameplay/src/PhysicsConstraint.cpp
  31. 117 0
      gameplay/src/PhysicsConstraint.h
  32. 30 0
      gameplay/src/PhysicsConstraint.inl
  33. 346 0
      gameplay/src/PhysicsController.cpp
  34. 261 0
      gameplay/src/PhysicsController.h
  35. 24 0
      gameplay/src/PhysicsFixedConstraint.cpp
  36. 64 0
      gameplay/src/PhysicsFixedConstraint.h
  37. 30 0
      gameplay/src/PhysicsFixedConstraint.inl
  38. 71 0
      gameplay/src/PhysicsGenericConstraint.cpp
  39. 167 0
      gameplay/src/PhysicsGenericConstraint.h
  40. 90 0
      gameplay/src/PhysicsGenericConstraint.inl
  41. 51 0
      gameplay/src/PhysicsHingeConstraint.cpp
  42. 66 0
      gameplay/src/PhysicsHingeConstraint.h
  43. 71 0
      gameplay/src/PhysicsMotionState.cpp
  44. 59 0
      gameplay/src/PhysicsMotionState.h
  45. 258 0
      gameplay/src/PhysicsRigidBody.cpp
  46. 348 0
      gameplay/src/PhysicsRigidBody.h
  47. 146 0
      gameplay/src/PhysicsRigidBody.inl
  48. 58 0
      gameplay/src/PhysicsSocketConstraint.cpp
  49. 58 0
      gameplay/src/PhysicsSocketConstraint.h
  50. 67 0
      gameplay/src/PhysicsSpringConstraint.cpp
  51. 196 0
      gameplay/src/PhysicsSpringConstraint.h
  52. 70 0
      gameplay/src/PhysicsSpringConstraint.inl
  53. 1 1
      gameplay/src/Plane.cpp
  54. 20 1
      gameplay/src/Plane.h
  55. 23 0
      gameplay/src/Plane.inl
  56. 49 28
      gameplay/src/PlatformMacOS.mm
  57. 325 14
      gameplay/src/PlatformQNX.cpp
  58. 8 4
      gameplay/src/PlatformWin32.cpp
  59. 1 0
      gameplay/src/Properties.h
  60. 15 7
      gameplay/src/Quaternion.cpp
  61. 42 0
      gameplay/src/Quaternion.h
  62. 23 0
      gameplay/src/Quaternion.inl
  63. 19 0
      gameplay/src/Ray.h
  64. 23 0
      gameplay/src/Ray.inl
  65. 2 2
      gameplay/src/Technique.cpp
  66. 74 0
      gameplay/src/Vector2.h
  67. 63 0
      gameplay/src/Vector2.inl
  68. 74 0
      gameplay/src/Vector3.h
  69. 64 0
      gameplay/src/Vector3.inl
  70. 74 0
      gameplay/src/Vector4.h
  71. 64 0
      gameplay/src/Vector4.inl
  72. 11 0
      gameplay/src/gameplay.h

+ 18 - 3
.gitignore

@@ -14,6 +14,7 @@
 /Device-Profile
 /Device-Release
 /gameplay/Debug
+/gameplay/DebugMem
 /gameplay/Release
 /gameplay/Simulator
 /gameplay/Simulator-Coverage
@@ -25,7 +26,8 @@
 /gameplay-encoder/Debug
 /gameplay-encoder/Release
 /gameplay-samples/sample00-mesh/Debug
-/gameplay-samples/sample00-mesh//Release
+/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
@@ -34,7 +36,8 @@
 /gameplay-samples/sample00-mesh/Device-Profile
 /gameplay-samples/sample00-mesh/Device-Release
 /gameplay-samples/sample01-longboard/Debug
-/gameplay-samples/sample01-longboard//Release
+/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
@@ -43,6 +46,7 @@
 /gameplay-samples/sample01-longboard/Device-Profile
 /gameplay-samples/sample01-longboard/Device-Release
 /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
@@ -52,6 +56,7 @@
 /gameplay-samples/sample02-spaceship/Device-Profile
 /gameplay-samples/sample02-spaceship/Device-Release
 /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
@@ -59,4 +64,14 @@
 /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/Device-Release
+/gameplay-samples/sample04-sandbox/Debug
+/gameplay-samples/sample04-sandbox/DebugMem
+/gameplay-samples/sample04-sandbox/Release
+/gameplay-samples/sample04-sandbox/Simulator
+/gameplay-samples/sample04-sandbox/Simulator-Coverage
+/gameplay-samples/sample04-sandbox/Simulator-Profile
+/gameplay-samples/sample04-sandbox/Device-Debug
+/gameplay-samples/sample04-sandbox/Device-Coverage
+/gameplay-samples/sample04-sandbox/Device-Profile
+/gameplay-samples/sample04-sandbox/Device-Release

+ 17 - 7
gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj

@@ -185,14 +185,8 @@
 		42475CDB147208A000610A6A = {
 			isa = PBXGroup;
 			children = (
-				42D277571472EFA700D867A4 /* libpcre.a */,
-				42D277581472EFA700D867A4 /* libpcrecpp.a */,
-				42C8EE3A1472DAAE00E43619 /* libbz2.dylib */,
-				42C8EE381472DAA300E43619 /* libz.dylib */,
-				42C8EE361472D7E700E43619 /* libxml2.dylib */,
-				42C8EE341472B60100E43619 /* libfreetype.a */,
-				42475D7B14720ECE00610A6A /* libdom.a */,
 				42475CE9147208A000610A6A /* gameplay-encoder */,
+				427D4F44147DC9080076760E /* Libraries */,
 				42475CE7147208A000610A6A /* Products */,
 			);
 			sourceTree = "<group>";
@@ -295,6 +289,20 @@
 			path = "gameplay-encoder";
 			sourceTree = "<group>";
 		};
+		427D4F44147DC9080076760E /* Libraries */ = {
+			isa = PBXGroup;
+			children = (
+				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 */
@@ -483,6 +491,7 @@
 					"\"$(SRCROOT)/../external-deps/freetype2/lib/macos\"",
 					"\"$(SRCROOT)/../external-deps/collada-dom/lib/macos\"",
 					"\"$(SRCROOT)/../external-deps/pcre/lib/macos\"",
+					"\"$(SRCROOT)/../../../Library/Developer/Xcode/DerivedData/gameplay-exiunaubxxjndaapmcqkaoeboiob/Build/Products/Debug\"",
 				);
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -509,6 +518,7 @@
 					"\"$(SRCROOT)/../external-deps/freetype2/lib/macos\"",
 					"\"$(SRCROOT)/../external-deps/collada-dom/lib/macos\"",
 					"\"$(SRCROOT)/../external-deps/pcre/lib/macos\"",
+					"\"$(SRCROOT)/../../../Library/Developer/Xcode/DerivedData/gameplay-exiunaubxxjndaapmcqkaoeboiob/Build/Products/Debug\"",
 				);
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 13 - 0
gameplay.sln

@@ -25,6 +25,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample03-character", "gamep
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay-encoder", "gameplay-encoder\gameplay-encoder.vcxproj", "{9D69B743-4872-4DD1-8E30-0087C64298D7}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D3CA8AE2-3ED6-458B-963A-EDA671E6F51C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample04-sandbox", "gameplay-samples\sample04-sandbox\sample04-sandbox.vcxproj", "{FA260001-5B2E-41B7-86DD-C7F26DF3A485}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -68,6 +75,12 @@ Global
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.DebugMem|Win32.Build.0 = Debug|Win32
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.Release|Win32.ActiveCfg = Release|Win32
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.Release|Win32.Build.0 = Release|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Debug|Win32.Build.0 = Debug|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.DebugMem|Win32.Build.0 = DebugMem|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Release|Win32.ActiveCfg = Release|Win32
+		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 412 - 396
gameplay/.cproject

@@ -1,396 +1,412 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?>
-
-<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-	<storageModule moduleId="org.eclipse.cdt.core.settings">
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.17111725">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.17111725" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.17111725" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.17111725." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1686166742" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.545743487" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.158841187" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Debug}" id="cdt.managedbuild.target.gnu.builder.base.2098111998" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.96907942" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1765481355" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.311918799" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1481323494" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.2133604142" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.997142816" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.1988140188" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.1929307156" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1944074393" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.85592747" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1489037662" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.1824441870" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.908036009" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.821495066" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1650721640" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.release.936504809">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.936504809" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.936504809" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.release.936504809." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.release.11990035" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.33079389" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1117051584" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Release}" id="cdt.managedbuild.target.gnu.builder.base.1199322737" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.1345567866" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compiler.optlevel.1056793982" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
-								<option id="com.qnx.qcc.option.compiler.security.324540233" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.398688299" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.1670164593" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1380846613" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.855139060" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<inputType id="com.qnx.qcc.inputType.assembler.590404074" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.2038455782" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.langcpp.868659975" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.1604612317" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.823080047" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.97765823" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.851611337">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.851611337" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.851611337" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.851611337." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1494216018" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.1727548796" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1288889025" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Profile}" id="cdt.managedbuild.target.gnu.builder.base.831558871" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.1281156842" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.626405189" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.profile2.1207899085" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1649809766" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.276653249" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.1503059677" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.81809638" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.2145279747" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.1503034293" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1259311407" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.620187213" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1398587920" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.profile2.1507133006" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.67846367" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.427877434" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.1941252718" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.370183971" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.304786667">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.304786667" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.304786667" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.304786667." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1939228131" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<option id="com.qnx.qcc.option.cpu.832672244" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.987519072" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Device-Coverage}" id="cdt.managedbuild.target.gnu.builder.base.121802503" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.306557636" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.168813234" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.coverage.1032644527" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1227516972" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.374283024" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.1769677874" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.2007171407" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.1537562121" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.1135579455" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1137191328" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.1976564730" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.483005272" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.coverage.1325683096" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.1336725462" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.261244208" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.1333876349" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1121702347" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.559445444">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.559445444" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.559445444" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.559445444." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1260117207" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.795462400" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Simulator}" id="cdt.managedbuild.target.gnu.builder.base.10075032" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.1004416224" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1122485646" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1671403331" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1863269886" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.847642559" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1038720310" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.521146732" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.180925874" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1284236061" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.1609792323" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1885061957" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.538911746" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.1731404314" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.1915056460" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1201481995" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.191203500">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.191203500" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.191203500" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.191203500." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1691673400" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1730932164" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Simulator-Profile}" id="cdt.managedbuild.target.gnu.builder.base.854227640" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.417488704" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1290366598" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.profile2.216911941" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1329750381" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1679396285" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.513622172" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1961855927" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.1089440729" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.1878429748" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1343548216" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.198713701" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1370984007" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.profile2.745766388" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.888102264" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.2125784858" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.1936736676" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.621342655" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-		<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.796584174">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.796584174" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
-				<externalSettings/>
-				<extensions>
-					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
-					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-				</extensions>
-			</storageModule>
-			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.796584174" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
-					<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.796584174." name="/" resourcePath="">
-						<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.349788538" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
-							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1819308065" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/gameplay/Simulator-Coverage}" id="cdt.managedbuild.target.gnu.builder.base.66192685" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-							<tool id="com.qnx.qcc.tool.compiler.563072865" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
-								<option id="com.qnx.qcc.option.compile.debug.1789973550" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.coverage.1289221781" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.security.1296061040" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.compiler.defines.1925901823" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
-								</option>
-								<option id="com.qnx.qcc.option.compiler.includePath.1685994750" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
-								</option>
-								<inputType id="com.qnx.qcc.inputType.compiler.1658185881" superClass="com.qnx.qcc.inputType.compiler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.assembler.746786008" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
-								<option id="com.qnx.qcc.option.assembler.debug.801192729" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
-								<inputType id="com.qnx.qcc.inputType.assembler.1060784613" superClass="com.qnx.qcc.inputType.assembler"/>
-							</tool>
-							<tool id="com.qnx.qcc.tool.linker.499344619" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
-								<option id="com.qnx.qcc.option.linker.debug.1036858603" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.coverage.120064975" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.langcpp.732448976" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.security.2060919956" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
-								<option id="com.qnx.qcc.option.linker.libraryPaths.2023922042" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
-									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
-								</option>
-							</tool>
-							<tool id="com.qnx.qcc.tool.archiver.1860081202" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
-						</toolChain>
-					</folderInfo>
-					<sourceEntries>
-						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-					</sourceEntries>
-				</configuration>
-			</storageModule>
-			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-		</cconfiguration>
-	</storageModule>
-	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="gameplay.null.436970955" name="gameplay"/>
-	</storageModule>
-	<storageModule moduleId="scannerConfiguration">
-		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.796584174">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.191203500">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.559445444">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.936504809">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.851611337">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.304786667">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.17111725">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
-		</scannerConfigBuildInfo>
-	</storageModule>
-	<storageModule moduleId="refreshScope"/>
-	<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
-</cproject>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.17111725">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.17111725" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.17111725" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.17111725." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1686166742" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<option id="com.qnx.qcc.option.cpu.545743487" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.158841187" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Device-Debug}" id="cdt.managedbuild.target.gnu.builder.base.2098111998" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.96907942" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.1765481355" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.311918799" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.1481323494" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.2133604142" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.997142816" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.1988140188" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.1929307156" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1944074393" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.85592747" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.1489037662" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.1824441870" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.908036009" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.821495066" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.1650721640" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.release.936504809">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.936504809" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.936504809" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.release.936504809." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.release.11990035" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<option id="com.qnx.qcc.option.cpu.33079389" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1117051584" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Device-Release}" id="cdt.managedbuild.target.gnu.builder.base.1199322737" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.1345567866" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compiler.optlevel.1056793982" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
+								<option id="com.qnx.qcc.option.compiler.security.324540233" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.398688299" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.1670164593" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.1380846613" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.855139060" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<inputType id="com.qnx.qcc.inputType.assembler.590404074" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.2038455782" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.langcpp.868659975" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.1604612317" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.823080047" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.97765823" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.851611337">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.851611337" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.851611337" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.851611337." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1494216018" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<option id="com.qnx.qcc.option.cpu.1727548796" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1288889025" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Device-Profile}" id="cdt.managedbuild.target.gnu.builder.base.831558871" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.1281156842" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.626405189" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.profile2.1207899085" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.1649809766" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.276653249" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.1503059677" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.81809638" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.2145279747" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.1503034293" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1259311407" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.620187213" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.1398587920" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.profile2.1507133006" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.67846367" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.427877434" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.1941252718" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.370183971" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.304786667">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.304786667" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.304786667" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.304786667." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1939228131" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<option id="com.qnx.qcc.option.cpu.832672244" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.987519072" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Device-Coverage}" id="cdt.managedbuild.target.gnu.builder.base.121802503" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.306557636" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.168813234" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.coverage.1032644527" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.1227516972" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.374283024" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.1769677874" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.2007171407" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.1537562121" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.1135579455" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1137191328" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.1976564730" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.483005272" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.coverage.1325683096" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.1336725462" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.261244208" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.1333876349" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.1121702347" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.559445444">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.559445444" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.559445444" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.559445444." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1260117207" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.795462400" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Simulator}" id="cdt.managedbuild.target.gnu.builder.base.10075032" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.1004416224" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.1122485646" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.1671403331" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.1863269886" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.847642559" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.1038720310" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.521146732" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.180925874" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1284236061" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.1609792323" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.1885061957" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.538911746" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.1731404314" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.1915056460" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.1201481995" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.191203500">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.191203500" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.191203500" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.191203500." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1691673400" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1730932164" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Simulator-Profile}" id="cdt.managedbuild.target.gnu.builder.base.854227640" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.417488704" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.1290366598" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.profile2.216911941" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.1329750381" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.1679396285" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.513622172" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.1961855927" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.1089440729" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.1878429748" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1343548216" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.198713701" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.1370984007" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.profile2.745766388" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.888102264" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.2125784858" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.1936736676" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.621342655" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.796584174">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.796584174" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
+				<externalSettings/>
+				<extensions>
+					<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.796584174" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+					<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.796584174." name="/" resourcePath="">
+						<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.349788538" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+							<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1819308065" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/gameplay/Simulator-Coverage}" id="cdt.managedbuild.target.gnu.builder.base.66192685" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+							<tool id="com.qnx.qcc.tool.compiler.563072865" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+								<option id="com.qnx.qcc.option.compile.debug.1789973550" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.coverage.1289221781" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.security.1296061040" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.compiler.defines.1925901823" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+								</option>
+								<option id="com.qnx.qcc.option.compiler.includePath.1685994750" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../external-deps/oggvorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+								</option>
+								<inputType id="com.qnx.qcc.inputType.compiler.1658185881" superClass="com.qnx.qcc.inputType.compiler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.assembler.746786008" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+								<option id="com.qnx.qcc.option.assembler.debug.801192729" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+								<inputType id="com.qnx.qcc.inputType.assembler.1060784613" superClass="com.qnx.qcc.inputType.assembler"/>
+							</tool>
+							<tool id="com.qnx.qcc.tool.linker.499344619" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+								<option id="com.qnx.qcc.option.linker.debug.1036858603" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.coverage.120064975" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.langcpp.732448976" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.security.2060919956" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+								<option id="com.qnx.qcc.option.linker.libraryPaths.2023922042" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+									<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+								</option>
+							</tool>
+							<tool id="com.qnx.qcc.tool.archiver.1860081202" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="gameplay.null.436970955" name="gameplay"/>
+	</storageModule>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.796584174">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.191203500">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.559445444">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.936504809">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.851611337">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.304786667">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.17111725">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="refreshScope" versionNumber="1">
+		<resource resourceType="PROJECT" workspacePath="/gameplay"/>
+	</storageModule>
+	<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
+</cproject>

+ 37 - 3
gameplay/gameplay.vcxproj

@@ -50,6 +50,15 @@
     <ClCompile Include="src\Node.cpp" />
     <ClCompile Include="src\Package.cpp" />
     <ClCompile Include="src\ParticleEmitter.cpp" />
+    <ClCompile Include="src\PhysicsConstraint.cpp" />
+    <ClCompile Include="src\PhysicsController.cpp" />
+    <ClCompile Include="src\PhysicsFixedConstraint.cpp" />
+    <ClCompile Include="src\PhysicsGenericConstraint.cpp" />
+    <ClCompile Include="src\PhysicsHingeConstraint.cpp" />
+    <ClCompile Include="src\PhysicsMotionState.cpp" />
+    <ClCompile Include="src\PhysicsRigidBody.cpp" />
+    <ClCompile Include="src\PhysicsSocketConstraint.cpp" />
+    <ClCompile Include="src\PhysicsSpringConstraint.cpp" />
     <ClCompile Include="src\Plane.cpp" />
     <ClCompile Include="src\PlatformQNX.cpp" />
     <ClCompile Include="src\PlatformWin32.cpp" />
@@ -107,6 +116,15 @@
     <ClInclude Include="src\Node.h" />
     <ClInclude Include="src\Package.h" />
     <ClInclude Include="src\ParticleEmitter.h" />
+    <ClInclude Include="src\PhysicsConstraint.h" />
+    <ClInclude Include="src\PhysicsController.h" />
+    <ClInclude Include="src\PhysicsFixedConstraint.h" />
+    <ClInclude Include="src\PhysicsGenericConstraint.h" />
+    <ClInclude Include="src\PhysicsHingeConstraint.h" />
+    <ClInclude Include="src\PhysicsMotionState.h" />
+    <ClInclude Include="src\PhysicsRigidBody.h" />
+    <ClInclude Include="src\PhysicsSocketConstraint.h" />
+    <ClInclude Include="src\PhysicsSpringConstraint.h" />
     <ClInclude Include="src\Plane.h" />
     <ClInclude Include="src\Platform.h" />
     <ClInclude Include="src\Properties.h" />
@@ -149,6 +167,22 @@
     <None Include="res\shaders\textured.fsh" />
     <None Include="res\shaders\textured.vsh" />
     <None Include="src\gameplay-main-macosx.mm" />
+    <None Include="src\BoundingBox.inl" />
+    <None Include="src\BoundingSphere.inl" />
+    <None Include="src\Matrix.inl" />
+    <None Include="src\Plane.inl" />
+    <None Include="src\Quaternion.inl" />
+    <None Include="src\Ray.inl" />
+    <None Include="src\Vector2.inl" />
+    <None Include="src\Vector3.inl" />
+    <None Include="src\Vector4.inl" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="src\PhysicsConstraint.inl" />
+    <None Include="src\PhysicsFixedConstraint.inl" />
+    <None Include="src\PhysicsGenericConstraint.inl" />
+    <None Include="src\PhysicsRigidBody.inl" />
+    <None Include="src\PhysicsSpringConstraint.inl" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{1032BA4B-57EB-4348-9E03-29DD63E80E4A}</ProjectGuid>
@@ -210,7 +244,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <RuntimeTypeInfo>
       </RuntimeTypeInfo>
     </ClCompile>
@@ -226,7 +260,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;GAMEPLAY_MEM_LEAK_DETECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <RuntimeTypeInfo>true</RuntimeTypeInfo>
     </ClCompile>
     <Link>
@@ -247,7 +281,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\external-deps\bullet\include;..\external-deps\openal\include\AL;..\external-deps\alut\include\AL;..\external-deps\oggvorbis\include;..\external-deps\glew\include;..\external-deps\libpng\include;..\external-deps\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 99 - 1
gameplay/gameplay.vcxproj.filters

@@ -177,6 +177,33 @@
     <ClCompile Include="src\DebugNew.cpp">
 		<Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\PhysicsController.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsRigidBody.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsHingeConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsFixedConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsGenericConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsSocketConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsSpringConstraint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\PhysicsMotionState.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Animation.h">
@@ -341,6 +368,33 @@
     <ClInclude Include="src\DebugNew.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\PhysicsController.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsMotionState.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsRigidBody.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsSpringConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsFixedConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsGenericConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsHingeConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\PhysicsSocketConstraint.h">
+      <Filter>src</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="res\shaders\bumped-specular.vsh">
@@ -403,8 +457,52 @@
     <None Include="res\shaders\bumped-specular.fsh">
       <Filter>res\shaders</Filter>
     </None>
+  </ItemGroup>
+  <ItemGroup>
     <None Include="src\gameplay-main-macosx.mm">
       <Filter>src</Filter>
     </None>
+    <None Include="src\PhysicsFixedConstraint.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\BoundingBox.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\PhysicsGenericConstraint.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\BoundingSphere.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\PhysicsSpringConstraint.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Matrix.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\PhysicsRigidBody.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Plane.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Quaternion.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Ray.inl">
+      <Filter>src</Filter>
+    </None>
+    <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\PhysicsConstraint.inl">
+      <Filter>src</Filter>
+    </None>
   </ItemGroup>
-</Project>
+</Project>

File diff suppressed because it is too large
+ 598 - 462
gameplay/gameplay.xcodeproj/project.pbxproj


+ 76 - 15
gameplay/src/AudioBuffer.cpp

@@ -9,6 +9,7 @@
 namespace gameplay
 {
 
+
 // Audio buffer cache
 static std::vector<AudioBuffer*> __buffers;
 
@@ -81,7 +82,7 @@ AudioBuffer* AudioBuffer::create(const char* path)
             goto cleanup;
         }
     }
-    else if(memcmp(header, "OGG", 3) == 0)
+    else if (memcmp(header, "OggS", 4) == 0)
     {
         if (!AudioBuffer::loadOgg(file, alBuffer))
         {
@@ -94,7 +95,6 @@ AudioBuffer* AudioBuffer::create(const char* path)
         LOG_ERROR_VARG("Unsupported audio file: %s", path);
     }
     
-    
     fclose(file);
 
     buffer = new AudioBuffer(path, alBuffer);
@@ -123,7 +123,7 @@ bool AudioBuffer::loadWav(FILE* file, ALuint buffer)
         return false;
     
     // Check for a valid pcm format.
-    if(fread(stream, 1, 2, file) != 2 || stream[1] != 0 || stream[0] != 1)
+    if (fread(stream, 1, 2, file) != 2 || stream[1] != 0 || stream[0] != 1)
     {
         LOG_ERROR("Unsupported audio file, not PCM format.");
         return false;
@@ -140,6 +140,7 @@ bool AudioBuffer::loadWav(FILE* file, ALuint buffer)
     ALuint frequency;
     if (fread(stream, 1, 4, file) != 4)
         return false;
+
     frequency  = stream[3]<<24;
     frequency |= stream[2]<<16;
     frequency |= stream[1]<<8;
@@ -158,21 +159,21 @@ bool AudioBuffer::loadWav(FILE* file, ALuint buffer)
     bits  = stream[1]<<8;
     bits |= stream[0];
     
-    
+
     // Now convert the given channel count and bit depth into an OpenAL format. 
     ALuint format = 0;
-    if(bits == 8)
+    if (bits == 8)
     {
-        if(channels == 1)
+        if (channels == 1)
             format = AL_FORMAT_MONO8;
-        else if(channels == 2)
+        else if (channels == 2)
             format = AL_FORMAT_STEREO8;
     }
-    else if(bits == 16)
+    else if (bits == 16)
     {
-        if(channels == 1)
+        if (channels == 1)
             format = AL_FORMAT_MONO16;
-        else if(channels == 2)
+        else if (channels == 2)
             format = AL_FORMAT_STEREO16;
     }
     else
@@ -191,24 +192,84 @@ bool AudioBuffer::loadWav(FILE* file, ALuint buffer)
     // Read how much data is remaining and buffer it up.
     unsigned int dataSize;
     fread(&dataSize, sizeof(int), 1, file);
-    unsigned char* data = new unsigned char[dataSize];
-    if (fread(data, sizeof(unsigned char), dataSize, file) != dataSize)
+
+    char* data = new char[dataSize];
+    if (fread(data, sizeof(char), dataSize, file) != dataSize)
     {
         LOG_ERROR("WAV file missing data.");
         SAFE_DELETE_ARRAY(data);
         return false;
     }
+
     alBufferData(buffer, format, data, dataSize, frequency);
     SAFE_DELETE_ARRAY(data);
     return true;
 }
     
-// TODO:
 bool AudioBuffer::loadOgg(FILE* file, ALuint buffer)
 {
-    LOG_ERROR("Ogg Vorbis not supported yet");
+    OggVorbis_File ogg_file;
+    vorbis_info* info;
+    ALenum format;
+    int result;
+    int section;
+    unsigned int size = 0;
+
+    rewind(file);
+
+    if ((result = ov_open(file, &ogg_file, NULL, 0)) < 0)
+    {
+        fclose(file);
+        LOG_ERROR("Could not open Ogg stream.");
+        return false;
+    }
+
+    info = ov_info(&ogg_file, -1);
+
+    if (info->channels == 1)
+        format = AL_FORMAT_MONO16;
+    else
+        format = AL_FORMAT_STEREO16;
+
+	// size = #samples * #channels * 2 (for 16 bit)
+    unsigned int data_size = ov_pcm_total(&ogg_file, -1) * info->channels * 2;
+    char* data = new char[data_size];
+
+    while (size < data_size)
+    {
+    	result = ov_read(&ogg_file, data + size, data_size - size, 0, 2, 1, &section);
+    	if (result > 0)
+    	{
+    		size += result;
+    	}
+    	else if (result < 0)
+    	{
+    		SAFE_DELETE_ARRAY(data);
+    		LOG_ERROR("OGG file missing data.");
+    		return false;
+    	}
+    	else
+    	{
+    		break;
+    	}
+    }
     
-    return false;
+    if (size == 0)
+    {
+    	SAFE_DELETE_ARRAY(data);
+    	LOG_ERROR("Unable to read OGG data.");
+    	return false;
+    }
+
+    alBufferData(buffer, format, data, data_size, info->rate);
+
+    SAFE_DELETE_ARRAY(data);
+    ov_clear(&ogg_file);
+
+    // ov_clear actually closes the file pointer as well
+    file = 0;
+
+    return true;
 }
 
 }

+ 27 - 0
gameplay/src/Base.h

@@ -63,6 +63,32 @@ extern void printError(const char* format, ...);
 #define WARN(x) printError(x)
 #define WARN_VARG(x, ...) printError(x, __VA_ARGS__)
 
+// Bullet Physics
+#include <btBulletDynamicsCommon.h>
+
+// Since Bullet overrides new, we have to allocate objects manually using its
+// aligned allocation function when we turn on memory leak detection in GamePlay.
+#ifdef GAMEPLAY_MEM_LEAK_DETECTION
+#define BULLET_NEW(type, name, ...) \
+    type* name = (type*)btAlignedAlloc(sizeof(type), 16); \
+    type __##name##_tmp (__VA_ARGS__); \
+    memcpy(name, &__##name##_tmp, sizeof(type))
+
+#define BULLET_DELETE(name) \
+    if (name) \
+    { \
+        btAlignedFree(name); \
+        name = NULL; \
+    }
+
+#else
+#define BULLET_NEW(type, name, ...) \
+    type* name = new type(__VA_ARGS__)
+
+#define BULLET_DELETE(name) SAFE_DELETE(name)
+#endif
+
+
 // Debug new for memory leak detection
 #ifdef GAMEPLAY_MEM_LEAK_DETECTION
 #include "DebugNew.h"
@@ -122,6 +148,7 @@ extern void printError(const char* format, ...);
 #include <OpenAL/al.h>
 #include <OpenAL/alc.h>
 #endif
+#include <vorbis/vorbisfile.h>
 
 // Screen/Window
 #define WINDOW_WIDTH        1024

+ 19 - 0
gameplay/src/BoundingBox.h

@@ -178,8 +178,27 @@ public:
      * @param matrix The transformation matrix to transform by.
      */
     void transform(const Matrix& matrix);
+
+    /**
+     * Transforms this bounding box by the given matrix.
+     * 
+     * @param matrix The matrix to transform by.
+     * @return This bounding box, after the transformation occurs.
+     */
+    inline BoundingBox& operator*=(const Matrix& matrix);
 };
 
+/**
+ * Transforms the given bounding box by the given matrix.
+ * 
+ * @param matrix The matrix to transform by.
+ * @param box The bounding box to transform.
+ * @return The resulting transformed bounding box.
+ */
+inline BoundingBox operator*(const Matrix& matrix, const BoundingBox& box);
+
 }
 
+#include "BoundingBox.inl"
+
 #endif

+ 23 - 0
gameplay/src/BoundingBox.inl

@@ -0,0 +1,23 @@
+/** 
+ * BoundingBox.inl
+ */
+
+#include "BoundingBox.h"
+
+namespace gameplay
+{
+
+inline BoundingBox& BoundingBox::operator*=(const Matrix& matrix)
+{
+    transform(matrix);
+    return *this;
+}
+
+inline BoundingBox operator*(const Matrix& matrix, const BoundingBox& box)
+{
+    BoundingBox b(box);
+    b.transform(matrix);
+    return b;
+}
+
+}

+ 19 - 0
gameplay/src/BoundingSphere.h

@@ -165,6 +165,14 @@ public:
      */
     void transform(const Matrix& matrix);
 
+    /**
+     * Transforms this bounding sphere by the given matrix.
+     * 
+     * @param matrix The matrix to transform by.
+     * @return This bounding sphere, after the transformation occurs.
+     */
+    inline BoundingSphere& operator*=(const Matrix& matrix);
+
 private:
 
     float distance(const BoundingSphere& sphere, const Vector3&);
@@ -172,6 +180,17 @@ private:
     bool contains(const BoundingSphere& sphere, Vector3* points, unsigned int count);
 };
 
+/**
+ * Transforms the given bounding sphere by the given matrix.
+ * 
+ * @param matrix The matrix to transform by.
+ * @param sphere The bounding sphere to transform.
+ * @return The resulting transformed bounding sphere.
+ */
+inline BoundingSphere operator*(const Matrix& matrix, const BoundingSphere& sphere);
+
 }
 
+#include "BoundingSphere.inl"
+
 #endif

+ 23 - 0
gameplay/src/BoundingSphere.inl

@@ -0,0 +1,23 @@
+/** 
+ * BoundingSphere.inl
+ */
+
+#include "BoundingSphere.h"
+
+namespace gameplay
+{
+
+inline BoundingSphere& BoundingSphere::operator*=(const Matrix& matrix)
+{
+    transform(matrix);
+    return *this;
+}
+
+inline BoundingSphere operator*(const Matrix& matrix, const BoundingSphere& sphere)
+{
+    BoundingSphere s(sphere);
+    s.transform(matrix);
+    return s;
+}
+
+}

+ 18 - 5
gameplay/src/Game.cpp

@@ -107,6 +107,9 @@ bool Game::startup()
     _audioController = new AudioController();
     _audioController->initialize();
 
+    _physicsController = new PhysicsController();
+    _physicsController->initialize();
+
     // Call user initialization.
     initialize();
     _state = RUNNING;
@@ -122,12 +125,13 @@ void Game::shutdown()
         finalize();
 
         _animationController->finalize();
-        delete _animationController;
-        _animationController = NULL;
+        SAFE_DELETE(_animationController);
 
         _audioController->finalize();
-        delete _audioController;
-        _audioController = NULL;
+        SAFE_DELETE(_audioController);
+
+        _physicsController->finalize();
+        SAFE_DELETE(_physicsController);
 
         RenderState::finalize();
     }
@@ -143,6 +147,7 @@ void Game::pause()
         _pausedTimeLast = Platform::getAbsoluteTime();
         _animationController->pause();
         _audioController->pause();
+        _physicsController->pause();
     }
 }
 
@@ -154,6 +159,7 @@ void Game::resume()
         _pausedTimeTotal += Platform::getAbsoluteTime() - _pausedTimeLast;
         _animationController->resume();
         _audioController->resume();
+        _physicsController->resume();
     }
 }
 
@@ -173,8 +179,10 @@ void Game::frame()
     long elapsedTime = (frameTime - lastFrameTime);
     lastFrameTime = frameTime;
 
-    // Update the schedule and running animations.
+    // Update the scheduled and running animations.
     _animationController->update(elapsedTime);
+    // Update the physics.
+    _physicsController->update(elapsedTime);
     // Application Update.
     update(elapsedTime);
 
@@ -251,6 +259,11 @@ const AudioController* Game::getAudioController() const
     return _audioController;
 }
 
+PhysicsController* Game::getPhysicsController()
+{
+    return _physicsController;
+}
+
 void Game::menu()
 {
 }

+ 10 - 0
gameplay/src/Game.h

@@ -8,6 +8,7 @@
 #include "Input.h"
 #include "AudioController.h"
 #include "AnimationController.h"
+#include "PhysicsController.h"
 #include "Vector4.h"
 
 namespace gameplay
@@ -174,6 +175,14 @@ public:
      */
     AnimationController* getAnimationController();
 
+    /**
+     * Gets the physics controller for managing control of physics
+     * associated with the game.
+     * 
+     * @return The physics controller for this game.
+     */
+    PhysicsController* getPhysicsController();
+
     /**
      * Menu callback on menu events.
      */
@@ -277,6 +286,7 @@ private:
     int _clearStencil;                          // The clear stencil value last used for clearing the stencil buffer.
     AnimationController* _animationController;  // Controls the scheduling and running of animations.
     AudioController* _audioController;          // Controls audio sources that are playing in the game.
+    PhysicsController* _physicsController;      // Controls the simulation of a physics scene and entities.
 };
 
 }

+ 4 - 4
gameplay/src/Input.h

@@ -66,10 +66,10 @@ public:
         KEY_DELETE,
         KEY_END,
         KEY_PG_DOWN,
-        KEY_LEFT,
-        KEY_RIGHT,
-        KEY_UP,
-        KEY_DOWN,
+        KEY_LEFT_ARROW,
+        KEY_RIGHT_ARROW,
+        KEY_UP_ARROW,
+        KEY_DOWN_ARROW,
         KEY_NUM_LOCK,
         KEY_KP_PLUS,
         KEY_KP_MINUS,

+ 25 - 6
gameplay/src/Joint.cpp

@@ -9,7 +9,7 @@ namespace gameplay
 {
 
 Joint::Joint(const char* id)
-    : Node(id), _jointMatrixDirty(true)
+    : Node(id), _jointMatrixDirty(true), _skin(NULL)
 {
 }
 
@@ -43,12 +43,8 @@ void Joint::updateJointMatrix(const Matrix& bindShape, Vector4* matrixPalette)
     {
         _jointMatrixDirty = false;
 
-        float r = (float)rand( ) / (float)RAND_MAX;
-        Matrix w = getWorldMatrix();
-        w.translate(r, r, r);
-
         Matrix t;
-        Matrix::multiply(getWorldMatrix(), getInverseBindPose(), &t);
+        Matrix::multiply(getJointMatrix(), getInverseBindPose(), &t);
         Matrix::multiply(t, bindShape, &t);
 
         matrixPalette[0].set(t.m[0], t.m[4], t.m[8], t.m[12]);
@@ -68,4 +64,27 @@ void Joint::setInverseBindPose(const Matrix& m)
     _jointMatrixDirty = true;
 }
 
+const Matrix& Joint::getWorldMatrix() const
+{
+    // If this is the root joint, then we 
+    // also apply the transform of the model
+    // that the skin is attached to to get the
+    // actual world matrix.
+    if (_parent == NULL && _skin != NULL)
+    {
+        Matrix::multiply(_skin->_model->getNode()->getWorldMatrix(), Node::getWorldMatrix(), &_jointWorld);
+    }
+    else
+    {
+        memcpy((void*)_jointWorld.m, Node::getWorldMatrix().m, sizeof(float) * 16);
+    }
+
+    return _jointWorld;
+}
+
+const Matrix& Joint::getJointMatrix() const
+{
+    return Node::getWorldMatrix();
+}
+
 }

+ 16 - 0
gameplay/src/Joint.h

@@ -35,6 +35,20 @@ public:
      */
     const Matrix& getInverseBindPose() const;
 
+    /**
+     * Gets the world matrix corresponding to this node.
+     *
+     * @return The world matrix of this node.
+     */
+    const Matrix& getWorldMatrix() const;
+
+    /**
+     * Gets the matrix corresponding to this joint.
+     *
+     * @return The matrix of this joint.
+     */
+    const Matrix& getJointMatrix() const;
+
 protected:
 
     /**
@@ -69,6 +83,8 @@ protected:
 
     Matrix _bindPose;
     bool _jointMatrixDirty;
+    MeshSkin* _skin;
+    mutable Matrix _jointWorld;
 };
 
 }

+ 4 - 4
gameplay/src/Material.cpp

@@ -24,7 +24,7 @@ Material::Material(const Material& m)
 
 Material::~Material()
 {
-	// Destroy all the techniques.
+    // Destroy all the techniques.
     for (unsigned int i = 0, count = _techniques.size(); i < count; ++i)
     {
         Technique* technique = _techniques[i];
@@ -59,7 +59,7 @@ Material* Material::create(const char* materialPath)
     // Create new material from the file passed in.
     Material* material = new Material();
 
-	// Go through all the material properties and create techniques under this material.
+    // Go through all the material properties and create techniques under this material.
     Properties* techniqueProperties = NULL;
     while ((techniqueProperties = materialProperties->getNextNamespace()))
     {
@@ -195,7 +195,7 @@ bool Material::loadTechnique(Material* material, Properties* techniqueProperties
     // Create a new technique
     Technique* technique = new Technique(techniqueProperties->getId(), material);
 
-	// Go through all the properties and create passes under this technique.
+    // Go through all the properties and create passes under this technique.
     techniqueProperties->rewind();
     Properties* passProperties = NULL;
     while ((passProperties = techniqueProperties->getNextNamespace()))
@@ -203,7 +203,7 @@ bool Material::loadTechnique(Material* material, Properties* techniqueProperties
         if (strcmp(passProperties->getNamespace(), "pass") == 0)
         {
             // Create and load passes.
-		    if (!loadPass(technique, passProperties))
+            if (!loadPass(technique, passProperties))
             {
                 SAFE_RELEASE(technique);
                 return false;

+ 1 - 1
gameplay/src/MaterialParameter.h

@@ -37,7 +37,7 @@ class MaterialParameter : public AnimationTarget
 
 public:
 
-     /**
+    /**
      * Animates the uniform.
      */
     static const int ANIMATE_UNIFORM = 1;

+ 13 - 8
gameplay/src/Matrix.cpp

@@ -904,24 +904,24 @@ void Matrix::subtract(const Matrix& m1, const Matrix& m2, Matrix* dst)
     dst->m[15] = m1.m[15] - m2.m[15];
 }
 
-void Matrix::transformVector(Vector3* vector) const
+void Matrix::transformPoint(Vector3* point) const
 {
-    transformVector(vector->x, vector->y, vector->z, 0.0f, vector);
+    transformVector(point->x, point->y, point->z, 1.0f, point);
 }
 
-void Matrix::transformVector(const Vector3& vector, Vector3* dst) const
+void Matrix::transformPoint(const Vector3& point, Vector3* dst) const
 {
-    transformVector(vector.x, vector.y, vector.z, 0.0f, dst);
+    transformVector(point.x, point.y, point.z, 1.0f, dst);
 }
 
-void Matrix::transformPoint(Vector3* point) const
+void Matrix::transformVector(Vector3* vector) const
 {
-    transformVector(point->x, point->y, point->z, 1.0f, point);
+    transformVector(vector->x, vector->y, vector->z, 0.0f, vector);
 }
 
-void Matrix::transformPoint(const Vector3& point, Vector3* dst) const
+void Matrix::transformVector(const Vector3& vector, Vector3* dst) const
 {
-    transformVector(point.x, point.y, point.z, 1.0f, dst);
+    transformVector(vector.x, vector.y, vector.z, 0.0f, dst);
 }
 
 void Matrix::transformVector(float x, float y, float z, float w, Vector3* dst) const
@@ -934,6 +934,11 @@ void Matrix::transformVector(float x, float y, float z, float w, Vector3* dst) c
         x * m[2] + y * m[6] + z * m[10] + w * m[14] );
 }
 
+void Matrix::transformVector(Vector4* vector) const
+{
+    transformVector(*vector, vector);
+}
+
 void Matrix::transformVector(const Vector4& vector, Vector4* dst) const
 {
     assert(dst);

+ 137 - 20
gameplay/src/Matrix.h

@@ -5,7 +5,6 @@
 #ifndef MATRIX_H_
 #define MATRIX_H_
 
-#include "Vector2.h"
 #include "Vector3.h"
 #include "Vector4.h"
 
@@ -236,7 +235,7 @@ public:
 //     * @param plane The Plane about which to create a reflection.
 //     * @param dst A matrix to store the result in.
 //     */
-//    static void createRefelction(const Plane& plane, Matrix* dst);
+//    static void createReflection(const Plane& plane, Matrix* dst);
 
     /**
      * Creates a scale matrix.
@@ -712,6 +711,24 @@ public:
      */
     static void subtract(const Matrix& m1, const Matrix& m2, Matrix* dst);
 
+    /**
+     * Transforms the specified point by this matrix.
+     *
+     * The result of the transformation is stored directly into point.
+     *
+     * @param point The point to transform and also a vector to hold the result in.
+     */
+    void transformPoint(Vector3* point) const;
+
+    /**
+     * Transforms the specified point by this matrix, and stores
+     * the result in dst.
+     *
+     * @param point The point to transform.
+     * @param dst A vector to store the transformed point in.
+     */
+    void transformPoint(const Vector3& point, Vector3* dst) const;
+
     /**
      * Transforms the specified vector by this matrix by
      * treating the fourth (w) coordinate as zero.
@@ -732,24 +749,6 @@ public:
      */
     void transformVector(const Vector3& vector, Vector3* dst) const;
 
-    /**
-     * Transforms the specified point by this matrix.
-     *
-     * The result of the transformation is stored directly into point.
-     *
-     * @param point The point to transform and also a vector to hold the result in.
-     */
-    void transformPoint(Vector3* point) const;
-
-    /**
-     * Transforms the specified point by this matrix, and stores
-     * the result in dst.
-     *
-     * @param point The point to transform.
-     * @param dst A vector to store the transformed point in.
-     */
-    void transformPoint(const Vector3& point, Vector3* dst) const;
-
     /**
      * Transforms the specified vector by this matrix.
      *
@@ -761,6 +760,15 @@ public:
      */
     void transformVector(float x, float y, float z, float w, Vector3* dst) const;
 
+    /**
+     * Transforms the specified vector by this matrix.
+     *
+     * The result of the transformation is stored directly into vector.
+     *
+     * @param vector The vector to transform.
+     */
+    void transformVector(Vector4* vector) const;
+
     /**
      * Transforms the specified vector by this matrix.
      *
@@ -818,8 +826,117 @@ public:
      * @param dst A matrix to store the result in.
      */
     void transpose(Matrix* dst) const;
+
+    /**
+     * Calculates the sum of this matrix with the given matrix.
+     * 
+     * Note: this does not modify this matrix.
+     * 
+     * @param m The matrix to add.
+     * @return The matrix sum.
+     */
+    inline Matrix operator+(const Matrix& m) const;
+    
+    /**
+     * Adds the given matrix to this matrix.
+     * 
+     * @param m The matrix to add.
+     * @return This matrix, after the addition occurs.
+     */
+    inline Matrix& operator+=(const Matrix& m);
+
+    /**
+     * Calculates the sum of this matrix with the given matrix.
+     * 
+     * Note: this does not modify this matrix.
+     * 
+     * @param m The matrix to add.
+     * @return The matrix sum.
+     */
+    inline Matrix operator-(const Matrix& m) const;
+
+    /**
+     * Subtracts the given matrix from this matrix.
+     * 
+     * @param m The matrix to subtract.
+     * @return This matrix, after the subtraction occurs.
+     */
+    inline Matrix& operator-=(const Matrix& m);
+
+    /**
+     * Calculates the negation of this matrix.
+     * 
+     * Note: this does not modify this matrix.
+     * 
+     * @return The negation of this matrix.
+     */
+    inline Matrix operator-() const;
+
+    /**
+     * Calculates the matrix product of this matrix with the given matrix.
+     * 
+     * Note: this does not modify this matrix.
+     * 
+     * @param m The matrix to multiply by.
+     * @return The matrix product.
+     */
+    inline Matrix operator*(const Matrix& m) const;
+
+    /**
+     * Right-multiplies this matrix by the given matrix.
+     * 
+     * @param m The matrix to multiply by.
+     * @return This matrix, after the multiplication occurs.
+     */
+    inline Matrix& operator*=(const Matrix& m);
 };
 
+/**
+ * Transforms the given vector by the given matrix.
+ * 
+ * Note: this treats the given vector as a vector and not as a point.
+ * 
+ * @param v The vector to transform.
+ * @param m The matrix to transform by.
+ * @return This vector, after the transformation occurs.
+ */
+inline Vector3& operator*=(Vector3& v, const Matrix& m);
+
+/**
+ * Transforms the given vector by the given matrix.
+ * 
+ * Note: this treats the given vector as a vector and not as a point.
+ * 
+ * @param m The matrix to transform by.
+ * @param v The vector to transform.
+ * @return The resulting transformed vector.
+ */
+inline Vector3 operator*(const Matrix& m, const Vector3& v);
+
+/**
+ * Transforms the given vector by the given matrix.
+ * 
+ * Note: this treats the given vector as a vector and not as a point.
+ * 
+ * @param v The vector to transform.
+ * @param m The matrix to transform by.
+ * @return This vector, after the transformation occurs.
+ */
+inline Vector4& operator*=(Vector4& v, const Matrix& m);
+
+/**
+ * Transforms the given vector by the given matrix.
+ * 
+ * Note: this treats the given vector as a vector and not as a point.
+ * 
+ * @param m The matrix to transform by.
+ * @param v The vector to transform.
+ * @return The resulting transformed vector.
+ */
+inline Vector4 operator*(const Matrix& m, const Vector4& v);
+
 }
 
+//#include "Matrix.inl"
+
 #endif

+ 82 - 0
gameplay/src/Matrix.inl

@@ -0,0 +1,82 @@
+/** 
+ * Matrix.inl
+ */
+
+#include "Matrix.h"
+
+namespace gameplay
+{
+
+inline Matrix Matrix::operator+(const Matrix& m) const
+{
+    Matrix result(*this);
+    result.add(m);
+    return result;
+}
+
+inline Matrix& Matrix::operator+=(const Matrix& m)
+{
+    add(m);
+    return *this;
+}
+
+inline Matrix Matrix::operator-(const Matrix& m) const
+{
+    Matrix result(*this);
+    result.subtract(m);
+    return result;
+}
+
+inline Matrix& Matrix::operator-=(const Matrix& m)
+{
+    subtract(m);
+    return *this;
+}
+
+inline Matrix Matrix::operator-() const
+{
+    Matrix m(*this);
+    m.negate();
+    return m;
+}
+
+inline Matrix Matrix::operator*(const Matrix& m) const
+{
+    Matrix result(*this);
+    result.multiply(m);
+    return result;
+}
+
+inline Matrix& Matrix::operator*=(const Matrix& m)
+{
+    multiply(m);
+    return *this;
+}
+
+inline Vector3& operator*=(Vector3& v, const Matrix& m)
+{
+    m.transformVector(&v);
+    return v;
+}
+
+inline Vector3 operator*(const Matrix& m, const Vector3& v)
+{
+    Vector3 x;
+    m.transformVector(v, &x);
+    return x;
+}
+
+inline Vector4& operator*=(Vector4& v, const Matrix& m)
+{
+    m.transformVector(&v);
+    return v;
+}
+
+inline Vector4 operator*(const Matrix& m, const Vector4& v)
+{
+    Vector4 x;
+    m.transformVector(v, &x);
+    return x;
+}
+
+}

+ 2 - 1
gameplay/src/MeshSkin.cpp

@@ -12,7 +12,7 @@
 namespace gameplay
 {
 
-MeshSkin::MeshSkin() : _matrixPalette(NULL)
+MeshSkin::MeshSkin() : _matrixPalette(NULL), _model(NULL)
 {
 }
 
@@ -81,6 +81,7 @@ void MeshSkin::setJoint(Joint* joint, unsigned int index)
     assert(index < _joints.size());
 
     _joints[index] = joint;
+    _joints[index]->_skin = this;
 }
 
 Vector4* MeshSkin::getMatrixPalette() const

+ 3 - 0
gameplay/src/MeshSkin.h

@@ -11,6 +11,7 @@ namespace gameplay
 {
 
 class Package;
+class Model;
 class Joint;
 
 /**
@@ -20,6 +21,7 @@ class MeshSkin
 {
     friend class Package;
     friend class Model;
+    friend class Joint;
 
 public:
 
@@ -112,6 +114,7 @@ private:
     // Each 4x3 row-wise matrix is represented as 3 Vector4's.
     // The number of Vector4's is (_joints.size() * 3).
     Vector4* _matrixPalette;
+    Model* _model;
 };
 
 }

+ 2 - 1
gameplay/src/Model.cpp

@@ -42,7 +42,7 @@ Model* Model::create(Mesh* mesh)
     return new Model(mesh);
 }
 
-Mesh* Model::getMesh()
+Mesh* Model::getMesh() const
 {
     return _mesh;
 }
@@ -187,6 +187,7 @@ void Model::setSkin(MeshSkin* skin)
 
         // Assign the new skin
         _skin = skin;
+        _skin->_model = this;
     }
 }
 

+ 3 - 3
gameplay/src/Model.h

@@ -38,7 +38,7 @@ public:
      * 
      * @return The Mesh for this Model.
      */
-    Mesh* getMesh();
+    Mesh* getMesh() const;
 
     /**
      * Returns the number of parts in the Mesh for this Model.
@@ -150,13 +150,13 @@ private:
      * Destructor. Hidden use release() instead.
      */
     ~Model();
-
+
     /**
      * Sets the MeshSkin for this model.
      * 
      * @param skin The MeshSkin for this model.
      */
-    void setSkin(MeshSkin* skin);
+    void setSkin(MeshSkin* skin);
 
     /**
      * Sets the node that is associated with this model.

+ 18 - 3
gameplay/src/Node.cpp

@@ -15,8 +15,8 @@ namespace gameplay
 
 Node::Node(const char* id)
     : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(NULL),
-    _camera(NULL), _light(NULL), _model(NULL), _audioSource(NULL), _particleEmitter(NULL), _dirtyBits(NODE_DIRTY_ALL),
-    _notifyHierarchyChanged(true), _boundsType(NONE)
+    _camera(NULL), _light(NULL), _model(NULL), _audioSource(NULL), _particleEmitter(NULL), _physicsRigidBody(NULL), 
+    _dirtyBits(NODE_DIRTY_ALL), _notifyHierarchyChanged(true), _boundsType(NONE)
 {
     if (id)
     {
@@ -51,6 +51,7 @@ Node::~Node()
     SAFE_RELEASE(_model);
     SAFE_RELEASE(_audioSource);
     SAFE_RELEASE(_particleEmitter);
+    SAFE_DELETE(_physicsRigidBody);
 }
 
 Node* Node::create(const char* id)
@@ -300,7 +301,7 @@ const Matrix& Node::getWorldMatrix() const
         // If we have a parent, multiply our parent world transform by our local
         // transform to obtain our final resolved world transform.
         Node* parent = getParent();
-        if (parent)
+        if (parent && !_physicsRigidBody)
         {
             Matrix::multiply(parent->getWorldMatrix(), getMatrix(), &_world);
         }
@@ -800,4 +801,18 @@ void Node::setParticleEmitter(ParticleEmitter* emitter)
     }
 }
 
+PhysicsRigidBody* Node::getPhysicsRigidBody() const
+{
+    return _physicsRigidBody;
+}
+
+void Node::setPhysicsRigidBody(PhysicsRigidBody::Type type, float mass, float friction,
+        float restitution, float linearDamping, float angularDamping)
+{
+    SAFE_DELETE(_physicsRigidBody);
+    
+    if (type != PhysicsRigidBody::SHAPE_NONE)
+        _physicsRigidBody = new PhysicsRigidBody(this, type, mass, friction, restitution, linearDamping, angularDamping);
+}
+
 }

+ 28 - 1
gameplay/src/Node.h

@@ -11,6 +11,7 @@
 #include "Model.h"
 #include "AudioSource.h"
 #include "ParticleEmitter.h"
+#include "PhysicsRigidBody.h"
 #include "BoundingBox.h"
 
 namespace gameplay
@@ -174,7 +175,7 @@ public:
      *
      * @return The world matrix of this node.
      */
-    const Matrix& getWorldMatrix() const;
+    virtual const Matrix& getWorldMatrix() const;
 
     /**
      * Gets the world view matrix corresponding to this node.
@@ -356,6 +357,31 @@ public:
      */
     void setParticleEmitter(ParticleEmitter* emitter);
 
+    /**
+     * Returns the pointer to this node's physics rigid body or NULL.
+     *
+     * @return The pointer to this node's physics rigid body or NULL.
+     */
+    PhysicsRigidBody* getPhysicsRigidBody() const;
+
+    /**
+     * Sets (or disables) the physics rigid body for this node.
+     * 
+     * Note: This is only allowed for nodes that have a model attached to them.
+     *
+     * @param type The type of rigid body to set; to disable the physics rigid
+     *      body, pass PhysicsRigidBody#SHAPE_NONE.
+     * @param mass The mass of the rigid body, in kilograms.
+     * @param friction The friction of the rigid body (between 0.0 and 1.0, where 0.0 is
+     *      minimal friction and 1.0 is maximal friction).
+     * @param restitution The restitution of the rigid body (this controls the bounciness of
+     *      the rigid body; between 0.0 and 1.0, where 0.0 is minimal bounciness and 1.0 is maximal bounciness).
+     * @param linearDamping The percentage of linear velocity lost per second (between 0.0 and 1.0).
+     * @param angularDamping The percentage of angular velocity lost per second (between 0.0 and 1.0).
+     */
+    void setPhysicsRigidBody(PhysicsRigidBody::Type type, float mass = 0.0f, float friction = 0.5f,
+        float restitution = 0.0f, float linearDamping = 0.0f, float angularDamping = 0.0f);
+
     /**
      * Returns the bounding box for the Node, in world space.
      *
@@ -430,6 +456,7 @@ protected:
     Model* _model;
     AudioSource* _audioSource;
     ParticleEmitter* _particleEmitter;
+    PhysicsRigidBody* _physicsRigidBody;
     mutable Matrix _world;
     mutable int _dirtyBits;
     bool _notifyHierarchyChanged;

+ 166 - 0
gameplay/src/PhysicsConstraint.cpp

@@ -0,0 +1,166 @@
+/*
+ * PhysicsConstraint.cpp
+ */
+
+#include "PhysicsConstraint.h"
+
+#include "Game.h"
+#include "Node.h"
+#include "PhysicsMotionState.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+PhysicsConstraint::PhysicsConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+    : _a(a), _b(b), _constraint(NULL)
+{
+}
+
+PhysicsConstraint::~PhysicsConstraint()
+{
+    // Remove the physics rigid bodies' references to this constraint.
+    if (_a)
+        _a->removeConstraint(this);
+    if (_b)
+        _b->removeConstraint(this);
+
+    // Remove the constraint from the physics world and delete the Bullet object.
+    Game::getInstance()->getPhysicsController()->removeConstraint(this);
+    SAFE_DELETE(_constraint);
+}
+
+Vector3 PhysicsConstraint::centerOfMassMidpoint(const Node* a, const Node* b)
+{
+    Vector3 tA, tB;
+    a->getWorldMatrix().getTranslation(&tA);
+    b->getWorldMatrix().getTranslation(&tB);
+
+    tA = getWorldCenterOfMass(a->getModel());
+    tB = getWorldCenterOfMass(b->getModel());
+    
+    Vector3 d(tA, tB);
+    d.scale(0.5f);
+    Vector3 c(tA);
+    c.add(d);
+
+    return c;
+}
+
+Quaternion PhysicsConstraint::getRotationOffset(const Node* node, const Vector3& point)
+{
+    // Create a translation matrix that translates to the given origin.
+    Matrix m;
+    Matrix::createTranslation(point, &m);
+
+    // Calculate the rotation offset to the rigid body by transforming 
+    // the translation matrix above into the rigid body's local space 
+    // (multiply by the inverse world matrix) and extracting the rotation.
+    Matrix mi;
+    node->getWorldMatrix().invert(&mi);
+    mi.multiply(m);
+    
+    Quaternion r;
+    mi.getRotation(&r);
+
+    return r;
+}
+
+Vector3 PhysicsConstraint::getTranslationOffset(const Node* node, const Vector3& point)
+{
+    // Create a translation matrix that translates to the given origin.
+    Matrix m;
+    Matrix::createTranslation(point, &m);
+
+    // Calculate the translation offset to the rigid body by transforming 
+    // the translation matrix above into the rigid body's local space 
+    // (multiply by the inverse world matrix) and extracting the translation.
+    Matrix mi;
+    node->getWorldMatrix().invert(&mi);
+    mi.multiply(m);
+    
+    Vector3 t;
+    mi.getTranslation(&t);
+
+    Vector3 s;
+    node->getWorldMatrix().getScale(&s);
+
+    t.x *= s.x;
+    t.y *= s.y;
+    t.z *= s.z;
+    
+    t = offsetByCenterOfMass(node, t);
+
+    return t;
+}
+
+btTransform PhysicsConstraint::getTransformOffset(const Node* node, const Vector3& origin)
+{
+    // Create a translation matrix that translates to the given origin.
+    Matrix m;
+    Matrix::createTranslation(origin, &m);
+
+    // Calculate the translation and rotation offset to the rigid body
+    // by transforming the translation matrix above into the rigid body's
+    // local space (multiply by the inverse world matrix and extract components).
+    Matrix mi;
+    node->getWorldMatrix().invert(&mi);
+    mi.multiply(m);
+
+    Quaternion r;
+    mi.getRotation(&r);
+    
+    Vector3 t;
+    mi.getTranslation(&t);
+
+    Vector3 s;
+    node->getWorldMatrix().getScale(&s);
+
+    t.x *= s.x;
+    t.y *= s.y;
+    t.z *= s.z;
+    
+    t = offsetByCenterOfMass(node, t);
+
+    return btTransform(btQuaternion(r.x, r.y, r.z, r.w), btVector3(t.x, t.y, t.z));
+}
+
+Vector3 PhysicsConstraint::getWorldCenterOfMass(const Model* model)
+{
+    Vector3 center;
+
+    const BoundingBox& box = model->getMesh()->getBoundingBox();
+    if (!(box.min.isZero() && box.max.isZero()))
+    {
+        Vector3 bMin, bMax;
+        model->getNode()->getWorldMatrix().transformPoint(box.min, &bMin);
+        model->getNode()->getWorldMatrix().transformPoint(box.max, &bMax);
+        center.set(bMin, bMax);
+        center.scale(0.5f);
+        center.add(bMin);
+    }
+    else
+    {
+        const BoundingSphere& sphere = model->getMesh()->getBoundingSphere();
+        if (!(sphere.center.isZero() && sphere.radius == 0))
+        {
+            model->getNode()->getWorldMatrix().transformPoint(sphere.center, &center);
+        }
+        else
+        {
+            // Warn the user that the model has no bounding volume.
+            WARN_VARG("Model \'%s\' has no bounding volume - center of mass is defaulting to local coordinate origin.", model->getNode()->getId());
+            model->getNode()->getWorldMatrix().transformPoint(&center);
+        }
+    }
+
+    return center;
+}
+
+Vector3 PhysicsConstraint::offsetByCenterOfMass(const Node* node, const Vector3& v)
+{
+    btVector3 centerOfMassOffset = ((PhysicsMotionState*)node->getPhysicsRigidBody()->_body->getMotionState())->_centerOfMassOffset.getOrigin();
+    return Vector3(v.x + centerOfMassOffset.x(), v.y + centerOfMassOffset.y(), v.z + centerOfMassOffset.z());
+}
+
+}

+ 117 - 0
gameplay/src/PhysicsConstraint.h

@@ -0,0 +1,117 @@
+/*
+ * PhysicsConstraint.h
+ */
+
+#ifndef PHYSICSCONSTRAINT_H_
+#define PHYSICSCONSTRAINT_H_
+
+#include "Base.h"
+#include "Model.h"
+#include "Vector3.h"
+
+namespace gameplay
+{
+    class Node;
+    class PhysicsRigidBody;
+
+/**
+ * Base class for physics constraints.
+ */
+class PhysicsConstraint
+{
+    friend class PhysicsController;
+    friend class PhysicsRigidBody;
+
+public:
+    /**
+     * Gets the impulse needed to break the constraint.
+     * 
+     * @return The impulse needed to break the constraint.
+     */
+    inline float getBreakingImpulse() const;
+
+    /**
+     * Sets the impulse needed to break the constraint
+     * (if an impulse greater than or equal to the given
+     * value is applied to the constraint, the constraint
+     * will be broken).
+     * 
+     * @param impulse The impulse needed to break the constraint.
+     */
+    inline void setBreakingImpulse(float impulse);
+
+    /**
+     * Gets whether the constraint is enabled or not.
+     * 
+     * @return Whether the constraint is enabled or not.
+     */
+    inline bool isEnabled() const;
+
+    /**
+     * Sets whether the constraint is enabled or not.
+     * 
+     * @param enabled Whether the constraint is enabled or not.
+     */
+    inline void setEnabled(bool enabled);
+
+    /**
+     * Calculates the midpoint between the given nodes' centers of mass.
+     * 
+     * @param a The first node.
+     * @param b The second node.
+     */
+    static Vector3 centerOfMassMidpoint(const Node* a, const Node* b);
+
+    /**
+     * Calculates the rotation offset to the given point in the given node's local space.
+     * 
+     * @param node The node to calculate a rotation offset for.
+     * @param point The point to calculate the rotation offset to.
+     */
+    static Quaternion getRotationOffset(const Node* node, const Vector3& point);
+
+    /**
+     * Calculates the translation offset to the given point in the given node's local space.
+     * 
+     * @param node The node to calculate a translation offset for.
+     * @param point The point to calculate the translation offset to.
+     */
+    static Vector3 getTranslationOffset(const Node* node, const Vector3& point);
+
+protected:
+    /**
+     * Constructor.
+     */
+    PhysicsConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Destructor.
+     */
+    virtual ~PhysicsConstraint();
+
+    /**
+     * Calculates the transform to be used as the offset (i.e. "frame in" 
+     * parameter in Bullet terms) to the given constraint origin.
+     */
+    static btTransform getTransformOffset(const Node* node, const Vector3& origin);
+    
+    /**
+     * Calculates the center of mass in world space of the given model.
+     */
+    static Vector3 getWorldCenterOfMass(const Model* model);
+
+    /**
+     * Offsets the given vector by the given node's center of mass.
+     */
+    static Vector3 offsetByCenterOfMass(const Node* node, const Vector3& v);
+
+    PhysicsRigidBody* _a;
+    PhysicsRigidBody* _b;
+    btTypedConstraint* _constraint;
+};
+
+}
+
+#include "PhysicsConstraint.inl"
+
+#endif

+ 30 - 0
gameplay/src/PhysicsConstraint.inl

@@ -0,0 +1,30 @@
+/*
+ * PhysicsConstraint.inl
+ */
+
+#include "PhysicsConstraint.h"
+
+namespace gameplay
+{
+
+inline float PhysicsConstraint::getBreakingImpulse() const
+{
+    return _constraint->getBreakingImpulseThreshold();
+}
+
+inline void PhysicsConstraint::setBreakingImpulse(float impulse)
+{
+    _constraint->setBreakingImpulseThreshold(impulse);
+}
+
+inline bool PhysicsConstraint::isEnabled() const
+{
+    return _constraint->isEnabled();
+}
+
+inline void PhysicsConstraint::setEnabled(bool enabled)
+{
+    _constraint->setEnabled(enabled);
+}
+
+}

+ 346 - 0
gameplay/src/PhysicsController.cpp

@@ -0,0 +1,346 @@
+/*
+ * PhysicsController.cpp
+ */
+
+#include "Base.h"
+#include "Game.h"
+#include "PhysicsController.h"
+#include "PhysicsMotionState.h"
+
+namespace gameplay
+{
+
+// Default gravity is 9.8 along the negative Y axis.
+PhysicsController::PhysicsController()
+    : _gravity(btScalar(0.0), btScalar(-9.8), btScalar(0.0)), _collisionConfiguration(NULL), _dispatcher(NULL),
+    _overlappingPairCache(NULL), _solver(NULL), _world(NULL), _status(Listener::DEACTIVATED), _listeners(NULL)
+{
+}
+
+void PhysicsController::addStatusListener(Listener* listener)
+{
+    if (!_listeners)
+        _listeners = new std::vector<Listener*>();
+
+    _listeners->push_back(listener);
+}
+
+PhysicsController::~PhysicsController()
+{
+    SAFE_DELETE(_listeners);
+}
+
+PhysicsFixedConstraint* PhysicsController::createFixedConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+{
+    PhysicsFixedConstraint* constraint = new PhysicsFixedConstraint(a, b);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsGenericConstraint* PhysicsController::createGenericConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+{
+    PhysicsGenericConstraint* constraint = new PhysicsGenericConstraint(a, b);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsGenericConstraint* PhysicsController::createGenericConstraint(PhysicsRigidBody* a,
+    const Quaternion& rotationOffsetA, const Vector3& translationOffsetA, PhysicsRigidBody* b,
+    const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+{
+    PhysicsGenericConstraint* constraint = new PhysicsGenericConstraint(a, rotationOffsetA, 
+        translationOffsetA, b, rotationOffsetB, translationOffsetB);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsHingeConstraint* PhysicsController::createHingeConstraint(PhysicsRigidBody* a,
+    const Quaternion& rotationOffsetA, const Vector3& translationOffsetA, PhysicsRigidBody* b, 
+    const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+{
+    PhysicsHingeConstraint* constraint = new PhysicsHingeConstraint(a, rotationOffsetA, 
+        translationOffsetA, b, rotationOffsetB, translationOffsetB);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsSocketConstraint* PhysicsController::createSocketConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+{
+    PhysicsSocketConstraint* constraint = new PhysicsSocketConstraint(a, b);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsSocketConstraint* PhysicsController::createSocketConstraint(PhysicsRigidBody* a,
+    const Vector3& translationOffsetA, PhysicsRigidBody* b, const Vector3& translationOffsetB)
+{
+    PhysicsSocketConstraint* constraint = new PhysicsSocketConstraint(a,
+        translationOffsetA, b, translationOffsetB);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsSpringConstraint* PhysicsController::createSpringConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+{
+    PhysicsSpringConstraint* constraint = new PhysicsSpringConstraint(a, b);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+PhysicsSpringConstraint* PhysicsController::createSpringConstraint(PhysicsRigidBody* a,
+    const Quaternion& rotationOffsetA, const Vector3& translationOffsetA, PhysicsRigidBody* b, 
+    const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+{
+    PhysicsSpringConstraint* constraint = new PhysicsSpringConstraint(a, rotationOffsetA, 
+        translationOffsetA, b, rotationOffsetB, translationOffsetB);
+    setupConstraint(a, b, constraint);
+    return constraint;
+}
+
+const Vector3& PhysicsController::getGravity(const Vector3& gravity) const
+{
+    return _gravity;
+}
+
+void PhysicsController::setGravity(const Vector3& gravity)
+{
+    _gravity = gravity;
+
+    if (_world)
+    {
+        _world->setGravity(btVector3(_gravity.x, _gravity.y, _gravity.z));
+    }
+}
+
+void PhysicsController::initialize()
+{
+    _collisionConfiguration = new btDefaultCollisionConfiguration();
+    _dispatcher = new btCollisionDispatcher(_collisionConfiguration);
+    _overlappingPairCache = new btDbvtBroadphase();
+    _solver = new btSequentialImpulseConstraintSolver();
+
+    // Create the world.
+    _world = new btDiscreteDynamicsWorld(_dispatcher, _overlappingPairCache, _solver, _collisionConfiguration);
+    _world->setGravity(btVector3(_gravity.x, _gravity.y, _gravity.z));
+}
+
+void PhysicsController::finalize()
+{
+    // Clean up the world and its various components.
+    SAFE_DELETE(_world);
+    SAFE_DELETE(_solver);
+    SAFE_DELETE(_overlappingPairCache);
+    SAFE_DELETE(_dispatcher);
+    SAFE_DELETE(_collisionConfiguration);
+}
+
+void PhysicsController::pause()
+{
+    // DUMMY FUNCTION
+}
+
+void PhysicsController::resume()
+{
+    // DUMMY FUNCTION
+}
+
+void PhysicsController::update(long elapsedTime)
+{
+    // Update the physics simulation, with a maximum
+    // of 10 simulation steps being performed in a given frame.
+    //
+    // Note that stepSimulation takes elapsed time in seconds
+    // so we divide by 1000 to convert from milliseconds.
+    _world->stepSimulation((float)elapsedTime * 0.001, 10);
+
+    // If we have status listeners, then check if our status has changed.
+    if (_listeners)
+    {
+        Listener::EventType oldStatus = _status;
+
+        if (_status = Listener::DEACTIVATED)
+        {
+            for (int i = 0; i < _world->getNumCollisionObjects(); i++)
+            {
+                if (_world->getCollisionObjectArray()[i]->isActive())
+                {
+                    _status = Listener::ACTIVATED;
+                    break;
+                }
+            }
+        }
+        else
+        {
+            bool allInactive = true;
+            for (int i = 0; i < _world->getNumCollisionObjects(); i++)
+            {
+                if (_world->getCollisionObjectArray()[i]->isActive())
+                {
+                    allInactive = false;
+                    break;
+                }
+            }
+
+            if (allInactive)
+                _status = Listener::DEACTIVATED;
+        }
+
+        // If the status has changed, notify our listeners.
+        if (oldStatus != _status)
+        {
+            for (unsigned int k = 0; k < _listeners->size(); k++)
+            {
+                (*_listeners)[k]->statusEvent(_status);
+            }
+        }
+    }
+
+    // All statuses are set with the DIRTY bit before collision processing occurs.
+    // During collision processing, if a collision occurs, the status is 
+    // set to COLLISION and the DIRTY bit is cleared. Then, after collision processing 
+    // is finished, if a given status is still dirty, the COLLISION bit is cleared.
+
+    // Dirty all the collision listeners' collision status caches.
+    for (unsigned int i = 0; i < _bodies.size(); i++)
+    {
+        if (_bodies[i]->_listeners)
+        {
+            for (unsigned int k = 0; k < _bodies[i]->_listeners->size(); k++)
+            {
+                std::map<PhysicsRigidBody::CollisionPair, int>::iterator iter = (*_bodies[i]->_listeners)[k]->_collisionStatus.begin();
+                for (; iter != (*_bodies[i]->_listeners)[k]->_collisionStatus.end(); iter++)
+                {
+                    iter->second |= PhysicsRigidBody::Listener::DIRTY;
+                }
+            }
+        }
+    }
+
+    // Go through the physics rigid bodies and update the collision listeners.
+    for (unsigned int i = 0; i < _bodies.size(); i++)
+    {
+        if (_bodies[i]->_listeners)
+        {
+            for (unsigned int k = 0; k < _bodies[i]->_listeners->size(); k++)
+            {
+                std::map<PhysicsRigidBody::CollisionPair, int>::iterator iter = (*_bodies[i]->_listeners)[k]->_collisionStatus.begin();
+                for (; iter != (*_bodies[i]->_listeners)[k]->_collisionStatus.end(); iter++)
+                {
+                    // If this collision pair was one that was registered for listening, then perform the collision test.
+                    // (In the case where we register for all collisions with a rigid body, there will be a lot
+                    // of collision pairs in the status cache that we did not explicitly register for.)
+                    if ((iter->second & PhysicsRigidBody::Listener::REGISTERED) != 0)
+                    {
+                        if (iter->first._rbB)
+                            Game::getInstance()->getPhysicsController()->_world->contactPairTest(iter->first._rbA->_body, iter->first._rbB->_body, *(*_bodies[i]->_listeners)[k]);
+                        else
+                            Game::getInstance()->getPhysicsController()->_world->contactTest(iter->first._rbA->_body, *(*_bodies[i]->_listeners)[k]);
+                    }
+                }   
+            }
+        }
+    }
+
+    // Go through all the collision listeners and update their collision status caches.
+    for (unsigned int i = 0; i < _bodies.size(); i++)
+    {
+        if (_bodies[i]->_listeners)
+        {
+            for (unsigned int k = 0; k < _bodies[i]->_listeners->size(); k++)
+            {
+                std::map<PhysicsRigidBody::CollisionPair, int>::iterator iter = (*_bodies[i]->_listeners)[k]->_collisionStatus.begin();
+                for (; iter != (*_bodies[i]->_listeners)[k]->_collisionStatus.end(); iter++)
+                {
+                    if ((iter->second & PhysicsRigidBody::Listener::DIRTY) != 0)
+                    {
+                        iter->second &= ~PhysicsRigidBody::Listener::COLLISION;
+                    }
+                }
+            }
+        }
+    }
+}
+
+void PhysicsController::addRigidBody(PhysicsRigidBody* body)
+{
+    _world->addRigidBody(body->_body);
+    _bodies.push_back(body);
+}
+
+btCollisionShape* PhysicsController::getBox(const Vector3& min, const Vector3& max, const btVector3& scale)
+{
+    btVector3 halfExtents(scale.x() * 0.5 * abs(max.x - min.x), scale.y() * 0.5 * abs(max.y - min.y), scale.z() * 0.5 * abs(max.z - min.z));
+    BULLET_NEW(btBoxShape, box, halfExtents);
+    _shapes.push_back(box);
+
+    return box;
+}
+
+btCollisionShape* PhysicsController::getSphere(float radius, const btVector3& scale)
+{
+    // Since sphere shapes depend only on the radius, the best we can do is take
+    // the largest dimension and apply that as the uniform scale to the rigid body.
+    float uniformScale = scale.x();
+    if (uniformScale < scale.y())
+        uniformScale = scale.y();
+    if (uniformScale < scale.z())
+        uniformScale = scale.z();
+
+    BULLET_NEW(btSphereShape, sphere, uniformScale * radius);
+    _shapes.push_back(sphere);
+
+    return sphere;
+}
+
+PhysicsRigidBody* PhysicsController::getPhysicsRigidBody(const btCollisionObject* collisionObject)
+{
+    // Find the rigid body and remove it from the world.
+    for (unsigned int i = 0; i < _bodies.size(); i++)
+    {
+        if (_bodies[i]->_body == collisionObject)
+            return _bodies[i];
+    }
+
+    return NULL;
+}
+
+void PhysicsController::removeConstraint(PhysicsConstraint* constraint)
+{
+    // Find the constraint and remove it from the physics world.
+    for (int i = _world->getNumConstraints() - 1; i >= 0; i--)
+    {
+        btTypedConstraint* currentConstraint = _world->getConstraint(i);
+        if (constraint->_constraint == currentConstraint)
+        {
+            _world->removeConstraint(currentConstraint);
+            break;
+        }
+    }
+}
+
+void PhysicsController::removeRigidBody(PhysicsRigidBody* rigidBody)
+{
+    // Find the rigid body and remove it from the world.
+    for (int i = _world->getNumCollisionObjects() - 1; i >= 0 ; i--)
+    {
+        btCollisionObject* obj = _world->getCollisionObjectArray()[i];
+        if (rigidBody->_body == obj)
+        {
+            _world->removeCollisionObject(obj);
+            break;
+        }
+    }
+}
+
+void PhysicsController::setupConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b, PhysicsConstraint* constraint)
+{
+    a->addConstraint(constraint);
+    if (b)
+    {
+        b->addConstraint(constraint);
+    }
+
+    _world->addConstraint(constraint->_constraint);
+}
+
+}

+ 261 - 0
gameplay/src/PhysicsController.h

@@ -0,0 +1,261 @@
+/*
+ * PhysicsController.h
+ */
+
+#ifndef PHYSICSCONTROLLER_H_
+#define PHYSICSCONTROLLER_H_
+
+#include "PhysicsConstraint.h"
+#include "PhysicsFixedConstraint.h"
+#include "PhysicsGenericConstraint.h"
+#include "PhysicsHingeConstraint.h"
+#include "PhysicsSocketConstraint.h"
+#include "PhysicsSpringConstraint.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+    
+/**
+ * Defines a class for controlling game physics.
+ */
+class PhysicsController
+{
+    friend class Game;
+    friend class PhysicsConstraint;
+    friend class PhysicsRigidBody;
+
+public:
+    /**
+     * Status listener interface.
+     */
+    class Listener
+    {
+    public:
+
+        /**
+         * The type of physics status event.
+         */
+        enum EventType 
+        {
+            /**
+             * Event fired when there were no active physics objects and at least one is now active.
+             */
+            ACTIVATED,
+
+            /**
+             * Event fired when there are no more active physics objects in the world.
+             */
+            DEACTIVATED
+        };
+
+        /**
+         * Handles when the physics world status changes.
+         */
+        virtual void statusEvent(EventType type) = 0;
+    };
+
+    /**
+     * Adds a status listener.
+     * 
+     * @param listener The listener to add.
+     */
+    void addStatusListener(Listener* listener);
+
+    /**
+     * Creates a fixed constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsFixedConstraint* createFixedConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b = NULL);
+
+    /**
+     * Creates a generic constraint so that the rigid body (or bodies) is
+     * (are) constrained to its (their) current world position(s).
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsGenericConstraint* createGenericConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b = NULL);
+
+    /**
+     * Creates a generic constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsGenericConstraint* createGenericConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, 
+        const Vector3& translationOffsetA, PhysicsRigidBody* b = NULL, 
+        const Quaternion& rotationOffsetB = Quaternion(), const Vector3& translationOffsetB = Vector3());
+
+    /**
+     * Creates a hinge constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsHingeConstraint* createHingeConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, 
+        const Vector3& translationOffsetA, PhysicsRigidBody* b = NULL, 
+        const Quaternion& rotationOffsetB = Quaternion(), const Vector3& translationOffsetB = Vector3());
+
+    /**
+     * Creates a socket constraint so that the rigid body (or bodies) is
+     * (are) constrained using its (their) current world position(s) for
+     * the translation offset(s) to the constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsSocketConstraint* createSocketConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b = NULL);
+
+    /**
+     * Creates a socket constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsSocketConstraint* createSocketConstraint(PhysicsRigidBody* a, const Vector3& translationOffsetA,
+        PhysicsRigidBody* b = NULL, const Vector3& translationOffsetB = Vector3());
+
+    /**
+     * Creates a spring constraint so that the rigid body (or bodies) is
+     * (are) constrained using its (their) current world position(s) for
+     * the translation offset(s) to the constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsSpringConstraint* createSpringConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Creates a spring constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsSpringConstraint* createSpringConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, 
+        const Vector3& translationOffsetA, PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB);
+
+    /**
+     * Gets the gravity vector for the simulated physics world.
+     * 
+     * @return The gravity vector.
+     */
+    const Vector3& getGravity(const Vector3& gravity) const;
+
+    /**
+     * Sets the gravity vector for the simulated physics world.
+     * 
+     * @param gravity The gravity vector.
+     */
+    void setGravity(const Vector3& gravity);
+
+private:
+    /**
+     * Constructor.
+     */
+    PhysicsController();
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsController();
+
+    /**
+     * Controller initialize.
+     */
+    void initialize();
+
+    /**
+     * Controller finalize.
+     */
+    void finalize();
+
+    /**
+     * Controller pause.
+     */
+    void pause();
+
+    /**
+     * Controller resume.
+     */
+    void resume();
+
+    /**
+     * Controller update.
+     */
+    void update(long elapsedTime);
+
+    // Adds the given rigid body to the world.
+    void addRigidBody(PhysicsRigidBody* body);
+
+    // Creates a box collision shape to be used in the creation of a rigid body.
+    btCollisionShape* getBox(const Vector3& min, const Vector3& max, const btVector3& scale);
+
+    // Gets the corresponding GamePlay object for the given Bullet object.
+    PhysicsRigidBody* getPhysicsRigidBody(const btCollisionObject* collisionObject);
+
+    // Creates a sphere collision shape to be used in the creation of a rigid body.
+    btCollisionShape* getSphere(float radius, const btVector3& scale);
+
+    // Removes the given constraint from the simulated physics world.
+    void removeConstraint(PhysicsConstraint* constraint);
+
+    // Removes the given rigid body from the simulated physics world.
+    void removeRigidBody(PhysicsRigidBody* rigidBody);
+
+    // Sets up the given constraint for the given two rigid bodies.
+    void setupConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b, PhysicsConstraint* constraint);
+    
+    Vector3 _gravity;
+    btDefaultCollisionConfiguration* _collisionConfiguration;
+    btCollisionDispatcher* _dispatcher;
+    btBroadphaseInterface* _overlappingPairCache;
+    btSequentialImpulseConstraintSolver* _solver;
+    btDynamicsWorld* _world;
+    btAlignedObjectArray<btCollisionShape*> _shapes;
+    Listener::EventType _status;
+    std::vector<PhysicsRigidBody*> _bodies;
+    std::vector<Listener*>* _listeners;
+};
+
+}
+
+#endif

+ 24 - 0
gameplay/src/PhysicsFixedConstraint.cpp

@@ -0,0 +1,24 @@
+/**
+ * PhysicsFixedConstraint.cpp
+ */
+
+#include "PhysicsFixedConstraint.h"
+
+namespace gameplay
+{
+
+PhysicsFixedConstraint::PhysicsFixedConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+    : PhysicsGenericConstraint(a, b)
+{
+    PhysicsGenericConstraint::setAngularLowerLimit(Vector3(0.0f, 0.0f, 0.0f));
+    PhysicsGenericConstraint::setAngularUpperLimit(Vector3(0.0f, 0.0f, 0.0f));
+    PhysicsGenericConstraint::setLinearLowerLimit(Vector3(0.0f, 0.0f, 0.0f));
+    PhysicsGenericConstraint::setLinearUpperLimit(Vector3(0.0f, 0.0f, 0.0f));
+}
+
+PhysicsFixedConstraint::~PhysicsFixedConstraint()
+{
+    // DUMMY FUNCTION
+}
+
+}

+ 64 - 0
gameplay/src/PhysicsFixedConstraint.h

@@ -0,0 +1,64 @@
+/*
+ * PhysicsFixedConstraint.h
+ */
+
+#ifndef PHYSICSFIXEDCONSTRAINT_H_
+#define PHYSICSFIXEDCONSTRAINT_H_
+
+#include "PhysicsGenericConstraint.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a constraint where two rigid bodies 
+ * (or one rigid body and the world) are bound together.
+ *
+ * (This is similar in concept to parenting one node to another,
+ * but can be used in specific situations for a more appropriate effect
+ * (e.g. for implementing sticky projectiles, etc.).)
+ */
+class PhysicsFixedConstraint : public PhysicsGenericConstraint
+{
+    friend class PhysicsController;
+
+protected:
+    /**
+     * @see PhysicsGenericConstraint
+     */
+    PhysicsFixedConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsFixedConstraint();
+
+    // Note: We make these functions protected to prevent usage
+    // (these are public in the base class, PhysicsGenericConstraint).
+
+    /**
+     * Protected to prevent usage.
+     */
+    inline void setAngularLowerLimit(const Vector3& limit);
+    
+    /**
+     * Protected to prevent usage.
+     */
+    inline void setAngularUpperLimit(const Vector3& limit);
+    
+    /**
+     * Protected to prevent usage.
+     */
+    inline void setLinearLowerLimit(const Vector3& limit);
+    
+    /**
+     * Protected to prevent usage.
+     */
+    inline void setLinearUpperLimit(const Vector3& limit);
+};
+
+}
+
+#include "PhysicsFixedConstraint.inl"
+
+#endif

+ 30 - 0
gameplay/src/PhysicsFixedConstraint.inl

@@ -0,0 +1,30 @@
+/**
+ * PhysicsFixedConstraint.inl
+ */
+
+#include "PhysicsFixedConstraint.h"
+
+namespace gameplay
+{
+
+inline void PhysicsFixedConstraint::setAngularLowerLimit(const Vector3& limit)
+{
+    PhysicsGenericConstraint::setAngularLowerLimit(limit);
+}
+
+inline void PhysicsFixedConstraint::setAngularUpperLimit(const Vector3& limit)
+{
+    PhysicsGenericConstraint::setAngularUpperLimit(limit);
+}
+
+inline void PhysicsFixedConstraint::setLinearLowerLimit(const Vector3& limit)
+{
+    PhysicsGenericConstraint::setLinearLowerLimit(limit);
+}
+
+inline void PhysicsFixedConstraint::setLinearUpperLimit(const Vector3& limit)
+{
+    PhysicsGenericConstraint::setLinearUpperLimit(limit);
+}
+
+}

+ 71 - 0
gameplay/src/PhysicsGenericConstraint.cpp

@@ -0,0 +1,71 @@
+/**
+ * PhysicsGenericConstraint.cpp
+ */
+
+#include "PhysicsGenericConstraint.h"
+
+#include "Node.h"
+#include "PhysicsMotionState.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+PhysicsGenericConstraint::PhysicsGenericConstraint()
+    : PhysicsConstraint(NULL, NULL), _rotationOffsetA(NULL), _rotationOffsetB(NULL),
+    _translationOffsetA(NULL), _translationOffsetB(NULL)
+{
+    // DUMMY FUNCTION
+}
+
+PhysicsGenericConstraint::PhysicsGenericConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+    : PhysicsConstraint(a, b), _rotationOffsetA(NULL), _rotationOffsetB(NULL),
+    _translationOffsetA(NULL), _translationOffsetB(NULL)
+{
+    if (b)
+    {
+        Vector3 origin = centerOfMassMidpoint(a->getNode(), b->getNode());
+        _constraint = new btGeneric6DofConstraint(*a->_body, *b->_body, getTransformOffset(a->getNode(), origin), getTransformOffset(b->getNode(), origin), true);
+    }
+    else
+    {
+        _constraint = new btGeneric6DofConstraint(*a->_body, btTransform::getIdentity(), true);
+    }
+}
+
+PhysicsGenericConstraint::PhysicsGenericConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+    PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+    : PhysicsConstraint(a, b), _rotationOffsetA(NULL), _rotationOffsetB(NULL), _translationOffsetA(NULL), _translationOffsetB(NULL)
+{
+    // Take scale into account for the first node's translation offset.
+    Vector3 sA;
+    a->getNode()->getWorldMatrix().getScale(&sA);
+    Vector3 tA(translationOffsetA.x * sA.x, translationOffsetA.y * sA.y, translationOffsetA.z * sA.z);
+
+    if (b)
+    {
+        // Take scale into account for the second node's translation offset.
+        Vector3 sB;
+        b->getNode()->getWorldMatrix().getScale(&sB);
+        Vector3 tB(translationOffsetB.x * sB.x, translationOffsetB.y * sB.y, translationOffsetB.z * sB.z);
+
+        btTransform frameInA(btQuaternion(rotationOffsetA.x, rotationOffsetA.y, rotationOffsetA.z, rotationOffsetA.w), btVector3(tA.x, tA.y, tA.z));
+        btTransform frameInB(btQuaternion(rotationOffsetB.x, rotationOffsetB.y, rotationOffsetB.z, rotationOffsetB.w), btVector3(tB.x, tB.y, tB.z));
+        _constraint = new btGeneric6DofConstraint(*a->_body, *b->_body, frameInA, frameInB, true);
+    }
+    else
+    {
+        btTransform frameInA(btQuaternion(rotationOffsetA.x, rotationOffsetA.y, rotationOffsetA.z, rotationOffsetA.w), btVector3(tA.x, tA.y, tA.z));
+        _constraint = new btGeneric6DofConstraint(*a->_body, frameInA, true);
+    }
+}
+
+PhysicsGenericConstraint::~PhysicsGenericConstraint()
+{
+    SAFE_DELETE(_rotationOffsetA);
+    SAFE_DELETE(_rotationOffsetB);
+    SAFE_DELETE(_translationOffsetA);
+    SAFE_DELETE(_translationOffsetB);
+}
+
+}

+ 167 - 0
gameplay/src/PhysicsGenericConstraint.h

@@ -0,0 +1,167 @@
+/*
+ * PhysicsGenericConstraint.h
+ */
+
+#ifndef PHYSICSGENERICCONSTRAINT_H_
+#define PHYSICSGENERICCONSTRAINT_H_
+
+#include "PhysicsConstraint.h"
+#include "Quaternion.h"
+#include "Vector3.h"
+
+namespace gameplay
+{
+    class PhysicsRigidBody;
+
+/**
+ * Represents a completely generic constraint between two
+ * rigid bodies (or one rigid body and the world) where the
+ * limits for all six degrees of freedom can be set individually.
+ */
+class PhysicsGenericConstraint : public PhysicsConstraint
+{
+    friend class PhysicsController;
+
+public:
+    /**
+     * Gets the rotation offset for the first rigid body in the constraint.
+     * 
+     * @return The rotation offset.
+     */
+    inline const Quaternion& getRotationOffsetA() const;
+
+    /**
+     * Gets the rotation offset for the second rigid body in the constraint.
+     * 
+     * @return The rotation offset.
+     */
+    inline const Quaternion& getRotationOffsetB() const;
+
+    /**
+     * Gets the translation offset for the first rigid body in the constraint.
+     * 
+     * @return The translation offset.
+     */
+    inline const Vector3& getTranslationOffsetA() const;
+
+    /**
+     * Gets the translation offset for the second rigid body in the constraint.
+     * 
+     * @return The translation offset.
+     */
+    inline const Vector3& getTranslationOffsetB() const;
+
+    /**
+     * Sets the lower angular limits (as Euler angle limits) along the constraint's local
+     * X, Y, and Z axes using the values in the given vector.
+     * 
+     * @param limits The lower angular limits (as Euler angle limits) along the local X, Y, and Z axes.
+     */
+    inline void setAngularLowerLimit(const Vector3& limits);
+
+    /**
+     * Sets the upper angular limits (as Euler angle limits) along the constraint's local
+     * X, Y, and Z axes using the values in the given vector.
+     * 
+     * @param limits The upper angular limits (as Euler angle limits) along the local X, Y, and Z axes.
+     */
+    inline void setAngularUpperLimit(const Vector3& limits);
+    
+    /**
+     * Sets the lower linear limits along the constraint's local
+     * X, Y, and Z axes using the values in the given vector.
+     * 
+     * @param limits The lower linear limits along the local X, Y, and Z axes.
+     */
+    inline void setLinearLowerLimit(const Vector3& limits);
+    
+    /**
+     * Sets the upper linear limits along the constraint's local
+     * X, Y, and Z axes using the values in the given vector.
+     * 
+     * @param limits The upper linear limits along the local X, Y, and Z axes.
+     */
+    inline void setLinearUpperLimit(const Vector3& limits);
+
+    /**
+     * Sets the rotation offset for the first rigid body in the constraint.
+     * 
+     * @param rotationOffset The rotation offset.
+     */
+    inline void setRotationOffsetA(const Quaternion& rotationOffset);
+
+    /**
+     * Sets the rotation offset for the second rigid body in the constraint.
+     * 
+     * @param rotationOffset The rotation offset.
+     */
+    inline void setRotationOffsetB(const Quaternion& rotationOffset);
+
+    /**
+     * Sets the translation offset for the first rigid body in the constraint.
+     * 
+     * @param translationOffset The translation offset.
+     */
+    inline void setTranslationOffsetA(const Vector3& translationOffset);
+
+    /**
+     * Sets the translation offset for the second rigid body in the constraint.
+     * 
+     * @param translationOffset The translation offset.
+     */
+    inline void setTranslationOffsetB(const Vector3& translationOffset);
+
+protected:
+    /**
+     * Constructor.
+     *
+     * Note: This should only used by subclasses that do not want
+     * the _constraint member variable to be initialized.
+     */
+    PhysicsGenericConstraint();
+
+    /**
+     * Creates a generic constraint so that the rigid body (or bodies) is
+     * (are) constrained to its (their) current world position(s).
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsGenericConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Creates a generic constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsGenericConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+        PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB);
+
+    /**
+     * Destructor.
+     */
+    virtual ~PhysicsGenericConstraint();
+
+private:
+    mutable Quaternion* _rotationOffsetA;
+    mutable Quaternion* _rotationOffsetB;
+    mutable Vector3* _translationOffsetA;
+    mutable Vector3* _translationOffsetB;
+};
+
+}
+
+#include "PhysicsGenericConstraint.inl"
+
+#endif

+ 90 - 0
gameplay/src/PhysicsGenericConstraint.inl

@@ -0,0 +1,90 @@
+/**
+ * PhysicsGenericConstraint.inl
+ */
+
+#include "PhysicsGenericConstraint.h"
+
+namespace gameplay
+{
+
+inline const Quaternion& PhysicsGenericConstraint::getRotationOffsetA() const
+{
+    if (!_rotationOffsetA)
+        _rotationOffsetA = new Quaternion();
+
+    btQuaternion ro = static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetA().getRotation();
+    _rotationOffsetA->set(ro.x(), ro.y(), ro.z(), ro.w());
+    return *_rotationOffsetA;
+}
+
+inline const Quaternion& PhysicsGenericConstraint::getRotationOffsetB() const
+{
+    if (!_rotationOffsetB)
+        _rotationOffsetB = new Quaternion();
+
+    btQuaternion ro = static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetB().getRotation();
+    _rotationOffsetB->set(ro.x(), ro.y(), ro.z(), ro.w());
+    return *_rotationOffsetB;
+}
+
+inline const Vector3& PhysicsGenericConstraint::getTranslationOffsetA() const
+{
+    if (!_translationOffsetA)
+        _translationOffsetA = new Vector3();
+
+    btVector3 to = static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetA().getOrigin();
+    _translationOffsetA->set(to.x(), to.y(), to.z());
+    return *_translationOffsetA;
+}
+
+inline const Vector3& PhysicsGenericConstraint::getTranslationOffsetB() const
+{
+    if (!_translationOffsetB)
+        _translationOffsetB = new Vector3();
+
+    btVector3 to = static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetB().getOrigin();
+    _translationOffsetB->set(to.x(), to.y(), to.z());
+    return *_translationOffsetB;
+}
+
+inline void PhysicsGenericConstraint::setAngularLowerLimit(const Vector3& limits)
+{
+    ((btGeneric6DofConstraint*)_constraint)->setAngularLowerLimit(btVector3(limits.x, limits.y, limits.z));
+}
+
+inline void PhysicsGenericConstraint::setAngularUpperLimit(const Vector3& limits)
+{
+    ((btGeneric6DofConstraint*)_constraint)->setAngularUpperLimit(btVector3(limits.x, limits.y, limits.z));
+}
+
+inline void PhysicsGenericConstraint::setLinearLowerLimit(const Vector3& limits)
+{
+    ((btGeneric6DofConstraint*)_constraint)->setLinearLowerLimit(btVector3(limits.x, limits.y, limits.z));
+}
+    
+inline void PhysicsGenericConstraint::setLinearUpperLimit(const Vector3& limits)
+{
+    ((btGeneric6DofConstraint*)_constraint)->setLinearUpperLimit(btVector3(limits.x, limits.y, limits.z));
+}
+
+inline void PhysicsGenericConstraint::setRotationOffsetA(const Quaternion& rotationOffset)
+{
+    static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetA().setRotation(btQuaternion(rotationOffset.x, rotationOffset.y, rotationOffset.z, rotationOffset.w));
+}
+
+inline void PhysicsGenericConstraint::setRotationOffsetB(const Quaternion& rotationOffset)
+{
+    static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetB().setRotation(btQuaternion(rotationOffset.x, rotationOffset.y, rotationOffset.z, rotationOffset.w));
+}
+
+inline void PhysicsGenericConstraint::setTranslationOffsetA(const Vector3& translationOffset)
+{
+    static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetA().setOrigin(btVector3(translationOffset.x, translationOffset.y, translationOffset.z));
+}
+
+inline void PhysicsGenericConstraint::setTranslationOffsetB(const Vector3& translationOffset)
+{
+    static_cast<btGeneric6DofConstraint*>(_constraint)->getFrameOffsetB().setOrigin(btVector3(translationOffset.x, translationOffset.y, translationOffset.z));
+}
+
+}

+ 51 - 0
gameplay/src/PhysicsHingeConstraint.cpp

@@ -0,0 +1,51 @@
+/*
+ * PhysicsHingeConstraint.cpp
+ */
+
+#include "PhysicsHingeConstraint.h"
+
+#include "Node.h"
+
+namespace gameplay
+{
+
+void PhysicsHingeConstraint::setLimits(float minAngle, float maxAngle, float bounciness)
+{
+    // Use the defaults for softness (0.9) and biasFactor (0.3).
+    ((btHingeConstraint*)_constraint)->setLimit(minAngle, maxAngle, 0.9f, 0.3f, bounciness);
+}
+
+PhysicsHingeConstraint::PhysicsHingeConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+    PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+    : PhysicsConstraint(a, b)
+{
+    // Take scale into account for the first node's translation offset.
+    Vector3 sA;
+    a->getNode()->getWorldMatrix().getScale(&sA);
+    Vector3 tA(translationOffsetA.x * sA.x, translationOffsetA.y * sA.y, translationOffsetA.z * sA.z);
+
+    if (b)
+    {
+        // Take scale into account for the second node's translation offset.
+        Vector3 sB;
+        b->getNode()->getWorldMatrix().getScale(&sB);
+        Vector3 tB(translationOffsetB.x * sB.x, translationOffsetB.y * sB.y, translationOffsetB.z * sB.z);
+
+        btTransform frameInA(btQuaternion(rotationOffsetA.x, rotationOffsetA.y, rotationOffsetA.z, rotationOffsetA.w), btVector3(tA.x, tA.y, tA.z));
+        btTransform frameInB(btQuaternion(rotationOffsetB.x, rotationOffsetB.y, rotationOffsetB.z, rotationOffsetB.w), btVector3(tB.x, tB.y, tB.z));
+        _constraint = new btHingeConstraint(*a->_body, *b->_body, frameInA, frameInB);
+    }
+    else
+    {
+        btTransform frameInA(btQuaternion(rotationOffsetA.x, rotationOffsetA.y, rotationOffsetA.z, rotationOffsetA.w), btVector3(tA.x, tA.y, tA.z));
+        _constraint = new btHingeConstraint(*a->_body, frameInA);
+    }
+}
+
+    
+PhysicsHingeConstraint::~PhysicsHingeConstraint()
+{
+    // DUMMY FUNCTION
+}
+
+}

+ 66 - 0
gameplay/src/PhysicsHingeConstraint.h

@@ -0,0 +1,66 @@
+/*
+ * PhysicsHingeConstraint.h
+ */
+
+#ifndef PHYSICSHINGECONSTRAINT_H_
+#define PHYSICSHINGECONSTRAINT_H_
+
+#include "PhysicsConstraint.h"
+#include "PhysicsRigidBody.h"
+#include "Quaternion.h"
+#include "Vector3.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a hinge constraint between two rigid bodies
+ * (or one rigid body and the world) where movement is
+ * restricted to rotation about one axis.
+ */
+class PhysicsHingeConstraint : public PhysicsConstraint
+{
+    friend class PhysicsController;
+
+public:
+    /**
+     * Sets the limits (and optionally, some properties) for the hinge.
+     * 
+     * @param minAngle The minimum angle for the hinge.
+     * @param maxAngle The maximum angle for the hinge.
+     * @param bounciness The bounciness of the hinge (this is applied as
+     *      a factor to the incoming velocity when a hinge limit is met in
+     *      order to calculate the outgoing velocity-for example, 0.0 corresponds
+     *      to no bounce and 1.0 corresponds to an outgoing velocity that is equal
+     *      in magnitude to the incoming velocity).
+     */
+    void setLimits(float minAngle, float maxAngle, float bounciness = 1.0f);
+
+private:
+    /**
+     * Creates a hinge constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsHingeConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+        PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB);
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsHingeConstraint();
+};
+
+}
+
+#endif

+ 71 - 0
gameplay/src/PhysicsMotionState.cpp

@@ -0,0 +1,71 @@
+/**
+ * PhysicsMotionState.cpp
+ */
+
+#include "PhysicsMotionState.h"
+
+namespace gameplay
+{
+
+PhysicsMotionState::PhysicsMotionState(Node* node, const Vector3* centerOfMassOffset) : _node(node),
+    _centerOfMassOffset(btTransform::getIdentity())
+{
+    if (centerOfMassOffset)
+    {
+        // Store the center of mass offset.
+        _centerOfMassOffset.setOrigin(btVector3(centerOfMassOffset->x, centerOfMassOffset->y, centerOfMassOffset->z));
+    }
+
+    updateTransformFromNode();
+}
+
+PhysicsMotionState::~PhysicsMotionState()
+{
+}
+
+void PhysicsMotionState::getWorldTransform(btTransform &transform) const
+{
+    if (_node->getPhysicsRigidBody() && _node->getPhysicsRigidBody()->isKinematic())
+        updateTransformFromNode();
+
+    transform = _centerOfMassOffset.inverse() * _worldTransform;
+}
+
+void PhysicsMotionState::setWorldTransform(const btTransform &transform)
+{
+    _worldTransform = transform * _centerOfMassOffset;
+        
+    const btQuaternion& rot = _worldTransform.getRotation();
+    const btVector3& pos = _worldTransform.getOrigin();
+
+    _node->setRotation(rot.x(), rot.y(), rot.z(), rot.w());
+    _node->setTranslation(pos.x(), pos.y(), pos.z());
+}
+
+void PhysicsMotionState::updateTransformFromNode() const
+{
+    // Store the initial world transform (minus the scale) for use by Bullet later on.
+    Quaternion rotation;
+    const Matrix& m = _node->getWorldMatrix();
+    m.getRotation(&rotation);
+
+    if (!_centerOfMassOffset.getOrigin().isZero())
+    {
+        // When there is a center of mass offset, we modify the initial world transformation
+        // so that when physics is initially applied, the object is in the correct location.
+        btQuaternion orientation(rotation.x, rotation.y, rotation.z, rotation.w);
+        btTransform offset = btTransform(orientation, btVector3(0.0f, 0.0f, 0.0f)) * _centerOfMassOffset.inverse();
+
+        btVector3 origin(m.m[12] + _centerOfMassOffset.getOrigin().getX() + offset.getOrigin().getX(),
+            m.m[13] + _centerOfMassOffset.getOrigin().getY() + offset.getOrigin().getY(), 
+            m.m[14] + _centerOfMassOffset.getOrigin().getZ() + offset.getOrigin().getZ());
+        _worldTransform = btTransform(orientation, origin);
+    }
+    else
+    {
+        _worldTransform = btTransform(btQuaternion(rotation.x, rotation.y, rotation.z, rotation.w), 
+            btVector3(m.m[12], m.m[13], m.m[14]));
+    }
+}
+
+}

+ 59 - 0
gameplay/src/PhysicsMotionState.h

@@ -0,0 +1,59 @@
+/*
+ * PhysicsMotionState.h
+ */
+
+#ifndef PHYSICSMOTIONSTATE_H_
+#define PHYSICSMOTIONSTATE_H_
+
+#include "Node.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+/**
+ * Interface between GamePlay and Bullet to keep object transforms synchronized properly.
+ * 
+ * @see btMotionState
+ */
+class PhysicsMotionState : public btMotionState
+{
+    friend class PhysicsRigidBody;
+    friend class PhysicsConstraint;
+
+protected:
+    /**
+     * Creates a physics motion state for a rigid body.
+     * 
+     * @param node The node that owns the rigid body that the motion state is being created for.
+     * @param centerOfMassOffset The translation offset to the center of mass of the rigid body.
+     */
+    PhysicsMotionState(Node* node, const Vector3* centerOfMassOffset = NULL);
+
+    /**
+     * Destructor.
+     */
+    virtual ~PhysicsMotionState();
+
+    /**
+     * @see btMotionState#getWorldTransform
+     */
+    virtual void getWorldTransform(btTransform &transform) const;
+
+    /**
+     * @see btMotionState#setWorldTransform
+     */
+    virtual void setWorldTransform(const btTransform &transform);
+
+private:
+    // Updates the motion state's world transform from the GamePlay Node object's world transform.
+    void updateTransformFromNode() const;
+
+    Node* _node;
+    btTransform _centerOfMassOffset;
+    mutable btTransform _worldTransform;
+};
+
+}
+
+#endif

+ 258 - 0
gameplay/src/PhysicsRigidBody.cpp

@@ -0,0 +1,258 @@
+/*
+ * PhysicsRigidBody.cpp
+ */
+
+#include "Base.h"
+#include "Game.h"
+#include "PhysicsController.h"
+#include "PhysicsMotionState.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+const int PhysicsRigidBody::Listener::DIRTY = 0x01;
+const int PhysicsRigidBody::Listener::COLLISION = 0x02;
+const int PhysicsRigidBody::Listener::REGISTERED = 0x04;
+
+PhysicsRigidBody::PhysicsRigidBody(Node* node, PhysicsRigidBody::Type type, float mass, 
+        float friction, float restitution, float linearDamping, float angularDamping)
+        : _shape(NULL), _body(NULL), _node(node), _listeners(NULL), _angularVelocity(NULL),
+        _anisotropicFriction(NULL), _gravity(NULL), _linearVelocity(NULL)
+{
+    switch (type)
+    {
+        case PhysicsRigidBody::SHAPE_BOX:
+        {
+            const BoundingBox& box = node->getModel()->getMesh()->getBoundingBox();
+
+            PhysicsController* physics = Game::getInstance()->getPhysicsController();
+            _shape = physics->getBox(box.min, box.max, btVector3(node->getScaleX(), node->getScaleY(), node->getScaleZ()));
+            
+            // Use the center of the bounding box as the center of mass offset.
+            Vector3 c(box.min, box.max);
+            c.scale(0.5f);
+            c.add(box.min);
+            c.negate();
+
+            if (c.lengthSquared() > MATH_EPSILON)
+                _body = createBulletRigidBody(_shape, mass, node, friction, restitution, linearDamping, angularDamping, &c);
+            else
+                _body = createBulletRigidBody(_shape, mass, node, friction, restitution, linearDamping, angularDamping);
+
+            break;
+        }
+        case PhysicsRigidBody::SHAPE_SPHERE:
+        {
+            const BoundingSphere& sphere = node->getModel()->getMesh()->getBoundingSphere();
+
+            PhysicsController* physics = Game::getInstance()->getPhysicsController();
+            _shape = physics->getSphere(sphere.radius, btVector3(node->getScaleX(), node->getScaleY(), node->getScaleZ()));
+
+            // Use the center of the bounding sphere as the center of mass offset.
+            Vector3 c(sphere.center);
+            c.negate();
+
+            if (c.lengthSquared() > MATH_EPSILON)
+                _body = createBulletRigidBody(_shape, mass, node, friction, restitution, linearDamping, angularDamping, &c);
+            else
+                _body = createBulletRigidBody(_shape, mass, node, friction, restitution, linearDamping, angularDamping);
+
+            break;
+        }
+    }
+
+    // Add the rigid body to the physics world.
+    Game::getInstance()->getPhysicsController()->addRigidBody(this);
+}
+
+PhysicsRigidBody::~PhysicsRigidBody()
+{
+    // Clean up all constraints linked to this rigid body.
+    PhysicsConstraint* ptr = NULL;
+    while (_constraints.size() > 0)
+    {
+        ptr = _constraints.back();
+        _constraints.pop_back();
+        SAFE_DELETE(ptr);
+    }
+
+    // Clean up the rigid body and its related objects.
+    if (_body)
+    {
+        if (_body->getMotionState())
+            delete _body->getMotionState();
+
+        if (_shape)
+            BULLET_DELETE(_shape);
+
+        Game::getInstance()->getPhysicsController()->removeRigidBody(this);
+        BULLET_DELETE(_body);
+    }
+
+    SAFE_DELETE(_listeners);
+    SAFE_DELETE(_angularVelocity);
+    SAFE_DELETE(_anisotropicFriction);
+    SAFE_DELETE(_gravity);
+    SAFE_DELETE(_linearVelocity);
+}
+
+void PhysicsRigidBody::addCollisionListener(Listener* listener, PhysicsRigidBody* body)
+{
+    if (!_listeners)
+        _listeners = new std::vector<Listener*>();
+
+    CollisionPair pair(this, body);
+    listener->_collisionStatus[pair] = PhysicsRigidBody::Listener::REGISTERED;
+
+    _listeners->push_back(listener);
+}
+
+void PhysicsRigidBody::applyForce(const Vector3& force, const Vector3* relativePosition)
+{
+    // If the force is significant enough, activate the rigid body 
+    // to make sure that it isn't sleeping and apply the force.
+    if (force.lengthSquared() > MATH_EPSILON)
+    {
+        _body->activate();
+        if (relativePosition)
+            _body->applyForce(btVector3(force.x, force.y, force.z), btVector3(relativePosition->x, relativePosition->y, relativePosition->z));
+        else
+            _body->applyCentralForce(btVector3(force.x, force.y, force.z));
+    }
+}
+
+void PhysicsRigidBody::applyImpulse(const Vector3& impulse, const Vector3* relativePosition)
+{
+    // If the impulse is significant enough, activate the rigid body 
+    // to make sure that it isn't sleeping and apply the impulse.
+    if (impulse.lengthSquared() > MATH_EPSILON)
+    {
+        _body->activate();
+
+        if (relativePosition)
+        {
+            _body->applyImpulse(btVector3(impulse.x, impulse.y, impulse.z), btVector3(relativePosition->x, relativePosition->y, relativePosition->z));
+        }
+        else
+            _body->applyCentralImpulse(btVector3(impulse.x, impulse.y, impulse.z));
+    }
+}
+
+void PhysicsRigidBody::applyTorque(const Vector3& torque)
+{
+    // If the torque is significant enough, activate the rigid body 
+    // to make sure that it isn't sleeping and apply the torque.
+    if (torque.lengthSquared() > MATH_EPSILON)
+    {
+        _body->activate();
+        _body->applyTorque(btVector3(torque.x, torque.y, torque.z));
+    }
+}
+
+void PhysicsRigidBody::applyTorqueImpulse(const Vector3& torque)
+{
+    // If the torque impulse is significant enough, activate the rigid body 
+    // to make sure that it isn't sleeping and apply the torque impulse.
+    if (torque.lengthSquared() > MATH_EPSILON)
+    {
+        _body->activate();
+        _body->applyTorqueImpulse(btVector3(torque.x, torque.y, torque.z));
+    }
+}
+
+bool PhysicsRigidBody::collidesWith(PhysicsRigidBody* body)
+{
+    static CollidesWithCallback callback;
+
+    callback.result = false;
+    Game::getInstance()->getPhysicsController()->_world->contactPairTest(_body, body->_body, callback);
+    return callback.result;
+}
+
+btRigidBody* PhysicsRigidBody::createBulletRigidBody(btCollisionShape* shape, float mass, Node* node,
+    float friction, float restitution, float linearDamping, float angularDamping, const Vector3* centerOfMassOffset)
+{
+    // If the mass is non-zero, then the object is dynamic
+    // and we need to calculate the local inertia.
+    btVector3 localInertia(0.0, 0.0, 0.0);
+    if (mass != 0.0)
+        shape->calculateLocalInertia(mass, localInertia);
+
+    // Create the Bullet physics rigid body object.
+    PhysicsMotionState* motionState = new PhysicsMotionState(node, centerOfMassOffset);
+    btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, motionState, shape, localInertia);
+    rbInfo.m_friction = friction;
+    rbInfo.m_restitution = restitution;
+    rbInfo.m_linearDamping = linearDamping;
+    rbInfo.m_angularDamping = angularDamping;
+    BULLET_NEW(btRigidBody, body, rbInfo);
+
+    return body;
+}
+
+void PhysicsRigidBody::addConstraint(PhysicsConstraint* constraint)
+{
+    _constraints.push_back(constraint);
+}
+
+void PhysicsRigidBody::removeConstraint(PhysicsConstraint* constraint)
+{
+    for (unsigned int i = 0; i < _constraints.size(); i++)
+    {
+        if (_constraints[i] == constraint)
+        {
+            _constraints.erase(_constraints.begin() + i);
+            break;
+        }
+    }
+}
+
+PhysicsRigidBody::CollisionPair::CollisionPair(PhysicsRigidBody* rbA, PhysicsRigidBody* rbB)
+    : _rbA(rbA), _rbB(rbB)
+{
+    // DUMMY FUNCTION
+}
+
+PhysicsRigidBody::Listener::~Listener()
+{
+    // DUMMY FUNCTION
+}
+
+btScalar PhysicsRigidBody::Listener::addSingleResult(btManifoldPoint& cp, const btCollisionObject* a,
+    int partIdA, int indexA, const btCollisionObject* b, int partIdB, int indexB)
+{
+    // Get pointers to the PhysicsRigidBody objects.
+    PhysicsRigidBody* rbA = Game::getInstance()->getPhysicsController()->getPhysicsRigidBody(a);
+    PhysicsRigidBody* rbB = Game::getInstance()->getPhysicsController()->getPhysicsRigidBody(b);
+    
+    // If the given rigid body pair has collided in the past, then
+    // we notify the listener only if the pair was not colliding
+    // during the previous frame. Otherwise, it's a new pair, so notify the listener.
+    CollisionPair pair(rbA, rbB);
+    if (_collisionStatus.count(pair) > 0)
+    {
+        if ((_collisionStatus[pair] & COLLISION) == 0)
+            collisionEvent(pair, Vector3(cp.getPositionWorldOnA().x(), cp.getPositionWorldOnA().y(), cp.getPositionWorldOnA().z()));
+    }
+    else
+    {
+        collisionEvent(pair, Vector3(cp.getPositionWorldOnA().x(), cp.getPositionWorldOnA().y(), cp.getPositionWorldOnA().z()));
+    }
+
+    // Update the collision status cache (we remove the dirty bit
+    // set in the controller's update so that this particular collision pair's
+    // status is not reset to 'no collision' when the controller's update completes).
+    _collisionStatus[pair] &= ~DIRTY;
+    _collisionStatus[pair] |= COLLISION;
+    return 0.0f;
+}
+
+btScalar PhysicsRigidBody::CollidesWithCallback::addSingleResult(btManifoldPoint& cp, const btCollisionObject* a, int partIdA,
+            int indexA, const btCollisionObject* b, int partIdB, int indexB)
+{
+    result = true;
+    return 0.0f;
+}
+
+}

+ 348 - 0
gameplay/src/PhysicsRigidBody.h

@@ -0,0 +1,348 @@
+/*
+ * PhysicsRigidBody.h
+ */
+
+#ifndef PHYSICSRIGIDBODY_H_
+#define PHYSICSRIGIDBODY_H_
+
+#include "Mesh.h"
+#include "PhysicsConstraint.h"
+#include "Transform.h"
+#include "Vector3.h"
+
+namespace gameplay
+{
+
+class Node;
+class PhysicsConstraint;
+
+/**
+ * Defines a class for physics rigid bodies.
+ */
+class PhysicsRigidBody
+{
+    friend class Node;
+    friend class PhysicsConstraint;
+    friend class PhysicsController;
+    friend class PhysicsFixedConstraint;
+    friend class PhysicsGenericConstraint;
+    friend class PhysicsHingeConstraint;
+    friend class PhysicsSocketConstraint;
+    friend class PhysicsSpringConstraint;
+
+public:
+    /**
+     * Represents the different types of rigid bodies.
+     */
+    enum Type
+    {
+        SHAPE_BOX,
+        SHAPE_SPHERE,
+        SHAPE_NONE
+    };
+
+    /** 
+     * Defines a pair of rigid bodies that collided (or may collide).
+     */
+    class CollisionPair
+    {
+    public:
+        /**
+         * Constructor.
+         */
+        CollisionPair(PhysicsRigidBody* rbA, PhysicsRigidBody* rbB);
+
+        /**
+         * Less than operator (needed for use as a key in std::map).
+         * 
+         * @param cp The collision pair to compare.
+         * @return True if this pair is "less than" the given pair; false otherwise.
+         */
+        bool operator<(const CollisionPair& cp) const;
+
+        /** The first rigid body in the collision. */
+        PhysicsRigidBody* _rbA;
+
+        /** The second rigid body in the collision. */
+        PhysicsRigidBody* _rbB;
+    };
+
+    /**
+     * Collision listener interface.
+     */
+    class Listener : public btCollisionWorld::ContactResultCallback
+    {
+        friend class PhysicsRigidBody;
+        friend class PhysicsController;
+
+    public:
+        /**
+         * Destructor.
+         */
+        virtual ~Listener();
+
+        /**
+         * Handles when a collision occurs for the rigid body where this listener is registered.
+         * 
+         * @param collisionPair The two rigid bodies involved in the collision.
+         * @param contactPoint The point (in world space) where the collision occurred.
+         */
+        virtual void collisionEvent(const CollisionPair& collisionPair, const Vector3& contactPoint) = 0;
+
+        /**
+         * Internal function used for Bullet integration (do not use or override).
+         */
+        btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObject* a, int partIdA,
+            int indexA, const btCollisionObject* b, int partIdB, int indexB);
+        
+    protected:
+        /** Holds the collision status for each pair of rigid bodies. */
+        std::map<CollisionPair, int> _collisionStatus;
+
+    private:
+        // Internal constant.
+        static const int DIRTY;
+        // Internal constant.
+        static const int COLLISION;
+        // Internal constant.
+        static const int REGISTERED;
+    };
+
+    /**
+     * Adds a collision listener for this rigid body.
+     * 
+     * @param listener The listener to add.
+     * @param body Specifies that only collisions with the given rigid body should trigger a notification.
+     */
+    void addCollisionListener(Listener* listener, PhysicsRigidBody* body = NULL);
+
+    /**
+     * Applies the given force to the rigid body (optionally, from the given relative position).
+     * 
+     * @param force The force to be applied.
+     * @param relativePosition The relative position from which to apply the force.
+     */
+    void applyForce(const Vector3& force, const Vector3* relativePosition = NULL);
+
+    /**
+     * Applies the given force impulse to the rigid body (optionally, from the given relative position).
+     * 
+     * @param impulse The force impulse to be applied.
+     * @param relativePosition The relative position from which to apply the force.
+     */
+    void applyImpulse(const Vector3& impulse, const Vector3* relativePosition = NULL);
+
+    /**
+     * Applies the given torque to the rigid body.
+     * 
+     * @param torque The torque to be applied.
+     */
+    void applyTorque(const Vector3& torque);
+
+    /**
+     * Applies the given torque impulse to the rigid body.
+     * 
+     * @param torque The torque impulse to be applied.
+     */
+    void applyTorqueImpulse(const Vector3& torque);
+    
+    /**
+     * Checks if this rigid body collides with the given rigid body.
+     * 
+     * @param body The rigid body to test collision with.
+     * @return True if this rigid body collides with the given rigid body; false otherwise.
+     */
+    bool collidesWith(PhysicsRigidBody* body);
+
+    /**
+     * Gets the rigid body's angular damping.
+     * 
+     * @return The angular damping.
+     */
+    inline float getAngularDamping() const;
+
+    /**
+     * Gets the rigid body's angular velocity.
+     * 
+     * @return The angular velocity.
+     */
+    inline const Vector3& getAngularVelocity() const;
+
+    /**
+     * Gets the rigid body's anisotropic friction.
+     * 
+     * @return The anisotropic friction.
+     */
+    inline const Vector3& getAnisotropicFriction() const;
+
+    /**
+     * Gets the rigid body's friction.
+     * 
+     * @return The friction.
+     */
+    inline float getFriction() const;
+
+    /**
+     * Gets the gravity that affects the rigid body (this can
+     * be different from the global gravity; @see #setGravity).
+     * 
+     * @return The gravity.
+     */
+    inline const Vector3& getGravity() const;
+
+    /**
+     * Gets the rigid body's linear damping.
+     * 
+     * @return The linear damping.
+     */
+    inline float getLinearDamping() const;
+
+    /**
+     * Gets the rigid body's linear velocity.
+     * 
+     * @return The linear velocity.
+     */
+    inline const Vector3& getLinearVelocity() const;
+
+    /**
+     * Gets the node that the rigid body is attached to.
+     * 
+     * @return The node.
+     */
+    inline const Node* getNode() const;
+
+    /**
+     * Gets the rigid body's restitution.
+     * 
+     * @return The restitution.
+     */
+    inline float getRestitution() const;
+
+    /**
+     * Gets whether the rigid body is a kinematic rigid body or not.
+     * 
+     * @return Whether the rigid body is kinematic or not.
+     */
+    inline bool isKinematic() const;
+
+    /**
+     * Sets the rigid body's angular velocity.
+     * 
+     * @param velocity The angular velocity.
+     */
+    inline void setAngularVelocity(const Vector3& velocity);
+
+    /**
+     * Sets the rigid body's anisotropic friction.
+     * 
+     * @param friction The anisotropic friction.
+     */
+    inline void setAnisotropicFriction(const Vector3& friction);
+
+    /**
+     * Sets the rigid body's linear and angular damping.
+     * 
+     * @param linearDamping The linear damping; between 0.0 (minimum) and 1.0 (maximum).
+     * @param angularDamping The angular damping; between 0.0 (minimum) and 1.0 (maximum).
+     */
+    inline void setDamping(float linearDamping, float angularDamping);
+
+    /**
+     * Sets the rigid body's friction.
+     * 
+     * @param friction The friction.
+     */
+    inline void setFriction(float friction);
+
+    /**
+     * Sets the rigid body's gravity (this overrides the global gravity for this rigid body).
+     * 
+     * @param gravity The gravity.
+     */
+    inline void setGravity(const Vector3& gravity);
+
+    /**
+     * Sets whether the rigid body is a kinematic rigid body or not.
+     * 
+     * @param kinematic Whether the rigid body is kinematic or not.
+     */
+    inline void setKinematic(bool kinematic);
+
+    /**
+     * Sets the rigid body's linear velocity.
+     * 
+     * @param velocity The linear velocity.
+     */
+    inline void setLinearVelocity(const Vector3& velocity);
+
+    /**
+     * Sets the rigid body's restitution (or bounciness).
+     * 
+     * @param restitution The restitution.
+     */
+    inline void setRestitution(float restitution);
+
+private:
+    /**
+     * Creates a rigid body.
+     * 
+     * @param node The node to create a rigid body for; note that the node must have
+     *      a model attached to it prior to creating a rigid body for it.
+     * @param type The type of rigid body to set.
+     * @param mass The mass of the rigid body, in kilograms.
+     * @param friction The friction of the rigid body (non-zero values give best simulation results).
+     * @param restitution The restitution of the rigid body (this controls the bounciness of
+     *      the rigid body; use zero for best simulation results).
+     * @param linearDamping The percentage of linear velocity lost per second (between 0.0 and 1.0).
+     * @param angularDamping The percentage of angular velocity lost per second (between 0.0 and 1.0).
+     */
+    PhysicsRigidBody(Node* node, PhysicsRigidBody::Type type, float mass, float friction = 0.5,
+        float restitution = 0.0, float linearDamping = 0.0, float angularDamping = 0.0);
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsRigidBody();
+
+    /**
+     * Private copy constructor to disallow copying.
+     */
+    PhysicsRigidBody(const PhysicsRigidBody& body);
+
+    // Creates the underlying Bullet Physics rigid body object
+    // for a PhysicsRigidBody object using the given parameters.
+    static btRigidBody* createBulletRigidBody(btCollisionShape* shape, float mass, Node* node,
+        float friction, float restitution, float linearDamping, float angularDamping,
+        const Vector3* centerOfMassOffset = NULL);
+
+    // Adds a constraint to this rigid body.
+    void addConstraint(PhysicsConstraint* constraint);
+
+    // Removes a constraint from this rigid body (used by the constraint destructor).
+    void removeConstraint(PhysicsConstraint* constraint);
+
+    // Internal class used to implement the collidesWith(PhysicsRigidBody*) function.
+    struct CollidesWithCallback : public btCollisionWorld::ContactResultCallback
+    {
+        btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObject* a, int partIdA,
+            int indexA, const btCollisionObject* b, int partIdB, int indexB);
+
+        bool result;
+    };
+
+    btCollisionShape* _shape;
+    btRigidBody* _body;
+    Node* _node;
+    std::vector<PhysicsConstraint*> _constraints;
+    std::vector<Listener*>* _listeners;
+    mutable Vector3* _angularVelocity;
+    mutable Vector3* _anisotropicFriction;
+    mutable Vector3* _gravity;
+    mutable Vector3* _linearVelocity;
+};
+
+}
+
+#include "PhysicsRigidBody.inl"
+
+#endif

+ 146 - 0
gameplay/src/PhysicsRigidBody.inl

@@ -0,0 +1,146 @@
+/**
+ * PhysicsRigidBody.inl
+ */
+
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+inline float PhysicsRigidBody::getAngularDamping() const
+{
+    return _body->getAngularDamping();
+}
+
+inline const Vector3& PhysicsRigidBody::getAngularVelocity() const
+{
+    if (!_angularVelocity)
+        _angularVelocity = new Vector3();
+
+    const btVector3& v = _body->getAngularVelocity();
+    _angularVelocity->set(v.x(), v.y(), v.z());
+    return *_angularVelocity;
+}
+
+inline const Vector3& PhysicsRigidBody::getAnisotropicFriction() const
+{
+    if (!_anisotropicFriction)
+        _anisotropicFriction = new Vector3();
+
+    const btVector3& af = _body->getAnisotropicFriction();
+    _anisotropicFriction->set(af.x(), af.y(), af.z());
+    return *_anisotropicFriction;
+}
+
+inline float PhysicsRigidBody::getFriction() const
+{
+    return _body->getFriction();
+}
+
+inline const Vector3& PhysicsRigidBody::getGravity() const
+{
+    if (!_gravity)
+        _gravity = new Vector3();
+
+    const btVector3& g = _body->getGravity();
+    _gravity->set(g.x(), g.y(), g.z());
+    return *_gravity;
+}
+
+inline float PhysicsRigidBody::getLinearDamping() const
+{
+    return _body->getLinearDamping();
+}
+
+inline const Vector3& PhysicsRigidBody::getLinearVelocity() const
+{
+    if (!_linearVelocity)
+        _linearVelocity = new Vector3();
+
+    const btVector3& v = _body->getLinearVelocity();
+    _linearVelocity->set(v.x(), v.y(), v.z());
+    return *_linearVelocity;
+}
+
+inline const Node* PhysicsRigidBody::getNode() const
+{
+    return _node;
+}
+
+inline float PhysicsRigidBody::getRestitution() const
+{
+    return _body->getRestitution();
+}
+
+inline bool PhysicsRigidBody::isKinematic() const
+{
+    return (_body->getCollisionFlags() & btCollisionObject::CF_KINEMATIC_OBJECT) != 0;
+}
+
+inline void PhysicsRigidBody::setAngularVelocity(const Vector3& velocity)
+{
+    _body->setAngularVelocity(btVector3(velocity.x, velocity.y, velocity.z));
+}
+
+inline void PhysicsRigidBody::setAnisotropicFriction(const Vector3& friction)
+{
+    _body->setAnisotropicFriction(btVector3(friction.x, friction.y, friction.z));
+}
+
+inline void PhysicsRigidBody::setDamping(float linearDamping, float angularDamping)
+{
+    _body->setDamping(linearDamping, angularDamping);
+}
+
+inline void PhysicsRigidBody::setFriction(float friction)
+{
+    _body->setFriction(friction);
+}
+
+inline void PhysicsRigidBody::setGravity(const Vector3& gravity)
+{
+    _body->setGravity(btVector3(gravity.x, gravity.y, gravity.z));
+}
+
+inline void PhysicsRigidBody::setKinematic(bool kinematic)
+{
+    if (kinematic)
+    {
+        _body->setCollisionFlags(_body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
+        _body->setActivationState(DISABLE_DEACTIVATION);
+    }
+    else
+    {
+        _body->setCollisionFlags(_body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
+        _body->setActivationState(ACTIVE_TAG);
+    }
+}
+
+inline void PhysicsRigidBody::setLinearVelocity(const Vector3& velocity)
+{
+    _body->setLinearVelocity(btVector3(velocity.x, velocity.y, velocity.z));
+}
+
+inline void PhysicsRigidBody::setRestitution(float restitution)
+{
+    _body->setRestitution(restitution);
+}
+
+inline bool PhysicsRigidBody::CollisionPair::operator<(const CollisionPair& cp) const
+{
+    // If the pairs are equal, then return false.
+    if ((_rbA == cp._rbA && _rbB == cp._rbB) || (_rbA == cp._rbB && _rbB == cp._rbA))
+        return false;
+    else
+    {
+        // We choose to compare based on _rbA arbitrarily.
+        if (_rbA < cp._rbA)
+            return true;
+        else if (_rbA == cp._rbA)
+            return _rbB < cp._rbB;
+        else
+            return false;
+    }
+}
+
+}

+ 58 - 0
gameplay/src/PhysicsSocketConstraint.cpp

@@ -0,0 +1,58 @@
+/**
+ * PhysicsSocketConstraint.cpp
+ */
+
+#include "PhysicsSocketConstraint.h"
+
+#include "Node.h"
+
+namespace gameplay
+{
+
+PhysicsSocketConstraint::PhysicsSocketConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+    : PhysicsConstraint(a, b)
+{
+    if (b)
+    {
+        Vector3 origin = centerOfMassMidpoint(a->getNode(), b->getNode());
+        btTransform frameInA = getTransformOffset(a->getNode(), origin);
+        btTransform frameInB = getTransformOffset(b->getNode(), origin);
+
+        _constraint = new btPoint2PointConstraint(*a->_body, *b->_body, frameInA.getOrigin(), frameInB.getOrigin());
+    }
+    else
+    {
+        _constraint = new btPoint2PointConstraint(*a->_body, btVector3(0.0f, 0.0f, 0.0f));
+    }
+}
+
+PhysicsSocketConstraint::PhysicsSocketConstraint(PhysicsRigidBody* a, const Vector3& translationOffsetA, 
+    PhysicsRigidBody* b, const Vector3& translationOffsetB)
+    : PhysicsConstraint(a, b)
+{
+    // Take scale into account for the first node's translation offset.
+    Vector3 sA;
+    a->getNode()->getWorldMatrix().getScale(&sA);
+    Vector3 tA(translationOffsetA.x * sA.x, translationOffsetA.y * sA.y, translationOffsetA.z * sA.z);
+
+    if (b)
+    {
+        // Take scale into account for the second node's translation offset.
+        Vector3 sB;
+        b->getNode()->getWorldMatrix().getScale(&sB);
+        Vector3 tB(translationOffsetB.x * sB.x, translationOffsetB.y * sB.y, translationOffsetB.z * sB.z);
+
+        _constraint = new btPoint2PointConstraint(*a->_body, *b->_body, btVector3(tA.x, tA.y, tA.z), btVector3(tB.x, tB.y, tB.z));
+    }
+    else
+    {
+        _constraint = new btPoint2PointConstraint(*a->_body, btVector3(tA.x, tA.y, tA.z));
+    }
+}
+
+PhysicsSocketConstraint::~PhysicsSocketConstraint()
+{
+    // DUMMY FUNCTION
+}
+
+}

+ 58 - 0
gameplay/src/PhysicsSocketConstraint.h

@@ -0,0 +1,58 @@
+/*
+ * PhysicsSocketConstraint.h
+ */
+
+#ifndef PHYSICSSOCKETCONSTRAINT_H_
+#define PHYSICSSOCKETCONSTRAINT_H_
+
+#include "PhysicsConstraint.h"
+#include "PhysicsRigidBody.h"
+#include "Vector3.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a ball-socket or point-to-point constraint
+ * between two rigid bodies (or one rigid body and the world)
+ * where rotation is unrestricted about the constraint joint (pivot point).
+ */
+class PhysicsSocketConstraint : public PhysicsConstraint
+{
+    friend class PhysicsController;
+
+private:
+    /**
+     * Creates a socket constraint so that the rigid body (or bodies) is
+     * (are) constrained using its (their) current world position(s) for
+     * the translation offset(s) to the constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsSocketConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Creates a socket constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsSocketConstraint(PhysicsRigidBody* a, const Vector3& translationOffsetA, 
+        PhysicsRigidBody* b, const Vector3& translationOffsetB);
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsSocketConstraint();
+};
+
+}
+
+#endif

+ 67 - 0
gameplay/src/PhysicsSpringConstraint.cpp

@@ -0,0 +1,67 @@
+/**
+ * PhysicsSpringConstraint.cpp
+ */
+
+#include "PhysicsSpringConstraint.h"
+
+#include "Node.h"
+#include "PhysicsRigidBody.h"
+
+namespace gameplay
+{
+
+PhysicsSpringConstraint::PhysicsSpringConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b)
+{
+    // Initialize the physics rigid body references since we don't call the PhysicsConstraint constructor that does it properly automatically.
+    _a = a;
+    _b = b;
+
+    Vector3 origin = centerOfMassMidpoint(a->getNode(), b->getNode());
+    _constraint = new btGeneric6DofSpringConstraint(*a->_body, *b->_body, getTransformOffset(a->getNode(), origin), getTransformOffset(b->getNode(), origin), true);
+}
+
+PhysicsSpringConstraint::PhysicsSpringConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+    PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB)
+{
+    // Initialize the physics rigid body references since we don't call the PhysicsConstraint constructor that does it properly automatically.
+    _a = a;
+    _b = b;
+
+    // Take scale into account for the translation offsets.
+    Vector3 sA;
+    a->getNode()->getWorldMatrix().getScale(&sA);
+    Vector3 tA(translationOffsetA.x * sA.x, translationOffsetA.y * sA.y, translationOffsetA.z * sA.z);
+
+    Vector3 sB;
+    b->getNode()->getWorldMatrix().getScale(&sB);
+    Vector3 tB(translationOffsetB.x * sB.x, translationOffsetB.y * sB.y, translationOffsetB.z * sB.z);
+
+    btTransform frameInA(btQuaternion(rotationOffsetA.x, rotationOffsetA.y, rotationOffsetA.z, rotationOffsetA.w), btVector3(tA.x, tA.y, tA.z));
+    btTransform frameInB(btQuaternion(rotationOffsetB.x, rotationOffsetB.y, rotationOffsetB.z, rotationOffsetB.w), btVector3(tB.x, tB.y, tB.z));
+    _constraint = new btGeneric6DofSpringConstraint(*a->_body, *b->_body, frameInA, frameInB, true);
+}
+
+PhysicsSpringConstraint::~PhysicsSpringConstraint()
+{
+    // DUMMY FUNCTION
+}
+
+void PhysicsSpringConstraint::setStrength(SpringProperty property, float strength)
+{
+    if (strength < MATH_EPSILON)
+        ((btGeneric6DofSpringConstraint*)_constraint)->enableSpring(property, false);
+    else
+    {
+        ((btGeneric6DofSpringConstraint*)_constraint)->enableSpring(property, true);
+        ((btGeneric6DofSpringConstraint*)_constraint)->setStiffness(property, strength);
+        ((btGeneric6DofSpringConstraint*)_constraint)->setEquilibriumPoint(property);
+    }
+}
+
+void PhysicsSpringConstraint::setDamping(SpringProperty property, float damping)
+{
+    ((btGeneric6DofSpringConstraint*)_constraint)->setDamping(property, damping);
+    ((btGeneric6DofSpringConstraint*)_constraint)->setEquilibriumPoint(property);
+}
+
+}

+ 196 - 0
gameplay/src/PhysicsSpringConstraint.h

@@ -0,0 +1,196 @@
+/*
+ * PhysicsSpringConstraint.h
+ */
+
+#ifndef PHYSICSSPRINGCONSTRAINT_H_
+#define PHYSICSSPRINGCONSTRAINT_H_
+
+#include "PhysicsGenericConstraint.h"
+
+namespace gameplay
+{
+
+/**
+ * Represents a generic spring constraint between two
+ * rigid bodies (or one rigid body and the world)
+ * where the spring strength and damping can be set
+ * for all six degrees of freedom.
+ */
+class PhysicsSpringConstraint : public PhysicsGenericConstraint
+{
+    friend class PhysicsController;
+
+public:
+    /**
+     * Sets the angular damping along the constraint's local X axis.
+     * 
+     * @param damping The angular damping value.
+     */
+    inline void setAngularDampingX(float damping);
+
+    /**
+     * Sets the angular damping along the constraint's local Y axis.
+     * 
+     * @param damping The angular damping value.
+     */
+    inline void setAngularDampingY(float damping);
+
+    /**
+     * Sets the angular damping along the constraint's local Z axis.
+     * 
+     * @param damping The angular damping value.
+     */
+    inline void setAngularDampingZ(float damping);
+
+    /**
+     * Sets the angular strength along the constraint's local X axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for angular movement about the X axis (setting to zero disables it).
+     * 
+     * @param strength The angular strength value.
+     */
+    inline void setAngularStrengthX(float strength);
+
+    /**
+     * Sets the angular strength along the constraint's local Y axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for angular movement about the Y axis (setting to zero disables it).
+     * 
+     * @param strength The angular strength value.
+     */
+    inline void setAngularStrengthY(float strength);
+
+    /**
+     * Sets the angular strength along the constraint's local Z axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for angular movement about the Z axis (setting to zero disables it).
+     * 
+     * @param strength The angular strength value.
+     */
+    inline void setAngularStrengthZ(float strength);
+
+    /**
+     * Sets the linear damping along the constraint's local X axis.
+     * 
+     * @param damping The linear damping value.
+     */
+    inline void setLinearDampingX(float damping);
+
+    /**
+     * Sets the linear damping along the constraint's local Y axis.
+     * 
+     * @param damping The linear damping value.
+     */
+    inline void setLinearDampingY(float damping);
+
+    /**
+     * Sets the linear damping along the constraint's local Z axis.
+     * 
+     * @param damping The linear damping value.
+     */
+    inline void setLinearDampingZ(float damping);
+
+    /**
+     * Sets the linear strength along the constraint's local X axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for linear movement along the X axis (setting to zero disables it).
+     * 
+     * @param strength The linear strength value.
+     */
+    inline void setLinearStrengthX(float strength);
+
+    /**
+     * Sets the linear strength along the constraint's local Y axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for linear movement along the Y axis (setting to zero disables it).
+     * 
+     * @param strength The linear strength value.
+     */
+    inline void setLinearStrengthY(float strength);
+
+    /**
+     * Sets the linear strength along the constraint's local Z axis.
+     *
+     * Note: setting the strength to a non-zero value enables the
+     * spring for linear movement along the Z axis (setting to zero disables it).
+     * 
+     * @param strength The linear strength value.
+     */
+    inline void setLinearStrengthZ(float strength);
+
+private:
+    // Represents the different properties that
+    // can be set on the spring constraint.
+    // 
+    // (Note: the values map to the index parameter
+    // used in the member functions of the Bullet
+    // class btGeneric6DofSpringConstraint.)
+    enum SpringProperty
+    {
+        LINEAR_X = 0,
+        LINEAR_Y,
+        LINEAR_Z,
+        ANGULAR_X,
+        ANGULAR_Y,
+        ANGULAR_Z
+    };
+
+    /**
+     * Creates a spring constraint so that the rigid body (or bodies) is
+     * (are) constrained using its (their) current world position(s) for
+     * the translation offset(s) to the constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param b The second rigid body to constrain (optional).
+     */
+    PhysicsSpringConstraint(PhysicsRigidBody* a, PhysicsRigidBody* b);
+
+    /**
+     * Creates a spring constraint.
+     * 
+     * @param a The first (possibly only) rigid body to constrain. If this is the only rigid
+     *      body specified the constraint applies between it and the global physics world object.
+     * @param rotationOffsetA The rotation offset for the first rigid body 
+     *      (in its local space) with respect to the constraint joint.
+     * @param translationOffsetA The translation offset for the first rigid body
+     *      (in its local space) with respect to the constraint joint.
+     * @param b The second rigid body to constrain (optional).
+     * @param rotationOffsetB The rotation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     * @param translationOffsetB The translation offset for the second rigid body
+     *      (in its local space) with respect to the constraint joint (optional).
+     */
+    PhysicsSpringConstraint(PhysicsRigidBody* a, const Quaternion& rotationOffsetA, const Vector3& translationOffsetA,
+        PhysicsRigidBody* b, const Quaternion& rotationOffsetB, const Vector3& translationOffsetB);
+
+    /**
+     * Destructor.
+     */
+    ~PhysicsSpringConstraint();
+
+    // Sets the strength for the given angular/linear 
+    // X/Y/Z axis combination determined by the given index.
+    // 
+    // See the Bullet class btGeneric6DofSpringConstraint
+    // for more information.
+    void setStrength(SpringProperty property, float strength);
+
+    // Sets the damping for the given angular/linear 
+    // X/Y/Z axis combination determined by the given index.
+    // 
+    // See the Bullet class btGeneric6DofSpringConstraint
+    // for more information.
+    void setDamping(SpringProperty property, float damping);
+};
+
+}
+
+#include "PhysicsSpringConstraint.inl"
+
+#endif

+ 70 - 0
gameplay/src/PhysicsSpringConstraint.inl

@@ -0,0 +1,70 @@
+/**
+ * PhysicsSpringConstraint.inl
+ */
+
+#include "PhysicsSpringConstraint.h"
+
+namespace gameplay
+{
+
+inline void PhysicsSpringConstraint::setAngularDampingX(float damping)
+{
+    setDamping(ANGULAR_X, damping);
+}
+
+inline void PhysicsSpringConstraint::setAngularDampingY(float damping)
+{
+    setDamping(ANGULAR_Y, damping);
+}
+
+inline void PhysicsSpringConstraint::setAngularDampingZ(float damping)
+{
+    setDamping(ANGULAR_Z, damping);
+}
+
+inline void PhysicsSpringConstraint::setAngularStrengthX(float strength)
+{
+    setStrength(ANGULAR_X, strength);
+}
+
+inline void PhysicsSpringConstraint::setAngularStrengthY(float strength)
+{
+    setStrength(ANGULAR_Y, strength);
+}
+
+inline void PhysicsSpringConstraint::setAngularStrengthZ(float strength)
+{
+    setStrength(ANGULAR_Z, strength);
+}
+
+inline void PhysicsSpringConstraint::setLinearDampingX(float damping)
+{
+    setDamping(LINEAR_X, damping);
+}
+
+inline void PhysicsSpringConstraint::setLinearDampingY(float damping)
+{
+    setDamping(LINEAR_Y, damping);
+}
+
+inline void PhysicsSpringConstraint::setLinearDampingZ(float damping)
+{
+    setDamping(LINEAR_Z, damping);
+}
+
+inline void PhysicsSpringConstraint::setLinearStrengthX(float strength)
+{
+    setStrength(LINEAR_X, strength);
+}
+
+inline void PhysicsSpringConstraint::setLinearStrengthY(float strength)
+{
+    setStrength(LINEAR_Y, strength);
+}
+
+inline void PhysicsSpringConstraint::setLinearStrengthZ(float strength)
+{
+    setStrength(LINEAR_Z, strength);
+}
+
+}

+ 1 - 1
gameplay/src/Plane.cpp

@@ -245,7 +245,7 @@ void Plane::set(const Plane& plane)
     _distance = plane._distance;
 }
 
-void Plane::transform(Matrix& matrix)
+void Plane::transform(const Matrix& matrix)
 {
     Matrix inverted;
     if (matrix.invert(&inverted))

+ 20 - 1
gameplay/src/Plane.h

@@ -196,7 +196,15 @@ public:
      *
      * @param matrix The transformation matrix to transform by.
      */
-    void transform(Matrix& matrix);
+    void transform(const Matrix& matrix);
+
+    /**
+     * Transforms this plane by the given matrix.
+     * 
+     * @param matrix The matrix to transform by.
+     * @return This plane, after the transformation occurs.
+     */
+    inline Plane& operator*=(const Matrix& matrix);
 
 private:
 
@@ -209,6 +217,17 @@ private:
     float _distance;    // The distance of the Plane along its normal from the origin.
 };
 
+/**
+ * Transforms the given plane by the given matrix.
+ * 
+ * @param matrix The matrix to transform by.
+ * @param plane The plane to transform.
+ * @return The resulting transformed plane.
+ */
+inline Plane operator*(const Matrix& matrix, const Plane& plane);
+
 }
 
+#include "Plane.inl"
+
 #endif

+ 23 - 0
gameplay/src/Plane.inl

@@ -0,0 +1,23 @@
+/** 
+ * Plane.inl
+ */
+
+#include "Plane.h"
+
+namespace gameplay
+{
+
+inline Plane& Plane::operator*=(const Matrix& matrix)
+{
+    transform(matrix);
+    return *this;
+}
+
+inline Plane operator*(const Matrix& matrix, const Plane& plane)
+{
+    Plane p(plane);
+    p.transform(matrix);
+    return p;
+}
+
+}

+ 49 - 28
gameplay/src/PlatformMacOS.mm

@@ -47,11 +47,13 @@ long getMachTimeInMilliseconds()
     return (long)((mach_absolute_time() * s_timebase_info.numer) / (kOneMillion * s_timebase_info.denom));
 }
 
+
 @class View;
 
 @interface View : NSOpenGLView <NSWindowDelegate> 
 {
     CVDisplayLinkRef displayLink;
+    NSRecursiveLock* lock;
     
     Game* _game;
 }
@@ -63,25 +65,37 @@ long getMachTimeInMilliseconds()
 
 -(void)windowWillClose:(NSNotification*)note 
 {
+    [lock lock];
     _game->exit();
+    [lock unlock];
     [[NSApplication sharedApplication] terminate:self];
 }
 
+
 - (CVReturn) getFrameForTime:(const CVTimeStamp*)outputTime
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
-    [self performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
+    
+    [self update];
+    
     [pool release];
+    
     return kCVReturnSuccess;
 }
 
 -(void) update
-{
+{       
+    [lock lock];
+
     [[self openGLContext] makeCurrentContext];
+    
     CGLLockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
-    _game->frame();
+    if (_game && _game->getState() == Game::RUNNING)       
+        _game->frame();
     CGLFlushDrawable((CGLContextObj)[[self openGLContext] CGLContextObj]);
     CGLUnlockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);  
+    
+    [lock unlock];
 }
 
 static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, 
@@ -93,6 +107,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
 
 - (id) initWithFrame: (NSRect) frame
 {    
+    lock = [[NSRecursiveLock alloc] init];
     _game = Game::getInstance();
     __timeStart = getMachTimeInMilliseconds();
     NSOpenGLPixelFormatAttribute attrs[] = 
@@ -149,53 +164,59 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
 }
 
 - (void) dealloc
-{       
-    _game->exit();
+{   
+    [lock lock];
     
     // Release the display link
+    CVDisplayLinkStop(displayLink);
     CVDisplayLinkRelease(displayLink);
+    
+    _game->exit();
+    
+    [lock unlock];
+
     [super dealloc];
 }
 
-- (void) mouseDown: (NSEvent*) theEvent
+- (void) mouseDown: (NSEvent*) event
 {
-    NSPoint point = [theEvent locationInWindow];
+    NSPoint point = [event locationInWindow];
     __leftMouseDown = true;
     _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_PRESS);
 }
 
-- (void) mouseUp: (NSEvent*) theEvent
+- (void) mouseUp: (NSEvent*) event
 {
-    NSPoint point = [theEvent locationInWindow];
+    NSPoint point = [event locationInWindow];
     __leftMouseDown = false;
     _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_RELEASE);
 }
 
-- (void) mouseDragged: (NSEvent*) theEvent
+- (void) mouseDragged: (NSEvent*) event
 {
-    NSPoint point = [theEvent locationInWindow];
+    NSPoint point = [event locationInWindow];
     if (__leftMouseDown)
     {
         _game->touch(point.x, WINDOW_HEIGHT - point.y, Input::TOUCHEVENT_MOVE);
     }
 }
 
-- (void) rightMouseDown: (NSEvent*) theEvent
+- (void) rightMouseDown: (NSEvent*) event
 {
     __rightMouseDown = true;
-     NSPoint point = [theEvent locationInWindow];
+     NSPoint point = [event locationInWindow];
     __lx = point.x;
     __ly = WINDOW_HEIGHT - point.y;
 }
 
-- (void) rightMouseUp: (NSEvent*) theEvent
+- (void) rightMouseUp: (NSEvent*) event
 {
    __rightMouseDown = false;
 }
 
-- (void) rightMouseDragged: (NSEvent*) theEvent
+- (void) rightMouseDragged: (NSEvent*) event
 {
-    NSPoint point = [theEvent locationInWindow];
+    NSPoint point = [event locationInWindow];
     if (__rightMouseDown)
     {
         // Update the pitch and roll by adding the scaled deltas.
@@ -212,12 +233,12 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     }
 }
 
-- (void) mouseEntered:(NSEvent *)theEvent
+- (void) mouseEntered: (NSEvent*)event
 {
     __hasMouse = true;
 }
 
-- (void) mouseExited:(NSEvent *)theEvent
+- (void) mouseExited: (NSEvent*)event
 {
     __leftMouseDown = false;
     __rightMouseDown = false;
@@ -257,13 +278,13 @@ int getKey(unsigned short keyCode, unsigned int modifierFlags)
         case 0x77:
             return Input::KEY_END;
         case 0x7B:
-            return Input::KEY_LEFT;
+            return Input::KEY_LEFT_ARROW;
         case 0x7C:
-            return Input::KEY_RIGHT;
+            return Input::KEY_RIGHT_ARROW;
         case 0x7E:
-            return Input::KEY_UP;
+            return Input::KEY_UP_ARROW;
         case 0x7D:
-            return Input::KEY_DOWN;
+            return Input::KEY_DOWN_ARROW;
         case 0x47:
             return Input::KEY_NUM_LOCK;
         case 0x45:
@@ -426,7 +447,7 @@ int getKey(unsigned short keyCode, unsigned int modifierFlags)
     }
 }
 
-- (void)flagsChanged:(NSEvent*)event
+- (void)flagsChanged: (NSEvent*)event
 {
     unsigned int keyCode = [event keyCode];
     unsigned int flags = [event modifierFlags];
@@ -463,12 +484,12 @@ int getKey(unsigned short keyCode, unsigned int modifierFlags)
     }
 }
 
-- (void) keyDown: (NSEvent *) event
+- (void) keyDown: (NSEvent*) event
 {    
     _game->keyPress(getKey([event keyCode], [event modifierFlags]), Input::KEYEVENT_DOWN);
 }
 
-- (void) keyUp: (NSEvent *) event
+- (void) keyUp: (NSEvent*) event
 {    
     _game->keyPress(getKey([event keyCode], [event modifierFlags]), Input::KEYEVENT_UP);
 }
@@ -512,10 +533,10 @@ Platform* Platform::create(Game* game)
 
 int Platform::enterMessagePump()
 {
-    NSAutoreleasePool *pool = [NSAutoreleasePool new];
+    NSAutoreleasePool* pool = [NSAutoreleasePool new];
     NSApplication* NSApp = [NSApplication sharedApplication];
     NSRect screenBounds = [[NSScreen mainScreen] frame];
-    NSRect viewBounds = NSMakeRect(0, 0, 1024, 600);
+    NSRect viewBounds = NSMakeRect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
     
     View* view = [[View alloc] initWithFrame:viewBounds];
     
@@ -524,7 +545,7 @@ int Platform::enterMessagePump()
                                  viewBounds.size.width, 
                                  viewBounds.size.height);
     
-    NSWindow *window = [[NSWindow alloc]
+    NSWindow* window = [[NSWindow alloc]
                         initWithContentRect:centered
                         styleMask:NSTitledWindowMask | NSClosableWindowMask
                         backing:NSBackingStoreBuffered

+ 325 - 14
gameplay/src/PlatformQNX.cpp

@@ -42,6 +42,324 @@ PFNGLISVERTEXARRAYOESPROC glIsVertexArray = NULL;
 namespace gameplay
 {
 
+// Gets the Input::Key enumeration constant that corresponds to the given QNX key code.
+static Input::Key getGameplayInputKey(int qnxKeycode)
+{
+    switch (qnxKeycode)
+    {
+    case KEYCODE_SYSREQ:
+        return Input::KEY_SYSREQ;
+    case KEYCODE_BREAK:
+        return Input::KEY_BREAK;
+    case KEYCODE_MENU:
+        return Input::KEY_MENU;
+    case KEYCODE_KP_ENTER:
+        return Input::KEY_KP_ENTER;
+    case KEYCODE_PAUSE:
+        return Input::KEY_PAUSE;
+    case KEYCODE_SCROLL_LOCK:
+        return Input::KEY_SCROLL_LOCK;
+    case KEYCODE_PRINT:
+        return Input::KEY_PRINT;
+    case KEYCODE_ESCAPE:
+        return Input::KEY_ESCAPE;
+    case KEYCODE_BACKSPACE:
+        return Input::KEY_BACKSPACE;
+    case KEYCODE_BACK_TAB:
+        return Input::KEY_BACK_TAB;
+    case KEYCODE_TAB:
+        return Input::KEY_TAB;
+    case KEYCODE_RETURN:
+        return Input::KEY_RETURN;
+    case KEYCODE_CAPS_LOCK:
+        return Input::KEY_CAPS_LOCK;
+    case KEYCODE_LEFT_SHIFT:
+        return Input::KEY_LEFT_SHIFT;
+    case KEYCODE_RIGHT_SHIFT:
+        return Input::KEY_RIGHT_SHIFT;
+    case KEYCODE_LEFT_CTRL:
+        return Input::KEY_LEFT_CTRL;
+    case KEYCODE_RIGHT_CTRL:
+        return Input::KEY_RIGHT_CTRL;
+    case KEYCODE_LEFT_ALT:
+        return Input::KEY_LEFT_ALT;
+    case KEYCODE_RIGHT_ALT:
+        return Input::KEY_RIGHT_ALT;
+    case KEYCODE_LEFT_HYPER:
+        return Input::KEY_LEFT_HYPER;
+    case KEYCODE_RIGHT_HYPER:
+        return Input::KEY_RIGHT_HYPER;
+    case KEYCODE_INSERT:
+        return Input::KEY_INSERT;
+    case KEYCODE_HOME:
+        return Input::KEY_HOME;
+    case KEYCODE_PG_UP:
+        return Input::KEY_PG_UP;
+    case KEYCODE_DELETE:
+        return Input::KEY_DELETE;
+    case KEYCODE_END:
+        return Input::KEY_END;
+    case KEYCODE_PG_DOWN:
+        return Input::KEY_PG_DOWN;
+    case KEYCODE_LEFT:
+        return Input::KEY_LEFT_ARROW;
+    case KEYCODE_RIGHT:
+        return Input::KEY_RIGHT_ARROW;
+    case KEYCODE_UP:
+        return Input::KEY_UP_ARROW;
+    case KEYCODE_DOWN:
+        return Input::KEY_DOWN_ARROW;
+    case KEYCODE_NUM_LOCK:
+        return Input::KEY_NUM_LOCK;
+    case KEYCODE_KP_PLUS:
+        return Input::KEY_KP_PLUS;
+    case KEYCODE_KP_MINUS:
+        return Input::KEY_KP_MINUS;
+    case KEYCODE_KP_MULTIPLY:
+        return Input::KEY_KP_MULTIPLY;
+    case KEYCODE_KP_DIVIDE:
+        return Input::KEY_KP_DIVIDE;
+    case KEYCODE_KP_HOME:
+        return Input::KEY_KP_HOME;
+    case KEYCODE_KP_UP:
+        return Input::KEY_KP_UP;
+    case KEYCODE_KP_PG_UP:
+        return Input::KEY_KP_PG_UP;
+    case KEYCODE_KP_LEFT:
+        return Input::KEY_KP_LEFT;
+    case KEYCODE_KP_FIVE:
+        return Input::KEY_KP_FIVE;
+    case KEYCODE_KP_RIGHT:
+        return Input::KEY_KP_RIGHT;
+    case KEYCODE_KP_END:
+        return Input::KEY_KP_END;
+    case KEYCODE_KP_DOWN:
+        return Input::KEY_KP_DOWN;
+    case KEYCODE_KP_PG_DOWN:
+        return Input::KEY_KP_PG_DOWN;
+    case KEYCODE_KP_INSERT:
+        return Input::KEY_KP_INSERT;
+    case KEYCODE_KP_DELETE:
+        return Input::KEY_KP_DELETE;
+    case KEYCODE_F1:
+        return Input::KEY_F1;
+    case KEYCODE_F2:
+        return Input::KEY_F2;
+    case KEYCODE_F3:
+        return Input::KEY_F3;
+    case KEYCODE_F4:
+        return Input::KEY_F4;
+    case KEYCODE_F5:
+        return Input::KEY_F5;
+    case KEYCODE_F6:
+        return Input::KEY_F6;
+    case KEYCODE_F7:
+        return Input::KEY_F7;
+    case KEYCODE_F8:
+        return Input::KEY_F8;
+    case KEYCODE_F9:
+        return Input::KEY_F9;
+    case KEYCODE_F10:
+        return Input::KEY_F10;
+    case KEYCODE_F11:
+        return Input::KEY_F11;
+    case KEYCODE_F12:
+        return Input::KEY_F12;
+    case KEYCODE_SPACE:
+        return Input::KEY_SPACE;
+    case KEYCODE_RIGHT_PAREN:
+        return Input::KEY_RIGHT_PARENTHESIS;
+    case KEYCODE_ZERO:
+        return Input::KEY_ZERO;
+    case KEYCODE_EXCLAM:
+        return Input::KEY_EXCLAM;
+    case KEYCODE_ONE:
+        return Input::KEY_ONE;
+    case KEYCODE_AT:
+        return Input::KEY_AT;
+    case KEYCODE_TWO:
+        return Input::KEY_TWO;
+    case KEYCODE_NUMBER:
+        return Input::KEY_NUMBER;
+    case KEYCODE_THREE:
+        return Input::KEY_THREE;
+    case KEYCODE_DOLLAR:
+        return Input::KEY_DOLLAR;
+    case KEYCODE_FOUR:
+        return Input::KEY_FOUR;
+    case KEYCODE_PERCENT:
+        return Input::KEY_PERCENT;
+    case KEYCODE_FIVE:
+        return Input::KEY_FIVE;
+    case KEYCODE_CIRCUMFLEX:
+        return Input::KEY_CIRCUMFLEX;
+    case KEYCODE_SIX:
+        return Input::KEY_SIX;
+    case KEYCODE_AMPERSAND:
+        return Input::KEY_AMPERSAND;
+    case KEYCODE_SEVEN:
+        return Input::KEY_SEVEN;
+    case KEYCODE_ASTERISK:
+        return Input::KEY_ASTERISK;
+    case KEYCODE_EIGHT:
+        return Input::KEY_EIGHT;
+    case KEYCODE_LEFT_PAREN:
+        return Input::KEY_LEFT_PARENTHESIS;
+    case KEYCODE_NINE:
+        return Input::KEY_NINE;
+    case KEYCODE_EQUAL:
+        return Input::KEY_EQUAL;
+    case KEYCODE_PLUS:
+        return Input::KEY_PLUS;
+    case KEYCODE_LESS_THAN:
+        return Input::KEY_LESS_THAN;
+    case KEYCODE_COMMA:
+        return Input::KEY_COMMA;
+    case KEYCODE_UNDERSCORE:
+        return Input::KEY_UNDERSCORE;
+    case KEYCODE_MINUS:
+        return Input::KEY_MINUS;
+    case KEYCODE_GREATER_THAN:
+        return Input::KEY_GREATER_THAN;
+    case KEYCODE_PERIOD:
+        return Input::KEY_PERIOD;
+    case KEYCODE_COLON:
+        return Input::KEY_COLON;
+    case KEYCODE_SEMICOLON:
+        return Input::KEY_SEMICOLON;
+    case KEYCODE_QUESTION:
+        return Input::KEY_QUESTION;
+    case KEYCODE_SLASH:
+        return Input::KEY_SLASH;
+    case KEYCODE_GRAVE:
+        return Input::KEY_GRAVE;
+    case KEYCODE_TILDE:
+        return Input::KEY_TILDE;
+    case KEYCODE_LEFT_BRACE:
+        return Input::KEY_LEFT_BRACE;
+    case KEYCODE_LEFT_BRACKET:
+        return Input::KEY_LEFT_BRACKET;
+    case KEYCODE_BAR:
+        return Input::KEY_BAR;
+    case KEYCODE_BACK_SLASH:
+        return Input::KEY_BACK_SLASH;
+    case KEYCODE_RIGHT_BRACE:
+        return Input::KEY_RIGHT_BRACE;
+    case KEYCODE_RIGHT_BRACKET:
+        return Input::KEY_RIGHT_BRACKET;
+    case KEYCODE_QUOTE:
+        return Input::KEY_QUOTE;
+    case KEYCODE_APOSTROPHE:
+        return Input::KEY_APOSTROPHE;
+    case KEYCODE_CAPITAL_A:
+        return Input::KEY_CAPITAL_A;
+    case KEYCODE_A:
+        return Input::KEY_A;
+    case KEYCODE_CAPITAL_B:
+        return Input::KEY_CAPITAL_B;
+    case KEYCODE_B:
+        return Input::KEY_B;
+    case KEYCODE_CAPITAL_C:
+        return Input::KEY_CAPITAL_C;
+    case KEYCODE_C:
+        return Input::KEY_C;
+    case KEYCODE_CAPITAL_D:
+        return Input::KEY_CAPITAL_D;
+    case KEYCODE_D:
+        return Input::KEY_D;
+    case KEYCODE_CAPITAL_E:
+        return Input::KEY_CAPITAL_E;
+    case KEYCODE_E:
+        return Input::KEY_E;
+    case KEYCODE_CAPITAL_F:
+        return Input::KEY_CAPITAL_F;
+    case KEYCODE_F:
+        return Input::KEY_F;
+    case KEYCODE_CAPITAL_G:
+        return Input::KEY_CAPITAL_G;
+    case KEYCODE_G:
+        return Input::KEY_G;
+    case KEYCODE_CAPITAL_H:
+        return Input::KEY_CAPITAL_H;
+    case KEYCODE_H:
+        return Input::KEY_H;
+    case KEYCODE_CAPITAL_I:
+        return Input::KEY_CAPITAL_I;
+    case KEYCODE_I:
+        return Input::KEY_I;
+    case KEYCODE_CAPITAL_J:
+        return Input::KEY_CAPITAL_J;
+    case KEYCODE_J:
+        return Input::KEY_J;
+    case KEYCODE_CAPITAL_K:
+        return Input::KEY_CAPITAL_K;
+    case KEYCODE_K:
+        return Input::KEY_K;
+    case KEYCODE_CAPITAL_L:
+        return Input::KEY_CAPITAL_L;
+    case KEYCODE_L:
+        return Input::KEY_L;
+    case KEYCODE_CAPITAL_M:
+        return Input::KEY_CAPITAL_M;
+    case KEYCODE_M:
+        return Input::KEY_M;
+    case KEYCODE_CAPITAL_N:
+        return Input::KEY_CAPITAL_N;
+    case KEYCODE_N:
+        return Input::KEY_N;
+    case KEYCODE_CAPITAL_O:
+        return Input::KEY_CAPITAL_O;
+    case KEYCODE_O:
+        return Input::KEY_O;
+    case KEYCODE_CAPITAL_P:
+        return Input::KEY_CAPITAL_P;
+    case KEYCODE_P:
+        return Input::KEY_P;
+    case KEYCODE_CAPITAL_Q:
+        return Input::KEY_CAPITAL_Q;
+    case KEYCODE_Q:
+        return Input::KEY_Q;
+    case KEYCODE_CAPITAL_R:
+        return Input::KEY_CAPITAL_R;
+    case KEYCODE_R:
+        return Input::KEY_R;
+    case KEYCODE_CAPITAL_S:
+        return Input::KEY_CAPITAL_S;
+    case KEYCODE_S:
+        return Input::KEY_S;
+    case KEYCODE_CAPITAL_T:
+        return Input::KEY_CAPITAL_T;
+    case KEYCODE_T:
+        return Input::KEY_T;
+    case KEYCODE_CAPITAL_U:
+        return Input::KEY_CAPITAL_U;
+    case KEYCODE_U:
+        return Input::KEY_U;
+    case KEYCODE_CAPITAL_V:
+        return Input::KEY_CAPITAL_V;
+    case KEYCODE_V:
+        return Input::KEY_V;
+    case KEYCODE_CAPITAL_W:
+        return Input::KEY_CAPITAL_W;
+    case KEYCODE_W:
+        return Input::KEY_W;
+    case KEYCODE_CAPITAL_X:
+        return Input::KEY_CAPITAL_X;
+    case KEYCODE_X:
+        return Input::KEY_X;
+    case KEYCODE_CAPITAL_Y:
+        return Input::KEY_CAPITAL_Y;
+    case KEYCODE_Y:
+        return Input::KEY_Y;
+    case KEYCODE_CAPITAL_Z:
+        return Input::KEY_CAPITAL_Z;
+    case KEYCODE_Z:
+        return Input::KEY_Z;
+    default:
+        return Input::KEY_NONE;
+    }
+}
+
 extern void printError(const char* format, ...)
 {
     va_list argptr;
@@ -404,18 +722,8 @@ int Platform::enterMessagePump()
                         screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_FLAGS, &flags);
                         screen_get_event_property_iv(__screenEvent, SCREEN_PROPERTY_KEY_SYM, &value);
                         int keyEvent = flags & KEY_DOWN ? Input::KEYEVENT_DOWN : Input::KEYEVENT_UP;
-                        switch (value)
-                        {
-                            case KEYCODE_A:
-                                Game::getInstance()->keyPress(Input::KEY_A, keyEvent);
-                                break;
-                            case KEYCODE_B:
-                                Game::getInstance()->keyPress(Input::KEY_B, keyEvent);
-                                break;
-                            case KEYCODE_P:
-                                Game::getInstance()->keyPress(Input::KEY_P, keyEvent);
-                                break;
-                        }
+                        Game::getInstance()->keyPress(getGameplayInputKey(value), keyEvent);
+                        break;
                     }
                 }
             }
@@ -433,6 +741,10 @@ int Platform::enterMessagePump()
             }
         }
 
+        // If we are done, then exit.
+        if (_game->getState() == Game::UNINITIALIZED)
+            break;
+
         // Idle time (no events left to process) is spent rendering.
         // We skip rendering when the window is not visible or the app is paused.
         if (visible && _game->getState() != Game::PAUSED)
@@ -455,14 +767,13 @@ int Platform::enterMessagePump()
             rc = eglSwapBuffers(__eglDisplay, __eglSurface);
             if (rc != EGL_TRUE)
             {
+                _game->exit();
                 perror("eglSwapBuffers");
                 break;
             }
         }
     }
 
-    _game->exit();
-
     screen_stop_events(__screenContext);
     bps_shutdown();
     screen_destroy_context(__screenContext);

+ 8 - 4
gameplay/src/PlatformWin32.cpp

@@ -78,13 +78,13 @@ static gameplay::Input::Key getGameplayInputKey(WPARAM win32KeyCode, bool shiftD
     case VK_NEXT:
         return gameplay::Input::KEY_PG_DOWN;
     case VK_LEFT:
-        return gameplay::Input::KEY_LEFT;
+        return gameplay::Input::KEY_LEFT_ARROW;
     case VK_RIGHT:
-        return gameplay::Input::KEY_RIGHT;
+        return gameplay::Input::KEY_RIGHT_ARROW;
     case VK_UP:
-        return gameplay::Input::KEY_UP;
+        return gameplay::Input::KEY_UP_ARROW;
     case VK_DOWN:
-        return gameplay::Input::KEY_DOWN;
+        return gameplay::Input::KEY_DOWN_ARROW;
     case VK_NUMLOCK:
         return gameplay::Input::KEY_NUM_LOCK;
     case VK_ADD:
@@ -527,6 +527,10 @@ int Platform::enterMessagePump()
             _game->frame();
             SwapBuffers(__hdc);
         }
+
+        // If we are done, then exit.
+        if (_game->getState() == Game::UNINITIALIZED)
+            break;
     }
 
     return msg.wParam;

+ 1 - 0
gameplay/src/Properties.h

@@ -7,6 +7,7 @@
 
 #include "Base.h"
 #include "Matrix.h"
+#include "Vector2.h"
 
 namespace gameplay
 {

+ 15 - 7
gameplay/src/Quaternion.cpp

@@ -23,6 +23,15 @@ Quaternion::Quaternion(float* array)
     set(array);
 }
 
+Quaternion::Quaternion(const Matrix& m)
+{
+    set(m);
+}
+
+Quaternion::Quaternion(const Vector3& axis, float angle)
+{
+    set(axis, angle);
+}
 
 Quaternion::Quaternion(const Quaternion& copy)
 {
@@ -192,15 +201,14 @@ void Quaternion::set(float* array)
     w = array[3];
 }
 
-void Quaternion::set(const Vector3& axis, float angle)
+void Quaternion::set(const Matrix& m)
 {
-    Quaternion rotationQuat;
-    Quaternion::createFromAxisAngle(axis, angle, &rotationQuat);
+    Quaternion::createFromRotationMatrix(m, this);
+}
 
-    this->x = rotationQuat.x;
-    this->y = rotationQuat.y;
-    this->z = rotationQuat.z;
-    this->w = rotationQuat.w;
+void Quaternion::set(const Vector3& axis, float angle)
+{
+    Quaternion::createFromAxisAngle(axis, angle, this);
 }
 
 void Quaternion::set(const Quaternion& q)

+ 42 - 0
gameplay/src/Quaternion.h

@@ -85,6 +85,21 @@ public:
      */
     Quaternion(float* array);
 
+    /**
+     * Constructs a quaternion equal to the rotational part of the specified matrix.
+     *
+     * @param m The matrix.
+     */
+    Quaternion(const Matrix& m);
+
+    /**
+     * 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.
      *
@@ -234,6 +249,13 @@ public:
      */
     void set(float* array);
 
+    /**
+     * Sets the quaternion equal to the rotational part of the specified matrix.
+     *
+     * @param m The matrix.
+     */
+    void set(const Matrix& m);
+
     /**
      * Sets the quaternion equal to the rotation from the specified axis and angle.
      * 
@@ -312,6 +334,24 @@ public:
      */
     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:
 
     static void slerpForSquad(const Quaternion& q1, const Quaternion& q2, float t, Quaternion* dst);
@@ -319,4 +359,6 @@ private:
 
 }
 
+#include "Quaternion.inl"
+
 #endif

+ 23 - 0
gameplay/src/Quaternion.inl

@@ -0,0 +1,23 @@
+/** 
+ * Quaternion.inl
+ */
+
+#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;
+}
+
+}

+ 19 - 0
gameplay/src/Ray.h

@@ -145,6 +145,14 @@ public:
      */
     void transform(const Matrix& matrix);
 
+    /**
+     * Transforms this ray by the given matrix.
+     * 
+     * @param matrix The matrix to transform by.
+     * @return This ray, after the transformation occurs.
+     */
+    inline Ray& operator*=(const Matrix& matrix);
+
 private:
 
     /**
@@ -156,6 +164,17 @@ private:
     Vector3 _direction;     // The ray direction vector.
 };
 
+/**
+ * Transforms the given ray by the given matrix.
+ * 
+ * @param matrix The matrix to transform by.
+ * @param ray The ray to transform.
+ * @return The resulting transformed ray.
+ */
+inline Ray operator*(const Matrix& matrix, const Ray& ray);
+
 }
 
+#include "Ray.inl"
+
 #endif

+ 23 - 0
gameplay/src/Ray.inl

@@ -0,0 +1,23 @@
+/** 
+ * Ray.inl
+ */
+
+#include "Ray.h"
+
+namespace gameplay
+{
+
+inline Ray& Ray::operator*=(const Matrix& matrix)
+{
+    transform(matrix);
+    return *this;
+}
+
+inline Ray operator*(const Matrix& matrix, const Ray& ray)
+{
+    Ray r(ray);
+    r.transform(matrix);
+    return r;
+}
+
+}

+ 2 - 2
gameplay/src/Technique.cpp

@@ -10,7 +10,7 @@ namespace gameplay
 {
 
 Technique::Technique(const char* id, Material* material)
-	: _id(id ? id : ""), _material(material)
+    : _id(id ? id : ""), _material(material)
 {
     assert(material);
 
@@ -23,7 +23,7 @@ Technique::Technique(const Technique& m)
 
 Technique::~Technique()
 {
-	// Destroy all the passes.
+    // Destroy all the passes.
     for (unsigned int i = 0, count = _passes.size(); i < count; ++i)
     {
         SAFE_RELEASE(_passes[i]);

+ 74 - 0
gameplay/src/Vector2.h

@@ -318,8 +318,82 @@ public:
      * @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) const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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-() const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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);
 };
 
+/**
+ * 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

+ 63 - 0
gameplay/src/Vector2.inl

@@ -0,0 +1,63 @@
+/** 
+ * Vector2.inl
+ */
+
+#include "Vector2.h"
+
+namespace gameplay
+{
+
+inline Vector2 Vector2::operator+(const Vector2& v) const
+{
+    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) const
+{
+    Vector2 result(*this);
+    result.subtract(v);
+    return result;
+}
+
+inline Vector2& Vector2::operator-=(const Vector2& v)
+{
+    subtract(v);
+    return *this;
+}
+
+inline Vector2 Vector2::operator-() const
+{
+    Vector2 result(*this);
+    result.negate();
+    return result;
+}
+
+inline Vector2 Vector2::operator*(float x) const
+{
+    Vector2 result(*this);
+    result.scale(x);
+    return result;
+}
+
+inline Vector2& Vector2::operator*=(float x)
+{
+    scale(x);
+    return *this;
+}
+
+inline Vector2 operator*(float x, const Vector2& v)
+{
+    Vector2 result(v);
+    result.scale(x);
+    return result;
+}
+
+}

+ 74 - 0
gameplay/src/Vector3.h

@@ -348,8 +348,82 @@ public:
      * @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) const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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-() const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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);
 };
 
+/**
+ * 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

+ 64 - 0
gameplay/src/Vector3.inl

@@ -0,0 +1,64 @@
+/** 
+ * Vector3.inl
+ */
+
+#include "Vector3.h"
+#include "Matrix.h"
+
+namespace gameplay
+{
+
+inline Vector3 Vector3::operator+(const Vector3& v) const
+{
+    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) const
+{
+    Vector3 result(*this);
+    result.subtract(v);
+    return result;
+}
+
+inline Vector3& Vector3::operator-=(const Vector3& v)
+{
+    subtract(v);
+    return *this;
+}
+
+inline Vector3 Vector3::operator-() const
+{
+    Vector3 result(*this);
+    result.negate();
+    return result;
+}
+
+inline Vector3 Vector3::operator*(float x) const
+{
+    Vector3 result(*this);
+    result.scale(x);
+    return result;
+}
+
+inline Vector3& Vector3::operator*=(float x)
+{
+    scale(x);
+    return *this;
+}
+
+inline Vector3 operator*(float x, const Vector3& v)
+{
+    Vector3 result(v);
+    result.scale(x);
+    return result;
+}
+
+}

+ 74 - 0
gameplay/src/Vector4.h

@@ -343,8 +343,82 @@ public:
      * @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) const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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-() const;
+
+    /**
+     * 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) const;
+
+    /**
+     * 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);
 };
 
+/**
+ * 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

+ 64 - 0
gameplay/src/Vector4.inl

@@ -0,0 +1,64 @@
+/** 
+ * Vector4.inl
+ */
+
+#include "Matrix.h"
+#include "Vector4.h"
+
+namespace gameplay
+{
+
+inline Vector4 Vector4::operator+(const Vector4& v) const
+{
+    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) const
+{
+    Vector4 result(*this);
+    result.subtract(v);
+    return result;
+}
+
+inline Vector4& Vector4::operator-=(const Vector4& v)
+{
+    subtract(v);
+    return *this;
+}
+
+inline Vector4 Vector4::operator-() const
+{
+    Vector4 result(*this);
+    result.negate();
+    return result;
+}
+
+inline Vector4 Vector4::operator*(float x) const
+{
+    Vector4 result(*this);
+    result.scale(x);
+    return result;
+}
+
+inline Vector4& Vector4::operator*=(float x)
+{
+    scale(x);
+    return *this;
+}
+
+inline Vector4 operator*(float x, const Vector4& v)
+{
+    Vector4 result(v);
+    result.scale(x);
+    return result;
+}
+
+}

+ 11 - 0
gameplay/src/gameplay.h

@@ -61,3 +61,14 @@
 #include "AnimationValue.h"
 #include "Animation.h"
 #include "AnimationClip.h"
+
+// Physics
+#include "PhysicsConstraint.h"
+#include "PhysicsController.h"
+#include "PhysicsFixedConstraint.h"
+#include "PhysicsGenericConstraint.h"
+#include "PhysicsHingeConstraint.h"
+#include "PhysicsMotionState.h"
+#include "PhysicsRigidBody.h"
+#include "PhysicsSocketConstraint.h"
+#include "PhysicsSpringConstraint.h"

Some files were not shown because too many files changed in this diff