Hi, i have problems. Can you help me?
- How to dettect a collision when my physics body is from physic editor (from code and web)?
error: 'class PhysicsShapeCache' has no member named 'setCollisionBitmask'
shapeCache -> setCollisionBitmask(0x000001);
class PhysicsShapeCache' has no member named 'setContactTestBitmask'
shapeCache -> setContactTestBitmask(true);
- I get error when write this code :
void HelloWorld::initPhysics()
{
auto contactListener = EventListenerPhysicsContact::create();
contactListener->onContactBegin =
CC_CALLBACK_1(HelloWorld::onCollision,this);
getEventDispatcher() ->addEventListenerWithSceneGraphPriority
(contactListener,this);
}
And here is the error:
no matching function for call to 'bind(<unresolved overloaded function type>, HelloWorld*, const std::_Placeholder<1>&)'
#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__)
note: in expansion of macro 'CC_CALLBACK_1'
contactListener->onContactBegin = CC_CALLBACK_1(HelloWorld::onCollision, this);
Some tutorial use that code, right? But i get an error