readme.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
  7. <title></title>
  8. <style type="text/css">
  9. /*
  10. :Author: David Goodger ([email protected])
  11. :Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
  12. :Copyright: This stylesheet has been placed in the public domain.
  13. Default cascading style sheet for the HTML output of Docutils.
  14. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
  15. customize this style sheet.
  16. */
  17. /* used to remove borders from tables and images */
  18. .borderless, table.borderless td, table.borderless th {
  19. border: 0 }
  20. table.borderless td, table.borderless th {
  21. /* Override padding for "table.docutils td" with "! important".
  22. The right padding separates the table cells. */
  23. padding: 0 0.5em 0 0 ! important }
  24. .first {
  25. /* Override more specific margin styles with "! important". */
  26. margin-top: 0 ! important }
  27. .last, .with-subtitle {
  28. margin-bottom: 0 ! important }
  29. .hidden {
  30. display: none }
  31. a.toc-backref {
  32. text-decoration: none ;
  33. color: black }
  34. blockquote.epigraph {
  35. margin: 2em 5em ; }
  36. dl.docutils dd {
  37. margin-bottom: 0.5em }
  38. /* Uncomment (and remove this text!) to get bold-faced definition list terms
  39. dl.docutils dt {
  40. font-weight: bold }
  41. */
  42. div.abstract {
  43. margin: 2em 5em }
  44. div.abstract p.topic-title {
  45. font-weight: bold ;
  46. text-align: center }
  47. div.admonition, div.attention, div.caution, div.danger, div.error,
  48. div.hint, div.important, div.note, div.tip, div.warning {
  49. margin: 2em ;
  50. border: medium outset ;
  51. padding: 1em }
  52. div.admonition p.admonition-title, div.hint p.admonition-title,
  53. div.important p.admonition-title, div.note p.admonition-title,
  54. div.tip p.admonition-title {
  55. font-weight: bold ;
  56. font-family: sans-serif }
  57. div.attention p.admonition-title, div.caution p.admonition-title,
  58. div.danger p.admonition-title, div.error p.admonition-title,
  59. div.warning p.admonition-title {
  60. color: red ;
  61. font-weight: bold ;
  62. font-family: sans-serif }
  63. /* Uncomment (and remove this text!) to get reduced vertical space in
  64. compound paragraphs.
  65. div.compound .compound-first, div.compound .compound-middle {
  66. margin-bottom: 0.5em }
  67. div.compound .compound-last, div.compound .compound-middle {
  68. margin-top: 0.5em }
  69. */
  70. div.dedication {
  71. margin: 2em 5em ;
  72. text-align: center ;
  73. font-style: italic }
  74. div.dedication p.topic-title {
  75. font-weight: bold ;
  76. font-style: normal }
  77. div.figure {
  78. margin-left: 2em ;
  79. margin-right: 2em }
  80. div.footer, div.header {
  81. clear: both;
  82. font-size: smaller }
  83. div.line-block {
  84. display: block ;
  85. margin-top: 1em ;
  86. margin-bottom: 1em }
  87. div.line-block div.line-block {
  88. margin-top: 0 ;
  89. margin-bottom: 0 ;
  90. margin-left: 1.5em }
  91. div.sidebar {
  92. margin: 0 0 0.5em 1em ;
  93. border: medium outset ;
  94. padding: 1em ;
  95. background-color: #ffffee ;
  96. width: 40% ;
  97. float: right ;
  98. clear: right }
  99. div.sidebar p.rubric {
  100. font-family: sans-serif ;
  101. font-size: medium }
  102. div.system-messages {
  103. margin: 5em }
  104. div.system-messages h1 {
  105. color: red }
  106. div.system-message {
  107. border: medium outset ;
  108. padding: 1em }
  109. div.system-message p.system-message-title {
  110. color: red ;
  111. font-weight: bold }
  112. div.topic {
  113. margin: 2em }
  114. h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
  115. h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  116. margin-top: 0.4em }
  117. h1.title {
  118. text-align: center }
  119. h2.subtitle {
  120. text-align: center }
  121. hr.docutils {
  122. width: 75% }
  123. img.align-left {
  124. clear: left }
  125. img.align-right {
  126. clear: right }
  127. ol.simple, ul.simple {
  128. margin-bottom: 1em }
  129. ol.arabic {
  130. list-style: decimal }
  131. ol.loweralpha {
  132. list-style: lower-alpha }
  133. ol.upperalpha {
  134. list-style: upper-alpha }
  135. ol.lowerroman {
  136. list-style: lower-roman }
  137. ol.upperroman {
  138. list-style: upper-roman }
  139. p.attribution {
  140. text-align: right ;
  141. margin-left: 50% }
  142. p.caption {
  143. font-style: italic }
  144. p.credits {
  145. font-style: italic ;
  146. font-size: smaller }
  147. p.label {
  148. white-space: nowrap }
  149. p.rubric {
  150. font-weight: bold ;
  151. font-size: larger ;
  152. color: maroon ;
  153. text-align: center }
  154. p.sidebar-title {
  155. font-family: sans-serif ;
  156. font-weight: bold ;
  157. font-size: larger }
  158. p.sidebar-subtitle {
  159. font-family: sans-serif ;
  160. font-weight: bold }
  161. p.topic-title {
  162. font-weight: bold }
  163. pre.address {
  164. margin-bottom: 0 ;
  165. margin-top: 0 ;
  166. font-family: serif ;
  167. font-size: 100% }
  168. pre.literal-block, pre.doctest-block {
  169. margin-left: 2em ;
  170. margin-right: 2em }
  171. span.classifier {
  172. font-family: sans-serif ;
  173. font-style: oblique }
  174. span.classifier-delimiter {
  175. font-family: sans-serif ;
  176. font-weight: bold }
  177. span.interpreted {
  178. font-family: sans-serif }
  179. span.option {
  180. white-space: nowrap }
  181. span.pre {
  182. white-space: pre }
  183. span.problematic {
  184. color: red }
  185. span.section-subtitle {
  186. /* font-size relative to parent (h1..h6 element) */
  187. font-size: 80% }
  188. table.citation {
  189. border-left: solid 1px gray;
  190. margin-left: 1px }
  191. table.docinfo {
  192. margin: 2em 4em }
  193. table.docutils {
  194. margin-top: 0.5em ;
  195. margin-bottom: 0.5em }
  196. table.footnote {
  197. border-left: solid 1px black;
  198. margin-left: 1px }
  199. table.docutils td, table.docutils th,
  200. table.docinfo td, table.docinfo th {
  201. padding-left: 0.5em ;
  202. padding-right: 0.5em ;
  203. vertical-align: top }
  204. table.docutils th.field-name, table.docinfo th.docinfo-name {
  205. font-weight: bold ;
  206. text-align: left ;
  207. white-space: nowrap ;
  208. padding-left: 0 }
  209. h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
  210. h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  211. font-size: 100% }
  212. ul.auto-toc {
  213. list-style-type: none }
  214. </style>
  215. </head>
  216. <body>
  217. <div class="document">
  218. <p><strong>AnKi 3D Engine</strong></p>
  219. <p>Copyright (C) 2009, 2010 Panagiotis Christopoulos-Charitos</p>
  220. <p><a class="reference external" href="http://www.ancient-ritual.com">http://www.ancient-ritual.com</a>
  221. <a class="reference external" href="mailto:godlike&#64;ancient-ritual.com">godlike&#64;ancient-ritual.com</a></p>
  222. <div class="contents topic" id="table-of-contents">
  223. <p class="topic-title first">Table of Contents</p>
  224. <ul class="simple">
  225. <li><a class="reference internal" href="#building" id="id1">Building</a><ul>
  226. <li><a class="reference internal" href="#required-libraries" id="id2">Required libraries</a><ul>
  227. <li><a class="reference internal" href="#bullet-physics-library" id="id3">Bullet Physics Library</a></li>
  228. <li><a class="reference internal" href="#sdl-ver-1-3" id="id4">SDL ver 1.3</a></li>
  229. <li><a class="reference internal" href="#glew" id="id5">GLEW</a></li>
  230. </ul>
  231. </li>
  232. <li><a class="reference internal" href="#generating-makefiles-and-building-anki" id="id6">Generating makefiles and building AnKi</a></li>
  233. </ul>
  234. </li>
  235. <li><a class="reference internal" href="#generating-source-documentation-doxygen" id="id7">Generating source documentation (doxygen)</a></li>
  236. <li><a class="reference internal" href="#assets" id="id8">Assets</a></li>
  237. <li><a class="reference internal" href="#coding-style" id="id9">Coding style</a><ul>
  238. <li><a class="reference internal" href="#classes" id="id10">Classes</a></li>
  239. <li><a class="reference internal" href="#material-shader-program-naming" id="id11">Material shader program naming</a></li>
  240. <li><a class="reference internal" href="#naming-shortcuts" id="id12">Naming shortcuts</a></li>
  241. <li><a class="reference internal" href="#controllers" id="id13">Controllers</a></li>
  242. <li><a class="reference internal" href="#submitting-patches" id="id14">Submitting patches</a></li>
  243. </ul>
  244. </li>
  245. <li><a class="reference internal" href="#todo-list" id="id15">ToDo list</a></li>
  246. </ul>
  247. </div>
  248. <div class="section" id="building">
  249. <h1><a class="toc-backref" href="#id1">Building</a></h1>
  250. <p>AnKi build system is very Linux specific (GNU make only) at the moment. It
  251. also requires a few extra development libraries. You can also find a custom
  252. build system that generates GNU makefiles.</p>
  253. <div class="section" id="required-libraries">
  254. <h2><a class="toc-backref" href="#id2">Required libraries</a></h2>
  255. <p>AnKi requires a few up to date versions of some libraries. The libraries are:</p>
  256. <ul class="simple">
  257. <li>Bullet Physics</li>
  258. <li>SDL ver 1.3</li>
  259. <li>GLEW</li>
  260. </ul>
  261. <p>So before generating makefiles or building AnKi you have to download from their
  262. repositories and build the above libraries. Instructions follow. You can
  263. alternately use the script download-and-build-externals.sh</p>
  264. <div class="section" id="bullet-physics-library">
  265. <h3><a class="toc-backref" href="#id3">Bullet Physics Library</a></h3>
  266. <p>From now on the AnKi requires the Bullet physics library. You need CMake and
  267. SVN installed.</p>
  268. <ol class="arabic simple">
  269. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  270. <li>$ cd ..</li>
  271. <li>$ svn checkout <a class="reference external" href="http://bullet.googlecode.com/svn/trunk/">http://bullet.googlecode.com/svn/trunk/</a> bullet_svn</li>
  272. <li>$ cd bullet_svn</li>
  273. <li>$ cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release</li>
  274. <li>$ make</li>
  275. </ol>
  276. </div>
  277. <div class="section" id="sdl-ver-1-3">
  278. <h3><a class="toc-backref" href="#id4">SDL ver 1.3</a></h3>
  279. <p>We need SDL ver 1.3 for creating OpenGL 3.x context. You need to have the
  280. Mercurial and autoconf installed.</p>
  281. <ol class="arabic simple">
  282. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  283. <li>$ cd ..</li>
  284. <li>$ hg clone <a class="reference external" href="http://hg.libsdl.org/SDL">http://hg.libsdl.org/SDL</a> SDL-hg</li>
  285. <li>$ cd SDL-hg</li>
  286. <li>$ ./autogen.sh</li>
  287. <li>$ ./configure</li>
  288. <li>$ make</li>
  289. </ol>
  290. </div>
  291. <div class="section" id="glew">
  292. <h3><a class="toc-backref" href="#id5">GLEW</a></h3>
  293. <p>The latest GLEW provides us with OpenGL 3 and 4 extensions. Needs SVN and a
  294. Unix environment (for step 5).</p>
  295. <ol class="arabic simple">
  296. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  297. <li>$ cd ..</li>
  298. <li>$ svn co <a class="reference external" href="https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew">https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew</a> glew</li>
  299. <li>$ cd glew</li>
  300. <li>$ make extensions</li>
  301. <li>$ make</li>
  302. </ol>
  303. </div>
  304. </div>
  305. <div class="section" id="generating-makefiles-and-building-anki">
  306. <h2><a class="toc-backref" href="#id6">Generating makefiles and building AnKi</a></h2>
  307. <p>There are 4 build targets in this folder. There is also a build system that
  308. generates GNU makefiles (it requires Python 3 installed). If you want to
  309. generate the makefile for the debug target (for example) do the following:</p>
  310. <ol class="arabic simple">
  311. <li>$ cd &lt;path to anki&gt;/build/debug</li>
  312. <li>$ ../genmakefile.py</li>
  313. <li>$ make</li>
  314. </ol>
  315. <p>And the build process will begin.</p>
  316. <p>The gen.cfg.py files contain the build options of every target. Their format
  317. is pretty straightforward and minimal.</p>
  318. <p><strong>WARNING</strong>: Sometimes I forget to update all the targets. The debug is always
  319. updated though.</p>
  320. </div>
  321. </div>
  322. <div class="section" id="generating-source-documentation-doxygen">
  323. <h1><a class="toc-backref" href="#id7">Generating source documentation (doxygen)</a></h1>
  324. <p>The AnKi source code uses doxygen style comments inside the source. To generate
  325. the html documentation from a terminal do:</p>
  326. <ol class="arabic simple">
  327. <li>$ cd docs</li>
  328. <li>$ doxygen doxyfile</li>
  329. </ol>
  330. <p>Then open doxygen.html to see it.</p>
  331. </div>
  332. <div class="section" id="assets">
  333. <h1><a class="toc-backref" href="#id8">Assets</a></h1>
  334. <p>Currently there are no assets (models, textures, materials etc) so even if you
  335. build it, the application will fail to run.</p>
  336. </div>
  337. <div class="section" id="coding-style">
  338. <h1><a class="toc-backref" href="#id9">Coding style</a></h1>
  339. <p>Some things to remember while coding AnKi.</p>
  340. <div class="section" id="classes">
  341. <h2><a class="toc-backref" href="#id10">Classes</a></h2>
  342. <p>class</p>
  343. <p>{</p>
  344. <blockquote>
  345. <p>friends</p>
  346. <p>pre-nested (if necessary)</p>
  347. <p>nested</p>
  348. <p>properties</p>
  349. <p>public</p>
  350. <p>protected</p>
  351. <p>private</p>
  352. </blockquote>
  353. <p>}</p>
  354. </div>
  355. <div class="section" id="material-shader-program-naming">
  356. <h2><a class="toc-backref" href="#id11">Material shader program naming</a></h2>
  357. <p>dnspgke:</p>
  358. <ul class="simple">
  359. <li>diffuse mapping</li>
  360. <li>normal mapping</li>
  361. <li>specular mapping</li>
  362. <li>parallax mapping</li>
  363. <li>grass like</li>
  364. <li>hardware skinning</li>
  365. <li>environment mapping</li>
  366. </ul>
  367. </div>
  368. <div class="section" id="naming-shortcuts">
  369. <h2><a class="toc-backref" href="#id12">Naming shortcuts</a></h2>
  370. <p>This list contains some of the naming shortcuts we use in AnKi:</p>
  371. <ul class="simple">
  372. <li>Array : arr</li>
  373. <li>Animation : anim</li>
  374. <li>Application : app</li>
  375. <li>Buffer : buff</li>
  376. <li>Camera : cam</li>
  377. <li>Color : col</li>
  378. <li>Controller : ctrl</li>
  379. <li>Feature : feat</li>
  380. <li>Fragment : frag</li>
  381. <li>Framebuffer Attachable Image : fai</li>
  382. <li>Geometry : geom</li>
  383. <li>Location : loc</li>
  384. <li>Material : mtl</li>
  385. <li>Matrix : mat</li>
  386. <li>Number : num</li>
  387. <li>Physics : phy</li>
  388. <li>Property : prop</li>
  389. <li>Quadrilateral : quad</li>
  390. <li>Quaternion : quat</li>
  391. <li>Resource : rsrc</li>
  392. <li>Rotation : rot</li>
  393. <li>Shader : shdr</li>
  394. <li>Shader Program : shaderProg or sProg</li>
  395. <li>Skeletal Animation : sAnim</li>
  396. <li>Skeleton : skel</li>
  397. <li>Text : txt</li>
  398. <li>Texture : tex</li>
  399. <li>Transformation : trf</li>
  400. <li>Translation : tsl</li>
  401. <li>Triangle : tri</li>
  402. <li>Utility : util</li>
  403. <li>Variable : var</li>
  404. <li>Vector : vec</li>
  405. <li>Vertex : vert</li>
  406. </ul>
  407. </div>
  408. <div class="section" id="controllers">
  409. <h2><a class="toc-backref" href="#id13">Controllers</a></h2>
  410. <p>The controllers are part of the scene node objects. They control the node's
  411. behaviour.</p>
  412. <p>They have an input (script, animation, etc) and they control a scene node. The
  413. naming convention of the controllers is:</p>
  414. <p>&lt;what the controller controls&gt;&lt;the input of the contoller&gt;Ctrl</p>
  415. <p>For Example:</p>
  416. <p>MeshSkelNodeCtrl A Mesh is controlled by a SkelNode</p>
  417. </div>
  418. <div class="section" id="submitting-patches">
  419. <h2><a class="toc-backref" href="#id14">Submitting patches</a></h2>
  420. <p>If you want to update/patch a file (for example Main.cpp) do:</p>
  421. <ul class="simple">
  422. <li>Make the changes on that file</li>
  423. <li>Save the differences in a file using &quot;svn diff Main.cpp &gt; /tmp/diff&quot;</li>
  424. <li>E-mail the &quot;diff&quot; file with subject &quot;[PATCH] Main.cpp updates&quot;</li>
  425. </ul>
  426. </div>
  427. </div>
  428. <div class="section" id="todo-list">
  429. <h1><a class="toc-backref" href="#id15">ToDo list</a></h1>
  430. <ul>
  431. <li><p class="first">Continue working on the new coding style in shaders</p>
  432. </li>
  433. <li><p class="first">Changes in the blending objects problem. The BS will become one stage and the
  434. PPS will be divided in two steps. The first will apply the SSAO and the EdgeAA
  435. in the IS_FAI and the second will do the rest</p>
  436. </li>
  437. <li><p class="first">The second Physics demo: Create a box that is geting moved by the user. It has
  438. to interact with the other boxes</p>
  439. </li>
  440. <li><p class="first">Set the gravity of a certain body to a lower value and see how it behaves</p>
  441. </li>
  442. <li><p class="first">In the Ragdoll bullet demo try to change the distances of the bodies</p>
  443. </li>
  444. <li><dl class="first docutils">
  445. <dt>Ask in the bullet forum:</dt>
  446. <dd><ul class="first last simple">
  447. <li>How to make floating particles like smoke. But first try with one body and
  448. manualy setting the gravity</li>
  449. <li>What the btCollisionObject::setActivationState takes as parameter?</li>
  450. </ul>
  451. </dd>
  452. </dl>
  453. </li>
  454. </ul>
  455. </div>
  456. </div>
  457. </body>
  458. </html>