Box2d CCPhysicsSprite and setPTMRatio

Box2d CCPhysicsSprite and setPTMRatio
0.0 0



I have the following class

#include "Box2d.h"
#include "cocos2d.h"
#include "cocos-ext.h"
class BPBody:cocos2d::extension::CCPhysicsSprite

in the file i have the following tag

APP_STL := gnustl_static

But in my class i cannot use this~~>setPTMRatio or this~~>setB2Body . I have searched everywhere and cannot find what i am doing wrong. Could anyone please help me ? What am i missing ?


Please try:

class BPBody : public cocos2d::extension::CCPhysicsSprite

If you don’t explicitly specify a public inheritance then C++ defaults to private inheritance which prevents access to parent class’ methods.



No. Still no prob.

    /** Body accessor when using regular Chipmunk */
    cpBody* getCPBody() const;
    void setCPBody(cpBody *pBody);
    /** Body accessor when using box2d */
    b2Body* getB2Body() const;
    void setB2Body(b2Body *pBody);

    float getPTMRatio() const;
    void setPTMRatio(float fPTMRatio);

If you see the code i am accessing is enclosed in the CC_ENABLE_BOX2D_INTEGRATION. How do i enable this flag ? What am i doing wrong ?


Did you try to define it in the Add something like in your


No tried this as well. Did not work.


Can anyone offer me any help ? I have to use the setPTM functions and the setb2Body function in my code. But nothing is working ? Can someone please help me ?