mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-07-14 02:21:51 -04:00
Improved general performance, Fixed Boid lift calculation
This commit is contained in:
parent
e4c5abe3c9
commit
74d2e07e59
3 changed files with 57 additions and 25 deletions
|
@ -110,7 +110,7 @@ function creatura.get_boid_dir(self)
|
|||
local closest_pos
|
||||
for _, object in ipairs(boids) do
|
||||
if object then
|
||||
boid_pos, vel = object:get_pos(), object:get_velocity()
|
||||
boid_pos, vel = object:get_pos(), vector.normalize(object:get_velocity())
|
||||
if boid_pos then
|
||||
local obj_yaw = object:get_yaw()
|
||||
pos_no, pos_sum = pos_no + 1, vec_add(pos_sum, boid_pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue