We are about to switch to a new forum software. Until then we have removed the registration on this forum.
why in the fisica library, in any contact function (like contactStarted), if you try to fire a method like setPosition, setRotation or setStatic on a FBody involved in the collision, it always returns "Assertion Error" ? Is there a workaround if for example I want to change the position, rotation or make it static once the contact happens?
for example:
void contactStarted(FContact c) { if (c.contains(myBody)) {
myBody.setStatic(false);
} }
thanks
Answers
i figured out a workaround where basically I just set a different fill for the body involved in the contact of which I want to setStatic(false), using setFill(0), then I loop trough all the bodies (they are contained in a custom array) and if one of them is black (getFill() == color(0)) then i restore its actual color and setStatic(false) and it works. Funny solution but it works.