-
Notifications
You must be signed in to change notification settings - Fork 5
Bone Manipulation
The core spine runtime doesn't provide any form of bone manipulation. It allows you to play an animation and gives you access to the various objects that make a skeleton. With the monkey-spine runtime we have added a SpineEntity that sits on-top of this and handles all of the complicated stuff. Such as bone manipulation...
For a complete reference to all of the API commands available to you, please see the file glue/spineentity.monkey. There are a plethora of methods available!
There is one technical issue with bone manipulation. You have two things potentially influencing your skeleton: the animation exported from Spine and the manipulation you want to perform on a particular bone. Because of this we have to make sure that we update our SpineEntity correctly.
spineBoy.Update(deltaTime)
spineBoy.SetBoneRotation("head", 45.0)
Upon calling the Update() method our SpineEntity will update the skeleton to the latest state of whichever animation you are playing. After that we are free to Get/Set the bones states and we will get the desired effect. You should treat each bone manipulation as only a short term change to the skeleton. Next time you call Update, the modifications you made will be replaced with the next state of the animation.
To clarify, you should be applying any bone manipulations each frame. The reasoning for this was a mix of reasons including the official generic runtime structure or the way animation is applied. The main idea though was that most people will probably not manipulate bones and we wanted to keep the SpineEntity a separate layer that didn't require massive alterations to the generic runtime.