Jump to content

[SOLVED]getPositionToRef Laggy Movement


Raggar
 Share

Recommended Posts

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?

 

Link to comment
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.

 

Link to comment
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

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...