AnKi 3D Engine

Copyright (C) 2009, 2010 Panagiotis Christopoulos-Charitos

http://www.ancient-ritual.com godlike@ancient-ritual.com

Table of Contents

Building

AnKi build system is very Linux specific (GNU make only) at the moment. It also requires a few extra development libraries. You can also find a custom build system that generates GNU makefiles.

Required libraries

AnKi requires a few up to date versions of some libraries. The libraries are:

  • Bullet Physics
  • SDL ver 1.3
  • GLEW

So before generating makefiles or building AnKi you have to download from their repositories and build the above libraries. Instructions follow. You can alternately use the script download-and-build-externals.sh

Bullet Physics Library

From now on the AnKi requires the Bullet physics library. You need CMake and SVN installed.

  1. $ Go to the root AnKi path (where src, shaders and blenderscripts are)
  2. $ cd ..
  3. $ svn checkout http://bullet.googlecode.com/svn/trunk/ bullet_svn
  4. $ cd bullet_svn
  5. $ cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
  6. $ make

SDL ver 1.3

We need SDL ver 1.3 for creating OpenGL 3.x context. You need to have the Mercurial and autoconf installed.

  1. $ Go to the root AnKi path (where src, shaders and blenderscripts are)
  2. $ cd ..
  3. $ hg clone http://hg.libsdl.org/SDL SDL-hg
  4. $ cd SDL-hg
  5. $ ./autogen.sh
  6. $ ./configure
  7. $ make

GLEW

The latest GLEW provides us with OpenGL 3 and 4 extensions. Needs SVN and a Unix environment (for step 5).

  1. $ Go to the root AnKi path (where src, shaders and blenderscripts are)
  2. $ cd ..
  3. $ svn co https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew glew
  4. $ cd glew
  5. $ make extensions
  6. $ make

Generating makefiles and building AnKi

There are 4 build targets in this folder. There is also a build system that generates GNU makefiles (it requires Python 3 installed). If you want to generate the makefile for the debug target (for example) do the following:

  1. $ cd <path to anki>/build/debug
  2. $ ../genmakefile.py
  3. $ make

And the build process will begin.

The gen.cfg.py files contain the build options of every target. Their format is pretty straightforward and minimal.

WARNING: Sometimes I forget to update all the targets. The debug is always updated though.

Generating source documentation (doxygen)

The AnKi source code uses doxygen style comments inside the source. To generate the html documentation from a terminal do:

  1. $ cd docs
  2. $ doxygen doxyfile

Then open doxygen.html to see it.

Assets

Currently there are no assets (models, textures, materials etc) so even if you build it, the application will fail to run.

Coding style

Some things to remember while coding AnKi.

Classes

class

{

friends

pre-nested (if necessary)

nested

properties

public

protected

private

}

Material shader program naming

dnspgke:

  • diffuse mapping
  • normal mapping
  • specular mapping
  • parallax mapping
  • grass like
  • hardware skinning
  • environment mapping

Naming shortcuts

This list contains some of the naming shortcuts we use in AnKi:

  • Array : arr
  • Animation : anim
  • Application : app
  • Buffer : buff
  • Camera : cam
  • Color : col
  • Controller : ctrl
  • Feature : feat
  • Fragment : frag
  • Framebuffer Attachable Image : fai
  • Geometry : geom
  • Location : loc
  • Material : mtl
  • Matrix : mat
  • Number : num
  • Physics : phy
  • Property : prop
  • Quadrilateral : quad
  • Quaternion : quat
  • Resource : rsrc
  • Rotation : rot
  • Shader : shdr
  • Shader Program : shaderProg or sProg
  • Skeletal Animation : sAnim
  • Skeleton : skel
  • Text : txt
  • Texture : tex
  • Transformation : trf
  • Translation : tsl
  • Triangle : tri
  • Utility : util
  • Variable : var
  • Vector : vec
  • Vertex : vert

Controllers

The controllers are part of the scene node objects. They control the node's behaviour.

They have an input (script, animation, etc) and they control a scene node. The naming convention of the controllers is:

<what the controller controls><the input of the contoller>Ctrl

For Example:

MeshSkelNodeCtrl A Mesh is controlled by a SkelNode

Submitting patches

If you want to update/patch a file (for example Main.cpp) do:

  • Make the changes on that file
  • Save the differences in a file using "svn diff Main.cpp > /tmp/diff"
  • E-mail the "diff" file with subject "[PATCH] Main.cpp updates"

ToDo list