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
42
S
5
G
5
Posts: 407
Reputation: 5,711

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
378
S
220
G
84
Posts: 23,868
Reputation: 188,151

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
42
S
5
G
5
Posts: 407
Reputation: 5,711

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
Image
B
99
S
22
G
16
Posts: 1,338
Reputation: 21,237

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
378
S
220
G
84
Posts: 23,868
Reputation: 188,151

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
42
S
5
G
5
Posts: 407
Reputation: 5,711


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests