/** Set the fixed distance with two bodies */classPhysicsJointDistance:publicPhysicsJoint{public:staticPhysicsJointDistance*construct(PhysicsBody*a,PhysicsBody*b,constPoint&anchr1,constPoint&anchr2);floatgetDistance()const;voidsetDistance(floatdistance);protected:boolinit(PhysicsBody*a,PhysicsBody*b,constPoint&anchr1,constPoint&anchr2);protected:PhysicsJointDistance(){}virtual~PhysicsJointDistance(){}};
staticinlinecpBoolqueryReject(cpShape*a,cpShape*b){return(// BBoxes must overlap
!cpBBIntersects(a->bb,b->bb)// Don't collide shapes attached to the same body.
||a->body==b->body// Don't collide objects in the same non-zero group
||(a->group&&a->group==b->group)// Don't collide objects that don't share at least on layer.
||!(a->layers&b->layers)// Don't collide infinite mass objects
||(a->body->m==INFINITY&&b->body->m==INFINITY));}
目前默认支持的引擎都有Cocos2D,Corona,Sparrow,LibGDX,AndEngine,Moai,Box2d/Nape-flash等。我们可以自定义导出数据格式,来让软件导出。而Physics_editor_export for quick-cocos2d-x就是在Corona模板(该引擎采用lua语言进行开发,导出的数据为.lua格式)的基础上进行修改而成。