Timeline for How to implement smooth flocking
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 5, 2012 at 20:45 | comment | added | House | I suppose because you're only adding to their position. Look some more at how you're calculating the position. | |
Dec 5, 2012 at 20:43 | comment | added | Craig | Hmm, they now all move to the right of the screen, always facing the same way. | |
Dec 5, 2012 at 20:31 | comment | added | House | Yes, something like that. Plug it in and see how it works. | |
Dec 5, 2012 at 19:42 | comment | added | Craig |
would it be along these lines then mice[index].targetPosition = mice[index].mousePosition += (separate * separationImpact) + (moveCloser * cohesionImpact) + (moveAligned * alignmentImpact); mouseOrientation = Game1.TurnToFace(mousePosition, mice[index].targetPosition, mouseOrientation, MouseTurnSpeed);
|
|
Dec 5, 2012 at 19:11 | comment | added | House |
Yes. You should be setting the seekPosition and using the TurnToFace function in the flocking. Since you're just setting the position of the mice, you're not making them move toward the desired position. So they won't necessarily be facing the position you move them to.
|
|
Dec 5, 2012 at 19:03 | comment | added | Craig | Well sorry jittery is the wrong word, they're moving sideways to get into the flock position, i just want it to be as smooth as the movement that they have for evading. They run away from me seperately which flows nice, then they go to flock and go sideways to their closest member. Would it still be fixed by how you detailed above? | |
Dec 4, 2012 at 18:28 | history | answered | House | CC BY-SA 3.0 |