Cool features from the upcoming Godot 3.1

Since I’ve being able to compile Godot from my laptop i’ve being testing it as I want to re-write the GodotMapLoader plugin for this version (my previous version is broken in v3.1).

And today I found out 2 cool features I want to share here:

  • Debug windows shows where the error is originated from
  • RigidBody have quite a few new and cool functions

Debugger

Above the 3.1 debugger version agains the 3.0 (below)

As you can see from the image now the errors tab of the debugger not only contains the error message, but has a dropdown that shows the source of the error.

And not only that, in the previous version the error was shown in the debugger tab, that, if you think about it, was the wrong place to display that, as the debugger tab should be used for debugging (like variables inspection).

So good job to the contributors that made that great improvement, I’m sure I’ll need that very soon.

RigidBody new and cool functions

Well, before rigid body was the standard node for object that need to fall… yes, and mainly that only, because the possibilities given by that node where quite limiting.

Here a comparison of properties and methods available in the respective versions:

Version 3.0

Methods

  1. void _integrate_forces ( PhysicsDirectBodyState state ) virtual
  2. N/A
  3. N/A
  4. N/A
  5. N/A
  6. void apply_impulse ( Vector3 position, Vector3 impulse )
  7. N/A
  8. Array get_colliding_bodies ( ) const
  9. void set_axis_velocity ( Vector3 axis_velocity )

Properties

  1. float angular_damp
  2. Vector3 angular_velocity
  3. bool axis_lock_angular_x
  4. bool axis_lock_angular_y
  5. bool axis_lock_angular_z
  6. bool axis_lock_linear_x
  7. bool axis_lock_linear_y
  8. bool axis_lock_linear_z
  9. float bounce
  10. bool can_sleep
  11. bool contact_monitor
  12. int contacts_reported
  13. bool continuous_cd
  14. N/A
  15. N/A
  16. N/A
  17. N/A
  18. N/A
  19. N/A
  20. N/A
  21. N/A
  22. N/A
  23. N/A

Version 3.1

Methods

  1. void _integrate_forces ( PhysicsDirectBodyState state ) virtual
  2. void add_central_force ( Vector3 force )
  3. void add_force ( Vector3 force, Vector3 position )
  4. void add_torque ( Vector3 torque )
  5. void apply_central_impulse ( Vector3 impulse )
  6. void apply_impulse ( Vector3 position, Vector3 impulse )
  7. void apply_torque_impulse ( Vector3 impulse )
  8. Array get_colliding_bodies ( ) const
  9. void set_axis_velocity ( Vector3 axis_velocity )

Properties

  1. float angular_damp
  2. Vector3 angular_velocity
  3. bool axis_lock_angular_x
  4. bool axis_lock_angular_y
  5. bool axis_lock_angular_z
  6. bool axis_lock_linear_x
  7. bool axis_lock_linear_y
  8. bool axis_lock_linear_z
  9. float bounce
  10. bool can_sleep
  11. bool contact_monitor
  12. int contacts_reported
  13. bool continuous_cd
  14. bool custom_integrator
  15. float friction
  16. float gravity_scale
  17. float linear_damp
  18. Vector3 linear_velocity
  19. float mass
  20. Mode mode
  21. PhysicsMaterial physics_material_override
  22. bool sleeping
  23. float weight

Why I’m so enthusias about it

Well, I tried months… or it was years…? Well, time ago, to develop a demo with a spaceship with ‘planets’ and realistic newtonian physics, so I had to use a RigidBody in order to do that, but, to simulate the rocket engine I couldn’t find an easy way to apply a constant force, like the one applied to a real rocket. I did it anyways by using another function that simulates a single impulse, repeated over time, namely apply_impuls, but it was not what I really needed, and in fact it would have been hard for example to calculare the correct force to place the rocket into stable orbit, for example.

Well, today I wanted to start over and do another “Rocket smulator” demo and of course, with Godot 3.1, so I found out this beautiful new, and wanted to share it with you, dear reader.

And in general, as you can see there are lot of new functions that surely will make our life’s much easier.. well, at least if you work with 3d and realistic physics.

Posted in Miscellaneous.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.