Runtime information
4.2 beta (Should apply to all current and future runtime update of physics constraint)
Problem statement
In general, my beta updated runtime physic constraints do not behave like the editor physics constraint. One easy difference is the application of wind or gravity to the physics constraint.
Troubleshooting statement
I debugged my beta updated runtime trying to find where the physics constraint misbehaved.
I stumbled upon if (remaining >= step)
on:
EsotericSoftware/spine-runtimesblob/4.2-beta/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java#L146
EsotericSoftware/spine-runtimesblob/4.2-beta/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java#L186
During my debugging, remaining
variable is always 0 preventing the branches from executing. If I reverse the comparison to less than or equal, it allowed my runtime physics constraint behave like the editor physics constraint.
I don't see how the remaining
variable is increasing beyond 0.
- The
reset
method sets remaining
variable to 0.
remaining -= step
decreasing counter
remaining += Math.max(skeleton.time - lastTime, 0)
always increasing by 0.
The skeleton.time
doesn't seem to have any real use. I don't see skeleton update
method being called in the runtime source.
public void update (float delta) {
time += delta;
}
EsotericSoftware/spine-runtimesblob/4.2-beta/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java#L818
Even if I call skeleton update
method with a delta
greater than step
in my rendering code before or after skeleton.updateWorldTransform(spine.Physics.update)
, the physics constraint doesn't look like in the editor.
In conclusion, I think this is a bug or I updated my runtime terribly wrong.