body

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const G = 6.674e-11

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Id      string
	Name    string
	Pos     vector.Vector
	Vel     vector.Vector
	Acc     vector.Vector
	Radius  float64
	Mass    float64
	AccChan chan vector.Vector
	Sprite  *pixel.Sprite
}

func NewBody

func NewBody(name string, x float64, y float64, r float64, m float64,
	vx float64, vy float64, s *pixel.Sprite) *Body

func NewBodyVector

func NewBodyVector(name string, pos vector.Vector, vel vector.Vector,
	r float64, m float64, s *pixel.Sprite) *Body

func (*Body) CalculateAcceleration

func (b *Body) CalculateAcceleration(others []*Body)

func (*Body) CollideWith

func (b *Body) CollideWith(other *Body)

func (Body) Collides

func (b Body) Collides(other *Body) bool

func (Body) String

func (b Body) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL