Source

pygamekit / collision.pxd

cimport gkmath
from prerequisites cimport *
from gameobject cimport *

cdef extern from "Physics/gkRayTest.h":
    
    cdef cppclass gkRay:
        gkRay(gkmath.Vector3, gkmath.Vector3)
        
    cdef cppclass gkRayTest:
        bool collides(gkRay&)
        gkmath.Vector3& getHitPoint()
        gkmath.Vector3& getHitNormal()
        btCollisionObject* getCollisionObject()
        gkGameObject* getObject()
        Real getHitFraction()

cdef extern from "btBulletDynamicsCommon.h":
    
    cdef cppclass btManifoldPoint
    cdef cppclass btDynamicsWorld
    cdef cppclass btCollisionObject
    cdef cppclass btCollisionShape
    
cdef extern from "Physics/gkPhysicsController.h":
    
    
    cdef struct gkContactInfo:
        gkPhysicsController* collider
        btManifoldPoint      point

        #typedef utArray[gkContactInfo] Array
        #typedef utArrayIterator[Array] Iterator

    cdef cppclass gkPhysicsController:
        
        gkPhysicsController(gkGameObject* object, btDynamicsWorld* owner)
        #virtual void setTransformState(const gkTransformState& state)
        #virtual void updateTransform()

        bool isStaticObject()

        void suspend(bool v)
        bool isSuspended()

        #gkPhysicsProperties& getProperties()

        void enableContactProcessing(bool v)

        #gkContactInfo::Array&    getContacts()
        #gkContactInfo::Iterator  getContactIterator()
        
        bool collidesWith(gkGameObject* ob, gkContactInfo* cpy) #cpy = 0
        bool collidesWith(const_std_string& 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*)
        #sensorTest is below as a stand-alone function

        # cast functions also below
        
        btCollisionObject* getCollisionObject()

        btCollisionShape* getShape()

        btDynamicsWorld* getOwner()

        gkGameObject* getObject()


        #gkBoundingBox getAabb()

        #void setShape(btCollisionShape* shape)

        #virtual void create()
        #virtual void destroy()

        #void _handleManifold(btPersistentManifold* manifold)
        #void _resetContactInfo()
        #bool _markDbvt(bool v)
        
        #btCollisionShape* _createShape()
        
    gkPhysicsController* gkPhysicsController_castController "gkPhysicsController::castController"(btCollisionObject* colObj)
    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 onlyActor, bool testAllMaterials)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.