SetFilterData has no effect

Discuss issues specific the Javascript port of Box2D
icd2k3
Posts: 31
Joined: Thu Dec 17, 2009 9:53 am

SetFilterData has no effect

Postby icd2k3 » Tue Feb 21, 2012 9:47 am

box2dweb 2.1a version: http://code.google.com/p/box2dweb/

Hey all, having a bit of trouble with the port. I am able to change the filter group of my objects dynamically (logs out fine) however, changing fixtures bodies at runtime seems to have no effect in the web vesrion.

I noticed for older box2d versions there was a world.refilter method that has been depreciated... any ideas to make my box2d bodies react to having their collision filter changed?

Background Info:
doing this for a game where there's 2 pirate ships that shoot at each other - when a cannonball hits a ship I change it's collision group so it should stop contacting the ship... but it does

I also tried adding my filter changes to an array and calling setfilterdata before the world timestep, but same issue.

TL;DR setting collision groups when creating fixtures works, but not dynamically during runtime with setfilterdata... pulling my hair out.

icd2k3
Posts: 31
Joined: Thu Dec 17, 2009 9:53 am

Re: SetFilterData has no effect

Postby icd2k3 » Tue Feb 21, 2012 10:45 am

Ah my bad, was unaware of contact.FlagForFiltering();


Return to “Javascript”



Who is online

Users browsing this forum: No registered users and 1 guest