Inertia working weird, things that spin are not transfering properly, far too much spinning for heavy objects #267
Replies: 5 comments
-
Can you describe again in more detail? Firstly, you said in Godot Physics it works correctly, and in Rapier inertia isn't calculated automatically (it is calculated automatically). """ The ship doesnt rotate as much as it used to in Godot Physics. I assume the inertia isn't calculated automatically... Btw, you can get the computed inertia of the body (even if its set to automatic) by doing: |
Beta Was this translation helpful? Give feedback.
-
Ah, right I gotcha, I'm using a RigidBody2D node. It has a Polygon2D node for its visual, the points are generated so the shape is not the same as other polygon2D. This shape array is then given to a CollisionPolygon2D so that its visual shape is equivalent to its collision. This is used as the asteroid. I'm also using a small 8-point CollisionPolygon to cut holes in the main Polyshape/roid but only when it's hit with a bullet. I'm using a RigidBody 2D with a CircleShape2D with CollisionShape2D for my ship. I In the Default physics engine, the poly asteroids colliding will apply accurate linear and angular forces and move smoothly rotationally speaking, again no damping is used for angular. I don't have to set inertia, but if I do set it to say, mass, I can get similar effects to how it works without setting inertia in Rapier2D. In Rapier with the same settings, no inertia set so should be automatic, it seems as though the angular movement is way too loose. The mass on my player object is set to 1000kg, or a metric ton, whereas some asteroid game objects are much heavier, say 80,000kg. The ship can easily stop a spinning asteroid and won't move at all, bouncing the asteroid rotationally back and forth. When asteroids collide they also exhibit this behavior, the linear momentum seems to spread correctly but the angular or rotation bounces erratically until it wears out, sometimes making them spin way faster than the frame rate can interpret it, which is way faster than I'd assume them to appear in space... at least my space, be it ever so humble. |
Beta Was this translation helpful? Give feedback.
-
So the issue is that when you call apply_force and/or apply_torque it applies more rotation than in regular Godot Engine? You should open an issue instead and put a reproducible project. |
Beta Was this translation helpful? Give feedback.
-
No, only when bodies collide, applying forces is fine. If I can reproduce the problem I will do that, but so far I cannot get a simple example to exhibit the weirdness. That's why I didn't really want to make it an issue since it's probably something I'm doing weird since I'm used to the default physics engine. I'll play with things in my test project and see if I can reproduce faithfully. |
Beta Was this translation helpful? Give feedback.
-
I did have a working example of the problem, until I removed the Rapier extension and re-downloaded 0.8.6. Now things seem to work correctly, have no idea why exactly. I've done this reinstall a few times but it may have been something that didn't get updated on my end on or before 0.8.3. |
Beta Was this translation helpful? Give feedback.
-
It seems like inertia isn't being calculated automatically. In default godot physics large colliding objects with smaller (less mass) ones work properly, however, everything acts like it has the same angular mass, like styrofoam or none at all, spinning wildly and often times asteroids gain angular velocity from little collision contact when they are actually metric tons in linear energy. I'm not sure how to make these objects act properly as in my situation it is a space game and things can't really have dampening, nor can I get the proper inertial effect from dampening. So I'm kinda stuck at this point or may just have to use default physics, which has it's own problems. Any insight would be a great help.
Beta Was this translation helpful? Give feedback.
All reactions