@mayobutter, or wck users.
traditionally box2d (at least 2.01 which i was used to) dispatches contactPersist events repeatedly until the contact no longer exists. i understand using alchemy this would slow things down... and its possible that the box2d core has changed this too in 2.1 i haven't checked.
to the point: using wck, i am trying to loop through the contact list and resend existing contacts on enter frame. but I seem to be doing something wrong.
i seem to get count > 0 when i first hit something, but if i stay inside the object, it goes back to 0.
wondering if you have a recommendation for getting back to "contactPersist" type functionality.
here's some stuff I'm using basically grabbed from your boxMan class.
traditionally box2d (at least 2.01 which i was used to) dispatches contactPersist events repeatedly until the contact no longer exists. i understand using alchemy this would slow things down... and its possible that the box2d core has changed this too in 2.1 i haven't checked.
to the point: using wck, i am trying to loop through the contact list and resend existing contacts on enter frame. but I seem to be doing something wrong.
i seem to get count > 0 when i first hit something, but if i stay inside the object, it goes back to 0.
wondering if you have a recommendation for getting back to "contactPersist" type functionality.
here's some stuff I'm using basically grabbed from your boxMan class.
Code:
public var contacts:ContactList;
public override function create():void {
reportBeginContact = true;
reportEndContact = true;
fixedRotation = true;
super.create();
listenWhileVisible(this, ContactEvent.BEGIN_CONTACT, handleContact);
contacts = new ContactList();
contacts.listenTo(this);
}
private function doCollision():void{ //called on enter frame
var count:int = 0;
contacts.forEach(function(keys:Array, c:ContactEvent) {
count++
//handleContact(c);
});
trace("count: "+count);
contacts.clean();
}
public override function create():void {
reportBeginContact = true;
reportEndContact = true;
fixedRotation = true;
super.create();
listenWhileVisible(this, ContactEvent.BEGIN_CONTACT, handleContact);
contacts = new ContactList();
contacts.listenTo(this);
}
private function doCollision():void{ //called on enter frame
var count:int = 0;
contacts.forEach(function(keys:Array, c:ContactEvent) {
count++
//handleContact(c);
});
trace("count: "+count);
contacts.clean();
}