Sign in to follow this  
Followers 0
Raggar

[SOLVED]getPositionToRef Laggy Movement

6 posts in this topic

I was wondering if it's possible, and if yes, then how, to get more responsive movement when using getPositionToRef to attach a mesh to a bone assigned to some skeleton from an imported model.

I think it's the same when using attachToBone.

http://www.babylonjs-playground.com/#1N9CSW#2

The position and rotation of bone #6 (right hand) is used to position the sphere. Imagine it was a sword or a gun. Try moving the camera around, and notice the movement of the sphere. It seems to be a little behind, and not as crisp as one would have hoped for. Am I missing something here?

 

Share this post


Link to post
Share on other sites

This is an issue with parenting the mesh to the camera.

http://www.babylonjs-playground.com/#1BZJVJ#92

http://www.babylonjs-playground.com/#1BZJVJ#96

edit:

also occurs when parenting to a mesh (skeletonViewer lags):

http://www.babylonjs-playground.com/#1BZJVJ#93

attachToBone doesn't look bad though:

http://www.babylonjs-playground.com/#1BZJVJ#94

http://www.babylonjs-playground.com/#1BZJVJ#95

For now you should use attachToBone.

edit 2:

I got it to work by computing the world matrix of the mesh before getting the position or the bone:

http://www.babylonjs-playground.com/#1N9CSW#6

I'll submit a PR to fix this issue sometime this week.

 

Wingnut and Raggar like this

Share this post


Link to post
Share on other sites
4 hours ago, adam said:

It appears to me that you might have some skeleton issues.

I'm wondering whether this might be because I'm using dummy objects instead of the standart bones in Max.

I'll recreate the skeleton using bones and see if that fixes the issue.

 

4 hours ago, adam said:

I got it to work by computing the world matrix of the mesh before getting the position or the bone:

http://www.babylonjs-playground.com/#1N9CSW#6

I'll submit a PR to fix this issue sometime this week.

 

Awesome. Looks much better. Thank you, once again :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.