Commits

Alberto Torres committed 7be9185 Draft

A lot of changes:

Added:
* Ray.xray, NegativeRay.
* GameObject vector/quat properties.
* Setters for GameObject.*_world.
* Colored tracebacks.
* More documented methods.
* ManualSensor, a sensor that is triggered by code, useful for replacing
sensors, but I may remove it in the future if I come with a better way of
doing this.
* Separate files for Camera, Entity objects.

Changed string and math types to match the names in gamekit
(gkScalar, gkString, gkVector3, etc).

Updated to cython 0.16.

Small fixes.

Comments (0)

Files changed (36)

     animation.pxd
     animation.pxi
     blendfile.pxi
+    camera.pxd
+    camera.pxi
     collision.pxd
     collision.pxi
     controller.pxi
     input.pxi
     mathutils.pxd
     mathutils.pyx
+    mesh.pxd
+    mesh.pxi
     prerequisites.pxd
     pywrap.pxd
     pywrap.pxi
     standalone.py
 )
 
-include(FindPythonInterp)
+#include(FindPythonInterp)
 #include(FindPythonLibs)
 
 # set(Py_DEBUG CACHE BOOL 0)
 #add_dependencies(gamekit.cpp gamekit.pyx)
 
 # Compile the extension
-if (PYGAMEKIT_AS_MODULES)
+if (PYGAMEKIT_AS_MODULES OR OGREKIT_BUILD_ANDROID)
     add_library(cython_gamekit MODULE gamekit.cpp ${PYGAMEKIT_SRC})
     # Build mathutils as a separate module instead
     add_library(cython_mathutils MODULE mathutils.cpp ${PYGAMEKIT_SRC})
 if (OGREKIT_BUILD_ANDROID)
   target_link_libraries(cython_gamekit log)
 endif()
-include_directories(${PYTHON_INCLUDE_PATH} ${OGREKIT_INCLUDE} ${CMAKE_CURRENT_BINARY_DIR} .)
-
+include_directories(
+    ${PYTHON_INCLUDE_PATH}
+    ${OGREKIT_INCLUDE}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    .
+)
     cdef cppclass gkAnimation:
         pass
     cdef cppclass gkAnimationPlayer:
-        Real         getTimePosition()
-        Real         getWeight()
+        gkScalar     getTimePosition()
+        gkScalar     getWeight()
         int          getMode()
-        Real         getSpeedFactor()
-        Real         getLength()
+        gkScalar     getSpeedFactor()
+        gkScalar     getLength()
 
         void         setMode(int v)
         void         setAnimation(gkAnimation* v)
-        void         setSpeedFactor(Real v)
+        void         setSpeedFactor(gkScalar v)
 
         void         enable(bool v)
         bool         isEnabled()
         bool         isDone()
 
-        void setBlendFrames(Real v)
-        void setTimePosition(Real v)
-        void setWeight(Real w)
+        void setBlendFrames(gkScalar v)
+        void setTimePosition(gkScalar v)
+        void setWeight(gkScalar w)
 
-        void evaluate(Real tick)
+        void evaluate(gkScalar tick)
         void reset()
         
         gkGameObject* getObject()
 cdef class Animation(pywrap):
     
     cdef gkGameObject *ob
-    cdef public Real blend_time
+    cdef public gkScalar blend_time
     cdef public int priority
     
     def play(self):
     def __getitem__(self,item):
         cdef Animation a
         cdef gkAnimationPlayer *ap
-        ap = (<gkGameObject*>self._p).getAnimationPlayer(to_stdstring(item))
+        ap = (<gkGameObject*>self._p).getAnimationPlayer(gkString(item))
         if ap==NULL:
-            ap = (<gkGameObject*>self._p).addAnimation(to_stdstring(item))
+            ap = (<gkGameObject*>self._p).addAnimation(gkString(item))
             if ap==NULL:
                 return None
         a = Animation().P(ap)
 
 
 cdef extern from "gkUtils.h":
-    std_string gkUtils_getFile "gkUtils::getFile"(const_std_string&)
+    gkString gkUtils_getFile "gkUtils::getFile"(gkString&)
     
 cdef extern from "Loaders/Blender2/gkBlendFile.h":
     cdef cppclass gkBlendFile:
     
 cdef extern from "Loaders/Blender2/gkBlendLoader.h":
     #cdef cppclass gkBlendLoader:
-    #    gkBlendFile* loadFile(const_std_string&, int, const_std_string&, const_std_string&)
+    #    gkBlendFile* loadFile(gkString&, int, gkString&, gkString&)
         
     #glBlendLoader gkBlendLoaderGS "gkBlendLoader::getSingleton"()
     # TODO: report this bug
     
-    cdef gkBlendFile* loadFile "gkBlendLoader::getSingleton().loadFile"(const_std_string&, int, const_std_string&, const_std_string&)
+    cdef gkBlendFile* loadFile "gkBlendLoader::getSingleton().loadFile"(gkString&, int, gkString&, gkString&)
         
 
 ONLY_ACTIVE_SCENE        = 1 << 0   # Load only the active scene found.
 
     def load(self, filename, options = ONLY_ACTIVE_SCENE, scene = "", group = "", seek = 0):
         
-        self.bfile = loadFile(gkUtils_getFile(to_stdstring(filename)), options, to_stdstring(scene), to_stdstring(group))
+        self.bfile = loadFile(gkUtils_getFile(gkString(filename)), options, gkString(scene), gkString(group))
 
 
 
+
+from prerequisites cimport *
+
+from gkmath cimport *
+
+cdef extern from "OgreCamera.h":
+    cppclass Ogre_Camera "Ogre::Camera":
+        void setFarClipDistance(gkScalar)
+
+cdef extern from "gkCamera.h":
+    cdef cppclass gkCamera:
+
+        gkCameraProperties& getCameraProperties()
+
+        void setClip(gkScalar start, gkScalar end)
+        void setFov(gkRadian& fov)
+        void setFov(gkDegree& fov)
+        void setOrthoScale(gkScalar& scale)
+        void setMainCamera(bool v)
+        void makeCurrent()
+        void setProjType(gkCameraProperties_Type type)
+
+        Ogre_Camera* getCamera()
+        gkScalar& getClipStart()
+        gkScalar& getClipEnd()
+        gkScalar& getFov()
+        gkScalar& getOrthoScale()
+        bool isMainCamera()
+        gkCameraProperties_Type getProjType()
+
+    cdef cppclass gkCameraProperties:
+        gkScalar m_clipstart
+        gkScalar m_clipend
+        gkScalar m_fov
+        gkScalar m_orthoscale
+        bool     m_start
+        int      m_type
+
+    cdef enum gkCameraProperties_Type:
+        CA_PERSPECTIVE
+        CA_ORTHOGRAPHIC
+
+
+# The camera class will have everything related to the camera and the render
+# target (it may be RenderWindow or a texture).
+
+from camera cimport *
+
+cdef class Camera(GameObject):
+    
+    pass
+
 
-cimport gkmath
+from gkmath cimport *
 from prerequisites cimport *
 from gameobject cimport *
 
 cdef extern from "Physics/gkRayTest.h":
     
     cdef cppclass gkRay:
-        gkRay(gkmath.Vector3, gkmath.Vector3)
+        gkRay(gkVector3, gkVector3)
         
     cdef cppclass gkRayTest:
         bool collides(gkRay&)
-        gkmath.Vector3& getHitPoint()
-        gkmath.Vector3& getHitNormal()
+        bool collides(gkVector3, gkVector3, gkRayTestFilter)
+        gkVector3& getHitPoint()
+        gkVector3& getHitNormal()
         btCollisionObject* getCollisionObject()
         gkGameObject* getObject()
-        Real getHitFraction()
+        gkScalar getHitFraction()
 
+    cdef cppclass gkRayTestFilter "gkRayTest::gkRayTestFilter":
+        gkRayTestFilter()
+    
+    cdef cppclass notMeFilter(gkRayTestFilter):
+        notMeFilter(gkGameObject *self)
+
+    cdef cppclass xrayFilter(gkRayTestFilter):
+        xrayFilter(gkGameObject *self, gkString& prop, gkString& material)
+        
 cdef extern from "btBulletDynamicsCommon.h":
     
     cdef cppclass btManifoldPoint
         #gkContactInfo::Iterator  getContactIterator()
         
         bool collidesWith(gkGameObject* ob, gkContactInfo* cpy) #cpy = 0
-        bool collidesWith(const_std_string& name, gkContactInfo* cpy, bool emptyFilter)#emptyFilter = true
+        bool collidesWith(gkString& name, gkContactInfo* cpy, bool emptyFilter)#emptyFilter = true
 
         # Sensor tests,
         # If prop is empty and material is empty, return any old collision.
         # If onlyActor is true, filter collision on actor settings (gkGameObjectProperties).
         # If testAllMaterials is true, test all assigned opposed to only testing the first assigned.
-        bool sensorCollides(const_std_string& prop, const_std_string& material, bool onlyActor, bool testAllMaterials)
-        bool sensorCollides(const_std_string& prop, const_std_string& material, bool onlyActor, bool testAllMaterials, gkGameObjectArray*)
+        bool sensorCollides(gkString& prop, gkString& material, bool onlyActor, bool testAllMaterials)
+        bool sensorCollides(gkString& prop, gkString& material, bool onlyActor, bool testAllMaterials, gkGameObjectArray*)
         #sensorTest is below as a stand-alone function
 
         # cast functions also below
     gkPhysicsController* gkPhysicsController_castController "gkPhysicsController::castController"(void* colObj)
     gkGameObject* gkPhysicsController_castObject "gkPhysicsController::castObject"(btCollisionObject* colObj)
 
-    bool gkPhysicsController_sensorTest "gkPhysicsController::sensorTest"(gkGameObject* ob, const_std_string& prop, const_std_string& material, 
+    bool gkPhysicsController_sensorTest "gkPhysicsController::sensorTest"(gkGameObject* ob, gkString& prop, gkString& material, 
                         bool onlyActor, bool testAllMaterials)
-
-#TODO: function for getting the appropiate python object from a gkGameObject pointer, instead of elifs everywhere
 
 
 from gameobject cimport *
 from collision cimport *
-cimport gkmath
+from gkmath cimport *
 
 cdef list collision_callbacks = []
 
 
+
 cdef class Collision(Sensor):
     
     cdef gkPhysicsController *pc
-    cdef std_string *prop
+    cdef gkString *prop
     cdef gkGameObjectArray *objlist
     
     def __init__(self, prop):
         del self.prop
-        self.prop = new std_string(prop)
+        self.prop = new gkString(prop)
         self.init_sensor([])
         
     def __dealloc__(self):
         
     cdef bool _test(self):
         if self.pc!=NULL:
-            return self.pc.sensorCollides(self.prop[0], to_stdstring(""), False, False, self.objlist)
+            return self.pc.sensorCollides(self.prop[0], gkString(""), False, False, self.objlist)
             
     property hit_objects:
         
 cdef class Ray(Collision):
     
     cdef gkRayTest *test
-    cdef gkmath.Vector3 *ray_to
+    cdef gkVector3 *ray_to
     cdef gkGameObject *obj_to
     cdef public bool only_actors
     cdef public bool xray
         
     def __init__(self, prop, ray_to = None):
         del self.prop
-        self.prop = new std_string(prop)
+        self.prop = new gkString(prop)
         self.init_sensor([])
         if isinstance(ray_to, GameObject):
             self.obj_to = <gkGameObject*>(<GameObject>ray_to)._p
         elif ray_to is not None:
-            self.ray_to = new gkmath.Vector3(ray_to[0], ray_to[1], ray_to[2])
+            self.ray_to = new gkVector3(ray_to[0], ray_to[1], ray_to[2])
         
     cdef bool _test(self):
-        cdef gkmath.Vector3 ray_from, ray_to
+        cdef gkVector3 ray_from, ray_to
         cdef gkGameObject *obj, *hit
+        cdef bool result
         
         if self.owner is not None:
             obj = <gkGameObject*>self.owner._p
             
             if self.obj_to:
                 ray_to = self.obj_to.getWorldPosition()
-                ray_to.isub(ray_from)
             else:
                 if self.ray_to==NULL:
-                    self.ray_to = new gkmath.Vector3(0,0,obj.getWorldScale().z)
+                    self.ray_to = new gkVector3(0,0,obj.getWorldScale().z)
                 ray_to = obj.getWorldOrientation().mul(self.ray_to[0])
+                ray_to.iadd(ray_from)
             
-            if self.test.collides(gkRay(ray_from, ray_to)):
-                hit = gkPhysicsController_castObject(self.test.getCollisionObject())
-                if hit and hit != obj:
-                    return gkPhysicsController_sensorTest(hit, self.prop[0], to_stdstring(""), self.only_actors, False)
-                
-        return False
+            if self.xray:
+                result = self.test.collides(ray_from, ray_to,
+                                            xrayFilter(obj, self.prop[0], gkString("")))
+            else:
+                result = self.test.collides(ray_from, ray_to, notMeFilter(obj))
+                if result:
+                    hit = gkPhysicsController_castObject(self.test.getCollisionObject())
+                    if hit:
+                        result = result and gkPhysicsController_sensorTest(
+                            hit, self.prop[0], gkString(""), self.only_actors, False)
+                            
+            return result                            
+        return False
+        
+        
+cdef bool prop_filter(btCollisionObject *ob, void *data):
+    return gkPhysicsController_castObject(ob).hasVariable((<gkString *>data)[0])
+        
+        
+cdef class NegativeRay(Ray):
+    
+    cdef bool _test(self):
+        return not Ray._test(self)
+        
+        
 
 class Controller(object):
     
-    def __init__(self, function, _instance = None):
+    def __init__(self, function, _klass = None, _instance = None):
         self.f = function
+        self.fname = getattr(function, '__name__', '')  # lambdas don't have a name
         self.calling_sensor = None
         self.sensors = []
         self.actuators = []
+        
+        # For instanced classes
+        self.klass = _klass
         self.instance = _instance
         
     def __get__(self, instance, klass):
         # This allows the controller to decorate a method,
         # which at the time of the decoration is still unbound.
         # http://wiki.python.org/moin/PythonDecoratorLibrary#Class_method_decorator_using_instance
-        if instance is not None and not self.instance:
-            for k,v in klass.__dict__.iteritems():
-                if v==self: break
-            r = instance.__dict__[k] = Controller(self.f, instance) # Return an instance of myself
+        
+        if instance is not None and self.instance is None:
+            
+            name = self.fname
+            
+            # Assign to the instance an instance of myself
+            # and return it
+            r = instance.__dict__[name] = Controller(self.f, klass, instance)
             return r
+        
+        ## Update function if class changed its type
+        #if self.klass is not klass:
+            #self.klass = klass
+            #f = self.f
+            #self.f = getattr(klass, f.__name__, f)  #infinite recursion?
+            
         return self
         
     def __call__(self, *args):
+            
         if self.instance is not None:
-            ret = self.f(self.instance, *self.sensors)
+            # Get the real method every time
+            # (for mutable classes)
+            f = getattr(self.instance.__class__, self.fname)
+            ret = f(self.instance, *self.sensors)
+        elif self.sensors:
+            ret = self.f(*self.sensors)
         else:
-            ret = self.f(*self.sensors)
+            ret = self.f(*args)
         for a in self.actuators:
             a(ret)
         
                 n.link(self)
             else:
                 self.actuators.append(n)
-    
-        
+
+    #def _update_instance(self, instance):
+        #self.instance = instance
             
 
-import sys, imp, traceback
+import sys, imp
+
+#import traceback
+
+from scene cimport *
 
 cdef extern from "gkLogger.h":
     #cdef cppclass gkLogger:
-    void gkLogger_enable "gkLogger::enable"(const_std_string&, bool verbose)
+    void gkLogger_enable "gkLogger::enable"(gkString&, bool verbose)
     void gkLogger_disable "gkLogger::disable"()
-    void gkLogger_write "gkLogger::write"(const_std_string& msg, bool force = 0)
+    void gkLogger_write "gkLogger::write"(gkString& msg, bool force = 0)
     
     void gkPrintf(char *fmt, ...)
     int GK_CPP_VERBOSE_LOG
     
 cdef extern from "gkUserDefs.h":
     cdef cppclass gkUserDefs:
-        void load(const_std_string& fname)
-        void parseString(const_std_string& key, const_std_string& val)
+        void load(gkString& fname)
+        void parseString(gkString& key, gkString& val)
 
 
         OgreRenderSystem        rendersystem       # Ogre render system to use
-        std_string              viewportOrientation# portrait, landscaperight, landscapeleft
+        gkString                viewportOrientation# portrait, landscaperight, landscapeleft
         int                     sceneManager       # TODO scene manager to use
-        std_string              log                # Main log file name
+        gkString                log                # Main log file name
         bool                    verbose            # Enable/Disable Ogre print-out
-        gkmath.Vector2          winsize            # Window width & height
-        std_string              wintitle           # Window title
-        std_string              extWinhandle       # External Window Handle
+        gkVector2          winsize            # Window width & height
+        gkString                wintitle           # Window title
+        gkString                extWinhandle       # External Window Handle
         bool                    fullscreen         # Fullscreen mode
         int                     framingType        # crop/letterbox/extend. Used when window is larger then requested
-        std_string              resources          # resources to load
+        gkString                resources          # resources to load
         bool                    blendermat         # convert meshes using blender materials
         bool                    grabInput          # hide & grab the mouse
         bool                    debugFps           # show fps and profiling information
         bool                    enableshadows
         int                     defaultMipMap      # Number of mipmaps to generate per texture (default 5)
 
-        std_string                shadowtechnique
-        #gkColor                 colourshadow
-        # Real                 fardistanceshadow
+        gkString                shadowtechnique
+        gkColor                 colourshadow
+        gkScalar                fardistanceshadow
 
-        #static OgreRenderSystem getOgreRenderSystem(const_std_string& val)
-        int getViewportFramingType(const_std_string& val)
+        OgreRenderSystem getOgreRenderSystem(gkString& val)
+        int getViewportFramingType(gkString& val)
         
 cdef extern from "gkEngine.h":
     
         gkUserDefs& getUserDefs()
         void requestExit()
 
-        void loadResources(const_std_string& name)
+        void loadResources(gkString& name)
 
         #void addDebugProperty(gkVariable* prop)
         #void removeDebugProperty(gkVariable* prop)
 
-        Real getStepRate()
-        Real getTickRate()
+        gkScalar getStepRate()
+        gkScalar getTickRate()
 
         gkScene* getActiveScene()
 
 
 cdef extern from "gkTextFile.h":
     cdef cppclass gkTextFile:
-        std_string& getText()
+        gkString& getText()
 
 cdef extern from "gkTextManager.h":
-    void* gkTextManager_getByName "gkTextManager::getSingleton().getByName"(const_std_string&)
-    bool gkTextManager_exists "gkTextManager::getSingleton().exists"(const_std_string&)
+    void* gkTextManager_getByName "gkTextManager::getSingleton().getByName"(gkString&)
+    bool gkTextManager_exists "gkTextManager::getSingleton().exists"(gkString&)
 
 #----------------------------------------------------------------------------
 # Globals
         
         if initialize:
             if cfgfile:
-                prefs.load(to_stdstring(cfgfile))
+                prefs.load(gkString(cfgfile))
                 
             self.eng = new gkEngine(prefs)
             self.eng.initialize()
             self.timer.reset()
             
             initialized = True
-            currentEngine = self
+            current_engine = self
             
     def __del__(self):
         self.eng.requestExit()
             return Scene().P(self.eng.getActiveScene())
 
     def _step_one_frame(self):
-        try:
-            evaluate_all_callbacks()
-        except SystemExit:
-            return False
-        except:
-            traceback.print_exc()
+        #try:
+        evaluate_all_callbacks()
+        #except SystemExit:
+            #return False
+        #except:
+            #traceback.print_exc()
         return self.eng.stepOneFrame()
     
     def load_blend(self, bfile, seek=0):
     def find_module(self, module_name, package_path):
         if package_path: return
         module_name += '.py'
-        if initialized and gkTextManager_exists(to_stdstring(module_name)):
+        if initialized and gkTextManager_exists(gkString(module_name)):
             return self
             
     def load_module(self, module_name):
         mod = imp.new_module(module_name)
         sys.modules[module_name] = mod
         module_name += '.py'
-        code = str((<gkTextFile*>gkTextManager_getByName(to_stdstring(module_name))).getText().c_str())
+        code = str((<gkTextFile*>gkTextManager_getByName(gkString(module_name))).getText().c_str())
         exec code in mod.__dict__
         return mod
 
 del TextBlockImporter
 
 def has_text_block(name):
-    if initialized: return gkTextManager_exists(to_stdstring(name))
+    if initialized: return gkTextManager_exists(gkString(name))
     
 def get_text_block(name):
     if initialized:
-        return str((<gkTextFile*>gkTextManager_getByName(to_stdstring(name))).getText().c_str())
+        return str((<gkTextFile*>gkTextManager_getByName(gkString(name))).getText().c_str())
     
 def reload_init():
     pass
 
-'''This documentation is a stub because has just been started. Expect much more text here soon.'''
+'''
+The Gamekit Python module has everything needed to make a game with Python.
+
+Report any missing feature to dithi (at) universodegoma.net.
+'''
 
 include "pywrap.pxi"
 include "sensor.pxi"
 include "controller.pxi"
 include "actuator.pxi"
 include "gameobject.pxi"
+include "camera.pxi"
+include "mesh.pxi"
 include "animation.pxi"
 include "collision.pxi"
 include "scene.pxi"
 include "engine.pxi"
 include "blendfile.pxi"
 include "input.pxi"
-#include "sound.pxi"
+include "sound.pxi"
 #include "overlay.pxi"
+#include "skyxhydrax.pxi"
 
-#gkLogger_enable(to_stdstring("AppCppDemo.log"), GK_CPP_VERBOSE_LOG)
+#gkLogger_enable(gkString("AppCppDemo.log"), GK_CPP_VERBOSE_LOG)
 
 cdef gkUserDefs *prefs = new gkUserDefs()
 #prefs.rendersystem = OGRE_RS_GL
 prefs.winsize.x = 1280
 prefs.winsize.y = 720
 #prefs.fullscreen = True
-prefs.wintitle = to_stdstring("Pixelements Python Gamekit.")
+prefs.wintitle = gkString("Pixelements Python Gamekit.")
 #prefs.verbose = GK_CPP_VERBOSE_LOG
 #prefs.fsaa = True
 #prefs.debugPhysics = True
 prefs.grabInput = False
 #prefs.useBulletDbvt = False
 prefs.enableshadows = 0
-prefs.shadowtechnique = to_stdstring("textureadditive")
+prefs.shadowtechnique = gkString("textureadditive")
 
 PLATFORM = ""
 if GK_PLATFORM == GK_PLATFORM_WIN32:
 
 from prerequisites cimport *
+from pywrap cimport *
 from variable cimport *
 from scene cimport *
 from collision cimport *
 from animation cimport *
-cimport gkmath
+from mesh cimport *
+from gkmath cimport *
 
 #cdef class GameObject(pywrap):
     #pass
 
 cdef extern from "OgreSceneNode.h":
     cdef cppclass Ogre_SceneNode "Ogre::SceneNode":
-        const_std_string& getName()
+        gkString& getName()
         void setVisible(bool,bool)
         
         Ogre_MovableObject *getAttachedObject (int)
 
-cdef extern from "OgreMovableObject.h":
-
-    cdef cppclass Ogre_MovableObject "Ogre::MovableObject":
-        const_std_string& getMovableType()
-        
-    Ogre_Entity *cast_entity "static_cast<Ogre::Entity *>" (void *)
-    
-cdef extern from "OgreEntity.h":
-    enum:
-        VES_TANGENT "Ogre::VES_TANGENT"
-    cdef cppclass Ogre_Entity "Ogre::Entity":
-        void buildTangentVectors "getMesh()->buildTangentVectors"(
-            int, unsigned short sourceTexCoordSet, unsigned short index, bool splitMirrored, bool splitRotated, bool storeParityInW)
-
 cdef extern from "gkScene.h":
     cppclass gkScene
     
         gkEntity*       getEntity()
         gkSkeleton*     getSkeleton()
         
-        gkVariable* createVariable(const_std_string& name, bool debug)
-        gkVariable* getVariable(const_std_string& name)
-        bool        hasVariable(const_std_string& name)
-        void        removeVariable(const_std_string& name)
+        gkVariable* createVariable(gkString& name, bool debug)
+        gkVariable* getVariable(gkString& name)
+        bool        hasVariable(gkString& name)
+        void        removeVariable(gkString& name)
         void        clearVariables()
     
-        gkGameObject* clone(const_std_string& name)
+        gkGameObject* clone(gkString& name)
 
         #bool                     hasParent()
         gkGameObject*             getParent()
         void removeChild(gkGameObject* ob)
         bool hasChild(gkGameObject* ob)
     
-        gkmath.TransformState&  getTransformState()
-        gkmath.Matrix4&         getTransform()
-        gkmath.Vector3&         getPosition()
-        gkmath.Quaternion&      getOrientation()
-        gkmath.Vector3&         getScale()
-        gkmath.Euler            getRotation()
+        gkTransformState&  getTransformState()
+        gkMatrix4&         getTransform()
+        gkVector3&         getPosition()
+        gkQuaternion&      getOrientation()
+        gkVector3&         getScale()
+        gkEuler            getRotation()
 
-        gkmath.TransformState&  getWorldTransformState()
-        gkmath.Matrix4&         getWorldTransform()
-        gkmath.Vector3&         getWorldPosition()
-        gkmath.Vector3&         getWorldScale()
-        gkmath.Quaternion&      getWorldOrientation()
-        gkmath.Euler            getWorldRotation()
+        gkTransformState&  getWorldTransformState()
+        gkMatrix4&         getWorldTransform()
+        gkVector3&         getWorldPosition()
+        gkVector3&         getWorldScale()
+        gkQuaternion&      getWorldOrientation()
+        gkEuler            getWorldRotation()
 
 
-        void applyTransformState(gkmath.TransformState& newstate, Real& weight)
-        void setTransform(gkmath.Matrix4& v)
-        void setTransform(gkmath.TransformState& v)
-        void setPosition(gkmath.Vector3& v)
-        void setScale(gkmath.Vector3& v)
+        void applyTransformState(gkTransformState& newstate, gkScalar& weight)
+        void setTransform(gkMatrix4& v)
+        void setTransform(gkTransformState& v)
+        void setPosition(gkVector3& v)
+        void setScale(gkVector3& v)
 
-        void setOrientation(gkmath.Quaternion& q)
-        void setOrientation(gkmath.Euler& v)
+        void setOrientation(gkQuaternion& q)
+        void setOrientation(gkEuler& v)
 
-        void rotate(gkmath.Euler& drot, int tspace)
-        void rotate(gkmath.Quaternion& q, int tspace)
-        void translate(gkmath.Vector3& dloc, int tspace)
-        void scale(gkmath.Vector3& dscale)
+        void rotate(gkEuler& drot, int tspace)
+        void rotate(gkQuaternion& q, int tspace)
+        void translate(gkVector3& dloc, int tspace)
+        void scale(gkVector3& dscale)
 
-        void yaw(gkmath.Radian& v, int tspace)
-        void pitch(gkmath.Radian& v, int tspace)
-        void roll(gkmath.Radian& v, int tspace)
+        void yaw(gkRadian& v, int tspace)
+        void pitch(gkRadian& v, int tspace)
+        void roll(gkRadian& v, int tspace)
 
         # Rigid body
 
-        void        applyTorque(gkmath.Vector3& t, int tspace)
-        void        applyForce(gkmath.Vector3& f, int tspace)
-        void        setLinearVelocity(gkmath.Vector3& linv, int tspace)
-        void        setAngularVelocity(gkmath.Vector3& angv, int tspace)
-        gkmath.Vector3   getLinearVelocity()
-        gkmath.Vector3   getAngularVelocity()
+        void        applyTorque(gkVector3& t, int tspace)
+        void        applyForce(gkVector3& f, int tspace)
+        void        setLinearVelocity(gkVector3& linv, int tspace)
+        void        setAngularVelocity(gkVector3& angv, int tspace)
+        gkVector3   getLinearVelocity()
+        gkVector3   getAngularVelocity()
         
         # physics
 
 
         # Animation
         
-        gkAnimationPlayer*     addAnimation(const_std_string name)
-        gkAnimationPlayer*     getAnimationPlayer(const_std_string name)
+        gkAnimationPlayer*     addAnimation(gkString name)
+        gkAnimationPlayer*     getAnimationPlayer(gkString name)
         
-        void playAnimation(gkAnimationPlayer* act, Real blend, int mode, int priority)
+        void playAnimation(gkAnimationPlayer* act, gkScalar blend, int mode, int priority)
         void stopAnimation(gkAnimationPlayer* act)
         
         gkAnimations& getAnimations()
     
     cppclass gkSkeleton
     
-    cdef cppclass gkEntity(gkGameObject):
+    cppclass gkEntity(gkGameObject):
+        void createInstance()
+        #gkEntityProperties&  getEntityProperties()
+        gkMesh* getMesh()
+        gkSkeleton* getSkeleton()
         void setSkeleton(gkSkeleton* skel)
-        void createInstance()
-        
+        void _resetPose()
+        void _destroyAsStaticGeometry()
+
     enum gkGameObjectMode:
-        GK_GHOST
-        GK_ACTOR
-        GK_INVISIBLE
-        GK_OCCLUDER
-        GK_HAS_LOGIC
-        GK_IMMOVABLE
-        GK_STATIC_GEOM
+            GK_GHOST
+            GK_ACTOR
+            GK_INVISIBLE
+            GK_OCCLUDER
+            GK_HAS_LOGIC
+            GK_IMMOVABLE
+            GK_STATIC_GEOM
         
     cdef cppclass gkGameObjectProperties:
         int m_mode
     
 cdef extern from "gkBone.h":
     cdef cppclass gkBone:
-        void applyChannelTransform(gkmath.TransformState& channel, Real weight)
-        void applyPoseTransform(gkmath.TransformState& pose)
-        gkmath.TransformState&        getPose()
+        void applyChannelTransform(gkTransformState& channel, gkScalar weight)
+        void applyPoseTransform(gkTransformState& pose)
+        gkTransformState&        getPose()
     
 cdef extern from "gkSkeleton.h":
     cdef cppclass gkSkeleton:
-        gkBone*              getBone(const_std_string& name)
-
-cdef extern from "gkCamera.h":
-    cdef cppclass gkCamera:
-        pass
+        gkBone*              getBone(gkString& name)
 
 cdef extern from "gkGameObject.h":
     
     cdef cppclass gkGameObjectHashMapIterator "gkGameObjectHashMap::Iterator":
         bool hasMoreElements()
         gkGameObjectHashMapIterator getNext()
-        std_string    first
+        gkString    first
         gkGameObject* second
 
     cdef cppclass gkGameObjectHashMap:
         gkAnimationsIterator iterator()
         unsigned int size()
         
+        
 
 from variable cimport *
-from gameobject cimport *
 from mathutils cimport *
-cimport gkmath
+from prerequisites cimport *
 
+from gkmath cimport *
 
 OBJECT_TYPES = 'NULL', 'CAMERA', 'LIGHT', 'ENTITY', 'OBJECT', 'SKELETON', 'PARTICLES'
 
             return Entity().P(ob)
         elif t == GK_SKELETON:
             return Skeleton().P(ob)
+        elif t == GK_CAMERA:
+            return Camera().P(ob)
         else:
             return GameObject().P(ob)
     else:
     return ob2
 
 cdef class GameObject(pywrap):
-    '''All game objects are derived from this class.
+    '''
+    All game objects are derived from this class.
     
-    Most properties are writable and makes the necessary transformations.
+    Most attributes are writable and makes the necessary transformations.
+    
+    Properties can be read, assigned or deleted from game objects as items::
+    
+        my_object['my_property'] = 3
+        del(my_object['my_property'])
+    
+    Properties can be booleans, integers, floats, strings, vectors or quaternions.
     
     .. warning::
         Accessing deleted objects will crash gamekit. In the future it will throw an error instead.
     
     @property
     def type(self):
+        '''
+        Object type can be one of the following strings:
+        
+        ========= =========================
+        String    Type (Blender equivalent)
+        ========= =========================
+        ENTITY    Mesh object
+        SKELETON  Armature
+        CAMERA    Camera
+        LIGHT     Light
+        PARTICLES Particle emitter (mesh)
+        OBJECT    Empty or unknown object
+        ========= =========================
+        
+        '''
+        
         return OBJECT_TYPES[(<gkGameObject*>self._p).getType()]
             
     @property
     def name(self):
-        '''The name of the object. If it comes from a single .blend, '''\
-        '''it can be assumed to be unique'''
+        '''
+        The name of the object. If it comes from a single .blend,
+        it can be assumed to be unique
+        '''
         
         cdef Ogre_SceneNode *n = (<gkGameObject*>self._p).getNode()
         if n!=NULL: return str(n.getName().c_str())
         return ""
     
-    # Properties, accessed like this: object['myProperty']
     def __getitem__(self,item):
-        '''does this work?'''
         cdef gkVariable *v
         cdef int t
-        cdef std_string s = to_stdstring(item)
+        cdef gkString s = gkString(item)
         cdef gkGameObject* o = <gkGameObject*>self._p
         
         if o.hasVariable(s):
                 return v.getValueBool()
             elif t==VAR_INT:
                 return v.getValueInt()
+            elif t==VAR_VEC3:
+                return Vector().assign(v.getValueVector3())
+            elif t==VAR_QUAT:
+                return Quaternion().assign(v.getValueQuaternion())
             else:
                 return str(v.getValueString().c_str())
             
     def __setitem__(self,item,value):
         cdef gkVariable *v
         cdef int t
-        cdef std_string s = to_stdstring(item)
+        cdef gkString s = gkString(item)
         cdef gkGameObject* o = <gkGameObject*>self._p
         
         if o.hasVariable(s):
         else:
             v = o.createVariable(s, 0)
             
-        if type(value)==float:
-            v.setValue(<Real>value)
-        elif type(value)==int:
-            v.setValue(<int>value)
-        elif type(value)==type(True):
+        if isinstance(value, float):
+            v.setValue(<gkScalar>value)
+        elif isinstance(value, int):
+            v.setValueInt(value)
+        elif isinstance(value, pybool):
             v.setValue(<bool>value)
-        elif type(value)==str:
-            v.setValue(to_stdstring(value))
+        elif isinstance(value, str):
+            v.setValue(gkString(value))
+        elif isinstance(value, Vector):
+            v.setValue((<Vector>value).v[0])
+        elif isinstance(value, Quaternion):
+            v.setValue((<Quaternion>value).q[0])
         else:
-            raise TypeError("Unsupported type for property "+str(item)+" (type is "+str(type(value))+")")
+            raise TypeError(
+                "Unsupported type for property {} (type is {})".format(
+                    item, type(item).__name__))
         
     def __delitem__(self,item):
-        (<gkGameObject*>self._p).removeVariable(to_stdstring(item))
+        (<gkGameObject*>self._p).removeVariable(gkString(item))
         
     def __contains__(self,item):
         cdef gkGameObject* o = <gkGameObject*>self._p
         
-        if o.hasVariable(to_stdstring(item)): return True
-        return False
+        return o.hasVariable(gkString(item))
         
     def __hash__(self):
         return str(self).__hash__()
         
     def clone(self, name):
-        cdef std_string *s = new std_string()
+        cdef gkString *s = new gkString()
         return GameObject().P((<gkGameObject*>self._p).clone(s.assign(name)))
         #TODO: use scn.cloneObject() instead
         
     def clone_recursive(self, lifespan=0):
+        '''
+        Returns a copy of the object having a copy of all children.
+        Skeletons are associated accordingly.
+        '''
         cdef gkGameObject *ob = cloneRecursiveImpl(<gkGameObject*>self._p, lifespan)
         return to_GameObject(ob)
 
     property parent:
-        '''Parent GameObject from which inherits position, rotation and scale.'''
+        '''
+        Parent GameObject from which inherits position, rotation and scale.
+        Can be set to change the parent.
+        
+        Local transformation is not changed. Use parent_in_place to change
+        parent while retaining world transformation.
+        
+        Set to None to unparent.
+        '''
         def __get__(self):
             cdef gkGameObject* ob = (<gkGameObject*>self._p).getParent()
             return to_GameObject(ob)
             else:
                 (<gkGameObject*>self._p).clearParent()
                 
+    property parent_in_place:
+        '''
+        Parent GameObject from which inherits position, rotation and scale.
+        It has the same value as parent, but when changed, local transformation
+        is modified to retain the world transformation.
+        
+        Set to None to unparent in place.
+        '''
+        def __get__(self):
+            cdef gkGameObject* ob = (<gkGameObject*>self._p).getParent()
+            return to_GameObject(ob)
+            
+        def __set__(self, GameObject ob):
+            if ob:
+                (<gkGameObject*>self._p).setParentInPlace(<gkGameObject*>ob._p)
+            else:
+                (<gkGameObject*>self._p).clearParentInPlace()
+                
     @property
     def children(self):
+        '''
+        Iterable containing all children of the game object.
+        '''
         return GameObjectArray().P(&((<gkGameObject*>self._p).getChildren()))
         
     property position:
-        
+        '''
+        Position in parent coordinates. If it has no parent, it's the same as
+        position_world.
+        '''
         def __get__(self):
-            cdef gkmath.Vector3 v = (<gkGameObject*>self._p).getPosition()
+            cdef gkVector3 v = (<gkGameObject*>self._p).getPosition()
             return Vector(v.x, v.y, v.z)
             
         def __set__(self,pos):
-            cdef gkmath.Vector3 v = gkmath.Vector3()
+            cdef gkVector3 v = gkVector3()
             v.x = pos[0]
             v.y = pos[1]
             v.z = pos[2]
             (<gkGameObject*>self._p).setPosition(v)
 
     property position_world:
+        '''
+        Position in world coordinates. If it has no parent, it's the same as
+        position.
+        '''
         
         def __get__(self):
-            cdef gkmath.Vector3 v = (<gkGameObject*>self._p).getWorldPosition()
+            cdef gkVector3 v = (<gkGameObject*>self._p).getWorldPosition()
             return Vector(v.x, v.y, v.z)
 
+        def __set__(self, pos):
+            cdef gkGameObject *ob = <gkGameObject*>self._p
+            if ob.getParent()!=NULL:
+                ob.setPosition(ob.getParent().getWorldTransform().inverse().mul(gkVector3(pos[0], pos[1], pos[2])))
+            else:
+                ob.setPosition(gkVector3(pos[0], pos[1], pos[2]))
+
     property rotation:
+        '''
+        Euler rotation in parent coordinates. If it has no parent, it's the same as
+        rotation_world.
+        
+        It's a Vector with an euler rotation in radians. It's recommended to use
+        orientation instead, which is a Quaternion.
+        '''
 
         def __get__(self):
-            cdef gkmath.Euler r = (<gkGameObject*>self._p).getRotation()
+            cdef gkEuler r = (<gkGameObject*>self._p).getRotation()
             return Vector(r.x.valueRadians(), r.y.valueRadians(), r.z.valueRadians())
 
         def __set__(self,rot):
-            cdef gkmath.Euler r = gkmath.Euler()
-            r.x = gkmath.Radian(rot[0])
-            r.y = gkmath.Radian(rot[1])
-            r.z = gkmath.Radian(rot[2])
+            cdef gkEuler r = gkEuler()
+            r.x = gkRadian(rot[0])
+            r.y = gkRadian(rot[1])
+            r.z = gkRadian(rot[2])
             (<gkGameObject*>self._p).setOrientation(r)
             
     property rotation_world:
+        '''
+        Euler rotation in world coordinates. If it has no parent, it's the same as
+        rotation.
+        
+        It's a Vector with an euler rotation in radians. It's recommended to use
+        orientation instead, which is a Quaternion.
+        '''
 
         def __get__(self):
-            cdef gkmath.Euler r = (<gkGameObject*>self._p).getWorldRotation()
+            cdef gkEuler r = (<gkGameObject*>self._p).getWorldRotation()
             return Vector(r.x.valueRadians(), r.y.valueRadians(), r.z.valueRadians())
 
+        def __set__(self, rot):
+            cdef gkGameObject *ob = <gkGameObject*>self._p
+            cdef gkEuler r = gkEuler()
+            r.x = gkRadian(rot[0])
+            r.y = gkRadian(rot[1])
+            r.z = gkRadian(rot[2])
+            if ob.getParent()!=NULL:
+                ob.setOrientation(ob.getParent().getWorldOrientation().inverse())
+                ob.rotate(r, TRANSFORM_PARENT)
+            else:
+                ob.setOrientation(r)
+
     property orientation:
+        '''
+        Quaternion rotation in parent coordinates. If it has no parent, it's the same as
+        orientation_world.
+        '''
         
         def __get__(self):
             cdef Quaternion q = Quaternion()
             return q
             
         def __set__(self, Quaternion q):
-            (<gkGameObject*>self._p).setOrientation(<gkmath.Quaternion>(q.q)[0])
+            (<gkGameObject*>self._p).setOrientation(<gkQuaternion>(q.q)[0])
 
     property orientation_world:
+        '''
+        Quaternion rotation in world coordinates. If it has no parent, it's the same as
+        orientation.
+        '''
         
         def __get__(self):
             cdef Quaternion q = Quaternion()
             (q.q).assign((<gkGameObject*>self._p).getWorldOrientation())
             return q
+            
+        def __set__(self, Quaternion q):
+            cdef gkGameObject *ob = <gkGameObject*>self._p
+            if ob.getParent()!=NULL:
+                ob.setOrientation(ob.getParent().getWorldOrientation().inverse())
+                ob.rotate(<gkQuaternion>(q.q)[0], TRANSFORM_PARENT)
+            else:
+                ob.setOrientation(<gkQuaternion>(q.q)[0])
 
     property scale:
+        '''
+        Local scaling factor.
+        '''
         
         def __get__(self):
-            cdef gkmath.Vector3 v = (<gkGameObject*>self._p).getScale()
+            cdef gkVector3 v = (<gkGameObject*>self._p).getScale()
             return Vector(v.x, v.y, v.z)
             
-        def __set__(self,pos):
-            cdef gkmath.Vector3 v = gkmath.Vector3()
+        def __set__(self, pos):
+            cdef gkVector3 v = gkVector3()
             v.x = pos[0]
             v.y = pos[1]
             v.z = pos[2]
             (<gkGameObject*>self._p).setScale(v)
 
     property linear_velocity:
+        '''
+        Linear velocity of the dynamic or rigid body object.
+        '''
         
         def __get__(self):
-            cdef gkmath.Vector3 v = (<gkGameObject*>self._p).getLinearVelocity()
+            cdef gkVector3 v = (<gkGameObject*>self._p).getLinearVelocity()
             return Vector(v.x, v.y, v.z)
             
         def __set__(self,pos):
-            cdef gkmath.Vector3 v = gkmath.Vector3()
+            cdef gkVector3 v = gkVector3()
             v.x = pos[0]
             v.y = pos[1]
             v.z = pos[2]
             (<gkGameObject*>self._p).setLinearVelocity(v,TRANSFORM_PARENT)
             
     property angular_velocity:
+        '''
+        Angular velocity of the dynamic or rigid body object.
+        '''
         
         def __get__(self):
-            cdef gkmath.Vector3 v = (<gkGameObject*>self._p).getAngularVelocity()
+            cdef gkVector3 v = (<gkGameObject*>self._p).getAngularVelocity()
             return Vector(v.x, v.y, v.z)
             
         def __set__(self,pos):
-            cdef gkmath.Vector3 v = gkmath.Vector3()
+            cdef gkVector3 v = gkVector3()
             v.x = pos[0]
             v.y = pos[1]
             v.z = pos[2]
             (<gkGameObject*>self._p).setAngularVelocity(v,TRANSFORM_PARENT)
             
     def translate(self, pos):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        
+        cdef gkVector3 v = gkVector3()
         v.x = pos[0]
         v.y = pos[1]
         v.z = pos[2]
         (<gkGameObject*>self._p).translate(v, TRANSFORM_PARENT)
 
     def translate_local(self, pos):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = pos[0]
         v.y = pos[1]
         v.z = pos[2]
         (<gkGameObject*>self._p).translate(v, TRANSFORM_LOCAL)
 
     def translate_world(self, pos):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = pos[0]
         v.y = pos[1]
         v.z = pos[2]
         (<gkGameObject*>self._p).translate(v, TRANSFORM_WORLD)
 
     def rotate(self, drot):
-        cdef gkmath.Euler r = gkmath.Euler()
-        r.x = gkmath.Radian(drot[0])
-        r.y = gkmath.Radian(drot[1])
-        r.z = gkmath.Radian(drot[2])
+        cdef gkEuler r = gkEuler()
+        r.x = gkRadian(drot[0])
+        r.y = gkRadian(drot[1])
+        r.z = gkRadian(drot[2])
         (<gkGameObject*>self._p).rotate(r, TRANSFORM_PARENT)
 
     def rotate_local(self, drot):
-        cdef gkmath.Euler r = gkmath.Euler()
-        r.x = gkmath.Radian(drot[0])
-        r.y = gkmath.Radian(drot[1])
-        r.z = gkmath.Radian(drot[2])
+        cdef gkEuler r = gkEuler()
+        r.x = gkRadian(drot[0])
+        r.y = gkRadian(drot[1])
+        r.z = gkRadian(drot[2])
         (<gkGameObject*>self._p).rotate(r, TRANSFORM_LOCAL)
 
     def rotate_world(self, drot):
-        cdef gkmath.Euler r = gkmath.Euler()
-        r.x = gkmath.Radian(drot[0])
-        r.y = gkmath.Radian(drot[1])
-        r.z = gkmath.Radian(drot[2])
+        cdef gkEuler r = gkEuler()
+        r.x = gkRadian(drot[0])
+        r.y = gkRadian(drot[1])
+        r.z = gkRadian(drot[2])
         (<gkGameObject*>self._p).rotate(r, TRANSFORM_WORLD)
         
     # Rigid body stuff
     
     def apply_torque(self, t):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = t[0]
         v.y = t[1]
         v.z = t[2]
         (<gkGameObject*>self._p).applyTorque(v, TRANSFORM_PARENT)
 
     def apply_torque_local(self, t):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = t[0]
         v.y = t[1]
         v.z = t[2]
         (<gkGameObject*>self._p).applyTorque(v, TRANSFORM_LOCAL)
 
     def apply_torque_world(self, t):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = t[0]
         v.y = t[1]
         v.z = t[2]
         (<gkGameObject*>self._p).applyTorque(v, TRANSFORM_WORLD)
 
     def apply_force(self, f):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = f[0]
         v.y = f[1]
         v.z = f[2]
         (<gkGameObject*>self._p).applyForce(v, TRANSFORM_PARENT)
 
     def apply_force_local(self, f):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = f[0]
         v.y = f[1]
         v.z = f[2]
         (<gkGameObject*>self._p).applyForce(v, TRANSFORM_LOCAL)
 
     def apply_force_world(self, f):
-        cdef gkmath.Vector3 v = gkmath.Vector3()
+        cdef gkVector3 v = gkVector3()
         v.x = f[0]
         v.y = f[1]
         v.z = f[2]
 
     @property
     def animations(self):
+        '''
+        Iterable of *known* animations for this object.
+        Use animations['animation_name'] to get an animation and add it to this iterable.
+        '''
+        
         return AnimationList().P(self._p)
         
     def add_sensor(self, Sensor sensor):
-        '''Bounds the sensor to the game object and returns the same sensor, '''\
-        '''or a copy if it's bound already to another object.
+        '''
+        Bounds the sensor to the game object and returns the same sensor, 
+        or a copy if it's bound already to another object.
+        
         
         Example::
         
         return sensor
         
     def add_actuator(self, actuator):
-        '''Bounds the actuator to the game object and returns the same actuator, '''\
-        '''or a copy if it's bound already to another object.
+        '''
+        Bounds the actuator to the game object and returns the same actuator,
+        or a copy if it's bound already to another object.
             
         This sets Actuator.owner, and also most actuators require this.
         '''
         actuator._set_owner(self)
         return actuator
         
-    def __richcmp__(self, other, op):
-        if isinstance(other, GameObject):
-            if op==2:   # __eq__
-                #return (<GameObject>other)._p == <void *>self._p
-                return (<GameObject>other)._getP() == self._getP()
-            elif op==3: # __ne__
-                #return (<GameObject>other)._p != <void *>self._p
-                return (<GameObject>other)._getP() != self._getP()
-        return False
-        
     property visible:
         '''Sets or returns the visibility of the object.
         If `True` it will be visible; if `False` it will be invisible. Physics will be unaffected.'''
                 prop.m_mode -= GK_INVISIBLE
             (<gkGameObject*>self._p).getNode().setVisible(v, False)
         
-cdef class Entity(GameObject):
-    
-    def buildTangentVectors(self, sourceTexCoordSet):
-        #print (<gkEntity*>self._p).getNode().getAttachedObject(0).getMovableType().c_str()
-        #="Entity"
-        (<Ogre_Entity*>(<gkEntity*>self._p).getNode().getAttachedObject(0)).buildTangentVectors(VES_TANGENT, sourceTexCoordSet, 0, True, False, True)
-    
-cdef class Camera(GameObject):
-    
-    pass
+
 
 cdef class Skeleton(GameObject):
     
     #def something(self, a, b, c, d):
-        #cdef gkBone *b1 = (<gkSkeleton*>self._p).getBone(to_stdstring('tizq'))
-        #cdef gkBone *b2 = (<gkSkeleton*>self._p).getBone(to_stdstring('tder'))
+        #cdef gkBone *b1 = (<gkSkeleton*>self._p).getBone(gkString('tizq'))
+        #cdef gkBone *b2 = (<gkSkeleton*>self._p).getBone(gkString('tder'))
         #cdef gkTransformState t1 = gkTransformState()
         #cdef gkTransformState t2 = gkTransformState()
-        #cdef gkmath.Vector3 v1, v2
+        #cdef gkVector3 v1, v2
         #t1.loc.x = a
         #t1.loc.z = b
         #t2.loc.x = c
 cdef class BoneList(pywrap):
     
     def __getitem__(self, name):
-        cdef gkBone *b = (<gkSkeleton*>self._p).getBone(to_stdstring(name))
+        cdef gkBone *b = (<gkSkeleton*>self._p).getBone(gkString(name))
         if b:
             return Bone().P(b)
         return None
 
 cdef class GameObjectList(pywrap):
+    # Actually wraps gkScene
         
     def __list__(self):
         cdef int hack1 "h;/*" = 0
         return self.__list__().__iter__() #TODO: can be made more efficient
         
     def __getitem__(self,item):
-        cdef gkGameObject *ob = (<gkScene*>self._p).getObject(to_stdstring(item))
+        cdef gkGameObject *ob = (<gkScene*>self._p).getObject(gkString(item))
         return to_GameObject(ob)
 
     def __len__(self):
         return (<gkScene*>self._p).getObjects().size()
+        
+    def __delitem__(self, item):
+        cdef gkScene *scn = <gkScene*>self._p
+        scn.removeObject(scn.getObject(gkString(item)))
     
 cdef class GameObjectArray(pywrap):
     
     def __len__(self):
         return (<gkGameObjectArray*>self._p).size()
     
+    # TODO: __delitem__
+    
      
 
 from prerequisites cimport *
 
-cdef extern from "OgreVector2.h" namespace "Ogre":
-    cppclass Vector2:
-        Real x
-        Real y
+cdef extern from "gkMathUtils.h":
+    cppclass gkVector2:
+        gkScalar x
+        gkScalar y
         bool isZeroLength()
-        #Real *ptr()
-    cppclass Vector3:
-        Vector3()
-        Vector3(Real,Real,Real)
-        Real x
-        Real y
-        Real z
-        Real normalise()
-        Vector3 *normalised()
-        Real length()
-        Real getitem "operator[]"(size_t)
-        Vector3& assign "operator="(Vector3)
-        Vector3 neg "operator-"()
-        Vector3& iadd "operator+="(Vector3)
-        Vector3& isub "operator-="(Vector3)
-        Vector3& imul "operator*="(Real)
-        Vector3& imul "operator*="(Vector3)
-        Vector3& idiv "operator/="(Real)
-        Vector3& idiv "operator/="(Vector3)
-        Real *ptr()
-        Radian angleBetween(Vector3)
-        Quaternion getRotationTo(Vector3)
-        Quaternion getRotationTo(Vector3, Vector3)
-        Real dotProduct (Vector3 &vec)
-        Vector3 crossProduct (Vector3 &vec)
-    cppclass Vector4:
-        Real x
-        Real y
-        Real z
-        Real w
-    cppclass Quaternion:
-        Quaternion()
-        Quaternion(Real*)
-        Quaternion(Real,Real,Real,Real)
-        Quaternion(Vector3 &,Vector3 &,Vector3 &)
-        Real x
-        Real y
-        Real z
-        Real w
-        Real normalise()
-        Quaternion *normalised()
-        Real getitem "operator[]"(size_t)
-        Quaternion& assign "operator="(Quaternion)
-        Quaternion neg "operator-"()
-        Quaternion& add "operator+"(Quaternion)
-        Quaternion& sub "operator-"(Quaternion)
-        Quaternion& mul "operator*"(Real)
-        Quaternion& mul "operator*"(Quaternion)
-        Quaternion& div "operator/"(Real)
-        Quaternion& div "operator/"(Quaternion)
-        Vector3 mul "operator*"(Vector3)
-        Real *ptr()
-    Quaternion quat_nlerp "Ogre::Quaternion::nlerp"(Real fT, Quaternion &rkP, Quaternion &rkQ, bool shortestPath)
-    Quaternion quat_Slerp "Ogre::Quaternion::Slerp"(Real fT, Quaternion &rkP, Quaternion &rkQ, bool shortestPath)
-    Quaternion quat_SlerpExtraSpins "Ogre::Quaternion::SlerpExtraSpins"(Real fT, Quaternion &rkP, Quaternion &rkQ, int iExtraSpins)
+        #gkScalar *ptr()
+    cppclass gkVector3:
+        gkVector3()
+        gkVector3(gkScalar,gkScalar,gkScalar)
+        gkScalar x
+        gkScalar y
+        gkScalar z
+        gkScalar normalise()
+        gkVector3 *normalised()
+        gkScalar length()
+        gkScalar getitem "operator[]"(size_t)
+        gkVector3& assign "operator="(gkVector3)
+        gkVector3 neg "operator-"()
+        gkVector3& iadd "operator+="(gkVector3)
+        gkVector3& isub "operator-="(gkVector3)
+        gkVector3& imul "operator*="(gkScalar)
+        gkVector3& imul "operator*="(gkVector3)
+        gkVector3& idiv "operator/="(gkScalar)
+        gkVector3& idiv "operator/="(gkVector3)
+        gkScalar *ptr()
+        gkRadian angleBetween(gkVector3)
+        gkQuaternion getRotationTo(gkVector3)
+        gkQuaternion getRotationTo(gkVector3, gkVector3)
+        gkScalar dotProduct (gkVector3 &vec)
+        gkVector3 crossProduct (gkVector3 &vec)
+    cppclass gkVector4:
+        gkScalar x
+        gkScalar y
+        gkScalar z
+        gkScalar w
+    cppclass gkQuaternion:
+        gkQuaternion()
+        gkQuaternion(gkScalar*)
+        gkQuaternion(gkScalar,gkScalar,gkScalar,gkScalar)
+        gkQuaternion(gkVector3 &,gkVector3 &,gkVector3 &)
+        gkScalar x
+        gkScalar y
+        gkScalar z
+        gkScalar w
+        gkScalar normalise()
+        gkQuaternion inverse "Inverse"()
+        gkScalar getitem "operator[]"(size_t)
+        gkQuaternion& assign "operator="(gkQuaternion)
+        gkQuaternion neg "operator-"()
+        gkQuaternion& add "operator+"(gkQuaternion)
+        gkQuaternion& sub "operator-"(gkQuaternion)
+        gkQuaternion& mul "operator*"(gkScalar)
+        gkQuaternion& mul "operator*"(gkQuaternion)
+        gkQuaternion& div "operator/"(gkScalar)
+        gkQuaternion& div "operator/"(gkQuaternion)
+        gkVector3 mul "operator*"(gkVector3)
+        gkScalar *ptr()
+    gkQuaternion quat_nlerp "gkQuaternion::nlerp"(gkScalar fT, gkQuaternion &rkP, gkQuaternion &rkQ, bool shortestPath)
+    gkQuaternion quat_Slerp "gkQuaternion::Slerp"(gkScalar fT, gkQuaternion &rkP, gkQuaternion &rkQ, bool shortestPath)
+    gkQuaternion quat_SlerpExtraSpins "gkQuaternion::SlerpExtraSpins"(gkScalar fT, gkQuaternion &rkP, gkQuaternion &rkQ, int iExtraSpins)
         
-    cppclass Matrix3:
-        Vector3 mCol0
-        Vector3 mCol1
-        Vector3 mCol2
+    cppclass gkMatrix3:
+        gkVector3 mCol0
+        gkVector3 mCol1
+        gkVector3 mCol2
+        gkVector3 mul "operator*"(gkVector3)
+        gkMatrix3 mul "operator*"(gkMatrix3)
+        gkMatrix4 inverse()
         
-    cppclass Matrix4:
-        Vector4 mCol0
-        Vector4 mCol1
-        Vector4 mCol2
-        Vector4 mCol3
+    cppclass gkMatrix4:
+        gkVector4 mCol0
+        gkVector4 mCol1
+        gkVector4 mCol2
+        gkVector4 mCol3
+        gkVector3 mul "operator*"(gkVector3)
+        gkVector4 mul "operator*"(gkVector4)
+        gkMatrix3 mul "operator*"(gkMatrix3)
+        gkMatrix4 mul "operator*"(gkMatrix4)
+        gkMatrix4 inverse()
     
-    cppclass Radian:
-        Radian(Real)
-        Real mRad
-        Real valueRadians()
-        Real valueDegrees()
+    cppclass gkRadian:
+        gkRadian(gkScalar)
+        gkScalar mRad
+        gkScalar valueRadians()
+        gkScalar valueDegrees()
         
-    cppclass Degree:
-        Real mDeg
+    cppclass gkDegree:
+        gkScalar mDeg
 
-        
-    
-    
-cdef extern from "gkMathUtils.h":
-    cppclass Euler "gkEuler":
-        Euler()
-        Radian x
-        Radian y
-        Radian z
+    cppclass gkEuler:
+        gkEuler()
+        gkRadian x
+        gkRadian y
+        gkRadian z
 
-    cppclass TransformState "gkTransformState":
-        TransformState()
-        TransformState(Vector3, Quaternion, Vector3)
-        Vector3           loc
-        Quaternion        rot
-        Vector3           scl
+    cppclass gkTransformState:
+        gkTransformState()
+        gkTransformState(gkVector3, gkQuaternion, gkVector3)
+        gkVector3 loc
+        gkQuaternion rot
+        gkVector3 scl
 
 
 from prerequisites cimport *
-cimport gkmath
+from gkmath cimport *
 
 cdef enum gkInputState:
     GK_NullState = 0
         int key_mod
         
     cdef cppclass gkMouse:
-        gkmath.Vector2 getPosition()
-        gkmath.Vector2 getRelative()
+        gkVector2 getPosition()
+        gkVector2 getRelative()
         bool isButtonDown(int)
         bool mouseMoved()
         clear()
-        Real wheelDelta
+        gkScalar wheelDelta
         int buttons[3]
 
         
 cdef list mousebutton_callbacks = []
 cdef int previous_keys[256] #TODO: use KC_MAX
 cdef int previous_mb[3]
-cdef gkmath.Vector2 prev_mouse
+cdef gkVector2 prev_mouse
 prev_mouse.x = -1
 
 cdef class Key(Sensor):
+    '''
+    Key sensor class. Declare with the key name as string::
+    
+        jump_key = Key('SPACE')
+        
+    See KEYS for the list of keys.
+    '''
     
     cdef int *key
     cdef int keynum
         else: return "<Key %s>" % KEYS[self.keynum]
 
 cdef class MouseButton(Sensor):
+    '''
+    Mouse button sensor class. Declare with the button number as argument [1-3].
+    
+    ============= ==========================
+    Button number Mouse button
+    ============= ==========================
+    1             Primary (usually left)
+    2             Secondary (usually right)
+    3             Middle (pushing the wheel)
+    ============= ==========================
+    
+    '''
     
     cdef int *but
     cdef int butnum
         if not 1<=button<=3:
             raise WrongInputError('Button must be between 1 and 3.')
         
-        self.but = &getMouse().buttons[button-1]
-        self.butnum = button
+        self.but = &getMouse().buttons[button - 1]
+        self.butnum = button - 1
         self.init_sensor(mousebutton_callbacks)
     
     def __nonzero__(self):
         return self.keybd.keys[code] == 1
         
 cdef class MouseMotion(Sensor):
-    
+    '''
+    Sensor that detects mouse motion. It only generates positive pulses,
+    never negative.
+    '''
     cdef gkMouse *mouse
     cdef int butnum
     
         
     @property
     def position(self):
-        cdef gkmath.Vector2 v = self.mouse.getPosition()
+        '''Absolute position of the mouse cursor in pixels.'''
+        cdef gkVector2 v = self.mouse.getPosition()
         return v.x, v.y
         
     @property
     def relative(self):
-        cdef gkmath.Vector2 v = self.mouse.getRelative()
+        '''Relative position of the mouse cursor since last logic tick.'''
+        cdef gkVector2 v = self.mouse.getRelative()
         return v.x, v.y
         
     #def isButtonDown(self, button):
            
 cdef class Accelerometer:
     cdef Vector v
-    cdef gkmath.Vector3 *v3
+    cdef gkVector3 *v3
 
     def __init__(self):
         self.v = Vector()
-        #self.v3 = <gkmath.Vector3 *>
+        #self.v3 = <gkVector3 *>
         
     property value:
         def __get__(self):
 cdef void evaluate_input_callbacks() except *:
     global prev_mouse
     cdef int k, *keys = getKeyboard().keys
-    cdef gkmath.Vector2 pos = getMouse().getPosition(), rel
+    cdef gkVector2 pos = getMouse().getPosition(), rel
     cdef Sensor e
     cdef int *mousebuttons = getMouse().buttons, b
     
 
-cimport gkmath
+from gkmath cimport *
 import gkmath
 
 cdef class Vector:
-    cdef gkmath.Vector3 *v
+    cdef gkVector3 *v
 
-    cdef Vector assign(self, gkmath.Vector3 v)
+    cdef Vector assign(self, gkVector3 v)
         
 cdef class Quaternion:
-    cdef gkmath.Quaternion *q
+    cdef gkQuaternion *q
         
-    cdef Quaternion assign(self, gkmath.Quaternion q)
+    cdef Quaternion assign(self, gkQuaternion q)
         
 
 
 from prerequisites cimport *
-cimport gkmath
+from gkmath cimport *
 
 cdef extern from "btBulletDynamicsCommon.h":
     cppclass btQuaternion: #for slerps, better than ogre's
         btQuaternion()
-        btQuaternion(Real x,Real y,Real z,Real w)
-        Real x()
-        Real y()
-        Real z()
-        Real w()
-        btQuaternion slerp (btQuaternion &q, Real &t)
+        btQuaternion(gkScalar x,gkScalar y,gkScalar z,gkScalar w)
+        gkScalar x()
+        gkScalar y()
+        gkScalar z()
+        gkScalar w()
+        btQuaternion slerp (btQuaternion &q, gkScalar &t)
         
 cdef class Vector:
     
     def __init__(self, ini=None, ini2=None, ini3=None):
         if ini3!=None:
-            self.v = new gkmath.Vector3(ini,ini2,ini3)
+            self.v = new gkVector3(ini,ini2,ini3)
         elif isinstance(ini, Vector):
-            self.v = new gkmath.Vector3()
+            self.v = new gkVector3()
             self.v.assign((<Vector>ini).v[0])
-            memcpy((<gkmath.Vector3*>self.v).ptr(),(<Vector>ini).v.ptr(),sizeof(Real)*3)
+            memcpy((<gkVector3*>self.v).ptr(),(<Vector>ini).v.ptr(),sizeof(gkScalar)*3)
         elif ini!=None:
-            self.v = new gkmath.Vector3(ini[0],ini[1],ini[2])
+            self.v = new gkVector3(ini[0],ini[1],ini[2])
         else:
-            self.v = new gkmath.Vector3()
+            self.v = new gkVector3()
 
     def __dealloc__(self):
         del self.v
         
-    cdef Vector assign(self, gkmath.Vector3 v):
+    cdef Vector assign(self, gkVector3 v):
         self.v.assign(v)
         return self
             
         def __get__(self):
             return self.v.length()
             
-        def __set__(self, Real v):
+        def __set__(self, gkScalar v):
             self.v.normalise()
             self.v.imul(v)
         
         if isinstance(v, Vector):
             (ret.v).iadd((<Vector>v).v[0])
         else:
-            (ret.v).iadd(gkmath.Vector3(v[0],v[1],v[2]))
+            (ret.v).iadd(gkVector3(v[0],v[1],v[2]))
         return ret
 
     def __sub__(self, v):
         if isinstance(v, Vector):
             (ret.v).isub((<Vector>v).v[0])
         else:
-            (ret.v).isub(gkmath.Vector3(v[0],v[1],v[2]))
+            (ret.v).isub(gkVector3(v[0],v[1],v[2]))
         return ret
 
     def __iadd__(self, v):
         if isinstance(v, Vector):
             (self.v).iadd((<Vector>v).v[0])
         else:
-            (self.v).iadd(gkmath.Vector3(v[0],v[1],v[2]))
+            (self.v).iadd(gkVector3(v[0],v[1],v[2]))
         return self
 
     def __isub__(self, v):
         if isinstance(v, Vector):
             (self.v).isub((<Vector>v).v[0])
         else:
-            (self.v).isub(gkmath.Vector3(v[0],v[1],v[2]))
+            (self.v).isub(gkVector3(v[0],v[1],v[2]))
         return self
         
     def __mul__(self, v):
         if isinstance(v, Vector):
             (ret.v).imul((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (ret.v).imul(gkmath.Vector3(v[0],v[1],v[2]))
+            (ret.v).imul(gkVector3(v[0],v[1],v[2]))
         else:
-            (ret.v).imul(<Real>v)
+            (ret.v).imul(<gkScalar>v)
         return ret
 
     def __div__(self, v):
         if isinstance(v, Vector):
             (ret.v).idiv((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (ret.v).idiv(gkmath.Vector3(v[0],v[1],v[2]))
+            (ret.v).idiv(gkVector3(v[0],v[1],v[2]))
         else:
-            (ret.v).idiv(<Real>v)
+            (ret.v).idiv(<gkScalar>v)
         return ret
 
     def __truediv__(self, v):
         if isinstance(v, Vector):
             (ret.v).idiv((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (ret.v).idiv(gkmath.Vector3(v[0],v[1],v[2]))
+            (ret.v).idiv(gkVector3(v[0],v[1],v[2]))
         else:
-            (ret.v).idiv(<Real>v)
+            (ret.v).idiv(<gkScalar>v)
         return ret
 
     def __imul__(self, v):
         if isinstance(v, Vector):
             (self.v).imul((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (self.v).imul(gkmath.Vector3(v[0],v[1],v[2]))
+            (self.v).imul(gkVector3(v[0],v[1],v[2]))
         else:
-            (self.v).imul(<Real>v)
+            (self.v).imul(<gkScalar>v)
         return self
 
     def __idiv__(self, v):
         if isinstance(v, Vector):
             (self.v).idiv((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (self.v).idiv(gkmath.Vector3(v[0],v[1],v[2]))
+            (self.v).idiv(gkVector3(v[0],v[1],v[2]))
         else:
-            (self.v).idiv(<Real>v)
+            (self.v).idiv(<gkScalar>v)
         return self
 
     def __itruediv__(self, v):
         if isinstance(v, Vector):
             (self.v).idiv((<Vector>v).v[0])
         elif getattr(v, '__getitem__', False):
-            (self.v).idiv(gkmath.Vector3(v[0],v[1],v[2]))
+            (self.v).idiv(gkVector3(v[0],v[1],v[2]))
         else:
-            (self.v).idiv(<Real>v)
+            (self.v).idiv(<gkScalar>v)
         return self
 
     def __pos__(self): return self
     def cross_product(self, other):
         return Vector().assign(self.v.crossProduct(Vector(other).v[0]))
         
-    #cdef assignv(self, gkmath.Vector3 v):
-    #    memcpy((<gkmath.Vector3*>self.v).ptr(),v.ptr(),sizeof(Real)*3)
+    #cdef assignv(self, gkVector3 v):
+    #    memcpy((<gkVector3*>self.v).ptr(),v.ptr(),sizeof(gkScalar)*3)
         
 cdef class Quaternion:
     
     def __init__(Quaternion self, ini=None, ini2=None, ini3=None, ini4=None):
         if isinstance(ini, Quaternion):
-            self.q = new gkmath.Quaternion()
+            self.q = new gkQuaternion()
             self.q.assign((<Quaternion>ini).q[0])
         elif ini4!=None:
-            self.q = new gkmath.Quaternion(ini,ini2,ini3,ini4)
+            self.q = new gkQuaternion(ini,ini2,ini3,ini4)
         elif ini3!=None:
             # from 3x3 matrix
-            self.q = new gkmath.Quaternion(Vector(ini).v[0],Vector(ini2).v[0],Vector(ini3).v[0])
+            self.q = new gkQuaternion(Vector(ini).v[0],Vector(ini2).v[0],Vector(ini3).v[0])
         elif ini!=None:
-            self.q = new gkmath.Quaternion(ini[0],ini[1],ini[2],ini[3])
+            self.q = new gkQuaternion(ini[0],ini[1],ini[2],ini[3])
         else:
-            self.q = new gkmath.Quaternion()
+            self.q = new gkQuaternion()
             
     def __dealloc__(self):
         del self.q
  
-    cdef Quaternion assign(self, gkmath.Quaternion q):
+    cdef Quaternion assign(self, gkQuaternion q):
         self.q.assign(q)
         return self
             
             (retv.v).assign((<Quaternion>self).q.mul((<Vector>v).v[0]))
             return retv
         retq = Quaternion()
-        (retq.q).assign((retq.q).mul(<Real>v))
+        (retq.q).assign((retq.q).mul(<gkScalar>v))
         return retq
         
     def inverted(Quaternion self):
         
     def lerp(self, Quaternion other, factor):
         cdef Quaternion q = Quaternion()
-        q.q.assign(gkmath.quat_nlerp(factor, self.q[0], other.q[0], False))
+        q.q.assign(quat_nlerp(factor, self.q[0], other.q[0], False))
         return q
         
     def slerp(self, Quaternion other, factor):
+
+
+from prerequisites cimport *
+from gameobject cimport *
+from gkmath cimport *
+
+cdef extern from "OgreMovableObject.h":
+
+    cdef cppclass Ogre_MovableObject "Ogre::MovableObject":
+        gkString& getMovableType()
+        
+    Ogre_Entity *cast_entity "static_cast<Ogre::Entity *>" (void *)
+    
+cdef extern from "OgreEntity.h":
+    enum:
+        VES_TANGENT "Ogre::VES_TANGENT"
+        
+    cdef cppclass Ogre_Entity "Ogre::Entity":
+        void buildTangentVectors "getMesh()->buildTangentVectors"(
+            int, unsigned short sourceTexCoordSet, unsigned short index, bool splitMirrored, bool splitRotated, bool storeParityInW)
+        
+        void reload "getMesh()->reload"()
+
+
+cdef extern from "gkMesh.h":
+    cppclass btTriangleMesh
+    cppclass gkMeshLoader
+    
+    cppclass gkDeformVertex:
+        int      group
+        gkScalar weight
+        int      vertexId
+    
+    cppclass gkVertex:
+        gkVertex()
+        gkVertex(gkVertex &)
+        gkVertex&    assign "operator="(gkVertex &)
+        gkVector3    co
+        gkVector3    no
+        unsigned int vcol
+        gkVector2    *uv  # actually uv[GK_UV_MAK] = uv[8]
+        int          vba
+    
+    cdef enum TriFlag:
+        TRI_INVISIBLE "gkTriangle::TRI_INVISIBLE"
+        TRI_COLLIDER "gkTriangle::TRI_COLLIDER"
+        
+    struct gkTriangle:
+        unsigned int i0
+        unsigned int i1
+        unsigned int i2
+        int          flag
+    
+    struct gkTriFace:
+        gkVector3    *p  # actually p[3]
+        unsigned int i[3]
+        gkTriFace()
+        gkVector3    normal()
+    
+    cppclass gkSubMeshIndexer
+    
+    cppclass Verticies
+    cppclass Triangles
+    cppclass DeformVerts
+    
+    cppclass gkSubMesh:
+        gkSubMesh()
+        Verticies&            getVertexBuffer()
+        Triangles&            getIndexBuffer()
+        DeformVerts&          getDeformVertexBuffer()
+        gkString              getMaterialName()
+        void                  setMaterialName(gkString &)
+        void                  setTotalLayers(int)
+        int                   getUvLayerCount()
+        void                  setVertexColors(bool)
+        bool                  hasVertexColors()
+        #gkBoundingBox&        getBoundingBox()
+        #gkMaterialProperties& getMaterial()
+        gkSubMesh*            clone()
+        void                  addTriangle(gkVertex &, unsigned int, gkVertex &, unsigned int, gkVertex &, unsigned int, int)
+        void                  addDeformVert(gkDeformVertex &)
+    
+    cppclass gkVertexGroup:
+        gkVertexGroup(gkString &, int)