cocos2d iphone - Box2D mouse Joint issue while dragging. TestPoint function return false -
i'm using box2d mouse joint drag objects i'm stuck in strange issue bodies not responding moved function because
if (currentfixture->testpoint(worldpoint)) {
always return false specific bodies.
from above image "yellow" body draggable position centre or bottom of body not top.
note: bodies created using "physiceditor" bodies "b2polygonshape".
edit: bodies without textures... think problem vertex lines intersecting each other.
edit2: using r.u.b.e same result here too.
when bodies have multiple fixtures, need check every fixture:
bool touchingbody( b2body* b, b2vec2 worldpoint ) { bool bodyistouched = false; (b2fixture* f = b->getfixturelist(); f; f = f->getnext()) { if ( bodyistouched = f->testpoint(worldpoint) ) break; } return bodyistouched; }
Comments
Post a Comment