Documentation ¶
Index ¶
- type Plane
- type Polygon
- func (p Polygon) Add(v Vector) Polygon
- func (p Polygon) CheckPosition(position Vector) Polygon
- func (p Polygon) Clone() Polygon
- func (p Polygon) ContainsPolygon(q Polygon) (normal Vector, depth float64)
- func (p Polygon) ContainsVector(v Vector) bool
- func (p Polygon) Copy(q Polygon) Polygon
- func (p Polygon) Intersects(q Polygon) (normal Vector, depth float64)
- func (p Polygon) Join(q Polygon) (Polygon, Polygon)
- func (p Polygon) SetPosition(position Vector) Polygon
- func (p Polygon) Update() Polygon
- type Rectangle
- func (r Rectangle) Area() float64
- func (r Rectangle) AreaOfOverlap(o Rectangle) float64
- func (r Rectangle) Contains(x, y float64) bool
- func (r Rectangle) Intersects(s Rectangle) bool
- func (r Rectangle) MaxPoint() Vector
- func (r Rectangle) MinPoint() Vector
- func (r Rectangle) Scale(c float64) Rectangle
- func (r Rectangle) ToPolygon() Polygon
- type Vector
- func (v Vector) Add(w Vector) Vector
- func (v Vector) Clone() Vector
- func (v Vector) Copy(w Vector) Vector
- func (v Vector) Distance(w Vector) float64
- func (v Vector) DotProduct(w Vector) float64
- func (v Vector) Invert() Vector
- func (v Vector) LeftNormal(w Vector) Vector
- func (v Vector) Length() float64
- func (v Vector) Magnitude() float64
- func (v Vector) Normal(w Vector) Vector
- func (v Vector) Normalize() Vector
- func (v Vector) Perpendicular() Vector
- func (v Vector) Projection(w Vector) Vector
- func (v Vector) Reflect(w Vector) Vector
- func (v Vector) RightNormal(w Vector) Vector
- func (v Vector) Scale(c float64) Vector
- func (v Vector) ScaleXY(cx, cy float64) Vector
- func (v Vector) Subtract(w Vector) Vector
- func (v Vector) UnitProjection(w Vector) Vector
- func (v Vector) UnitReflect(w Vector) Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plane ¶
func (Plane) DistanceTo ¶
type Polygon ¶
type Polygon struct { Position Vector Vectors []Vector CalcVectors []Vector Planes []Plane Bounds Rectangle }
func NewPolygon ¶
NewPolygon accepts an array of vectors in CCW rotation
func (Polygon) CheckPosition ¶
func (Polygon) ContainsPolygon ¶
func (Polygon) ContainsVector ¶
func (Polygon) SetPosition ¶
type Rectangle ¶
func NewRectangle ¶
func (Rectangle) AreaOfOverlap ¶ added in v1.1.0
func (Rectangle) Intersects ¶
type Vector ¶
func (Vector) DotProduct ¶
func (Vector) Perpendicular ¶
func (Vector) Projection ¶
func (Vector) RightNormal ¶
For counter clockwise order
func (Vector) UnitProjection ¶
func (Vector) UnitReflect ¶
Click to show internal directories.
Click to hide internal directories.