flow

package
v0.0.0-...-32a2d26 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstC

func ConstC(val float64) func(float64, float64) float64

func KDev

func KDev(devProcent float64) float64

Возвращает коэффициент нормальной дистрибуций сигма в процентах devProcent 68% попадут в (100-devProcent, 100+devProcent) 95% попадут в (100-2*devProcent, 100+2*devProcent) Отклонения больше 3 сигма ограничиваются

func LineRand

func LineRand(min, max float64) func() float64

func LinearLifeTime

func LinearLifeTime(a, b float64) func(point Point) float64

func NewAttrFs

func NewAttrFs() map[string]AttrF

func NormRand

func NormRand(center, devPercent float64) func() float64

func RandomInCirc

func RandomInCirc(R float64) func() V2

func RandomOnSide

func RandomOnSide(sideOrt V2, wide float64) func() V2

func SinLifeTime

func SinLifeTime(med, dev, period float64) func(p Point) float64

func SinMaxTime

func SinMaxTime(med, dev, periods float64) func(p Point) float64

Types

type AttrF

type AttrF = func(p Point) float64

type Flow

type Flow struct {
	// contains filtered or unexported fields
}

func (*Flow) IsEmpty

func (f *Flow) IsEmpty() bool

func (*Flow) Req

func (f *Flow) Req(Q *graph.DrawQueue)

func (*Flow) SetActive

func (f *Flow) SetActive(activeSpawn bool)

func (*Flow) Update

func (f *Flow) Update(dt float64)

type Params

type Params struct {
	SpawnPeriod float64

	SpawnPos       SpawnPosF
	SpawnLife      func() float64
	SpawnUpdDrawer func() updDrawPointer

	VelocityF VelocityF
	AttrFs    map[string]AttrF
}

func (Params) New

func (fp Params) New() *Flow

type Point

type Point struct {
	// contains filtered or unexported fields
}

func (Point) Req

func (p Point) Req(Q *graph.DrawQueue)

type SpawnPosF

type SpawnPosF func() (pos V2)

type SpriteDrawerParams

type SpriteDrawerParams struct {
	Sprite       *graph.Sprite
	CycleType    int
	DoRandomLine bool
	FPS          float64
	Layer        int
}

func (SpriteDrawerParams) New

func (params SpriteDrawerParams) New() updDrawPointer

type VelocityF

type VelocityF func(pos V2) V2

func ComposeDecart

func ComposeDecart(vx, vy func(x, y float64) float64) VelocityF

func ComposeRadial

func ComposeRadial(tang, norm func(l, w float64) float64) VelocityF

func (VelocityF) Add

func (f VelocityF) Add(delta V2) VelocityF

func (VelocityF) AddMul

func (f VelocityF) AddMul(delta V2, t float64) VelocityF

func (VelocityF) Rot

func (f VelocityF) Rot(angle float64) VelocityF

Jump to

Keyboard shortcuts

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