vista

package
v0.0.0-...-548dba9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	angle.Period
	//total height, from 0-180
	//Full angle is supposed to have 180
	//and Ray to have 0
	Height float64
}

func NewArea

func NewArea(period angle.Period, height float64) Area

func (Area) Contains

func (a Area) Contains(b Area) bool

type Circle

type Circle struct {
	Center vec2.V2
	Radius float64
}

func (Circle) FromPoint

func (c Circle) FromPoint(p vec2.V2) (dist float64, period angle.Period)

type Emitter

type Emitter interface {
	EmitterCone() SightCone
	EmitSpectre() Spectre
	EmitDir(dir float64)
}

type Object

type Object interface {
	VistaCircle() Circle
	VistaTypes() (isObstacle, isTarget, isBlocker bool)
}

type ObjectData

type ObjectData struct {
	Object Object
	Dist   float64
	Area   Area
}

type Result

type Result struct {
	Target     ObjectData
	Blockers   []ObjectData
	Obstacles  []ObjectData
	MainPeriod angle.Period
}

type SightCone

type SightCone struct {
	Position vec2.V2
	Zone     Area
	MaxDist  float64
}

type Spectre

type Spectre string

func (Spectre) Wants

func (watch Spectre) Wants(emi Spectre) bool

type Vista

type Vista struct {
	//current source position
	SightCone
	IgnoreSelf Object
	// contains filtered or unexported fields
}

func New

func New() *Vista

func (*Vista) Calculate

func (h *Vista) Calculate(objects []Object)

func (*Vista) ClearTempSlices

func (h *Vista) ClearTempSlices(resultsToo bool)

func (*Vista) Result

func (h *Vista) Result() []Result

type WatchRec

type WatchRec struct {
}

type WatchResult

type WatchResult []WatchRec

type Watcher

type Watcher interface {
	WatchCone() SightCone
	WantedSpectre() Spectre
}

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool() WorkerPool

func (WorkerPool) Run

func (wp WorkerPool) Run(f func())

func (WorkerPool) Wait

func (wp WorkerPool) Wait()

func (WorkerPool) WaitClose

func (wp WorkerPool) WaitClose()

type World

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

func NewWorld

func NewWorld() *World

func (*World) Add

func (w *World) Add(x interface{})

func (*World) Calculate

func (w *World) Calculate()

func (*World) Del

func (w *World) Del(x interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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