Hi,
I have some problem retrieving contact point in 2.1a... I want to show a sparkle in the contact point
I have used this code suggested in a previous post:
This seem to work properly in the most cases but when a lot of body collides, the collision point is not the one involving FixtureA and FixtureB.
Any suggestions?
I have some problem retrieving contact point in 2.1a... I want to show a sparkle in the contact point
I have used this code suggested in a previous post:
Code:
public override function BeginContact(contact:b2Contact):void
{
var collisionParams:CollisionParams = GetCollisionParams();//new CollisionParams(); // ottimizzazione: usare un buffer
collisionParams.shape1 = contact.GetFixtureA();
collisionParams.shape2 = contact.GetFixtureB();
contact.GetWorldManifold(_tempManifold);
//_tempManifold = contact.GetManifold();
collisionParams.position = _tempManifold.m_points[0];
_contactStack_Enter.push(collisionParams);
}
{
var collisionParams:CollisionParams = GetCollisionParams();//new CollisionParams(); // ottimizzazione: usare un buffer
collisionParams.shape1 = contact.GetFixtureA();
collisionParams.shape2 = contact.GetFixtureB();
contact.GetWorldManifold(_tempManifold);
//_tempManifold = contact.GetManifold();
collisionParams.position = _tempManifold.m_points[0];
_contactStack_Enter.push(collisionParams);
}
This seem to work properly in the most cases but when a lot of body collides, the collision point is not the one involving FixtureA and FixtureB.
Any suggestions?