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

Failing to load skeleton #32

Open
crjc opened this issue Nov 12, 2020 · 3 comments
Open

Failing to load skeleton #32

crjc opened this issue Nov 12, 2020 · 3 comments

Comments

@crjc
Copy link

crjc commented Nov 12, 2020

Hello, lovely plugin here. I'm just struggling to load a particular mesh:

Walking2.glb.zip
(However, CesiumMan works fine)

Basically, I am receiving the following assertion from Ogre:
(!pos.isNaN() && "Invalid vector supplied as parameter"), function setPosition, file .../OgreMain/src/OgreOldNode.cpp, line 391.

bone->setPosition(parent->convertWorldToLocalPosition(translation));

It looks like convertWorldToLocalPosition is returning NaN values because the scale of the parent bone is +inf.

If I comment out the following line, the mesh loads fine - however, playing an animation makes everything look awful. I may be mistaken but I believe the scale becomes so small until it reaches a point where _getDerivedScale starts returning +inf.

bone->setScale(parent->_getDerivedScale() / scale);

I'm kinda running out of ideas and would appreciate it if I could be pointed in the right direction

Thanks!

@crjc
Copy link
Author

crjc commented Nov 27, 2020

I actually stopped that assertion by flipping the division, although the mesh breaks as soon as you begin an animation.

bone->setScale(scale / parent->_getDerivedScale()); 

@xissburg
Copy link

Try removing the scale. As you see in line 38 it is doing a decomposition of the bind matrix into rotation, translation and scale. What are the contents of that matrix.?

@crjc
Copy link
Author

crjc commented Nov 30, 2020

I believe the matrix is the global transform of the bone, and Ogre expects the position, rotation and scale of a bone to be local.

I have tried to simply not apply the scale to a bone, and this loads the mesh fine, however animations turn the mesh into spaghetti.

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

No branches or pull requests

2 participants