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

Bullet rigid body in character mode can't be rotated #12979

Closed
m4nu3lf opened this issue Nov 16, 2017 · 17 comments
Closed

Bullet rigid body in character mode can't be rotated #12979

m4nu3lf opened this issue Nov 16, 2017 · 17 comments

Comments

@m4nu3lf
Copy link
Contributor

m4nu3lf commented Nov 16, 2017

Operating system or device, Godot version, GPU Model and driver (if graphics related):
Linux amd64, Godot build 9a78efc

Issue description:
A body in character mode shouldn't rotate because forces act on it, bu itt should still be able to rotate if a non zero angular velocity is set. However using bullet and character mode seems to lock the object and prevent it to rotate in any way.

Steps to reproduce:
Create a rigid body, set it to character mode and set the angular velocity to (0, 10, 0). Switch between Bullet and GodotPhysics.

@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 16, 2017

A possible solution could be to just set the inertia along the axes to infinity if that is supported by Bullet

@reduz
Copy link
Member

reduz commented Nov 17, 2017 via email

@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 17, 2017

@reduz not even by changing the transform? (it is overwritten by the physics engine I think at every frame). If that is the case what is the purpose of this mode?
In GodotPhysics the body character mode can rotate if the angular velocity is set or by changing transform. Is this a bug in the GodotPhysics engine?

@reduz
Copy link
Member

reduz commented Nov 17, 2017 via email

@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 17, 2017

OK, but how is it meant to be used? is it the armature that should rotate?

@reduz
Copy link
Member

reduz commented Nov 17, 2017 via email

@eon-s
Copy link
Contributor

eon-s commented Nov 17, 2017

It was always possible to rotate the body, which is useful for capsules and other type of irregular shapes, in 3 the shape should be rotated instead then?

And if the rotation is a bug, affects 2D bodies...

@puppetmaster-
Copy link

@reduz Are there any plans to remove node2d properties from physic nodes or replace it with (physic working) one.
It's very confusing and also not beginner friendly and the quote in documentation
"In Godot you can animate anything you find in the Inspector." does not count anymore (very sad).
I'm not angry if it sound so.

@reduz
Copy link
Member

reduz commented Nov 17, 2017

@puppetmaster- I don't have the slightest clue about the meaning of what you just wrote

@puppetmaster-
Copy link

@reduz I try to explain . . .
RigidBody2D, KinematicBody2D . . . inherit from node2d, but when you use node2d function or animate the node2d properties you get a lot of problem or it didn't work. In godot 2.1 some of them worked but no more in godot 3. I attached some issues where describe it better.

some Issues:
#12335
#5734
#2129
#11050

I hope is clear now.

@reduz
Copy link
Member

reduz commented Nov 17, 2017

@puppetmaster- this has always worked like this, and it's super easy to work around. I don't really see the problem. Most of these issues should be closed, save for applying scale to rigid bodies, which will be done, but after 3.0 is out

@puppetmaster-
Copy link

@reduz Great! So animating position, scale and rotation will work again in a future release after 3.0 is out.

@reduz
Copy link
Member

reduz commented Nov 17, 2017

@puppetmaster- there really is no point in animating those things, you can animate the shapes or meshes though and that works fine.

@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 17, 2017

I think the discussion is a bit OT now, but @eon-s had a very fair point. I personally think it would be good to have a behavior like in the old engine, so you can rotate the body with the collision shapes (e.g. on user input) but without having it rolling, or rotating in any way because of physics interactions.
This is my opinion but in any case I'm not sure this is supported by Bullet.

@reduz
Copy link
Member

reduz commented Nov 17, 2017

@m4nu3lf Of course it should be good, but it makes supporting it in a physic engine more work, for something that can be very easily worked around. I would have expected it to not even work in Godot physics

@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 17, 2017

Yes, it basically behaves like if the inertia has some infinite values. So it all boils down if you can set the inverse inertia to zero in Bullet. I agree that it can be worked around as I already did in one project, (so it is not a major issue for me), but it is not immediate if you want to keep the physics interactions for the linear part and you have an irregular shape.

@kakoeimon
Copy link

After some discussion on irc I found out that:
Bullet physics RigidBodies in Character mode cannot use angular velocity to rotate, but it is possible to manipulate the transform.
The problem can be bypassed by using Axis Lock and not the Character mode.
For example lock Angular X and Z to be able to rotate in Y.
I believe this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants