• Runtimes
  • C runtime physics issues

I'm working on a game that uses the C runtime. We're in the process of updating to 4.2 to make use of physics. But I've run into an issue. Here's a video:

It first shows how the animation plays back within the Spine editor. Then how it looks when passing "NONE" to updateWorldTransform(). Then how it looks when passing "UPDATE" instead. I can step through with a debugger and see it is running code for the physics constraints, and the behavior with "UPDATE" is different from with "NONE" or "POSE", so the physics is clearly doing something, but it's hard to tell what.

Things I have tried that made no difference: updating the runtime code to the latest from github, re-exporting the spine project, changing the spSkeletonJson->scale when importing, changing the timestep passed to spAnimationState_update(), calling spSkeleton_updateCache() at various times.

At this point I'm out of ideas for how to further debug this to figure out what's going wrong. Any suggestions or guidance is appreciated.

Related Discussions
...

Are you calling updateWorldTransform elsewhere? Doing that can pose the skeleton without physics or apply physics multiple times.

Are you advancing the skeleton time? You'll need to call Skeleton update.

Yep, it was that I wasn't calling spSkeleton_update(). I was heavily referencing the SDL runtime as a reference implementation, which also doesn't call update() on the skeleton (maybe an oversight?) and must have somehow missed it in the documentation. Thanks for the prompt reply!

  • Nate оценил это.

Sorry, that one's on me. While I did test the C++ SDL runtime, It appears I didn't test the C runtime with respect to physics. I've updated spine-sdl's C backend accordingly. Sorry for wasting your time!