Permalink
Browse files

Import from previous repository

  • Loading branch information...
0 parents commit a920475217d6baace6cadbea4bbc61efd8857edc @starbugs committed Apr 15, 2012
Showing with 49,055 additions and 0 deletions.
  1. +51 −0 3rd-party/kazmath/include/kazmath/GL/mat4stack.h
  2. +58 −0 3rd-party/kazmath/include/kazmath/GL/matrix.h
  3. +53 −0 3rd-party/kazmath/include/kazmath/aabb.h
  4. +39 −0 3rd-party/kazmath/include/kazmath/kazmath.h
  5. +75 −0 3rd-party/kazmath/include/kazmath/mat3.h
  6. +93 −0 3rd-party/kazmath/include/kazmath/mat4.h
  7. +41 −0 3rd-party/kazmath/include/kazmath/neon_matrix_impl.h
  8. +70 −0 3rd-party/kazmath/include/kazmath/plane.h
  9. +113 −0 3rd-party/kazmath/include/kazmath/quaternion.h
  10. +50 −0 3rd-party/kazmath/include/kazmath/ray2.h
  11. +74 −0 3rd-party/kazmath/include/kazmath/utility.h
  12. +64 −0 3rd-party/kazmath/include/kazmath/vec2.h
  13. +68 −0 3rd-party/kazmath/include/kazmath/vec3.h
  14. +68 −0 3rd-party/kazmath/include/kazmath/vec4.h
  15. +14 −0 3rd-party/kazmath/src/CMakeLists.txt
  16. +738 −0 3rd-party/kazmath/src/ChangeLog
  17. +74 −0 3rd-party/kazmath/src/GL/mat4stack.c
  18. +191 −0 3rd-party/kazmath/src/GL/matrix.c
  19. +63 −0 3rd-party/kazmath/src/aabb.c
  20. +372 −0 3rd-party/kazmath/src/mat3.c
  21. +789 −0 3rd-party/kazmath/src/mat4.c
  22. +97 −0 3rd-party/kazmath/src/neon_matrix_impl.c
  23. +188 −0 3rd-party/kazmath/src/plane.c
  24. +582 −0 3rd-party/kazmath/src/quaternion.c
  25. +184 −0 3rd-party/kazmath/src/ray2.c
  26. +59 −0 3rd-party/kazmath/src/utility.c
  27. +118 −0 3rd-party/kazmath/src/vec2.c
  28. +310 −0 3rd-party/kazmath/src/vec3.c
  29. +154 −0 3rd-party/kazmath/src/vec4.c
  30. +98 −0 3rd-party/kazmath_neon.patch
  31. +1,841 −0 Doxyfile
  32. +33 −0 LICENSE_Kazmath.txt
  33. +23 −0 LICENSE_cocos2d.txt
  34. +21 −0 LICENSE_icedcoffee.txt
  35. +56 −0 README.md
  36. BIN artwork/gradient.psd
  37. +188 −0 doxygen/templates/DoxygenLayout.xml
  38. +954 −0 doxygen/templates/customdoxygen.css
  39. +16 −0 doxygen/templates/footer.html
  40. +29 −0 doxygen/templates/header.html
  41. +695 −0 icedcoffee-ios.xcodeproj/project.pbxproj
  42. +57 −0 icedcoffee-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/icedcoffee-ios.xcscheme
  43. +22 −0 icedcoffee-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/xcschememanagement.plist
  44. +676 −0 icedcoffee-mac.xcodeproj/project.pbxproj
  45. +57 −0 icedcoffee-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/icedcoffee-mac.xcscheme
  46. +22 −0 icedcoffee-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/xcschememanagement.plist
  47. +927 −0 icedcoffee-tests-ios.xcodeproj/project.pbxproj
  48. +84 −0 icedcoffee-tests-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/DepthBufferTest.xcscheme
  49. +84 −0 icedcoffee-tests-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/MultiTouchSpritesTest.xcscheme
  50. +84 −0 icedcoffee-tests-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/PickingTest.xcscheme
  51. +84 −0 ...offee-tests-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/RetinaDisplaySupportTest.xcscheme
  52. +57 −0 icedcoffee-tests-ios.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/xcschememanagement.plist
  53. +1,393 −0 icedcoffee-tests-mac.xcodeproj/project.pbxproj
  54. +7 −0 icedcoffee-tests-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  55. BIN ...ests-mac.xcodeproj/project.xcworkspace/xcuserdata/Tobi.xcuserdatad/UserInterfaceState.xcuserstate
  56. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/AlphaBlendingTest.xcscheme
  57. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/DepthBufferTest.xcscheme
  58. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/FontRenderingTest.xcscheme
  59. +51 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/KazmathTests.xcscheme
  60. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/PickingTest.xcscheme
  61. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/TextureCacheTest.xcscheme
  62. +84 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/icedcoffee-tests-mac.xcscheme
  63. +87 −0 icedcoffee-tests-mac.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/xcschememanagement.plist
  64. +10 −0 icedcoffee.xcworkspace/contents.xcworkspacedata
  65. BIN icedcoffee.xcworkspace/xcuserdata/Tobi.xcuserdatad/UserInterfaceState.xcuserstate
  66. +31 −0 icedcoffee/ICAsyncTextureCacheDelegate.h
  67. +199 −0 icedcoffee/ICCamera.h
  68. +182 −0 icedcoffee/ICCamera.m
  69. +72 −0 icedcoffee/ICCameraPointsToPixelsPerspective.h
  70. +121 −0 icedcoffee/ICCameraPointsToPixelsPerspective.m
  71. +112 −0 icedcoffee/ICConfiguration.h
  72. +158 −0 icedcoffee/ICConfiguration.m
  73. +28 −0 icedcoffee/ICEventDelegate.h
  74. +251 −0 icedcoffee/ICHostViewController.h
  75. +220 −0 icedcoffee/ICHostViewController.m
  76. +53 −0 icedcoffee/ICIdentifiable.h
  77. +31 −0 icedcoffee/ICIdentifiable.m
  78. +31 −0 icedcoffee/ICLabel.h
  79. +45 −0 icedcoffee/ICLabel.m
  80. +68 −0 icedcoffee/ICMouseEventDispatcher.h
  81. +261 −0 icedcoffee/ICMouseEventDispatcher.m
  82. +56 −0 icedcoffee/ICMouseResponder.h
  83. +614 −0 icedcoffee/ICNode.h
  84. +556 −0 icedcoffee/ICNode.m
  85. +102 −0 icedcoffee/ICNodeVisitor.h
  86. +74 −0 icedcoffee/ICNodeVisitor.m
  87. +35 −0 icedcoffee/ICNodeVisitorDrawing.h
  88. +62 −0 icedcoffee/ICNodeVisitorDrawing.m
  89. +62 −0 icedcoffee/ICNodeVisitorPicking.h
  90. +138 −0 icedcoffee/ICNodeVisitorPicking.m
  91. +157 −0 icedcoffee/ICRenderTexture.h
  92. +315 −0 icedcoffee/ICRenderTexture.m
  93. +192 −0 icedcoffee/ICResponder.h
  94. +88 −0 icedcoffee/ICResponder.m
  95. +216 −0 icedcoffee/ICScene.h
  96. +210 −0 icedcoffee/ICScene.m
  97. +27 −0 icedcoffee/ICScheduler.h
  98. +27 −0 icedcoffee/ICScheduler.m
  99. +103 −0 icedcoffee/ICShaderCache.h
  100. +130 −0 icedcoffee/ICShaderCache.m
  101. +96 −0 icedcoffee/ICShaderProgram.h
  102. +233 −0 icedcoffee/ICShaderProgram.m
  103. +111 −0 icedcoffee/ICSprite.h
  104. +272 −0 icedcoffee/ICSprite.m
  105. +245 −0 icedcoffee/ICTexture2D.h
  106. +655 −0 icedcoffee/ICTexture2D.m
  107. +72 −0 icedcoffee/ICTextureCache.h
  108. +170 −0 icedcoffee/ICTextureCache.m
  109. +31 −0 icedcoffee/ICTextureLoader.h
  110. +54 −0 icedcoffee/ICTextureLoader.m
  111. +42 −0 icedcoffee/ICTouchEventDispatcher.h
  112. +83 −0 icedcoffee/ICTouchEventDispatcher.m
  113. +37 −0 icedcoffee/ICTouchResponder.h
  114. +103 −0 icedcoffee/ICView.h
  115. +69 −0 icedcoffee/ICView.m
  116. +57 −0 icedcoffee/IcedCoffee.h
  117. +49 −0 icedcoffee/Platforms/Mac/ICGLView.h
  118. +166 −0 icedcoffee/Platforms/Mac/ICGLView.m
  119. +68 −0 icedcoffee/Platforms/Mac/ICHostViewControllerMac.h
  120. +235 −0 icedcoffee/Platforms/Mac/ICHostViewControllerMac.m
  121. +73 −0 icedcoffee/Platforms/iOS/ICES2Renderer.h
  122. +191 −0 icedcoffee/Platforms/iOS/ICES2Renderer.m
  123. +60 −0 icedcoffee/Platforms/iOS/ICESRenderer.h
  124. +148 −0 icedcoffee/Platforms/iOS/ICGLView.h
  125. +408 −0 icedcoffee/Platforms/iOS/ICGLView.m
  126. +68 −0 icedcoffee/Platforms/iOS/ICHostViewControllerIOS.h
  127. +198 −0 icedcoffee/Platforms/iOS/ICHostViewControllerIOS.m
  128. +73 −0 icedcoffee/Platforms/icGL.h
  129. +64 −0 icedcoffee/Platforms/icNS.h
  130. +27 −0 icedcoffee/icConfig.h
  131. +73 −0 icedcoffee/icDefaults.h
  132. +66 −0 icedcoffee/icGLState.h
  133. +124 −0 icedcoffee/icGLState.m
  134. +101 −0 icedcoffee/icMacros.h
  135. +105 −0 icedcoffee/icTypes.h
  136. +52 −0 icedcoffee/icUtils.h
  137. +67 −0 icedcoffee/icUtils.m
  138. +8 −0 resources-ios/icedcoffee-ios-Prefix.pch
  139. BIN resources/images/gradient-white-transparent.png
  140. BIN resources/images/iced-coffee-npot.png
  141. BIN resources/images/landscapes/061212-nordkapp.jpg
  142. BIN resources/images/landscapes/Arianit_Brod_image149.jpg
  143. BIN resources/images/landscapes/Autumn_scene_at_Woodleigh_(3_of_7).jpg
  144. BIN resources/images/landscapes/Autumn_scenery.jpg
  145. BIN resources/images/landscapes/Hunkubakka.jpg
  146. BIN resources/images/landscapes/Island1984_078.jpg
  147. +5 −0 resources/images/landscapes/LICENSE_landscapes.txt
  148. BIN resources/images/landscapes/Molisacasablanca.jpg
  149. BIN resources/images/landscapes/Serra_de_Tramuntana_express.jpg
  150. BIN resources/images/landscapes/Zwei_Baeume_IMG_5267.jpg
  151. BIN resources/images/landscapes/sundown2.jpg
  152. BIN resources/images/thiswayup.png
  153. +12 −0 resources/shaders/Picking.fsh
  154. +16 −0 resources/shaders/PositionTextureA8Color.fsh
  155. +22 −0 resources/shaders/PositionTextureA8Color.vsh
  156. +14 −0 resources/shaders/PositionTextureColor.fsh
  157. +22 −0 resources/shaders/PositionTextureColor.vsh
  158. +36 −0 tests-ios/DepthBufferTest/AppDelegate.h
  159. +150 −0 tests-ios/DepthBufferTest/AppDelegate.m
  160. +47 −0 tests-ios/DepthBufferTest/DepthBufferTest-Info.plist
  161. +14 −0 tests-ios/DepthBufferTest/DepthBufferTest-Prefix.pch
  162. +2 −0 tests-ios/DepthBufferTest/en.lproj/InfoPlist.strings
  163. +32 −0 tests-ios/DepthBufferTest/main.m
  164. +29 −0 tests-ios/MultiTouchSpritesTest/AppDelegate.h
  165. +83 −0 tests-ios/MultiTouchSpritesTest/AppDelegate.m
  166. +47 −0 tests-ios/MultiTouchSpritesTest/MultiTouchSpritesTest-Info.plist
  167. +14 −0 tests-ios/MultiTouchSpritesTest/MultiTouchSpritesTest-Prefix.pch
  168. +2 −0 tests-ios/MultiTouchSpritesTest/en.lproj/InfoPlist.strings
  169. +32 −0 tests-ios/MultiTouchSpritesTest/main.m
  170. +32 −0 tests-ios/PickingTest/AppDelegate.h
  171. +113 −0 tests-ios/PickingTest/AppDelegate.m
  172. +47 −0 tests-ios/PickingTest/PickingTest-Info.plist
  173. +14 −0 tests-ios/PickingTest/PickingTest-Prefix.pch
  174. +2 −0 tests-ios/PickingTest/en.lproj/InfoPlist.strings
  175. +32 −0 tests-ios/PickingTest/main.m
  176. +29 −0 tests-ios/RetinaDisplaySupportTest/AppDelegate.h
  177. +83 −0 tests-ios/RetinaDisplaySupportTest/AppDelegate.m
  178. +47 −0 tests-ios/RetinaDisplaySupportTest/RetinaDisplaySupportTest-Info.plist
  179. +14 −0 tests-ios/RetinaDisplaySupportTest/RetinaDisplaySupportTest-Prefix.pch
  180. +2 −0 tests-ios/RetinaDisplaySupportTest/en.lproj/InfoPlist.strings
  181. +32 −0 tests-ios/RetinaDisplaySupportTest/main.m
  182. +307 −0 tests-ios/SimplePickingTest/SimplePickingTest.xcodeproj/project.pbxproj
  183. +7 −0 tests-ios/SimplePickingTest/SimplePickingTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  184. BIN ...kingTest.xcodeproj/project.xcworkspace/xcuserdata/Tobi.xcuserdatad/UserInterfaceState.xcuserstate
  185. +98 −0 ...Test/SimplePickingTest.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/SimplePickingTest.xcscheme
  186. +22 −0 ...ngTest/SimplePickingTest.xcodeproj/xcuserdata/Tobi.xcuserdatad/xcschemes/xcschememanagement.plist
  187. +36 −0 tests-ios/SimplePickingTest/SimplePickingTest/AppDelegate.h
  188. +114 −0 tests-ios/SimplePickingTest/SimplePickingTest/AppDelegate.m
  189. +27 −0 tests-ios/SimplePickingTest/SimplePickingTest/ResponsiveSprite.h
  190. +32 −0 tests-ios/SimplePickingTest/SimplePickingTest/ResponsiveSprite.m
  191. +47 −0 tests-ios/SimplePickingTest/SimplePickingTest/SimplePickingTest-Info.plist
  192. +14 −0 tests-ios/SimplePickingTest/SimplePickingTest/SimplePickingTest-Prefix.pch
  193. +2 −0 tests-ios/SimplePickingTest/SimplePickingTest/en.lproj/InfoPlist.strings
  194. +32 −0 tests-ios/SimplePickingTest/SimplePickingTest/main.m
  195. +34 −0 tests-mac/AlphaBlendingTest/AlphaBlendingTest-Info.plist
  196. +7 −0 tests-mac/AlphaBlendingTest/AlphaBlendingTest-Prefix.pch
  197. +32 −0 tests-mac/AlphaBlendingTest/AppDelegate.h
  198. +72 −0 tests-mac/AlphaBlendingTest/AppDelegate.m
  199. +29 −0 tests-mac/AlphaBlendingTest/en.lproj/Credits.rtf
  200. +2 −0 tests-mac/AlphaBlendingTest/en.lproj/InfoPlist.strings
  201. +4,582 −0 tests-mac/AlphaBlendingTest/en.lproj/MainMenu.xib
  202. +28 −0 tests-mac/AlphaBlendingTest/main.m
  203. +36 −0 tests-mac/DepthBufferTest/AppDelegate.h
  204. +101 −0 tests-mac/DepthBufferTest/AppDelegate.m
  205. +34 −0 tests-mac/DepthBufferTest/DepthBufferTest-Info.plist
  206. +7 −0 tests-mac/DepthBufferTest/DepthBufferTest-Prefix.pch
  207. +29 −0 tests-mac/DepthBufferTest/en.lproj/Credits.rtf
  208. +2 −0 tests-mac/DepthBufferTest/en.lproj/InfoPlist.strings
  209. +4,582 −0 tests-mac/DepthBufferTest/en.lproj/MainMenu.xib
  210. +28 −0 tests-mac/DepthBufferTest/main.m
  211. +32 −0 tests-mac/FontRenderingTest/AppDelegate.h
  212. +67 −0 tests-mac/FontRenderingTest/AppDelegate.m
  213. +34 −0 tests-mac/FontRenderingTest/FontRenderingTest-Info.plist
  214. +7 −0 tests-mac/FontRenderingTest/FontRenderingTest-Prefix.pch
  215. +29 −0 tests-mac/FontRenderingTest/en.lproj/Credits.rtf
  216. +2 −0 tests-mac/FontRenderingTest/en.lproj/InfoPlist.strings
  217. +4,582 −0 tests-mac/FontRenderingTest/en.lproj/MainMenu.xib
  218. +28 −0 tests-mac/FontRenderingTest/main.m
  219. +22 −0 tests-mac/KazmathTests/KazmathTests-Info.plist
  220. +7 −0 tests-mac/KazmathTests/KazmathTests-Prefix.pch
  221. +27 −0 tests-mac/KazmathTests/KazmathTests.h
  222. +96 −0 tests-mac/KazmathTests/KazmathTests.m
  223. +2 −0 tests-mac/KazmathTests/en.lproj/InfoPlist.strings
  224. +32 −0 tests-mac/PickingTest/AppDelegate.h
  225. +111 −0 tests-mac/PickingTest/AppDelegate.m
  226. +34 −0 tests-mac/PickingTest/PickingTest-Info.plist
  227. +7 −0 tests-mac/PickingTest/PickingTest-Prefix.pch
  228. +29 −0 tests-mac/PickingTest/en.lproj/Credits.rtf
  229. +2 −0 tests-mac/PickingTest/en.lproj/InfoPlist.strings
  230. +4,582 −0 tests-mac/PickingTest/en.lproj/MainMenu.xib
  231. +28 −0 tests-mac/PickingTest/main.m
  232. +36 −0 tests-mac/TextureCacheTest/AppDelegate.h
  233. +59 −0 tests-mac/TextureCacheTest/AppDelegate.m
  234. +27 −0 tests-mac/TextureCacheTest/ImageSprite.h
  235. +38 −0 tests-mac/TextureCacheTest/ImageSprite.m
  236. +34 −0 tests-mac/TextureCacheTest/TextureCacheTest-Info.plist
  237. +7 −0 tests-mac/TextureCacheTest/TextureCacheTest-Prefix.pch
  238. +33 −0 tests-mac/TextureCacheTest/TextureCacheTestScene.h
  239. +114 −0 tests-mac/TextureCacheTest/TextureCacheTestScene.m
  240. +29 −0 tests-mac/TextureCacheTest/en.lproj/Credits.rtf
  241. +2 −0 tests-mac/TextureCacheTest/en.lproj/InfoPlist.strings
  242. +4,582 −0 tests-mac/TextureCacheTest/en.lproj/MainMenu.xib
  243. +28 −0 tests-mac/TextureCacheTest/main.m
  244. +27 −0 tests-shared-src/PickingTest/ResponsiveSprite.h
  245. +45 −0 tests-shared-src/PickingTest/ResponsiveSprite.m
  246. +27 −0 tests-shared-src/PickingTest/ResponsiveView.h
  247. +47 −0 tests-shared-src/PickingTest/ResponsiveView.m
@@ -0,0 +1,51 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef C_STACK_H_INCLUDED
+#define C_STACK_H_INCLUDED
+
+#include "../mat4.h"
+
+typedef struct km_mat4_stack {
+ int capacity; //The total item capacity
+ int item_count; //The number of items
+ kmMat4* top;
+ kmMat4* stack;
+} km_mat4_stack;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void km_mat4_stack_initialize(km_mat4_stack* stack);
+void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item);
+void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut);
+void km_mat4_stack_release(km_mat4_stack* stack);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // C_STACK_H_INCLUDED
@@ -0,0 +1,58 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef KM_GL_MATRIX_H_INCLUDED
+#define KM_GL_MATRIX_H_INCLUDED
+
+#define KM_GL_MODELVIEW 0x1700
+#define KM_GL_PROJECTION 0x1701
+#define KM_GL_TEXTURE 0x1702
+
+typedef unsigned int kmGLEnum;
+
+#include "../mat4.h"
+#include "../vec3.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void kmGLFreeAll(void);
+void kmGLPushMatrix(void);
+void kmGLPopMatrix(void);
+void kmGLMatrixMode(kmGLEnum mode);
+void kmGLLoadIdentity(void);
+void kmGLLoadMatrix(const kmMat4* pIn);
+void kmGLMultMatrix(const kmMat4* pIn);
+void kmGLTranslatef(float x, float y, float z);
+void kmGLRotatef(float angle, float x, float y, float z);
+void kmGLScalef(float x, float y, float z);
+void kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MATRIX_H_INCLUDED
@@ -0,0 +1,53 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef KAZMATH_AABB_H_INCLUDED
+#define KAZMATH_AABB_H_INCLUDED
+
+#include "vec3.h"
+#include "utility.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A struture that represents an axis-aligned
+ * bounding box.
+ */
+typedef struct kmAABB {
+ kmVec3 min; /** The max corner of the box */
+ kmVec3 max; /** The min corner of the box */
+} kmAABB;
+
+const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox);
+kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn);
+kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
@@ -0,0 +1,39 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef KAZMATH_H_INCLUDED
+#define KAZMATH_H_INCLUDED
+
+#include "vec2.h"
+#include "vec3.h"
+#include "mat3.h"
+#include "mat4.h"
+#include "utility.h"
+#include "quaternion.h"
+#include "plane.h"
+#include "aabb.h"
+#include "ray2.h"
+
+#endif // KAZMATH_H_INCLUDED
@@ -0,0 +1,75 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef MAT3_H_INCLUDED
+#define MAT3_H_INCLUDED
+
+#include "utility.h"
+
+struct kmVec3;
+struct kmQuaternion;
+
+typedef struct kmMat3{
+ kmScalar mat[9];
+} kmMat3;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+kmMat3* const kmMat3Fill(kmMat3* pOut, const kmScalar* pMat);
+kmMat3* const kmMat3Adjugate(kmMat3* pOut, const kmMat3* pIn);
+kmMat3* const kmMat3Identity(kmMat3* pOut);
+kmMat3* const kmMat3Inverse(kmMat3* pOut, const kmScalar pDeterminate, const kmMat3* pM);
+const int kmMat3IsIdentity(const kmMat3* pIn);
+kmMat3* const kmMat3Transpose(kmMat3* pOut, const kmMat3* pIn);
+const kmScalar kmMat3Determinant(const kmMat3* pIn);
+kmMat3* const kmMat3Multiply(kmMat3* pOut, const kmMat3* pM1, const kmMat3* pM2);
+kmMat3* const kmMat3ScalarMultiply(kmMat3* pOut, const kmMat3* pM, const kmScalar pFactor);
+
+kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians);
+struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn);
+
+kmMat3* const kmMat3Assign(kmMat3* pOut, const kmMat3* pIn);
+const int kmMat3AreEqual(const kmMat3* pM1, const kmMat3* pM2);
+
+kmMat3* const kmMat3RotationX(kmMat3* pOut, const kmScalar radians);
+kmMat3* const kmMat3RotationY(kmMat3* pOut, const kmScalar radians);
+kmMat3* const kmMat3RotationZ(kmMat3* pOut, const kmScalar radians);
+
+kmMat3* const kmMat3Rotation(kmMat3* pOut, const kmScalar radians);
+kmMat3* const kmMat3Scaling(kmMat3* pOut, const kmScalar x, const kmScalar y);
+kmMat3* const kmMat3Translation(kmMat3* pOut, const kmScalar x, const kmScalar y);
+
+kmMat3* const kmMat3RotationQuaternion(kmMat3* pOut, const struct kmQuaternion* pIn);
+kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians);
+struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // MAT3_H_INCLUDED
+
@@ -0,0 +1,93 @@
+/*
+Copyright (c) 2008, Luke Benstead.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MAT4_H_INCLUDED
+#define MAT4_H_INCLUDED
+
+#include "utility.h"
+
+struct kmVec3;
+struct kmMat3;
+struct kmQuaternion;
+struct kmPlane;
+
+/*
+A 4x4 matrix
+
+ | 0 4 8 12 |
+mat = | 1 5 9 13 |
+ | 2 6 10 14 |
+ | 3 7 11 15 |
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct kmMat4 {
+ kmScalar mat[16];
+} kmMat4;
+
+kmMat4* const kmMat4Fill(kmMat4* pOut, const kmScalar* pMat);
+
+
+kmMat4* const kmMat4Identity(kmMat4* pOut);
+
+kmMat4* const kmMat4Inverse(kmMat4* pOut, const kmMat4* pM);
+
+
+const int kmMat4IsIdentity(const kmMat4* pIn);
+
+kmMat4* const kmMat4Transpose(kmMat4* pOut, const kmMat4* pIn);
+kmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2);
+
+kmMat4* const kmMat4Assign(kmMat4* pOut, const kmMat4* pIn);
+const int kmMat4AreEqual(const kmMat4* pM1, const kmMat4* pM2);
+
+kmMat4* const kmMat4RotationX(kmMat4* pOut, const kmScalar radians);
+kmMat4* const kmMat4RotationY(kmMat4* pOut, const kmScalar radians);
+kmMat4* const kmMat4RotationZ(kmMat4* pOut, const kmScalar radians);
+kmMat4* const kmMat4RotationPitchYawRoll(kmMat4* pOut, const kmScalar pitch, const kmScalar yaw, const kmScalar roll);
+kmMat4* const kmMat4RotationQuaternion(kmMat4* pOut, const struct kmQuaternion* pQ);
+kmMat4* const kmMat4RotationTranslation(kmMat4* pOut, const struct kmMat3* rotation, const struct kmVec3* translation);
+kmMat4* const kmMat4Scaling(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z);
+kmMat4* const kmMat4Translation(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z);
+
+struct kmVec3* const kmMat4GetUpVec3(struct kmVec3* pOut, const kmMat4* pIn);
+struct kmVec3* const kmMat4GetRightVec3(struct kmVec3* pOut, const kmMat4* pIn);
+struct kmVec3* const kmMat4GetForwardVec3(struct kmVec3* pOut, const kmMat4* pIn);
+
+kmMat4* const kmMat4PerspectiveProjection(kmMat4* pOut, kmScalar fovY, kmScalar aspect, kmScalar zNear, kmScalar zFar);
+kmMat4* const kmMat4OrthographicProjection(kmMat4* pOut, kmScalar left, kmScalar right, kmScalar bottom, kmScalar top, kmScalar nearVal, kmScalar farVal);
+kmMat4* const kmMat4LookAt(kmMat4* pOut, const struct kmVec3* pEye, const struct kmVec3* pCenter, const struct kmVec3* pUp);
+
+kmMat4* const kmMat4RotationAxisAngle(kmMat4* pOut, const struct kmVec3* axis, kmScalar radians);
+struct kmMat3* const kmMat4ExtractRotation(struct kmMat3* pOut, const kmMat4* pIn);
+struct kmPlane* const kmMat4ExtractPlane(struct kmPlane* pOut, const kmMat4* pIn, const kmEnum plane);
+struct kmVec3* const kmMat4RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat4* pIn);
+#ifdef __cplusplus
+}
+#endif
+#endif /* MAT4_H_INCLUDED */
Oops, something went wrong.

0 comments on commit a920475

Please sign in to comment.