Changing frames breaks revolute joints

Bugs will be moved here once resolved.

Post » Wed Dec 12, 2012 10:14 am

In short physics break when I change frames. I've noticed this from r111.
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Wed Dec 12, 2012 2:42 pm

It's hard to fix this because different animation frames can have a different size, collision polygon or origin, and the only way to update that in the physics engine is to destroy the physics body and teleport in a new one which breaks the joints, and there may not be an easy way to reattach them (such as if the attached image point is missing in the next frame).

Workaround: use physics only on objects which are not animated, and place animated sprites on top.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Wed Dec 12, 2012 7:47 pm

Would it be possible to have global collision mask? I currently use pin to object, but it doesn't look smooth.
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Thu Dec 13, 2012 1:28 pm

@nemo

You can use a global mask like an invisible object, where you can setup the points to anchor in, like you said, but a global collision mask, no.

Keep the collision masks simpler, or your game performance will suffer with hundred of calculations without necessity.
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,206
Reputation: 18,331

Post » Thu Dec 13, 2012 2:29 pm

@nemo - isn't using an invisible object with no animations the same as a global collision mask?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Dec 16, 2012 10:10 pm

@Ashley
I have created a physical skeleton and the head of it, is just invisible black box with the actual visible (Head)object pinned to it.
This is almost OK looking, but it doesn't follow the (box)head so well and kind of shakes when the physic is in action. It also feels like it's killing my mobile performance.
nemo2012-12-16 22:13:24
B
40
S
5
G
5
Posts: 405
Reputation: 5,657


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests