Jump to content

Updating Bone Transform Matrices


mkadirtan
 Share

Recommended Posts

Hello everyone! ?

In my BJS project, it is possible to key a characters position in the timeline.

I achieved  this result using GSAP Timeline tool. However, for my system to be consistent I need to control skeleton animations via same timeline.

My solution ideas:

  1. use some kind of goToFrame() function (which I couldn't find for skeletal animations, also it is hard to control speed this way)
  2. Manage skeleton animation using a nested timeline.

My problem is that:

I've found the way bone animations are recorded. If I'm correct "_localMatrix.m" value is being updated during animation. However, I couldn't manage to update it manually. What am I missing here? What does "_" in a variable name tell me?

Thanks in advance!

//Loaded animation data
myCharacter.skeleton.bones[i].animations[j]._keys[k].value.m

//Characters current state
myCharacter.skeleton.bones[i]._localMatrix.m

 

Capture.JPG

Link to comment
Share on other sites

Hi @mkadirtan!

Usually an underscore '_' in front of a variable name is something that should not be used publicly.  Though you can try moving all of the skeleton animations to an AnimationGroup.  That way you can call .goToFrame(frameNumber) to go to the frame you want.
Here is an example playground: http://playground.babylonjs.com/#6A4VD7#3

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...