Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of http://git.rim.net/gaming/box2d

  • Loading branch information...
commit 381016e9e774b2d1711fa65be4ddcf511afb7d43 2 parents 751fd6f + e22eec4
Eduardo Pelegri-Llopart authored
Showing with 26,939 additions and 0 deletions.
  1. +450 −0 .cproject
  2. +8 −0 .gitignore
  3. +77 −0 .project
  4. +67 −0 Box2D/Box2D.h
  5. +3 −0  Box2D/Box2DConfig.cmake
  6. +205 −0 Box2D/CMakeLists.txt
  7. +171 −0 Box2D/Collision/Shapes/b2ChainShape.cpp
  8. +102 −0 Box2D/Collision/Shapes/b2ChainShape.h
  9. +100 −0 Box2D/Collision/Shapes/b2CircleShape.cpp
  10. +91 −0 Box2D/Collision/Shapes/b2CircleShape.h
  11. +139 −0 Box2D/Collision/Shapes/b2EdgeShape.cpp
  12. +74 −0 Box2D/Collision/Shapes/b2EdgeShape.h
  13. +361 −0 Box2D/Collision/Shapes/b2PolygonShape.cpp
  14. +95 −0 Box2D/Collision/Shapes/b2PolygonShape.h
  15. +101 −0 Box2D/Collision/Shapes/b2Shape.h
  16. +122 −0 Box2D/Collision/b2BroadPhase.cpp
  17. +248 −0 Box2D/Collision/b2BroadPhase.h
  18. +154 −0 Box2D/Collision/b2CollideCircle.cpp
  19. +698 −0 Box2D/Collision/b2CollideEdge.cpp
  20. +317 −0 Box2D/Collision/b2CollidePolygon.cpp
  21. +249 −0 Box2D/Collision/b2Collision.cpp
  22. +276 −0 Box2D/Collision/b2Collision.h
  23. +603 −0 Box2D/Collision/b2Distance.cpp
  24. +141 −0 Box2D/Collision/b2Distance.h
  25. +771 −0 Box2D/Collision/b2DynamicTree.cpp
  26. +284 −0 Box2D/Collision/b2DynamicTree.h
  27. +483 −0 Box2D/Collision/b2TimeOfImpact.cpp
  28. +58 −0 Box2D/Collision/b2TimeOfImpact.h
  29. +217 −0 Box2D/Common/b2BlockAllocator.cpp
  30. +62 −0 Box2D/Common/b2BlockAllocator.h
  31. +44 −0 Box2D/Common/b2Draw.cpp
  32. +81 −0 Box2D/Common/b2Draw.h
  33. +85 −0 Box2D/Common/b2GrowableStack.h
  34. +94 −0 Box2D/Common/b2Math.cpp
  35. +731 −0 Box2D/Common/b2Math.h
  36. +44 −0 Box2D/Common/b2Settings.cpp
  37. +150 −0 Box2D/Common/b2Settings.h
  38. +83 −0 Box2D/Common/b2StackAllocator.cpp
  39. +60 −0 Box2D/Common/b2StackAllocator.h
  40. +100 −0 Box2D/Common/b2Timer.cpp
  41. +45 −0 Box2D/Common/b2Timer.h
  42. +54 −0 Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp
  43. +39 −0 Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h
  44. +54 −0 Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp
  45. +39 −0 Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h
  46. +53 −0 Box2D/Dynamics/Contacts/b2CircleContact.cpp
  47. +39 −0 Box2D/Dynamics/Contacts/b2CircleContact.h
  48. +240 −0 Box2D/Dynamics/Contacts/b2Contact.cpp
  49. +331 −0 Box2D/Dynamics/Contacts/b2Contact.h
  50. +832 −0 Box2D/Dynamics/Contacts/b2ContactSolver.cpp
  51. +94 −0 Box2D/Dynamics/Contacts/b2ContactSolver.h
  52. +50 −0 Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp
  53. +39 −0 Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h
  54. +50 −0 Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
  55. +39 −0 Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h
  56. +50 −0 Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp
  57. +38 −0 Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h
  58. +53 −0 Box2D/Dynamics/Contacts/b2PolygonContact.cpp
  59. +39 −0 Box2D/Dynamics/Contacts/b2PolygonContact.h
  60. +260 −0 Box2D/Dynamics/Joints/b2DistanceJoint.cpp
  61. +169 −0 Box2D/Dynamics/Joints/b2DistanceJoint.h
  62. +251 −0 Box2D/Dynamics/Joints/b2FrictionJoint.cpp
  63. +119 −0 Box2D/Dynamics/Joints/b2FrictionJoint.h
  64. +423 −0 Box2D/Dynamics/Joints/b2GearJoint.cpp
  65. +125 −0 Box2D/Dynamics/Joints/b2GearJoint.h
  66. +199 −0 Box2D/Dynamics/Joints/b2Joint.cpp
  67. +222 −0 Box2D/Dynamics/Joints/b2Joint.h
  68. +217 −0 Box2D/Dynamics/Joints/b2MouseJoint.cpp
  69. +126 −0 Box2D/Dynamics/Joints/b2MouseJoint.h
  70. +637 −0 Box2D/Dynamics/Joints/b2PrismaticJoint.cpp
  71. +196 −0 Box2D/Dynamics/Joints/b2PrismaticJoint.h
  72. +332 −0 Box2D/Dynamics/Joints/b2PulleyJoint.cpp
  73. +143 −0 Box2D/Dynamics/Joints/b2PulleyJoint.h
  74. +504 −0 Box2D/Dynamics/Joints/b2RevoluteJoint.cpp
  75. +204 −0 Box2D/Dynamics/Joints/b2RevoluteJoint.h
  76. +241 −0 Box2D/Dynamics/Joints/b2RopeJoint.cpp
  77. +114 −0 Box2D/Dynamics/Joints/b2RopeJoint.h
  78. +330 −0 Box2D/Dynamics/Joints/b2WeldJoint.cpp
  79. +126 −0 Box2D/Dynamics/Joints/b2WeldJoint.h
  80. +419 −0 Box2D/Dynamics/Joints/b2WheelJoint.cpp
  81. +213 −0 Box2D/Dynamics/Joints/b2WheelJoint.h
  82. +514 −0 Box2D/Dynamics/b2Body.cpp
  83. +846 −0 Box2D/Dynamics/b2Body.h
  84. +293 −0 Box2D/Dynamics/b2ContactManager.cpp
  85. +52 −0 Box2D/Dynamics/b2ContactManager.h
  86. +303 −0 Box2D/Dynamics/b2Fixture.cpp
  87. +345 −0 Box2D/Dynamics/b2Fixture.h
  88. +539 −0 Box2D/Dynamics/b2Island.cpp
  89. +93 −0 Box2D/Dynamics/b2Island.h
  90. +70 −0 Box2D/Dynamics/b2TimeStep.h
  91. +1,316 −0 Box2D/Dynamics/b2World.cpp
  92. +349 −0 Box2D/Dynamics/b2World.h
  93. +36 −0 Box2D/Dynamics/b2WorldCallbacks.cpp
  94. +155 −0 Box2D/Dynamics/b2WorldCallbacks.h
  95. +259 −0 Box2D/Rope/b2Rope.cpp
  96. +115 −0 Box2D/Rope/b2Rope.h
  97. +1 −0  Build/Readme.txt
  98. +74 −0 Build/vs2010/Box2D.sln
  99. +340 −0 Build/vs2010/Box2D.vcxproj
  100. +301 −0 Build/vs2010/Box2D.vcxproj.filters
  101. +250 −0 Build/vs2010/FreeGLUT.vcxproj
  102. +102 −0 Build/vs2010/FreeGLUT.vcxproj.filters
  103. +275 −0 Build/vs2010/GLUI.vcxproj
  104. +129 −0 Build/vs2010/GLUI.vcxproj.filters
  105. +209 −0 Build/vs2010/HelloWorld.vcxproj
  106. +6 −0 Build/vs2010/HelloWorld.vcxproj.filters
  107. +265 −0 Build/vs2010/Testbed.vcxproj
  108. +171 −0 Build/vs2010/Testbed.vcxproj.filters
  109. +1,210 −0 Build/xcode4/Box2D.xcodeproj/project.pbxproj
  110. +7 −0 Build/xcode4/Box2D.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  111. +49 −0 Building.txt
  112. +35 −0 CMakeLists.txt
  113. +164 −0 Documentation/API/html/_box2_d_8h_source.html
  114. +224 −0 Documentation/API/html/annotated.html
  115. +164 −0 Documentation/API/html/b2_block_allocator_8h_source.html
  116. +784 −0 Documentation/API/html/b2_body_8h_source.html
  117. +328 −0 Documentation/API/html/b2_broad_phase_8h_source.html
  118. +146 −0 Documentation/API/html/b2_chain_and_circle_contact_8h_source.html
  119. +146 −0 Documentation/API/html/b2_chain_and_polygon_contact_8h_source.html
  120. +181 −0 Documentation/API/html/b2_chain_shape_8h_source.html
  121. +146 −0 Documentation/API/html/b2_circle_contact_8h_source.html
Sorry, we could not display the entire diff because too many files (747) changed.
View
450 .cproject
@@ -0,0 +1,450 @@
+<?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.991264391">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.991264391" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Device-Debug"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.991264391" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.debug.991264391." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1220689096" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.2117140365" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.runtime.1875816732" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.795693017" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Device-Debug}" id="com.qnx.nto.1721836940" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool command="qcc" id="com.qnx.qcc.tool.compiler.778639393" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.1832773145" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.140760399" 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.767603017" 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.694370304" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.1262189218" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.242719627" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.546745647" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.262523746" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.983666268" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1909573860" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.607321994" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.1434921466" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.86531573" 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.905553758" 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.1875494488" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.release.1570411085">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.1570411085" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Device-Release"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.1570411085" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.release.1570411085." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.release.714830853" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.151850842" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.runtime.159006348" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.6392697" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Device-Release}" id="com.qnx.nto.1825618731" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.191930414" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.1100560111" 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.134984285" 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.16775985" 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.1368529825" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.1041788454" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.491501254" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.2075840612" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.254219414" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1221408355" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.langcpp.1336820194" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1681221229" 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.1152340801" 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.1116486600" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.730800174">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.730800174" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Device-Profile"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.730800174" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.profile.730800174." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.profile.730391239" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.1073722662" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.runtime.1845394599" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.611772203" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Device-Profile}" id="com.qnx.nto.208309357" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.964711081" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.983016669" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.profile2.347018783" 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.1624837928" 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.1493695009" 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.1991311633" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.1619513121" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.1236019198" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.368656697" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.78472354" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.1752773477" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.606713057" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.362682228" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.profile2.2069216286" 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.1955937681" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.354838149" 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.301119602" 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.1996930897" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1418712830">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1418712830" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Device-Coverage"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.1418712830" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1418712830." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.91199142" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.1203872202" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.runtime.1398236295" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.129067540" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Device-Coverage}" id="com.qnx.nto.2057711496" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1793588446" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.2070749175" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.coverage.613940232" 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.1670950354" 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.283161888" 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.1198807528" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.934660212" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.1365138813" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1089714556" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.989898774" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.1765222045" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1892522774" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.1156876616" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.coverage.1561288492" 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.381653803" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.61266639" 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.248323950" 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.2066938983" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.1053656939">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.1053656939" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Simulator"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.1053656939" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.debug.1053656939." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1184398587" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.runtime.1939652226" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1823546056" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Simulator}" id="com.qnx.nto.1924361823" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.616662524" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.1888775676" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.2145209289" 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.8400623" 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.1761845246" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.494816967" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.847354580" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1079128231" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.573361263" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.376379117" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.933076782" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.564328645" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.3374935" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1273208223" 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.851884241" 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.1720564489" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.1123518083">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.1123518083" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Simulator-Profile"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.1123518083" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.profile.1123518083." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1535310055" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.runtime.559387716" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1499542636" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Simulator-Profile}" id="com.qnx.nto.1937810358" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1445823766" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.805291848" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.profile2.1810036102" 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.716922104" 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.1783626208" 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.683975921" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.1231866896" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.1809437339" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.177844402" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.107953018" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.501152929" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1789953738" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.604792574" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.profile2.1123720384" 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.28053912" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1763332833" 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.1139338054" 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.1283669083" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1088278290">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1088278290" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/box2d"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/box2d/Simulator-Coverage"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="box2d"/>
+ </externalSetting>
+ </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"/>
+ </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.1088278290" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1088278290." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1770149974" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.runtime.1523923411" name="Runtime:" superClass="com.qnx.qcc.option.runtime" value="com.qnx.qcc.option.gen.runtime.c++._gpp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1378961849" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/box2d/Simulator-Coverage}" id="com.qnx.nto.336243661" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1462796109" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.1375045690" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.coverage.1348405241" 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.588993089" 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.141841273" 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.985025736" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.qccoptions.2076363605" name="QCC Options" superClass="com.qnx.qcc.option.compiler.qccoptions" valueType="stringList"/>
+ <inputType id="com.qnx.qcc.inputType.compiler.1613997988" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.797529982" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.1735147515" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.723140431" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.954797867" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.1041459030" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.coverage.1805207006" 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.740060096" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.819106374" 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.56114630" 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.554461382" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Box2D"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="box2d.null.1226821196" name="box2d"/>
+ </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.debug.1053656939">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1088278290">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.991264391">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.730800174">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1418712830">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.1570411085">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.1123518083">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+</cproject>
View
8 .gitignore
@@ -0,0 +1,8 @@
+
+/Device-Debug
+/Simulator-Coverage
+/Simulator-Profile
+/Device-Coverage
+/Device-Profile
+/Device-Release
+/Simulator
View
77 .project
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>box2d</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/box2d/Device-Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
View
67 Box2D/Box2D.h
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BOX2D_H
+#define BOX2D_H
+
+/**
+\mainpage Box2D API Documentation
+
+\section intro_sec Getting Started
+
+For documentation please see http://box2d.org/documentation.html
+
+For discussion please visit http://box2d.org/forum
+*/
+
+// These include files constitute the main Box2D API
+
+#include <Box2D/Common/b2Settings.h>
+#include <Box2D/Common/b2Draw.h>
+#include <Box2D/Common/b2Timer.h>
+
+#include <Box2D/Collision/Shapes/b2CircleShape.h>
+#include <Box2D/Collision/Shapes/b2EdgeShape.h>
+#include <Box2D/Collision/Shapes/b2ChainShape.h>
+#include <Box2D/Collision/Shapes/b2PolygonShape.h>
+
+#include <Box2D/Collision/b2BroadPhase.h>
+#include <Box2D/Collision/b2Distance.h>
+#include <Box2D/Collision/b2DynamicTree.h>
+#include <Box2D/Collision/b2TimeOfImpact.h>
+
+#include <Box2D/Dynamics/b2Body.h>
+#include <Box2D/Dynamics/b2Fixture.h>
+#include <Box2D/Dynamics/b2WorldCallbacks.h>
+#include <Box2D/Dynamics/b2TimeStep.h>
+#include <Box2D/Dynamics/b2World.h>
+
+#include <Box2D/Dynamics/Contacts/b2Contact.h>
+
+#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
+#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
+#include <Box2D/Dynamics/Joints/b2GearJoint.h>
+#include <Box2D/Dynamics/Joints/b2WheelJoint.h>
+#include <Box2D/Dynamics/Joints/b2MouseJoint.h>
+#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
+#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
+#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
+#include <Box2D/Dynamics/Joints/b2RopeJoint.h>
+#include <Box2D/Dynamics/Joints/b2WeldJoint.h>
+
+#endif
View
3  Box2D/Box2DConfig.cmake
@@ -0,0 +1,3 @@
+get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include(${SELF_DIR}/Box2D-targets.cmake)
+get_filename_component(Box2D_INCLUDE_DIRS "${SELF_DIR}/../../include" ABSOLUTE)
View
205 Box2D/CMakeLists.txt
@@ -0,0 +1,205 @@
+set(BOX2D_Collision_SRCS
+ Collision/b2BroadPhase.cpp
+ Collision/b2CollideCircle.cpp
+ Collision/b2CollideEdge.cpp
+ Collision/b2CollidePolygon.cpp
+ Collision/b2Collision.cpp
+ Collision/b2Distance.cpp
+ Collision/b2DynamicTree.cpp
+ Collision/b2TimeOfImpact.cpp
+)
+set(BOX2D_Collision_HDRS
+ Collision/b2BroadPhase.h
+ Collision/b2Collision.h
+ Collision/b2Distance.h
+ Collision/b2DynamicTree.h
+ Collision/b2TimeOfImpact.h
+)
+set(BOX2D_Shapes_SRCS
+ Collision/Shapes/b2CircleShape.cpp
+ Collision/Shapes/b2EdgeShape.cpp
+ Collision/Shapes/b2ChainShape.cpp
+ Collision/Shapes/b2PolygonShape.cpp
+)
+set(BOX2D_Shapes_HDRS
+ Collision/Shapes/b2CircleShape.h
+ Collision/Shapes/b2EdgeShape.h
+ Collision/Shapes/b2ChainShape.h
+ Collision/Shapes/b2PolygonShape.h
+ Collision/Shapes/b2Shape.h
+)
+set(BOX2D_Common_SRCS
+ Common/b2BlockAllocator.cpp
+ Common/b2Draw.cpp
+ Common/b2Math.cpp
+ Common/b2Settings.cpp
+ Common/b2StackAllocator.cpp
+ Common/b2Timer.cpp
+)
+set(BOX2D_Common_HDRS
+ Common/b2BlockAllocator.h
+ Common/b2Draw.h
+ Common/b2GrowableStack.h
+ Common/b2Math.h
+ Common/b2Settings.h
+ Common/b2StackAllocator.h
+ Common/b2Timer.h
+)
+set(BOX2D_Dynamics_SRCS
+ Dynamics/b2Body.cpp
+ Dynamics/b2ContactManager.cpp
+ Dynamics/b2Fixture.cpp
+ Dynamics/b2Island.cpp
+ Dynamics/b2World.cpp
+ Dynamics/b2WorldCallbacks.cpp
+)
+set(BOX2D_Dynamics_HDRS
+ Dynamics/b2Body.h
+ Dynamics/b2ContactManager.h
+ Dynamics/b2Fixture.h
+ Dynamics/b2Island.h
+ Dynamics/b2TimeStep.h
+ Dynamics/b2World.h
+ Dynamics/b2WorldCallbacks.h
+)
+set(BOX2D_Contacts_SRCS
+ Dynamics/Contacts/b2CircleContact.cpp
+ Dynamics/Contacts/b2Contact.cpp
+ Dynamics/Contacts/b2ContactSolver.cpp
+ Dynamics/Contacts/b2PolygonAndCircleContact.cpp
+ Dynamics/Contacts/b2EdgeAndCircleContact.cpp
+ Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
+ Dynamics/Contacts/b2ChainAndCircleContact.cpp
+ Dynamics/Contacts/b2ChainAndPolygonContact.cpp
+ Dynamics/Contacts/b2PolygonContact.cpp
+)
+set(BOX2D_Contacts_HDRS
+ Dynamics/Contacts/b2CircleContact.h
+ Dynamics/Contacts/b2Contact.h
+ Dynamics/Contacts/b2ContactSolver.h
+ Dynamics/Contacts/b2PolygonAndCircleContact.h
+ Dynamics/Contacts/b2EdgeAndCircleContact.h
+ Dynamics/Contacts/b2EdgeAndPolygonContact.h
+ Dynamics/Contacts/b2ChainAndCircleContact.h
+ Dynamics/Contacts/b2ChainAndPolygonContact.h
+ Dynamics/Contacts/b2PolygonContact.h
+)
+set(BOX2D_Joints_SRCS
+ Dynamics/Joints/b2DistanceJoint.cpp
+ Dynamics/Joints/b2FrictionJoint.cpp
+ Dynamics/Joints/b2GearJoint.cpp
+ Dynamics/Joints/b2Joint.cpp
+ Dynamics/Joints/b2MouseJoint.cpp
+ Dynamics/Joints/b2PrismaticJoint.cpp
+ Dynamics/Joints/b2PulleyJoint.cpp
+ Dynamics/Joints/b2RevoluteJoint.cpp
+ Dynamics/Joints/b2RopeJoint.cpp
+ Dynamics/Joints/b2WeldJoint.cpp
+ Dynamics/Joints/b2WheelJoint.cpp
+)
+set(BOX2D_Joints_HDRS
+ Dynamics/Joints/b2DistanceJoint.h
+ Dynamics/Joints/b2FrictionJoint.h
+ Dynamics/Joints/b2GearJoint.h
+ Dynamics/Joints/b2Joint.h
+ Dynamics/Joints/b2MouseJoint.h
+ Dynamics/Joints/b2PrismaticJoint.h
+ Dynamics/Joints/b2PulleyJoint.h
+ Dynamics/Joints/b2RevoluteJoint.h
+ Dynamics/Joints/b2RopeJoint.h
+ Dynamics/Joints/b2WeldJoint.h
+ Dynamics/Joints/b2WheelJoint.h
+)
+set(BOX2D_Rope_SRCS
+ Rope/b2Rope.cpp
+)
+set(BOX2D_Rope_HDRS
+ Rope/b2Rope.h
+)
+set(BOX2D_General_HDRS
+ Box2D.h
+)
+include_directories( ../ )
+
+if(BOX2D_BUILD_SHARED)
+ add_library(Box2D_shared SHARED
+ ${BOX2D_General_HDRS}
+ ${BOX2D_Joints_SRCS}
+ ${BOX2D_Joints_HDRS}
+ ${BOX2D_Contacts_SRCS}
+ ${BOX2D_Contacts_HDRS}
+ ${BOX2D_Dynamics_SRCS}
+ ${BOX2D_Dynamics_HDRS}
+ ${BOX2D_Common_SRCS}
+ ${BOX2D_Common_HDRS}
+ ${BOX2D_Shapes_SRCS}
+ ${BOX2D_Shapes_HDRS}
+ ${BOX2D_Collision_SRCS}
+ ${BOX2D_Collision_HDRS}
+ ${BOX2D_Rope_SRCS}
+ ${BOX2D_Rope_HDRS}
+ )
+ set_target_properties(Box2D_shared PROPERTIES
+ OUTPUT_NAME "Box2D"
+ CLEAN_DIRECT_OUTPUT 1
+ VERSION ${BOX2D_VERSION}
+ )
+endif()
+
+if(BOX2D_BUILD_STATIC)
+ add_library(Box2D STATIC
+ ${BOX2D_General_HDRS}
+ ${BOX2D_Joints_SRCS}
+ ${BOX2D_Joints_HDRS}
+ ${BOX2D_Contacts_SRCS}
+ ${BOX2D_Contacts_HDRS}
+ ${BOX2D_Dynamics_SRCS}
+ ${BOX2D_Dynamics_HDRS}
+ ${BOX2D_Common_SRCS}
+ ${BOX2D_Common_HDRS}
+ ${BOX2D_Shapes_SRCS}
+ ${BOX2D_Shapes_HDRS}
+ ${BOX2D_Collision_SRCS}
+ ${BOX2D_Collision_HDRS}
+ ${BOX2D_Rope_SRCS}
+ ${BOX2D_Rope_HDRS}
+ )
+ set_target_properties(Box2D PROPERTIES
+ CLEAN_DIRECT_OUTPUT 1
+ VERSION ${BOX2D_VERSION}
+ )
+endif()
+
+# These are used to create visual studio folders.
+source_group(Collision FILES ${BOX2D_Collision_SRCS} ${BOX2D_Collision_HDRS})
+source_group(Collision\\Shapes FILES ${BOX2D_Shapes_SRCS} ${BOX2D_Shapes_HDRS})
+source_group(Common FILES ${BOX2D_Common_SRCS} ${BOX2D_Common_HDRS})
+source_group(Dynamics FILES ${BOX2D_Dynamics_SRCS} ${BOX2D_Dynamics_HDRS})
+source_group(Dynamics\\Contacts FILES ${BOX2D_Contacts_SRCS} ${BOX2D_Contacts_HDRS})
+source_group(Dynamics\\Joints FILES ${BOX2D_Joints_SRCS} ${BOX2D_Joints_HDRS})
+source_group(Include FILES ${BOX2D_General_HDRS})
+source_group(Rope FILES ${BOX2D_Rope_SRCS} ${BOX2D_Rope_HDRS})
+
+if(BOX2D_INSTALL)
+ # install headers
+ install(FILES ${BOX2D_General_HDRS} DESTINATION include/Box2D)
+ install(FILES ${BOX2D_Collision_HDRS} DESTINATION include/Box2D/Collision)
+ install(FILES ${BOX2D_Shapes_HDRS} DESTINATION include/Box2D/Collision/Shapes)
+ install(FILES ${BOX2D_Common_HDRS} DESTINATION include/Box2D/Common)
+ install(FILES ${BOX2D_Dynamics_HDRS} DESTINATION include/Box2D/Dynamics)
+ install(FILES ${BOX2D_Contacts_HDRS} DESTINATION include/Box2D/Dynamics/Contacts)
+ install(FILES ${BOX2D_Joints_HDRS} DESTINATION include/Box2D/Dynamics/Joints)
+ install(FILES ${BOX2D_Rope_HDRS} DESTINATION include/Box2D/Rope)
+
+ # install libraries
+ if(BOX2D_BUILD_SHARED)
+ install(TARGETS Box2D_shared EXPORT Box2D-targets DESTINATION lib)
+ endif()
+ if(BOX2D_BUILD_STATIC)
+ install(TARGETS Box2D EXPORT Box2D-targets DESTINATION lib)
+ endif()
+
+ # install build system hooks for third-party apps
+ install(EXPORT Box2D-targets DESTINATION lib/Box2D)
+ install(FILES Box2DConfig.cmake DESTINATION lib/Box2D)
+endif(BOX2D_INSTALL)
View
171 Box2D/Collision/Shapes/b2ChainShape.cpp
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <Box2D/Collision/Shapes/b2ChainShape.h>
+#include <Box2D/Collision/Shapes/b2EdgeShape.h>
+#include <new>
+#include <cstring>
+using namespace std;
+
+b2ChainShape::~b2ChainShape()
+{
+ b2Free(m_vertices);
+ m_vertices = NULL;
+ m_count = 0;
+}
+
+void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
+{
+ b2Assert(m_vertices == NULL && m_count == 0);
+ b2Assert(count >= 3);
+ m_count = count + 1;
+ m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));
+ memcpy(m_vertices, vertices, count * sizeof(b2Vec2));
+ m_vertices[count] = m_vertices[0];
+ m_prevVertex = m_vertices[m_count - 2];
+ m_nextVertex = m_vertices[1];
+ m_hasPrevVertex = true;
+ m_hasNextVertex = true;
+}
+
+void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count)
+{
+ b2Assert(m_vertices == NULL && m_count == 0);
+ b2Assert(count >= 2);
+ m_count = count;
+ m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2));
+ memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2));
+ m_hasPrevVertex = false;
+ m_hasNextVertex = false;
+}
+
+void b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex)
+{
+ m_prevVertex = prevVertex;
+ m_hasPrevVertex = true;
+}
+
+void b2ChainShape::SetNextVertex(const b2Vec2& nextVertex)
+{
+ m_nextVertex = nextVertex;
+ m_hasNextVertex = true;
+}
+
+b2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const
+{
+ void* mem = allocator->Allocate(sizeof(b2ChainShape));
+ b2ChainShape* clone = new (mem) b2ChainShape;
+ clone->CreateChain(m_vertices, m_count);
+ clone->m_prevVertex = m_prevVertex;
+ clone->m_nextVertex = m_nextVertex;
+ clone->m_hasPrevVertex = m_hasPrevVertex;
+ clone->m_hasNextVertex = m_hasNextVertex;
+ return clone;
+}
+
+int32 b2ChainShape::GetChildCount() const
+{
+ // edge count = vertex count - 1
+ return m_count - 1;
+}
+
+void b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const
+{
+ b2Assert(0 <= index && index < m_count - 1);
+ edge->m_type = b2Shape::e_edge;
+ edge->m_radius = m_radius;
+
+ edge->m_vertex1 = m_vertices[index + 0];
+ edge->m_vertex2 = m_vertices[index + 1];
+
+ if (index > 0)
+ {
+ edge->m_vertex0 = m_vertices[index - 1];
+ edge->m_hasVertex0 = true;
+ }
+ else
+ {
+ edge->m_vertex0 = m_prevVertex;
+ edge->m_hasVertex0 = m_hasPrevVertex;
+ }
+
+ if (index < m_count - 2)
+ {
+ edge->m_vertex3 = m_vertices[index + 2];
+ edge->m_hasVertex3 = true;
+ }
+ else
+ {
+ edge->m_vertex3 = m_nextVertex;
+ edge->m_hasVertex3 = m_hasNextVertex;
+ }
+}
+
+bool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const
+{
+ B2_NOT_USED(xf);
+ B2_NOT_USED(p);
+ return false;
+}
+
+bool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& xf, int32 childIndex) const
+{
+ b2Assert(childIndex < m_count);
+
+ b2EdgeShape edgeShape;
+
+ int32 i1 = childIndex;
+ int32 i2 = childIndex + 1;
+ if (i2 == m_count)
+ {
+ i2 = 0;
+ }
+
+ edgeShape.m_vertex1 = m_vertices[i1];
+ edgeShape.m_vertex2 = m_vertices[i2];
+
+ return edgeShape.RayCast(output, input, xf, 0);
+}
+
+void b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const
+{
+ b2Assert(childIndex < m_count);
+
+ int32 i1 = childIndex;
+ int32 i2 = childIndex + 1;
+ if (i2 == m_count)
+ {
+ i2 = 0;
+ }
+
+ b2Vec2 v1 = b2Mul(xf, m_vertices[i1]);
+ b2Vec2 v2 = b2Mul(xf, m_vertices[i2]);
+
+ aabb->lowerBound = b2Min(v1, v2);
+ aabb->upperBound = b2Max(v1, v2);
+}
+
+void b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const
+{
+ B2_NOT_USED(density);
+
+ massData->mass = 0.0f;
+ massData->center.SetZero();
+ massData->I = 0.0f;
+}
View
102 Box2D/Collision/Shapes/b2ChainShape.h
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B2_CHAIN_SHAPE_H
+#define B2_CHAIN_SHAPE_H
+
+#include <Box2D/Collision/Shapes/b2Shape.h>
+
+class b2EdgeShape;
+
+/// A chain shape is a free form sequence of line segments.
+/// The chain has two-sided collision, so you can use inside and outside collision.
+/// Therefore, you may use any winding order.
+/// Since there may be many vertices, they are allocated using b2Alloc.
+/// Connectivity information is used to create smooth collisions.
+/// WARNING: The chain will not collide properly if there are self-intersections.
+class b2ChainShape : public b2Shape
+{
+public:
+ b2ChainShape();
+
+ /// The destructor frees the vertices using b2Free.
+ ~b2ChainShape();
+
+ /// Create a loop. This automatically adjusts connectivity.
+ /// @param vertices an array of vertices, these are copied
+ /// @param count the vertex count
+ void CreateLoop(const b2Vec2* vertices, int32 count);
+
+ /// Create a chain with isolated end vertices.
+ /// @param vertices an array of vertices, these are copied
+ /// @param count the vertex count
+ void CreateChain(const b2Vec2* vertices, int32 count);
+
+ /// Establish connectivity to a vertex that precedes the first vertex.
+ /// Don't call this for loops.
+ void SetPrevVertex(const b2Vec2& prevVertex);
+
+ /// Establish connectivity to a vertex that follows the last vertex.
+ /// Don't call this for loops.
+ void SetNextVertex(const b2Vec2& nextVertex);
+
+ /// Implement b2Shape. Vertices are cloned using b2Alloc.
+ b2Shape* Clone(b2BlockAllocator* allocator) const;
+
+ /// @see b2Shape::GetChildCount
+ int32 GetChildCount() const;
+
+ /// Get a child edge.
+ void GetChildEdge(b2EdgeShape* edge, int32 index) const;
+
+ /// This always return false.
+ /// @see b2Shape::TestPoint
+ bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
+
+ /// Implement b2Shape.
+ bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeAABB
+ void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
+
+ /// Chains have zero mass.
+ /// @see b2Shape::ComputeMass
+ void ComputeMass(b2MassData* massData, float32 density) const;
+
+ /// The vertices. Owned by this class.
+ b2Vec2* m_vertices;
+
+ /// The vertex count.
+ int32 m_count;
+
+ b2Vec2 m_prevVertex, m_nextVertex;
+ bool m_hasPrevVertex, m_hasNextVertex;
+};
+
+inline b2ChainShape::b2ChainShape()
+{
+ m_type = e_chain;
+ m_radius = b2_polygonRadius;
+ m_vertices = NULL;
+ m_count = 0;
+ m_hasPrevVertex = NULL;
+ m_hasNextVertex = NULL;
+}
+
+#endif
View
100 Box2D/Collision/Shapes/b2CircleShape.cpp
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <Box2D/Collision/Shapes/b2CircleShape.h>
+#include <new>
+using namespace std;
+
+b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const
+{
+ void* mem = allocator->Allocate(sizeof(b2CircleShape));
+ b2CircleShape* clone = new (mem) b2CircleShape;
+ *clone = *this;
+ return clone;
+}
+
+int32 b2CircleShape::GetChildCount() const
+{
+ return 1;
+}
+
+bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const
+{
+ b2Vec2 center = transform.p + b2Mul(transform.q, m_p);
+ b2Vec2 d = p - center;
+ return b2Dot(d, d) <= m_radius * m_radius;
+}
+
+// Collision Detection in Interactive 3D Environments by Gino van den Bergen
+// From Section 3.1.2
+// x = s + a * r
+// norm(x) = radius
+bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& transform, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ b2Vec2 position = transform.p + b2Mul(transform.q, m_p);
+ b2Vec2 s = input.p1 - position;
+ float32 b = b2Dot(s, s) - m_radius * m_radius;
+
+ // Solve quadratic equation.
+ b2Vec2 r = input.p2 - input.p1;
+ float32 c = b2Dot(s, r);
+ float32 rr = b2Dot(r, r);
+ float32 sigma = c * c - rr * b;
+
+ // Check for negative discriminant and short segment.
+ if (sigma < 0.0f || rr < b2_epsilon)
+ {
+ return false;
+ }
+
+ // Find the point of intersection of the line with the circle.
+ float32 a = -(c + b2Sqrt(sigma));
+
+ // Is the intersection point on the segment?
+ if (0.0f <= a && a <= input.maxFraction * rr)
+ {
+ a /= rr;
+ output->fraction = a;
+ output->normal = s + a * r;
+ output->normal.Normalize();
+ return true;
+ }
+
+ return false;
+}
+
+void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ b2Vec2 p = transform.p + b2Mul(transform.q, m_p);
+ aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius);
+ aabb->upperBound.Set(p.x + m_radius, p.y + m_radius);
+}
+
+void b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const
+{
+ massData->mass = density * b2_pi * m_radius * m_radius;
+ massData->center = m_p;
+
+ // inertia about the local origin
+ massData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p));
+}
View
91 Box2D/Collision/Shapes/b2CircleShape.h
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B2_CIRCLE_SHAPE_H
+#define B2_CIRCLE_SHAPE_H
+
+#include <Box2D/Collision/Shapes/b2Shape.h>
+
+/// A circle shape.
+class b2CircleShape : public b2Shape
+{
+public:
+ b2CircleShape();
+
+ /// Implement b2Shape.
+ b2Shape* Clone(b2BlockAllocator* allocator) const;
+
+ /// @see b2Shape::GetChildCount
+ int32 GetChildCount() const;
+
+ /// Implement b2Shape.
+ bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
+
+ /// Implement b2Shape.
+ bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeAABB
+ void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeMass
+ void ComputeMass(b2MassData* massData, float32 density) const;
+
+ /// Get the supporting vertex index in the given direction.
+ int32 GetSupport(const b2Vec2& d) const;
+
+ /// Get the supporting vertex in the given direction.
+ const b2Vec2& GetSupportVertex(const b2Vec2& d) const;
+
+ /// Get the vertex count.
+ int32 GetVertexCount() const { return 1; }
+
+ /// Get a vertex by index. Used by b2Distance.
+ const b2Vec2& GetVertex(int32 index) const;
+
+ /// Position
+ b2Vec2 m_p;
+};
+
+inline b2CircleShape::b2CircleShape()
+{
+ m_type = e_circle;
+ m_radius = 0.0f;
+ m_p.SetZero();
+}
+
+inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const
+{
+ B2_NOT_USED(d);
+ return 0;
+}
+
+inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const
+{
+ B2_NOT_USED(d);
+ return m_p;
+}
+
+inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const
+{
+ B2_NOT_USED(index);
+ b2Assert(index == 0);
+ return m_p;
+}
+
+#endif
View
139 Box2D/Collision/Shapes/b2EdgeShape.cpp
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <Box2D/Collision/Shapes/b2EdgeShape.h>
+#include <new>
+using namespace std;
+
+void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)
+{
+ m_vertex1 = v1;
+ m_vertex2 = v2;
+ m_hasVertex0 = false;
+ m_hasVertex3 = false;
+}
+
+b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const
+{
+ void* mem = allocator->Allocate(sizeof(b2EdgeShape));
+ b2EdgeShape* clone = new (mem) b2EdgeShape;
+ *clone = *this;
+ return clone;
+}
+
+int32 b2EdgeShape::GetChildCount() const
+{
+ return 1;
+}
+
+bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const
+{
+ B2_NOT_USED(xf);
+ B2_NOT_USED(p);
+ return false;
+}
+
+// p = p1 + t * d
+// v = v1 + s * e
+// p1 + t * d = v1 + s * e
+// s * e - t * d = p1 - v1
+bool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& xf, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ // Put the ray into the edge's frame of reference.
+ b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p);
+ b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p);
+ b2Vec2 d = p2 - p1;
+
+ b2Vec2 v1 = m_vertex1;
+ b2Vec2 v2 = m_vertex2;
+ b2Vec2 e = v2 - v1;
+ b2Vec2 normal(e.y, -e.x);
+ normal.Normalize();
+
+ // q = p1 + t * d
+ // dot(normal, q - v1) = 0
+ // dot(normal, p1 - v1) + t * dot(normal, d) = 0
+ float32 numerator = b2Dot(normal, v1 - p1);
+ float32 denominator = b2Dot(normal, d);
+
+ if (denominator == 0.0f)
+ {
+ return false;
+ }
+
+ float32 t = numerator / denominator;
+ if (t < 0.0f || input.maxFraction < t)
+ {
+ return false;
+ }
+
+ b2Vec2 q = p1 + t * d;
+
+ // q = v1 + s * r
+ // s = dot(q - v1, r) / dot(r, r)
+ b2Vec2 r = v2 - v1;
+ float32 rr = b2Dot(r, r);
+ if (rr == 0.0f)
+ {
+ return false;
+ }
+
+ float32 s = b2Dot(q - v1, r) / rr;
+ if (s < 0.0f || 1.0f < s)
+ {
+ return false;
+ }
+
+ output->fraction = t;
+ if (numerator > 0.0f)
+ {
+ output->normal = -normal;
+ }
+ else
+ {
+ output->normal = normal;
+ }
+ return true;
+}
+
+void b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ b2Vec2 v1 = b2Mul(xf, m_vertex1);
+ b2Vec2 v2 = b2Mul(xf, m_vertex2);
+
+ b2Vec2 lower = b2Min(v1, v2);
+ b2Vec2 upper = b2Max(v1, v2);
+
+ b2Vec2 r(m_radius, m_radius);
+ aabb->lowerBound = lower - r;
+ aabb->upperBound = upper + r;
+}
+
+void b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const
+{
+ B2_NOT_USED(density);
+
+ massData->mass = 0.0f;
+ massData->center = 0.5f * (m_vertex1 + m_vertex2);
+ massData->I = 0.0f;
+}
View
74 Box2D/Collision/Shapes/b2EdgeShape.h
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B2_EDGE_SHAPE_H
+#define B2_EDGE_SHAPE_H
+
+#include <Box2D/Collision/Shapes/b2Shape.h>
+
+/// A line segment (edge) shape. These can be connected in chains or loops
+/// to other edge shapes. The connectivity information is used to ensure
+/// correct contact normals.
+class b2EdgeShape : public b2Shape
+{
+public:
+ b2EdgeShape();
+
+ /// Set this as an isolated edge.
+ void Set(const b2Vec2& v1, const b2Vec2& v2);
+
+ /// Implement b2Shape.
+ b2Shape* Clone(b2BlockAllocator* allocator) const;
+
+ /// @see b2Shape::GetChildCount
+ int32 GetChildCount() const;
+
+ /// @see b2Shape::TestPoint
+ bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
+
+ /// Implement b2Shape.
+ bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeAABB
+ void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeMass
+ void ComputeMass(b2MassData* massData, float32 density) const;
+
+ /// These are the edge vertices
+ b2Vec2 m_vertex1, m_vertex2;
+
+ /// Optional adjacent vertices. These are used for smooth collision.
+ b2Vec2 m_vertex0, m_vertex3;
+ bool m_hasVertex0, m_hasVertex3;
+};
+
+inline b2EdgeShape::b2EdgeShape()
+{
+ m_type = e_edge;
+ m_radius = b2_polygonRadius;
+ m_vertex0.x = 0.0f;
+ m_vertex0.y = 0.0f;
+ m_vertex3.x = 0.0f;
+ m_vertex3.y = 0.0f;
+ m_hasVertex0 = false;
+ m_hasVertex3 = false;
+}
+
+#endif
View
361 Box2D/Collision/Shapes/b2PolygonShape.cpp
@@ -0,0 +1,361 @@
+/*
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <Box2D/Collision/Shapes/b2PolygonShape.h>
+#include <new>
+
+b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
+{
+ void* mem = allocator->Allocate(sizeof(b2PolygonShape));
+ b2PolygonShape* clone = new (mem) b2PolygonShape;
+ *clone = *this;
+ return clone;
+}
+
+void b2PolygonShape::SetAsBox(float32 hx, float32 hy)
+{
+ m_vertexCount = 4;
+ m_vertices[0].Set(-hx, -hy);
+ m_vertices[1].Set( hx, -hy);
+ m_vertices[2].Set( hx, hy);
+ m_vertices[3].Set(-hx, hy);
+ m_normals[0].Set(0.0f, -1.0f);
+ m_normals[1].Set(1.0f, 0.0f);
+ m_normals[2].Set(0.0f, 1.0f);
+ m_normals[3].Set(-1.0f, 0.0f);
+ m_centroid.SetZero();
+}
+
+void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle)
+{
+ m_vertexCount = 4;
+ m_vertices[0].Set(-hx, -hy);
+ m_vertices[1].Set( hx, -hy);
+ m_vertices[2].Set( hx, hy);
+ m_vertices[3].Set(-hx, hy);
+ m_normals[0].Set(0.0f, -1.0f);
+ m_normals[1].Set(1.0f, 0.0f);
+ m_normals[2].Set(0.0f, 1.0f);
+ m_normals[3].Set(-1.0f, 0.0f);
+ m_centroid = center;
+
+ b2Transform xf;
+ xf.p = center;
+ xf.q.Set(angle);
+
+ // Transform vertices and normals.
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ m_vertices[i] = b2Mul(xf, m_vertices[i]);
+ m_normals[i] = b2Mul(xf.q, m_normals[i]);
+ }
+}
+
+int32 b2PolygonShape::GetChildCount() const
+{
+ return 1;
+}
+
+static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count)
+{
+ b2Assert(count >= 3);
+
+ b2Vec2 c; c.Set(0.0f, 0.0f);
+ float32 area = 0.0f;
+
+ // pRef is the reference point for forming triangles.
+ // It's location doesn't change the result (except for rounding error).
+ b2Vec2 pRef(0.0f, 0.0f);
+#if 0
+ // This code would put the reference point inside the polygon.
+ for (int32 i = 0; i < count; ++i)
+ {
+ pRef += vs[i];
+ }
+ pRef *= 1.0f / count;
+#endif
+
+ const float32 inv3 = 1.0f / 3.0f;
+
+ for (int32 i = 0; i < count; ++i)
+ {
+ // Triangle vertices.
+ b2Vec2 p1 = pRef;
+ b2Vec2 p2 = vs[i];
+ b2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0];
+
+ b2Vec2 e1 = p2 - p1;
+ b2Vec2 e2 = p3 - p1;
+
+ float32 D = b2Cross(e1, e2);
+
+ float32 triangleArea = 0.5f * D;
+ area += triangleArea;
+
+ // Area weighted centroid
+ c += triangleArea * inv3 * (p1 + p2 + p3);
+ }
+
+ // Centroid
+ b2Assert(area > b2_epsilon);
+ c *= 1.0f / area;
+ return c;
+}
+
+void b2PolygonShape::Set(const b2Vec2* vertices, int32 count)
+{
+ b2Assert(3 <= count && count <= b2_maxPolygonVertices);
+ m_vertexCount = count;
+
+ // Copy vertices.
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ m_vertices[i] = vertices[i];
+ }
+
+ // Compute normals. Ensure the edges have non-zero length.
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ int32 i1 = i;
+ int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0;
+ b2Vec2 edge = m_vertices[i2] - m_vertices[i1];
+ b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon);
+ m_normals[i] = b2Cross(edge, 1.0f);
+ m_normals[i].Normalize();
+ }
+
+#ifdef _DEBUG
+ // Ensure the polygon is convex and the interior
+ // is to the left of each edge.
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ int32 i1 = i;
+ int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0;
+ b2Vec2 edge = m_vertices[i2] - m_vertices[i1];
+
+ for (int32 j = 0; j < m_vertexCount; ++j)
+ {
+ // Don't check vertices on the current edge.
+ if (j == i1 || j == i2)
+ {
+ continue;
+ }
+
+ b2Vec2 r = m_vertices[j] - m_vertices[i1];
+
+ // If this crashes, your polygon is non-convex, has colinear edges,
+ // or the winding order is wrong.
+ float32 s = b2Cross(edge, r);
+ b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order");
+ }
+ }
+#endif
+
+ // Compute the polygon centroid.
+ m_centroid = ComputeCentroid(m_vertices, m_vertexCount);
+}
+
+bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const
+{
+ b2Vec2 pLocal = b2MulT(xf.q, p - xf.p);
+
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]);
+ if (dot > 0.0f)
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& xf, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ // Put the ray into the polygon's frame of reference.
+ b2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p);
+ b2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p);
+ b2Vec2 d = p2 - p1;
+
+ float32 lower = 0.0f, upper = input.maxFraction;
+
+ int32 index = -1;
+
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ // p = p1 + a * d
+ // dot(normal, p - v) = 0
+ // dot(normal, p1 - v) + a * dot(normal, d) = 0
+ float32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1);
+ float32 denominator = b2Dot(m_normals[i], d);
+
+ if (denominator == 0.0f)
+ {
+ if (numerator < 0.0f)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // Note: we want this predicate without division:
+ // lower < numerator / denominator, where denominator < 0
+ // Since denominator < 0, we have to flip the inequality:
+ // lower < numerator / denominator <==> denominator * lower > numerator.
+ if (denominator < 0.0f && numerator < lower * denominator)
+ {
+ // Increase lower.
+ // The segment enters this half-space.
+ lower = numerator / denominator;
+ index = i;
+ }
+ else if (denominator > 0.0f && numerator < upper * denominator)
+ {
+ // Decrease upper.
+ // The segment exits this half-space.
+ upper = numerator / denominator;
+ }
+ }
+
+ // The use of epsilon here causes the assert on lower to trip
+ // in some cases. Apparently the use of epsilon was to make edge
+ // shapes work, but now those are handled separately.
+ //if (upper < lower - b2_epsilon)
+ if (upper < lower)
+ {
+ return false;
+ }
+ }
+
+ b2Assert(0.0f <= lower && lower <= input.maxFraction);
+
+ if (index >= 0)
+ {
+ output->fraction = lower;
+ output->normal = b2Mul(xf.q, m_normals[index]);
+ return true;
+ }
+
+ return false;
+}
+
+void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const
+{
+ B2_NOT_USED(childIndex);
+
+ b2Vec2 lower = b2Mul(xf, m_vertices[0]);
+ b2Vec2 upper = lower;
+
+ for (int32 i = 1; i < m_vertexCount; ++i)
+ {
+ b2Vec2 v = b2Mul(xf, m_vertices[i]);
+ lower = b2Min(lower, v);
+ upper = b2Max(upper, v);
+ }
+
+ b2Vec2 r(m_radius, m_radius);
+ aabb->lowerBound = lower - r;
+ aabb->upperBound = upper + r;
+}
+
+void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const
+{
+ // Polygon mass, centroid, and inertia.
+ // Let rho be the polygon density in mass per unit area.
+ // Then:
+ // mass = rho * int(dA)
+ // centroid.x = (1/mass) * rho * int(x * dA)
+ // centroid.y = (1/mass) * rho * int(y * dA)
+ // I = rho * int((x*x + y*y) * dA)
+ //
+ // We can compute these integrals by summing all the integrals
+ // for each triangle of the polygon. To evaluate the integral
+ // for a single triangle, we make a change of variables to
+ // the (u,v) coordinates of the triangle:
+ // x = x0 + e1x * u + e2x * v
+ // y = y0 + e1y * u + e2y * v
+ // where 0 <= u && 0 <= v && u + v <= 1.
+ //
+ // We integrate u from [0,1-v] and then v from [0,1].
+ // We also need to use the Jacobian of the transformation:
+ // D = cross(e1, e2)
+ //
+ // Simplification: triangle centroid = (1/3) * (p1 + p2 + p3)
+ //
+ // The rest of the derivation is handled by computer algebra.
+
+ b2Assert(m_vertexCount >= 3);
+
+ b2Vec2 center; center.Set(0.0f, 0.0f);
+ float32 area = 0.0f;
+ float32 I = 0.0f;
+
+ // s is the reference point for forming triangles.
+ // It's location doesn't change the result (except for rounding error).
+ b2Vec2 s(0.0f, 0.0f);
+
+ // This code would put the reference point inside the polygon.
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ s += m_vertices[i];
+ }
+ s *= 1.0f / m_vertexCount;
+
+ const float32 k_inv3 = 1.0f / 3.0f;
+
+ for (int32 i = 0; i < m_vertexCount; ++i)
+ {
+ // Triangle vertices.
+ b2Vec2 e1 = m_vertices[i] - s;
+ b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s;
+
+ float32 D = b2Cross(e1, e2);
+
+ float32 triangleArea = 0.5f * D;
+ area += triangleArea;
+
+ // Area weighted centroid
+ center += triangleArea * k_inv3 * (e1 + e2);
+
+ float32 ex1 = e1.x, ey1 = e1.y;
+ float32 ex2 = e2.x, ey2 = e2.y;
+
+ float32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2;
+ float32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2;
+
+ I += (0.25f * k_inv3 * D) * (intx2 + inty2);
+ }
+
+ // Total mass
+ massData->mass = density * area;
+
+ // Center of mass
+ b2Assert(area > b2_epsilon);
+ center *= 1.0f / area;
+ massData->center = center + s;
+
+ // Inertia tensor relative to the local origin (point s).
+ massData->I = density * I;
+
+ // Shift to center of mass then to original body origin.
+ massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center));
+}
View
95 Box2D/Collision/Shapes/b2PolygonShape.h
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B2_POLYGON_SHAPE_H
+#define B2_POLYGON_SHAPE_H
+
+#include <Box2D/Collision/Shapes/b2Shape.h>
+
+/// A convex polygon. It is assumed that the interior of the polygon is to
+/// the left of each edge.
+/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices.
+/// In most cases you should not need many vertices for a convex polygon.
+class b2PolygonShape : public b2Shape
+{
+public:
+ b2PolygonShape();
+
+ /// Implement b2Shape.
+ b2Shape* Clone(b2BlockAllocator* allocator) const;
+
+ /// @see b2Shape::GetChildCount
+ int32 GetChildCount() const;
+
+ /// Copy vertices. This assumes the vertices define a convex polygon.
+ /// It is assumed that the exterior is the the right of each edge.
+ /// The count must be in the range [3, b2_maxPolygonVertices].
+ void Set(const b2Vec2* vertices, int32 vertexCount);
+
+ /// Build vertices to represent an axis-aligned box.
+ /// @param hx the half-width.
+ /// @param hy the half-height.
+ void SetAsBox(float32 hx, float32 hy);
+
+ /// Build vertices to represent an oriented box.
+ /// @param hx the half-width.
+ /// @param hy the half-height.
+ /// @param center the center of the box in local coordinates.
+ /// @param angle the rotation of the box in local coordinates.
+ void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle);
+
+ /// @see b2Shape::TestPoint
+ bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
+
+ /// Implement b2Shape.
+ bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
+ const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeAABB
+ void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
+
+ /// @see b2Shape::ComputeMass
+ void ComputeMass(b2MassData* massData, float32 density) const;
+
+ /// Get the vertex count.
+ int32 GetVertexCount() const { return m_vertexCount; }
+
+ /// Get a vertex by index.
+ const b2Vec2& GetVertex(int32 index) const;
+
+ b2Vec2 m_centroid;
+ b2Vec2 m_vertices[b2_maxPolygonVertices];
+ b2Vec2 m_normals[b2_maxPolygonVertices];
+ int32 m_vertexCount;
+};
+
+inline b2PolygonShape::b2PolygonShape()
+{
+ m_type = e_polygon;
+ m_radius = b2_polygonRadius;
+ m_vertexCount = 0;
+ m_centroid.SetZero();
+}
+
+inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const
+{
+ b2Assert(0 <= index && index < m_vertexCount);
+ return m_vertices[index];
+}
+
+#endif
View
101 Box2D/Collision/Shapes/b2Shape.h
@@ -0,0 +1,101