Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for manual bone rotation issue affecting all cloned animated skel… #1759

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

abow
Copy link
Contributor

@abow abow commented Feb 9, 2017

…etons that

Fix for this issue:
http://www.html5gamedevs.com/topic/28257-cloning-bones/

When an animation is played on a bone, the matrix from the animation key frame replaces the _matrix (localMatrix) of the bone.
When a skeleton is cloned, the animations of each of the bones are copied, but they still share keyframes. Since the animations share the same keyframes and the keyframe matrix replace the bone's localMatrix, the bones of a cloned skeleton end up sharing the same localMatrix when they play the same animation.

This PG compares bones of two cloned skeletons before and after animations are run:
http://www.babylonjs-playground.com/#1ZBQR3#5

This fix uses a setter to force the _matrix to copy the values to the localMatrix of the bone. As a result, the bone retains the original unique localMatrix.

@deltakosh deltakosh merged commit cdd710a into BabylonJS:master Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants