Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cohesion Behavior doesn't take position of boid being steered into account? #6

Closed
MichaelDCMack opened this issue Jan 12, 2012 · 2 comments
Assignees

Comments

@MichaelDCMack
Copy link

Hi!

First thing I tried after opening the boids example was reducing it to two birds who only had Cohesion Behaviors. I then made the Cohesion Behaviors aware of everything within 180 degrees and radius of 20.

Strangely, the birds consistently behaved badly. One would head for the edge of the screen and the other would follow (based on the initial positions).

So I looked, and when the center of the boid 'flock' is found in the Cohesion Behavior, it is found in global space rather than 'current boid relative space'. That means that the forces being generated were only proper if the current boid being steered happened to be at the origin.

When I fixed this, the boids continually 'seeked' each other as I was expecting.

Bug or feature?

@ricardojmendez
Copy link
Owner

Hi Michael,

Not sure why this issue escaped me, but you seem to be right - that would be a bug. Thanks!

@ghost ghost assigned ricardojmendez Jan 20, 2012
@ricardojmendez
Copy link
Owner

Resolved on commit a47da05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants