Comments (2)
I was looking at the automatically calculated inertia vector and comparing it to the one that the default 3D physics provides and it looks like the y and z are swapped, as if GodotJolt is mistaking Z as the up vector.
I'm not sure how this went unreported for this long, nor how I missed this to begin with, but yes, the inertia as reported by PhysicsDirectBodyState3D.inverse_inertia
is indeed incorrect. Apparently I had missed that you need to multiply Jolt's GetInverseInertiaDiagonal()
with its GetInertiaRotation()
in some way to get the proper local-space inertia. So the inertia is correct within Jolt, but reported incorrectly by this extension.
If you need a workaround (until I can publish a fix) you should be able to extract the inertia diagonal from the world-space inertia tensor instead, as that one is actually correct, by doing something like this:
var inverse_inertia_tensor := state.transform.basis.transposed() * state.inverse_inertia_tensor * state.transform.basis
var inverse_inertia := Vector3(inverse_inertia_tensor[0][0], inverse_inertia_tensor[1][1], inverse_inertia_tensor[2][2])
I've got a body that is very narrow but tall and I wanted to make sure it could spin freely along the y axis but be hard to topple (so in default physics this would be making the x and z inertia very high) but this does not do anything at all in GodotJolt.
I'm guessing you're leaving the Y-component at zero? It appears I've also missed the fact that Godot Physics allows for a partial custom inertia, where leaving only certain components at zero will still use the automatically computed value for those components. Right now you'll only get the automatically computed value for the inertia if you leave all three components at zero, meaning you actually get zero (which is not valid) if you only leave one or two components at zero. The workaround in this case (until I can get a fix in) would be to set a non-zero value for all components if you want to use a custom inertia.
from godot-jolt.
The fix for both of these issues can now be found in the latest pre-release, 0.13.0-beta1, which you'll find here.
Note that this version targets the just recently released Godot 4.3-beta1, so won't work with Godot 4.2. Also note that this version is not available through the Godot Asset Library, so you'll need to download it through GitHub.
A proper release will be out some time around Godot 4.3-stable.
from godot-jolt.
Related Issues (20)
- Linux clang build doesn`t work HOT 2
- `JoltPhysicsServer` returns the direct state of bodies without a space in `_body_get_direct_state` HOT 1
- [Crash] Freeing any PhysicsBody3D with a CollisionPolygon3D will crash the game when "Visible Collision Shapes" is enabled HOT 3
- `linear_damp`/`angular_damp` produces inconsistent behavior between different `physics_ticks_per_second` HOT 13
- Increase precision of sliders for Contact Allowed Penetration and Contact Speculative Distance HOT 1
- Editor ray-casts fail when using many bodies HOT 7
- Softbody properties cannot be changed HOT 3
- Double-Precision-Engine crashes upon loading project HOT 2
- CharacterBody-RigidBody collision is broken HOT 1
- Support for tapered capsule shape HOT 1
- GodotJolt is crashing the project and can't be opened in the editor, when Godot is a custom 4.2.2 build HOT 1
- JoltGeneric6DOFJoint3D angular limit gizmo not correct HOT 11
- Inconsistent behaviour between placed and instantiated `RigidBody3D` HOT 22
- Applying force/torque to `RigidBody3D` does not reset its sleep timer HOT 9
- Several crashes when running with fuzzer HOT 1
- `mouse_entered` and `mouse_exited` for CollisionObject3D do not work HOT 2
- Add support for AddressSanitizer HOT 1
- Improve doc for using a non-stable version of godot HOT 3
- Add CMake option for providing a custom extension API HOT 6
- version 0.13 beta1 doesnt open in brand new project HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-jolt.