Versions in this module Expand all Collapse all v0 v0.0.0 Jan 17, 2025 Changes in this version + func LineTest(settings LineTestSettings) bool + type Bounds struct + Max ebimath.Vector + Min ebimath.Vector + func (b *Bounds) MoveVec(vec ebimath.Vector) Bounds + func (b Bounds) Center() ebimath.Vector + func (b Bounds) Height() float64 + func (b Bounds) Intersection(other Bounds) Bounds + func (b Bounds) IsEmpty() bool + func (b Bounds) IsIntersecting(other Bounds) bool + func (b Bounds) Move(x, y float64) Bounds + func (b Bounds) Width() float64 + type Cell struct + Shapes []IShape + X int + Y int + func (cell *Cell) Contains(obj IShape) bool + func (cell *Cell) HasTags(tags Tags) bool + func (cell *Cell) IsOccupied() bool + type CellSelection struct + EndX int + EndY int + StartX int + StartY int + func (c CellSelection) FilterShapes() ShapeFilter + func (c CellSelection) ForEach(iterationFunction func(shape IShape) bool) + type Circle struct + func NewCircle(x, y, radius float64) *Circle + func (c *Circle) Bounds() Bounds + func (c *Circle) Clone() IShape + func (c *Circle) Intersection(other IShape) IntersectionSet + func (c *Circle) Project(axis ebimath.Vector) Projection + func (c *Circle) Radius() float64 + func (c *Circle) SetRadius(radius float64) + type ConvexPolygon struct + Closed bool + Points []ebimath.Vector + func NewConvexPolygon(x, y float64, points []float64) *ConvexPolygon + func NewConvexPolygonVec(position ebimath.Vector, points []ebimath.Vector) *ConvexPolygon + func NewLine(x1, y1, x2, y2 float64) *ConvexPolygon + func NewRectangle(x, y, w, h float64) *ConvexPolygon + func NewRectangleFromCorners(x1, y1, x2, y2 float64) *ConvexPolygon + func NewRectangleFromTopLeft(x, y, w, h float64) *ConvexPolygon + func (cp *ConvexPolygon) AddPoints(vertexPositions ...float64) error + func (cp *ConvexPolygon) AddPointsVec(points ...ebimath.Vector) + func (cp *ConvexPolygon) Bounds() Bounds + func (cp *ConvexPolygon) Center() ebimath.Vector + func (cp *ConvexPolygon) Clone() IShape + func (cp *ConvexPolygon) FlipH() + func (cp *ConvexPolygon) FlipV() + func (cp *ConvexPolygon) IsContainedBy(otherShape IShape) bool + func (cp *ConvexPolygon) Lines() []collidingLine + func (cp *ConvexPolygon) Project(axis ebimath.Vector) Projection + func (cp *ConvexPolygon) RecenterPoints() + func (cp *ConvexPolygon) ReverseVertexOrder() + func (cp *ConvexPolygon) SATAxes() []ebimath.Vector + func (cp *ConvexPolygon) ShapeLineTest(settings ShapeLineTestSettings) bool + func (cp *ConvexPolygon) Transformed() []ebimath.Vector + func (p *ConvexPolygon) Intersection(other IShape) IntersectionSet + func (p *ConvexPolygon) Rotate(radians float64) + func (p *ConvexPolygon) Rotation() float64 + func (p *ConvexPolygon) Scale() ebimath.Vector + func (p *ConvexPolygon) SetRotation(radians float64) + func (p *ConvexPolygon) SetScale(x, y float64) + func (p *ConvexPolygon) SetScaleVec(vec ebimath.Vector) + type IShape interface + Bounds func() Bounds + Clone func() IShape + Data func() any + DistanceSquaredTo func(other IShape) float64 + DistanceTo func(other IShape) float64 + ID func() uint32 + Intersection func(other IShape) IntersectionSet + IntersectionTest func(settings IntersectionTestSettings) bool + IsAbove func(other IShape) bool + IsBelow func(other IShape) bool + IsIntersecting func(other IShape) bool + IsLeftOf func(other IShape) bool + IsRightOf func(other IShape) bool + Move func(x, y float64) + MoveVec func(vec ebimath.Vector) + Position func() ebimath.Vector + SelectTouchingCells func(margin int) CellSelection + SetData func(data any) + SetPosition func(x, y float64) + SetPositionVec func(vec ebimath.Vector) + SetX func(float64) + SetY func(float64) + Space func() *Space + Tags func() *Tags + VecTo func(other IShape) ebimath.Vector + type Intersection struct + Normal ebimath.Vector + Point ebimath.Vector + type IntersectionSet struct + Center ebimath.Vector + Intersections []Intersection + MTV ebimath.Vector + OtherShape IShape + func (is IntersectionSet) BottommostPoint() ebimath.Vector + func (is IntersectionSet) Distance(alongAxis ebimath.Vector) float64 + func (is IntersectionSet) IsEmpty() bool + func (is IntersectionSet) LeftmostPoint() ebimath.Vector + func (is IntersectionSet) RightmostPoint() ebimath.Vector + func (is IntersectionSet) TopmostPoint() ebimath.Vector + type IntersectionTestSettings struct + OnIntersect func(set IntersectionSet) bool + TestAgainst ShapeIterator + type LineTestSettings struct + End ebimath.Vector + OnIntersect func(set IntersectionSet, index, max int) bool + Start ebimath.Vector + TestAgainst ShapeIterator + type Projection struct + Max float64 + Min float64 + func (projection Projection) IsInside(other Projection) bool + func (projection Projection) IsOverlapping(other Projection) bool + func (projection Projection) Overlap(other Projection) float64 + type Set map[E]struct + func (s Set[E]) Add(elements ...E) + func (s Set[E]) Clear() + func (s Set[E]) Clone() Set[E] + func (s Set[E]) Combine(otherSet Set[E]) + func (s Set[E]) Contains(element E) bool + func (s Set[E]) ForEach(f func(element E) bool) + func (s Set[E]) Remove(elements ...E) + func (s Set[E]) Set(other Set[E]) + type ShapeBase struct + func (c *ShapeBase) SetPositionVec(vec ebimath.Vector) + func (c *ShapeBase) SetX(x float64) + func (c *ShapeBase) SetY(y float64) + func (s *ShapeBase) Data() any + func (s *ShapeBase) DistanceSquaredTo(other IShape) float64 + func (s *ShapeBase) DistanceTo(other IShape) float64 + func (s *ShapeBase) ID() uint32 + func (s *ShapeBase) IntersectionTest(settings IntersectionTestSettings) bool + func (s *ShapeBase) IsAbove(other IShape) bool + func (s *ShapeBase) IsBelow(other IShape) bool + func (s *ShapeBase) IsIntersecting(other IShape) bool + func (s *ShapeBase) IsLeftOf(other IShape) bool + func (s *ShapeBase) IsRightOf(other IShape) bool + func (s *ShapeBase) Move(x, y float64) + func (s *ShapeBase) MoveVec(vec ebimath.Vector) + func (s *ShapeBase) Position() ebimath.Vector + func (s *ShapeBase) SelectTouchingCells(margin int) CellSelection + func (s *ShapeBase) SetData(data any) + func (s *ShapeBase) SetPosition(x, y float64) + func (s *ShapeBase) Space() *Space + func (s *ShapeBase) Tags() *Tags + func (s *ShapeBase) VecTo(other IShape) ebimath.Vector + type ShapeCollection []IShape + func (s ShapeCollection) First() IShape + func (s ShapeCollection) ForEach(forEachFunc func(shape IShape) bool) + func (s ShapeCollection) Last() IShape + func (s ShapeCollection) SetTags(tags Tags) + func (s ShapeCollection) SortByDistance(point ebimath.Vector) + func (s ShapeCollection) UnsetTags(tags Tags) + type ShapeFilter struct + Filters []func(s IShape) bool + func (s ShapeFilter) ByDataType(dataType reflect.Type) ShapeFilter + func (s ShapeFilter) ByDistance(point ebimath.Vector, min, max float64) ShapeFilter + func (s ShapeFilter) ByFunc(filterFunc func(s IShape) bool) ShapeFilter + func (s ShapeFilter) ByTags(tags Tags) ShapeFilter + func (s ShapeFilter) Count() int + func (s ShapeFilter) First() IShape + func (s ShapeFilter) ForEach(forEachFunc func(shape IShape) bool) + func (s ShapeFilter) Last() IShape + func (s ShapeFilter) Not(shapes ...IShape) ShapeFilter + func (s ShapeFilter) NotByTags(tags Tags) ShapeFilter + func (s ShapeFilter) Shapes() ShapeCollection + type ShapeIterator interface + ForEach func(iterationFunction func(shape IShape) bool) + type ShapeLineTestSettings struct + IncludeAllPoints bool + Lines []int + OnIntersect func(set IntersectionSet, index, count int) bool + StartOffset ebimath.Vector + TestAgainst ShapeIterator + Vector ebimath.Vector + type Space struct + func NewSpace(spaceWidth, spaceHeight, cellWidth, cellHeight int) *Space + func (s *Space) Add(shapes ...IShape) + func (s *Space) Cell(cx, cy int) *Cell + func (s *Space) CellHeight() int + func (s *Space) CellWidth() int + func (s *Space) FilterCells(bounds Bounds) CellSelection + func (s *Space) FilterShapes() ShapeFilter + func (s *Space) ForEachShape(forEach func(shape IShape, index, maxCount int) bool) + func (s *Space) Height() int + func (s *Space) HeightInCells() int + func (s *Space) Remove(shapes ...IShape) + func (s *Space) RemoveAll() + func (s *Space) Resize(width, height int) + func (s *Space) Shapes() ShapeCollection + func (s *Space) Width() int + func (s *Space) WidthInCells() int + type Tags uint64 + func NewTag(tagName string) Tags + func (t *Tags) Clear() + func (t *Tags) Set(tagValue Tags) + func (t *Tags) Unset(tagValue Tags) + func (t Tags) Has(tagValue Tags) bool + func (t Tags) IsEmpty() bool + func (t Tags) String() string