cocos2dx代码中拿不到cocoStudio中设置的碰撞框,可以监听到帧事件

CCDictionary* boneDic = armature->getBoneDic();

//CCLog("%d
+++++",boneDic->count());

CCDictElement element = NULL;

CCArray
blist = CCArray::createWithCapacity(10);

CCDICT_FOREACH(boneDic, element)

{

CCBone* axeBone = (CCBone*)element->getObject();

CCLog("^^^^^^^^^^ %s",axeBone->getName().c_str());

CCArray* decs = axeBone->getDisplayManager()->getDecorativeDisplayList();

int size = decs->count();

for (int i = 0 ; i < size ; i++)

{

CCDecorativeDisplay* d = axeBone->getDisplayManager()->getDecorativeDisplayByIndex(i);

CCColliderDetector* detector = d->getColliderDetector();

if (detector)

{

blist = detector->getColliderBodyList();

}



CCObject* p = NULL;

if (blist)

{

CCARRAY_FOREACH(blist,p)

{

ColliderBody* cb = (ColliderBody*)p;

cpShape* cp = cb->getShape();// shape 始终为空

if (cb)

{

CCLog("–Get colliderBody success!–");

}

if (cp)

{

CCLog("–Get shape success!–");

}



// cpShape* csh = cb->getShape();

// cpSpaceAddShape(space,csh);

}

}

}

}

已解决