Documentation ¶
Index ¶
- type BodyStats
- type Field
- func (f *Field) Add(position vect.Vect, r float32, m vect.Float, velocity vect.Vect, ...)
- func (f *Field) ClearObjects()
- func (f Field) Draw(win pixel.Target)
- func (f *Field) MakeCanvas()
- func (f Field) Stats() (output []BodyStats)
- func (f *Field) Step()
- func (f *Field) Steps(n int)
- func (f *Field) ToggleShowTrails()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { ShowTrails bool ViewFinder *viewfinder.ViewFinder // contains filtered or unexported fields }
Field represents a gravity simulation field
func (*Field) Add ¶
func (f *Field) Add(position vect.Vect, r float32, m vect.Float, velocity vect.Vect, color color.Color, manual bool)
Add adds a new body to the field
func (*Field) ClearObjects ¶
func (f *Field) ClearObjects()
ClearObjects removes all manually added bodies from the field
func (*Field) MakeCanvas ¶
func (f *Field) MakeCanvas()
MakeCanvas creates a pixelgl canvas on which to draw the field
func (*Field) ToggleShowTrails ¶
func (f *Field) ToggleShowTrails()
ToggleShowTrails toggles the ShowTrails setting
Click to show internal directories.
Click to hide internal directories.