Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BallList []*Ball
BallList is the global slice of balls
Functions ¶
func Boundary ¶
Boundary checks if ball should bounce within a rectangle (invert direction) Calculation based on collision with fixed surface Coefficent of restitution set by factor (if 1 elastic collision)
func Collide ¶
func Collide(b1, b2 *Ball)
Collide updates balls based on collision to other balls Calculation based on elastic collision with equal mass
Types ¶
Click to show internal directories.
Click to hide internal directories.