Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NThinkGroups is the number of think groups. NThinkGroups = 6 // At 60 fps, this gives us thinking at 10Hz. )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Boid ¶
type Boid struct { *phys.Body // ThinkGroup is the number of the group with which this boid // considers its local neighbors when updating. ThinkGroup uint }
A Boid is a bird-like (cow-like, or fish-like) object.
type BoidInfo ¶
type BoidInfo struct { // MaxVelocity is the fastest that a boid can move. MaxVelocity float64 // LocalDist is the distance determining when two boids // are flocking together. LocalDist float64 // MatchBias is multiplied by the velocity matching // velocity. MatchBias float64 // CenterDist is the minimum distance a boid must be // away from the center before they try to center // themselves. CenterDist float64 // CenterBias is multiplied by the centering velocity. CenterBias float64 // AvoidDist is the distance at which boids will avoid // eachother. AvoidDist float64 // AvoidBias is multiplied by the avoid velocity. AvoidBias float64 // PlayerDist is the distance at which boids will avoid // the player. PlayerDist float64 // PlayerBias is the weight applied to avoiding the player. PlayerBias float64 // TerrainDist is the distance at which terrain is avoided. TerrainDist float64 // TerrainBias is the weight applied to avoiding terrain. TerrainBias float64 // AvoidTerrain is a string of terrain types that are avoided. AvoidTerrain string // MaxDepth is the maximum water depth before this boid // attempts to avoid. MaxDepth int }
BoidInfo contains behavior information about boids. The XxxBias terms are fairly arbitrary weights that are applied to boid rules in order to prioritize them. Unfortunately, the only good way to set them seems to be painful trial-and-error.
Click to show internal directories.
Click to hide internal directories.