Menu

#17 minor optimization

open
nobody
5
2008-05-21
2008-05-21
Aidin Abedi
No

The following and similar-but-not-mentioned behaviors can be algorithmically optimized to use mult instead of div. In large simulations this is good.

Edit SteerLibrary.h at line 877 to:
if (neighbors > 0) steering = (steering - (forward() * (float)neighbors)).normalize();

Edit SteerLibrary.h at line 914 to:
if (neighbors > 0) steering = (steering - (position() * (float)neighbors)).normalize();

line no. refer to rev 188

/fooguru

Discussion

MongoDB Logo MongoDB