View previous topic :: View next topic |
Author |
Message |
brianguertin
Joined: 26 Dec 2008 Posts: 8
|
Posted: Sun Jan 04, 2009 3:23 pm Post subject: body stops reacting after xForm |
|
|
Im trying to use xForm to just move a body from point A to B. If i try once, its position is moved to the new location, but it stops reacting to all gravity/collision. Further calls to xForm with different positions dont have any effect. I've tried waking up the body after the call just in case but that doesn't help; |
|
Back to top |
|
|
mike
Joined: 28 Dec 2008 Posts: 34
|
Posted: Sun Jan 04, 2009 5:26 pm Post subject: |
|
|
What exactly is xForm? I might be able to help but i have no idea what xForm is. |
|
Back to top |
|
|
brianguertin
Joined: 26 Dec 2008 Posts: 8
|
Posted: Sun Jan 04, 2009 9:10 pm Post subject: oops |
|
|
Sorry, i meant I'm setting the bodies position using the method Body.xForm.
body_.xForm(Vec2(0, 1), 0); // teleports the body to (0, 1) |
|
Back to top |
|
|
brianguertin
Joined: 26 Dec 2008 Posts: 8
|
Posted: Sun Jan 04, 2009 9:22 pm Post subject: |
|
|
ok upon further inspection, i noticed xForm always returns false which supposedly means the body is outside the world aabb. problem is, i see no mention of how im supposed to *set* the aabb... the World constructor only expects gravity and whether to sleep
new World(Vec2(0, 9.9, true);
// but according to box2d i should be providing an AABB
auto aabb = new AABB;
aabb.lowerBound.set(-100, -100);
aabb.upperBound.set(100, 100);
new World(aabb, Vec2(0, 9.9, true);
// but this doesnt work with blaze. what am i missing? |
|
Back to top |
|
|
brianguertin
Joined: 26 Dec 2008 Posts: 8
|
Posted: Sun Jan 04, 2009 10:26 pm Post subject: |
|
|
ok, im not exactly sure what the logic is supposed to be in the xForm method, but i looked over it and it calls a function (Shape.synchronize) which always returns false. It then decides, if that function returns false, that it should freeze the body, therefore the body is frozen 100% of the time when calling xForm.
to work around this i juse commented out the part the whole part that says "if (freeze == true)", and associated logic so that it wont freeze the body anymore. my editor is looking good again |
|
Back to top |
|
|
SirAlaran
Joined: 19 Feb 2007 Posts: 84 Location: Silicon Valley
|
Posted: Thu Jan 08, 2009 2:39 pm Post subject: |
|
|
brianguertin wrote: | ok, im not exactly sure what the logic is supposed to be in the xForm method, but i looked over it and it calls a function (Shape.synchronize) which always returns false. It then decides, if that function returns false, that it should freeze the body, therefore the body is frozen 100% of the time when calling xForm.
to work around this i juse commented out the part the whole part that says "if (freeze == true)", and associated logic so that it wont freeze the body anymore. my editor is looking good again |
Hm. I'll have to try to track down Mason and ask him about that. I didn't write blaze (and honestly haven't had the time to look through it all) so I don't even know why synchronize is supposed to return a bool.
If something else explodes because of this, let me know. If you don't find any bugs caused by it I may just make those lines commented in svn. |
|
Back to top |
|
|
|