Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
824 stars 92 forks source link

Refactor test motion #15

Closed pcbeard closed 8 months ago

pcbeard commented 8 months ago

Cache allocations of params and test_motion_result

Instead of allocating these on each call to _physics_process(), allocate once using @onready variables.

Also refactor calls to PhysicsServer3D.body_test_motion() to call a helper function, test_motion() to make the code smaller.

pcbeard commented 8 months ago

Here's a performance trace taken with these changes:

refactor_test_motion