sectors

package
v0.0.0-...-cc30c68 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SECTOR_LINE_WIDTH     = 10
	STRUCTURE_CEILING_GAP = 20.0

	MIN_STRUCTURE_HEIGHT = 0.0
)

Variables

View Source
var (
	MIN_SEGMENT_WIDTH float64
	MAX_SEGMENT_WIDTH float64

	MAX_STRUCTURE_HEIGHT float64
)

Functions

This section is empty.

Types

type Range

type Range struct {
	Start pixel.Vec

	End pixel.Vec
}

type Sector

type Sector struct {
	Color    color.Color
	Width    float64
	Segments []Segment
	Polygons []*imdraw.IMDraw
}

func GenerateSector

func GenerateSector(sectorWidth float64, maxHeight float64, maxSegments int, color color.Color) (s Sector)

func (*Sector) Draw

func (s *Sector) Draw(target pixel.Target)

type Segment

type Segment struct {
	Range Range

	Y     func(float64) float64 // TODO: rename to Y
	Slope func(float64) float64 // TODO: rename to Slope
}

func NewRangedLineSegment

func NewRangedLineSegment(slope, startX, endX, startY float64) Segment

func NewSinSegment

func NewSinSegment(waveLength float64, waveHeight float64, offset float64, intercept float64, onlyPositive bool) Segment

Jump to

Keyboard shortcuts

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