vec

package
v0.0.0-...-2dfa829 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max(a int, b int) int

Max returns the maximum value out of a and b.

func Min

func Min(a int, b int) int

Min returns the minimum value out of a and b.

func MinF

func MinF(a float32, b float32) float32

MaxF returns the maximum float value out of a and b.

Types

type AABB

type AABB struct {
	Min Vec // Min is the minimum extents of the bounding box.
	Max Vec // Max is the maximum extents of the bounding box.
}

Axis Aligned Bounding Box

func AABBFromIndex

func AABBFromIndex(i int, j int, iWidth int, jWidth int) AABB

AABBFromIndex creates an AABB from the supplied indexes, and the grid size.

func AABBFromWaypoint

func AABBFromWaypoint(a models.Waypoint, maxW int, maxH int) AABB

AABBFromWaypoints creates an AABB from the supplied waypoing and the maximum dimensions of the frame.

func AABBFromWaypoints

func AABBFromWaypoints(a models.Waypoint, b models.Waypoint, maxW int, maxH int) AABB

AABBFromWaypoints creates an AABB from the two supplied waypoints and the maximum dimensions of the frame.

func (*AABB) Intersects

func (b *AABB) Intersects(a *AABB) bool

Intersects returns true if a and b overlap (intersect), false otherwise.

type Shaft

type Shaft struct {
	Bounds   AABB
	MinPlane [2]Vec
	MaxPlane [2]Vec
}

func ShaftFromWaypoints

func ShaftFromWaypoints(a models.Waypoint, b models.Waypoint, maxW int, maxH int) Shaft

func (*Shaft) Intersects

func (s *Shaft) Intersects(b *AABB) bool

type Vec

type Vec [2]int

func (*Vec) Length

func (v *Vec) Length() float64

Jump to

Keyboard shortcuts

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