Timeline for Can I swap out Farseer physics fixtures at runtime?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 25, 2012 at 18:49 | comment | added | Engineer | Thanks @WilHall, good luck slaying the other bugs if you haven't already. | |
| Jan 25, 2012 at 16:42 | comment | added | WilHall | Your answer has taken me the farthest for this question, so marking it as accepted. | |
| Jan 25, 2012 at 16:41 | vote | accept | WilHall | ||
| Jan 24, 2012 at 13:46 | comment | added | Engineer | @WilHall Have you tried a simple test case: Nothing but a world and a couple of bodies, and you hitting a key to toggle enablement of each? Just to make sure everything is kosher? Because if all you're doing is that, there should be no breakage to speak of. When that's working, google "teleport b2body" and you'll see how to shift it once enabled/disabled. | |
| Jan 24, 2012 at 13:38 | comment | added | WilHall | Hm, well currently I'm just enabling/disabling bodies, and still getting that error. If I don't disable/enable then, they error dissapears. Is there any reason doing so would cause that? | |
| Jan 24, 2012 at 13:32 | comment | added | jgallant | You cannot move fixtures around, it breaks. If you do that, you need to re-register the fixture to your Body, which will initialize a new fixture (bad for memory). You can, however, move bodies around. | |
| Jan 24, 2012 at 13:30 | comment | added | WilHall | I modified my player class to enable the body for the state it's in and disable bodies for other states, but I get the error NullReferenceException was Unhandled when stepping my world: mWorld.Step(Math.Min((float)nGameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));. I verified that none of the variables on that line were null. I got this error previously when I tried to modify fixtures in the player body, seems to happen when I change the player's body during the simulation. | |
| Jan 24, 2012 at 13:09 | comment | added | WilHall | But since this would be the player body, I would have to worry about movement...I suppose I could just disable the bodies that weren't being used? | |
| Jan 24, 2012 at 13:02 | history | edited | Engineer | CC BY-SA 3.0 | added 5 characters in body |
| Jan 24, 2012 at 12:57 | history | answered | Engineer | CC BY-SA 3.0 |