You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, grabbable objects are switched to RigidBody.MODE_CHARACTER whenever grabbed in order to attach the object to the hand, but this interferes with the normal RigidBody physics of that object. This is alright, but the implementation for the throw() part of the code applies an artificial force to the RigidBody upon release (upon switching back to RigidBody mode), rather than actually letting the RigidBody gain its velocity normally. This causes some throws to look weird and have an unnatural trajectory.
The solution should be to never change the RigidBody mode of the grabbed object, and instead change its transform.origin via _integrate_forces() to modify its position in the PhysicsState. Another possible solution would be to simply perform better calculations on the hand trajectory and factor that into the artificial application of velocity. I prefer the former.
The text was updated successfully, but these errors were encountered:
Be wary that the reason why MODE_CHARACTER was chosen in the first place was also to completely circumvent collision with the player's body. Making it use the normal rigid body state would then require the collision layers to be tweaked so that it doesn't collide with the player's body.
Currently, grabbable objects are switched to RigidBody.MODE_CHARACTER whenever grabbed in order to attach the object to the hand, but this interferes with the normal RigidBody physics of that object. This is alright, but the implementation for the throw() part of the code applies an artificial force to the RigidBody upon release (upon switching back to RigidBody mode), rather than actually letting the RigidBody gain its velocity normally. This causes some throws to look weird and have an unnatural trajectory.
The solution should be to never change the RigidBody mode of the grabbed object, and instead change its transform.origin via _integrate_forces() to modify its position in the PhysicsState. Another possible solution would be to simply perform better calculations on the hand trajectory and factor that into the artificial application of velocity. I prefer the former.
The text was updated successfully, but these errors were encountered: