physics/CCPhysicsWorld

来源:互联网 发布:seo html页面优化 编辑:程序博客网 时间:2024/05/29 08:25

#ifndef __CCPHYSICSWORLD_H__

#define __CCPHYSICSWORLD_H__


#include "../utils/CCArmatureDefine.h"

#include "../CCBone.h"

#include "../external_tool/sigslot.h"


#include <list>

using std::list;


#ifndef PT_RATIO

#define PT_RATIO 32

#endif


struct b2Manifold;

struct b2ContactImpulse;

class b2Fixture;

class b2Contact;

class b2World;


NS_CC_EXT_BEGIN


class ContactListener;

class GLESDebugDraw;


class CCPhysicsWorld

{

public:

    static CCPhysicsWorld *sharedPhysicsWorld();

    static void purgePhysicsWorld();


    void initNoGravityWorld();

private:

    CCPhysicsWorld();

    ~CCPhysicsWorld();


private:

    static CCPhysicsWorld *s_PhysicsWorld;


    b2World *m_pNoGravityWorld;


    ContactListener *m_pContactListener;


    GLESDebugDraw *m_pDebugDraw;

public:

    void update(float dt);

    void drawDebug();


    b2World *getNoGravityWorld();


    sigslot::signal2<CCBone *, CCBone *> BoneColliderSignal;

};


NS_CC_EXT_END


#endif/*__CCPHYSICSWORLD_H__*/


0 0