godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.51k stars 21.07k forks source link

Scaling Skeleton with PhysicalBones results in math errors #40614

Open arnerak opened 4 years ago

arnerak commented 4 years ago

Godot version: 3.2.1

OS/device including version: Windows 10 1903

Issue description: This error appears (many times) when scaling up a rigged character with PhysicalBones. core/math/basis.cpp:304 - Condition "!m.is_diagonal()" is true. Returned: Vector3() In a project of mine these errors already appear in the editor, when switching to a scene tab that contains such a Node. It also happens when running the game once the scene is initalized, as well as when closing the game. In the attached project it only happens when closing the game for some reason. It does not matter whether I scale up the character in blender or godot. Note that this also breaks HingeJoints: gg

Steps to reproduce:

  1. Let mixamo rig a model
  2. import into blender 2.1. (scale up armature and mesh in blender)
  3. export better collada
  4. auto generate physical bones
  5. (scale up if 2.1 was skipped)
  6. run physical bone simulation

Minimal reproduction project: godottest.zip

fire commented 4 years ago

Is the scaling uniform or not? Like 2x on all axes?

arnerak commented 4 years ago

Is the scaling uniform or not? Like 2x on all axes?

Yes, however it only tends to glitch out from large scaling factors like 10 and above. For now I have scaled the mesh properly before importing it into mixamo to avoid scaling it afterwards and it works fine.