Source

pygamekit / entity.pxd



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 "gkEntity.h":
    cppclass gkEntity(gkGameObject):
        gkEntityProperties&  getEntityProperties()
        gkMesh* getMesh()
        gkSkeleton* getSkeleton()
        void setSkeleton(gkSkeleton* skel)
        void _resetPose()
        void _destroyAsStaticGeometry()

    cppclass gkEntityProperties:
        gkMesh*         m_mesh
        bool            m_casts
        gkString        m_source
        gkString        m_startPose

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)
        int       getIndex()
        gkString& getName()
    
    ctypedef utArray[gkSubMesh*]             SubMeshArray "gkMesh::SubMeshArray"
    ctypedef utArrayIterator[SubMeshArray]   SubMeshIterator "gkMesh::SubMeshIterator"
    ctypedef utArray[gkVertexGroup*]         VertexGroups "gkMesh::VertexGroups"
    
    cppclass gkMesh:
        #gkMesh(gkResourceManager *, gkResourceName &, gkResourceHandle &)
        void                  addSubMesh(gkSubMesh *)
        #void                  _setSkeleton(gkSkeletonResource *)
        #gkSkeletonResource*   getSkeleton()
        #gkBoundingBox&        getBoundingBox()
        btTriangleMesh*       getTriMesh()
        #gkMaterialProperties& getFirstMaterial()
        gkVertexGroup*        createVertexGroup(gkString &)
        VertexGroups&         getGroups()
        gkVertexGroup*        findVertexGroup(gkString &)
        gkVertexGroup*        findVertexGroup(int)
        SubMeshIterator       getSubMeshIterator()
        gkMeshLoader*         getLoader()
        int                   getMeshVertexCount()
        gkVertex&             getMeshVertex(int)
        int                   getMeshTriFaceCount()
        gkTriFace             getMeshTriFace(int)
    
cdef extern from "gkMeshManager.h":
    cppclass gkMeshManager "gkMeshManager::getSingleton":
        gkMeshManager()
        gkMesh* create "create<gkMesh>"(gkString& name)