Re: [Algorithms] raytrace sharing
Brought to you by:
vexxed72
From: Jim O. <j.o...@in...> - 2000-11-14 23:22:37
|
> I am working on AI right now, and come across something that, > if there are > ... > how to optimize walks of same tree but different "center" > position of cone. Perhaps you can decrease the number of full walks by doing a bidirectional line of sight test on all your objects. I.e. for (i = 0; i < n; i++) { for (j = i; j < n; j++) { if (objects[i].isInLineOfSight(objects[j]) { /* process object[j]'s relation to object[i] here */ } if (objects[j].isInLineOfSight(objects[i])) { /* process object[i]'s relation to object[j] here */ } } } The AI processing time should be exactly the same, but the time required to walk all nodes should decrease. Jim Offerman Innovade |