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
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
- void _integrate_forces ( PhysicsDirectBodyState state ) virtual
- N/A
- N/A
- N/A
- N/A
- void apply_impulse ( Vector3 position, Vector3 impulse )
- N/A
- Array get_colliding_bodies ( ) const
- void set_axis_velocity ( Vector3 axis_velocity )
Properties
- float angular_damp
- Vector3 angular_velocity
- bool axis_lock_angular_x
- bool axis_lock_angular_y
- bool axis_lock_angular_z
- bool axis_lock_linear_x
- bool axis_lock_linear_y
- bool axis_lock_linear_z
- float bounce
- bool can_sleep
- bool contact_monitor
- int contacts_reported
- bool continuous_cd
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
- N/A
Version 3.1
Methods
- void _integrate_forces ( PhysicsDirectBodyState state ) virtual
- void add_central_force ( Vector3 force )
- void add_force ( Vector3 force, Vector3 position )
- void add_torque ( Vector3 torque )
- void apply_central_impulse ( Vector3 impulse )
- void apply_impulse ( Vector3 position, Vector3 impulse )
- void apply_torque_impulse ( Vector3 impulse )
- Array get_colliding_bodies ( ) const
- void set_axis_velocity ( Vector3 axis_velocity )
Properties
- float angular_damp
- Vector3 angular_velocity
- bool axis_lock_angular_x
- bool axis_lock_angular_y
- bool axis_lock_angular_z
- bool axis_lock_linear_x
- bool axis_lock_linear_y
- bool axis_lock_linear_z
- float bounce
- bool can_sleep
- bool contact_monitor
- int contacts_reported
- bool continuous_cd
- bool custom_integrator
- float friction
- float gravity_scale
- float linear_damp
- Vector3 linear_velocity
- float mass
- Mode mode
- PhysicsMaterial physics_material_override
- bool sleeping
- 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.