Documentation ¶
Index ¶
- Constants
- Variables
- func GetLocation(point, linePoint1, linePoint2 *Vector2) float64
- func GetWinding(points ...*Vector2) float64
- func GetWindingFromList(points []*Vector2) float64
- func IntervalClamp(x, min, max float64) float64
- func ReverseSliceVector2(s []*Vector2)
- func ReverseWinding(points ...*Vector2)
- func ReverseWindingFromList(points []*Vector2)
- type AABB
- func (a *AABB) ContainsAABB(a2 *AABB) bool
- func (a *AABB) ContainsVector2(v *Vector2) bool
- func (a *AABB) ContainsXY(x, y float64) bool
- func (a *AABB) Expand(expansion float64)
- func (a *AABB) GetArea() float64
- func (a *AABB) GetExpanded(expansion float64) *AABB
- func (a *AABB) GetHeight() float64
- func (a *AABB) GetIntersection(a2 *AABB) *AABB
- func (a *AABB) GetMaxX() float64
- func (a *AABB) GetMaxY() float64
- func (a *AABB) GetMinX() float64
- func (a *AABB) GetMinY() float64
- func (a *AABB) GetPerimeter() float64
- func (a *AABB) GetTranslated(translation *Vector2) *AABB
- func (a *AABB) GetUnion(a2 *AABB) *AABB
- func (a *AABB) GetWidth() float64
- func (a *AABB) Intersection(a2 *AABB)
- func (a *AABB) IsDegenerate() bool
- func (a *AABB) IsDegenerateWithError(e float64) bool
- func (a *AABB) Overlaps(a2 *AABB) bool
- func (a *AABB) String() string
- func (a *AABB) Translate(translation *Vector2)
- func (a *AABB) Union(a2 *AABB)
- type AbstractShape
- func (a *AbstractShape) GetCenter() *Vector2
- func (a *AbstractShape) GetID() string
- func (a *AbstractShape) GetRadius() float64
- func (a *AbstractShape) GetUserData() interface{}
- func (a *AbstractShape) RotateAboutXY(theta, x, y float64)
- func (a *AbstractShape) SetUserData(data interface{})
- func (a *AbstractShape) TranslateXY(x, y float64)
- type Capsule
- func (c *Capsule) ContainsVector2(v *Vector2) bool
- func (c *Capsule) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (c *Capsule) CreateAABB() *AABB
- func (c *Capsule) CreateAABBTransform(transform *Transform) *AABB
- func (c *Capsule) CreateMass(density float64) *Mass
- func (c *Capsule) GetAxes(foci []*Vector2, t *Transform) []*Vector2
- func (c *Capsule) GetCapRadius() float64
- func (c *Capsule) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (c *Capsule) GetFarthestPoint(v *Vector2, t *Transform) *Vector2
- func (c *Capsule) GetFoci(t *Transform) []*Vector2
- func (c *Capsule) GetLength() float64
- func (c *Capsule) GetRadiusVector2(center *Vector2) float64
- func (c *Capsule) GetRotation() float64
- func (c *Capsule) ProjectVector2(v *Vector2) *Interval
- func (c *Capsule) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (c *Capsule) RotateAboutCenter(theta float64)
- func (c *Capsule) RotateAboutOrigin(theta float64)
- func (c *Capsule) RotateAboutVector2(theta float64, v *Vector2)
- func (c *Capsule) RotateAboutXY(theta, x, y float64)
- func (c *Capsule) TranslateVector2(v *Vector2)
- func (c *Capsule) TranslateXY(x, y float64)
- type Circle
- func (c *Circle) ContainsVector2(v *Vector2) bool
- func (c *Circle) ContainsVector2Transform(v *Vector2, t *Transform) bool
- func (c *Circle) CreateAABB() *AABB
- func (c *Circle) CreateAABBTransform(t *Transform) *AABB
- func (c *Circle) CreateMass(density float64) *Mass
- func (c *Circle) GetAxes(foci []*Vector2, t *Transform) []*Vector2
- func (c *Circle) GetFarthestFeature(v *Vector2, t *Transform) Featurer
- func (c *Circle) GetFarthestPoint(v *Vector2, t *Transform) *Vector2
- func (c *Circle) GetFoci(t *Transform) []*Vector2
- func (c *Circle) GetRadiusVector2(v *Vector2) float64
- func (c *Circle) ProjectVector2(v *Vector2) *Interval
- func (c *Circle) ProjectVector2Transform(v *Vector2, t *Transform) *Interval
- func (c *Circle) RotateAboutCenter(theta float64)
- func (c *Circle) RotateAboutOrigin(theta float64)
- func (c *Circle) RotateAboutVector2(theta float64, v *Vector2)
- func (c *Circle) TranslateVector2(v *Vector2)
- type Convexer
- type Edge
- type Ellipse
- func (e *Ellipse) ContainsVector2(v *Vector2) bool
- func (e *Ellipse) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (e *Ellipse) CreateAABB() *AABB
- func (e *Ellipse) CreateAABBTransform(transform *Transform) *AABB
- func (e *Ellipse) CreateMass(density float64) *Mass
- func (e *Ellipse) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (e *Ellipse) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (e *Ellipse) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (e *Ellipse) GetFoci(transform *Transform) []*Vector2
- func (e *Ellipse) GetHalfHeight() float64
- func (e *Ellipse) GetHalfWidth() float64
- func (e *Ellipse) GetHeight() float64
- func (e *Ellipse) GetRadiusVector2(center *Vector2) float64
- func (e *Ellipse) GetRotation() float64
- func (e *Ellipse) GetWidth() float64
- func (e *Ellipse) ProjectVector2(v *Vector2) *Interval
- func (e *Ellipse) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (e *Ellipse) RotateAboutCenter(theta float64)
- func (e *Ellipse) RotateAboutOrigin(theta float64)
- func (e *Ellipse) RotateAboutVector2(theta float64, v *Vector2)
- func (e *Ellipse) RotateAboutXY(theta, x, y float64)
- func (e *Ellipse) TranslateVector2(v *Vector2)
- type Feature
- type Featurer
- type HalfEllipse
- func (h *HalfEllipse) ContainsVector2(v *Vector2) bool
- func (h *HalfEllipse) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (h *HalfEllipse) CreateAABB() *AABB
- func (h *HalfEllipse) CreateAABBTransform(transform *Transform) *AABB
- func (h *HalfEllipse) CreateMass(density float64) *Mass
- func (h *HalfEllipse) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (h *HalfEllipse) GetEllipseCenter() *Vector2
- func (h *HalfEllipse) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (h *HalfEllipse) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (h *HalfEllipse) GetFoci(transform *Transform) []*Vector2
- func (h *HalfEllipse) GetHalfWidth() float64
- func (h *HalfEllipse) GetHeight() float64
- func (h *HalfEllipse) GetRadiusVector2(center *Vector2) float64
- func (h *HalfEllipse) GetRotation() float64
- func (h *HalfEllipse) GetWidth() float64
- func (h *HalfEllipse) ProjectVector2(v *Vector2) *Interval
- func (h *HalfEllipse) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (h *HalfEllipse) RotateAboutCenter(theta float64)
- func (h *HalfEllipse) RotateAboutOrigin(theta float64)
- func (h *HalfEllipse) RotateAboutVector2(theta float64, v *Vector2)
- func (h *HalfEllipse) RotateAboutXY(theta, x, y float64)
- func (h *HalfEllipse) TranslateVector2(v *Vector2)
- func (h *HalfEllipse) TranslateXY(x, y float64)
- type Interval
- func (i *Interval) Clamp(x float64) float64
- func (i *Interval) Contains(i2 *Interval) bool
- func (i *Interval) Distance(i2 *Interval) float64
- func (i *Interval) Expand(x float64)
- func (i *Interval) GetExpanded(x float64) *Interval
- func (i *Interval) GetIntersection(i2 *Interval) *Interval
- func (i *Interval) GetLength() float64
- func (i *Interval) GetMax() float64
- func (i *Interval) GetMin() float64
- func (i *Interval) GetOverlap(i2 *Interval) float64
- func (i *Interval) GetUnion(i2 *Interval) *Interval
- func (i *Interval) IncludesExclusive(x float64) bool
- func (i *Interval) IncludesInclusive(x float64) bool
- func (i *Interval) IncludesInclusiveMax(x float64) bool
- func (i *Interval) IncludesInclusiveMin(x float64) bool
- func (i *Interval) Intersection(i2 *Interval)
- func (i *Interval) IsDegenerate() bool
- func (i *Interval) IsDegenerateWithError(e float64) bool
- func (i *Interval) Overlaps(i2 *Interval) bool
- func (i *Interval) SetMax(max float64)
- func (i *Interval) SetMin(min float64)
- func (i *Interval) String() string
- func (i *Interval) Union(i2 *Interval)
- type Mass
- type Matrix22
- func (m *Matrix22) AddMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) Determinant() float64
- func (m *Matrix22) DifferenceMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) GetInverse() *Matrix22
- func (m *Matrix22) GetTranspose() *Matrix22
- func (m *Matrix22) Identity() *Matrix22
- func (m *Matrix22) Invert() *Matrix22
- func (m *Matrix22) MultiplyMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) MultiplyScalar(s float64) *Matrix22
- func (m *Matrix22) MultiplyTVector2(v *Vector2) *Vector2
- func (m *Matrix22) MultiplyVector2(v *Vector2) *Vector2
- func (m *Matrix22) ProductMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) ProductScalar(s float64) *Matrix22
- func (m *Matrix22) ProductTVector2(v *Vector2) *Vector2
- func (m *Matrix22) ProductVector2(v *Vector2) *Vector2
- func (m *Matrix22) Solve(v *Vector2) *Vector2
- func (m *Matrix22) SubtractMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) SumMatrix22(m2 *Matrix22) *Matrix22
- func (m *Matrix22) Transpose() *Matrix22
- type Matrix33
- func (m *Matrix33) Add(m2 *Matrix33) *Matrix33
- func (m *Matrix33) Determinant() float64
- func (m *Matrix33) Difference(m2 *Matrix33) *Matrix33
- func (m *Matrix33) GetInverse() *Matrix33
- func (m *Matrix33) GetTranspose() *Matrix33
- func (m *Matrix33) Identity() *Matrix33
- func (m *Matrix33) Invert() *Matrix33
- func (m *Matrix33) MultiplyMatrix33(m2 *Matrix33) *Matrix33
- func (m *Matrix33) MultiplyScalar(s float64) *Matrix33
- func (m *Matrix33) MultiplyTVector3(v *Vector3) *Vector3
- func (m *Matrix33) MultiplyVector3(v *Vector3) *Vector3
- func (m *Matrix33) ProductMatrix33(m2 *Matrix33) *Matrix33
- func (m *Matrix33) ProductScalar(s float64) *Matrix33
- func (m *Matrix33) ProductTVector3(v *Vector3) *Vector3
- func (m *Matrix33) ProductVector3(v *Vector3) *Vector3
- func (m *Matrix33) Solve22(v *Vector2) *Vector2
- func (m *Matrix33) Solve33(v *Vector3) *Vector3
- func (m *Matrix33) Subtract(m2 *Matrix33) *Matrix33
- func (m *Matrix33) Sum(m2 *Matrix33) *Matrix33
- func (m *Matrix33) Transpose() *Matrix33
- type Polygon
- func CreatePolygon(vertices ...*Vector2) *Polygon
- func CreatePolygonAtOrigin(vertices ...*Vector2) *Polygon
- func CreatePolygonalCapsule(count int, width, height float64) *Polygon
- func CreatePolygonalCircle(count int, radius float64) *Polygon
- func CreatePolygonalCircleTheta(count int, radius, theta float64) *Polygon
- func CreatePolygonalEllipse(count int, width, height float64) *Polygon
- func CreatePolygonalHalfEllipse(count int, width, height float64) *Polygon
- func CreatePolygonalHalfEllipseAtOrigin(count int, width, height float64) *Polygon
- func CreatePolygonalSlice(count int, radius, theta float64) *Polygon
- func CreatePolygonalSliceAtOrigin(count int, radius, theta float64) *Polygon
- func CreateUnitCirclePolygon(count int, radius float64) *Polygon
- func CreateUnitCirclePolygonTheta(count int, radius, theta float64) *Polygon
- func Flip(polygon Wounder, axis *Vector2) *Polygon
- func FlipAlongTheXAxis(polygon Wounder) *Polygon
- func FlipAlongTheXAxisVector2(polygon Wounder, point *Vector2) *Polygon
- func FlipAlongTheYAxis(polygon Wounder) *Polygon
- func FlipAlongTheYAxisVector2(polygon Wounder, point *Vector2) *Polygon
- func FlipVector2(polygon Wounder, axis, point *Vector2) *Polygon
- func MinkowskiSum(p1, p2 WounderConvexer) *Polygon
- func MinkowskiSumCirclePolygonInt(circle *Circle, polygon *Polygon, count int) *Polygon
- func MinkowskiSumPolygonCircleInt(polygon *Polygon, circle *Circle, count int) *Polygon
- func MinkowskiSumPolygonFloat64Int(polygon *Polygon, radius float64, count int) *Polygon
- func NewPolygon(vertices ...*Vector2) *Polygon
- func ScalePolygon(polygon *Polygon, scale float64) *Polygon
- func (p *Polygon) ContainsVector2(v *Vector2) bool
- func (p *Polygon) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (p *Polygon) CreateAABB() *AABB
- func (p *Polygon) CreateAABBTransform(transform *Transform) *AABB
- func (p *Polygon) CreateMass(density float64) *Mass
- func (p *Polygon) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (p *Polygon) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (p *Polygon) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (p *Polygon) GetFoci(transform *Transform) []*Vector2
- func (p *Polygon) ProjectVector2(v *Vector2) *Interval
- func (p *Polygon) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (p *Polygon) RotateAboutCenter(theta float64)
- func (p *Polygon) RotateAboutOrigin(theta float64)
- func (p *Polygon) RotateAboutVector2(theta float64, v *Vector2)
- func (p *Polygon) RotateAboutXY(theta, x, y float64)
- func (p *Polygon) TranslateVector2(v *Vector2)
- func (p *Polygon) TranslateXY(x, y float64)
- type Ray
- type Rectangle
- func (r *Rectangle) ContainsVector2(v *Vector2) bool
- func (r *Rectangle) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (r *Rectangle) CreateAABB() *AABB
- func (r *Rectangle) CreateAABBTransform(transform *Transform) *AABB
- func (r *Rectangle) CreateMass(density float64) *Mass
- func (r *Rectangle) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (r *Rectangle) GetCenter() *Vector2
- func (r *Rectangle) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (r *Rectangle) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (r *Rectangle) GetFoci(transform *Transform) []*Vector2
- func (r *Rectangle) GetHeight() float64
- func (r *Rectangle) GetID() string
- func (r *Rectangle) GetNormals() []*Vector2
- func (r *Rectangle) GetRotation() float64
- func (r *Rectangle) GetUserData() interface{}
- func (r *Rectangle) GetVertices() []*Vector2
- func (r *Rectangle) GetWidth() float64
- func (r *Rectangle) ProjectVector2(v *Vector2) *Interval
- func (r *Rectangle) ProjectVector2Transform(axis *Vector2, transform *Transform) *Interval
- func (r *Rectangle) RotateAboutCenter(theta float64)
- func (r *Rectangle) RotateAboutOrigin(theta float64)
- func (r *Rectangle) RotateAboutVector2(theta float64, v *Vector2)
- func (r *Rectangle) RotateAboutXY(theta, x, y float64)
- func (r *Rectangle) SetUserData(data interface{})
- func (r *Rectangle) TranslateVector2(v *Vector2)
- func (r *Rectangle) TranslateXY(x, y float64)
- type Segment
- func CreateHorizontalSegment(length float64) *Segment
- func CreateSegment(p1, p2 *Vector2) *Segment
- func CreateSegmentAtOrigin(p1, p2 *Vector2) *Segment
- func CreateSegmentEnd(end *Vector2) *Segment
- func CreateVerticalSegment(length float64) *Segment
- func NewSegment(p1, p2 *Vector2) *Segment
- func ScaleSegment(segment *Segment, scale float64) *Segment
- func (s *Segment) ContainsTransformRadius(point *Vector2, transform *Transform, radius float64) bool
- func (s *Segment) ContainsVector2(v *Vector2) bool
- func (s *Segment) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (s *Segment) CreateAABB() *AABB
- func (s *Segment) CreateAABBTransform(transform *Transform) *AABB
- func (s *Segment) CreateMass(density float64) *Mass
- func (s *Segment) GetAxes(foci []*Vector2, t *Transform) []*Vector2
- func (s *Segment) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (s *Segment) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (s *Segment) GetFoci(transform *Transform) []*Vector2
- func (s *Segment) GetLength() float64
- func (s *Segment) GetLineIntersection(segment *Segment) *Vector2
- func (s *Segment) GetPoint1() *Vector2
- func (s *Segment) GetPoint2() *Vector2
- func (s *Segment) GetPointOnLineClosestToPoint(point *Vector2) *Vector2
- func (s *Segment) GetPointOnSegmentClosestToPoint(point *Vector2) *Vector2
- func (s *Segment) GetRadiusVector2(v *Vector2) float64
- func (s *Segment) GetSegmentIntersection(segment *Segment) *Vector2
- func (s *Segment) ProjectVector2(v *Vector2) *Interval
- func (s *Segment) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (s *Segment) RotateAboutCenter(theta float64)
- func (s *Segment) RotateAboutOrigin(theta float64)
- func (s *Segment) RotateAboutVector2(theta float64, v *Vector2)
- func (s *Segment) RotateAboutXY(theta, x, y float64)
- func (s *Segment) TranslateVector2(v *Vector2)
- func (s *Segment) TranslateXY(x, y float64)
- type Shaper
- type Slice
- func (s *Slice) ContainsVector2(v *Vector2) bool
- func (s *Slice) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (s *Slice) CreateAABB() *AABB
- func (s *Slice) CreateAABBTransform(transform *Transform) *AABB
- func (s *Slice) CreateMass(density float64) *Mass
- func (s *Slice) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (s *Slice) GetCircleCenter() *Vector2
- func (s *Slice) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (s *Slice) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (s *Slice) GetFoci(transform *Transform) []*Vector2
- func (s *Slice) GetRadiusVector2(center *Vector2) float64
- func (s *Slice) GetRotation() float64
- func (s *Slice) GetSliceRadius() float64
- func (s *Slice) GetTheta() float64
- func (s *Slice) ProjectVector2(v *Vector2) *Interval
- func (s *Slice) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (s *Slice) RotateAboutCenter(theta float64)
- func (s *Slice) RotateAboutOrigin(theta float64)
- func (s *Slice) RotateAboutVector2(theta float64, v *Vector2)
- func (s *Slice) RotateAboutXY(theta, x, y float64)
- func (s *Slice) TranslateVector2(v *Vector2)
- func (s *Slice) TranslateXY(x, y float64)
- type Transform
- func (t *Transform) GetInverseTransformedR(v *Vector2) *Vector2
- func (t *Transform) GetInverseTransformedRInDestination(v, v2 *Vector2)
- func (t *Transform) GetInverseTransformedVector2(v *Vector2) *Vector2
- func (t *Transform) GetInverseTransformedVector2InDestination(v, dest *Vector2)
- func (t *Transform) GetRotation() float64
- func (t *Transform) GetRotationTransform() *Transform
- func (t *Transform) GetTransformedR(v *Vector2) *Vector2
- func (t *Transform) GetTransformedRInDestination(v, v2 *Vector2)
- func (t *Transform) GetTransformedVector2(v *Vector2) *Vector2
- func (t *Transform) GetTransformedVector2InDestination(v, dest *Vector2)
- func (t *Transform) GetTranslation() *Vector2
- func (t *Transform) GetTranslationTransform() *Transform
- func (t *Transform) GetValues() []float64
- func (t *Transform) Identity()
- func (t *Transform) InverseTransform(v *Vector2)
- func (t *Transform) InverseTransformR(v *Vector2)
- func (t *Transform) Lerp(end *Transform, alpha float64)
- func (t *Transform) LerpDelta(dp *Vector2, da, alpha float64)
- func (t *Transform) LerpDeltaInDestination(dp *Vector2, da, alpha float64, result *Transform)
- func (t *Transform) LerpInDestination(end *Transform, alpha float64, result *Transform)
- func (t *Transform) Lerped(end *Transform, alpha float64) *Transform
- func (t *Transform) LerpedDelta(dp *Vector2, da, alpha float64) *Transform
- func (t *Transform) RotateAboutOrigin(theta float64)
- func (t *Transform) RotateAboutVector2(theta float64, v *Vector2)
- func (t *Transform) RotateAboutXY(theta, x, y float64)
- func (t *Transform) Set(t2 *Transform)
- func (t *Transform) SetRotation(theta float64) float64
- func (t *Transform) SetTranslationFromVector2(v *Vector2)
- func (t *Transform) SetTranslationFromXY(x, y float64)
- func (t *Transform) Transform(v *Vector2)
- func (t *Transform) TransformR(v *Vector2)
- func (t *Transform) TranslateVector2(v *Vector2)
- func (t *Transform) TranslateXY(x, y float64)
- type Transformer
- type Triangle
- func CreateEquilateralTriangle(height float64) *Triangle
- func CreateIsoscelesTriangle(width, height float64) *Triangle
- func CreateRightTriangle(width, height float64) *Triangle
- func CreateRightTriangleMirror(width, height float64, mirror bool) *Triangle
- func CreateTriangle(p1, p2, p3 *Vector2) *Triangle
- func CreateTriangleAtOrigin(p1, p2, p3 *Vector2) *Triangle
- func NewTriangle(p1, p2, p3 *Vector2) *Triangle
- func (t *Triangle) ContainsVector2(v *Vector2) bool
- func (t *Triangle) ContainsVector2Transform(point *Vector2, transform *Transform) bool
- func (t *Triangle) CreateAABB() *AABB
- func (t *Triangle) CreateAABBTransform(transform *Transform) *AABB
- func (t *Triangle) CreateMass(density float64) *Mass
- func (t *Triangle) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
- func (t *Triangle) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
- func (t *Triangle) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
- func (t *Triangle) GetFoci(transform *Transform) []*Vector2
- func (t *Triangle) ProjectVector2(v *Vector2) *Interval
- func (t *Triangle) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
- func (t *Triangle) RotateAboutCenter(theta float64)
- func (t *Triangle) RotateAboutOrigin(theta float64)
- func (t *Triangle) RotateAboutVector2(theta float64, v *Vector2)
- func (t *Triangle) RotateAboutXY(theta, x, y float64)
- func (t *Triangle) TranslateVector2(v *Vector2)
- func (t *Triangle) TranslateXY(x, y float64)
- type Vector2
- func Cleanse(points []*Vector2) []*Vector2
- func GetAreaWeightedCenter(points ...*Vector2) *Vector2
- func GetAreaWeightedCenterFromList(points []*Vector2) *Vector2
- func GetAverageCenter(points ...*Vector2) *Vector2
- func GetAverageCenterFromList(points []*Vector2) *Vector2
- func GetFarthestPoint(v1, v2, n *Vector2, t *Transform) *Vector2
- func GetLineIntersection(ap1, ap2, bp1, bp2 *Vector2) *Vector2
- func GetPointOnLineClosestToPoint(point, linePoint1, linePoint2 *Vector2) *Vector2
- func GetPointOnSegmentClosestToPoint(point, linePoint1, linePoint2 *Vector2) *Vector2
- func GetSegmentIntersection(ap1, ap2, bp1, bp2 *Vector2) *Vector2
- func NewVector2FromA2B(a, b *Vector2) *Vector2
- func NewVector2FromA2B_XY(xa, ya, xb, yb float64) *Vector2
- func NewVector2FromDirection(direction float64) *Vector2
- func NewVector2FromMagnitudeAndDirection(magnitude, direction float64) *Vector2
- func NewVector2FromVector2(vOrig *Vector2) *Vector2
- func NewVector2FromXY(x, y float64) *Vector2
- func Vector2TripleProduct(a, b, c *Vector2) *Vector2
- func (v *Vector2) AddVector2(v2 *Vector2) *Vector2
- func (v *Vector2) AddXY(x, y float64) *Vector2
- func (v *Vector2) CrossVector2(v2 *Vector2) float64
- func (v *Vector2) CrossXY(x, y float64) float64
- func (v *Vector2) CrossZ(z float64) *Vector2
- func (v *Vector2) DifferenceVector2(v2 *Vector2) *Vector2
- func (v *Vector2) DifferenceXY(x, y float64) *Vector2
- func (v *Vector2) DistanceFromVector2(v2 *Vector2) float64
- func (v *Vector2) DistanceFromXY(x, y float64) float64
- func (v *Vector2) DistanceSquaredFromVector2(v2 *Vector2) float64
- func (v *Vector2) DistanceSquaredFromXY(x, y float64) float64
- func (v *Vector2) DotVector2(v2 *Vector2) float64
- func (v *Vector2) DotXY(x, y float64) float64
- func (v *Vector2) EqualsVector2(v2 *Vector2) bool
- func (v *Vector2) EqualsXY(x, y float64) bool
- func (v *Vector2) GetAngleBetween(v2 *Vector2) float64
- func (v *Vector2) GetDirection() float64
- func (v *Vector2) GetLeftHandOrthogonalVector() *Vector2
- func (v *Vector2) GetMagnitude() float64
- func (v *Vector2) GetMagnitudeSquared() float64
- func (v *Vector2) GetNegative() *Vector2
- func (v *Vector2) GetNormalized() *Vector2
- func (v *Vector2) GetRightHandOrthogonalVector() *Vector2
- func (v *Vector2) GetXComponent() *Vector2
- func (v *Vector2) GetYComponent() *Vector2
- func (v *Vector2) HereToVector2(v2 *Vector2) *Vector2
- func (v *Vector2) HereToXY(x, y float64) *Vector2
- func (v *Vector2) IsOrthogonalVector2(v2 *Vector2) bool
- func (v *Vector2) IsOrthogonalXY(x, y float64) bool
- func (v *Vector2) IsZero() bool
- func (v *Vector2) Left() *Vector2
- func (v *Vector2) Multiply(scalar float64) *Vector2
- func (v *Vector2) Negate() *Vector2
- func (v *Vector2) Normalize() float64
- func (v *Vector2) Product(scalar float64) *Vector2
- func (v *Vector2) Project(v2 *Vector2) *Vector2
- func (v *Vector2) Right() *Vector2
- func (v *Vector2) RotateAboutOrigin(theta float64) *Vector2
- func (v *Vector2) RotateAboutVector2(theta float64, v2 *Vector2) *Vector2
- func (v *Vector2) RotateAboutXY(theta, x, y float64) *Vector2
- func (v *Vector2) SetDirection(angle float64) *Vector2
- func (v *Vector2) SetMagnitude(magnitude float64) *Vector2
- func (v *Vector2) SetToVector2(v2 *Vector2) *Vector2
- func (v *Vector2) SetToXY(x, y float64) *Vector2
- func (v *Vector2) String() string
- func (v *Vector2) SubtractVector2(v2 *Vector2) *Vector2
- func (v *Vector2) SubtractXY(x, y float64) *Vector2
- func (v *Vector2) SumVector2(v2 *Vector2) *Vector2
- func (v *Vector2) SumXY(x, y float64) *Vector2
- func (v *Vector2) Zero() *Vector2
- type Vector3
- func (v *Vector3) AddFloats(x, y, z float64) *Vector3
- func (v *Vector3) AddVector3(v2 *Vector3) *Vector3
- func (v *Vector3) CrossFloats(x, y, z float64) *Vector3
- func (v *Vector3) CrossVector3(v2 *Vector3) *Vector3
- func (v *Vector3) DifferenceFloats(x, y, z float64) *Vector3
- func (v *Vector3) DifferenceVector3(v2 *Vector3) *Vector3
- func (v *Vector3) DistanceFloats(x, y, z float64) float64
- func (v *Vector3) DistanceSquaredFloats(x, y, z float64) float64
- func (v *Vector3) DistanceSquaredVector3(v2 *Vector3) float64
- func (v *Vector3) DistanceVector3(v2 *Vector3) float64
- func (v *Vector3) DotFloats(x, y, z float64) float64
- func (v *Vector3) DotVector3(v2 *Vector3) float64
- func (v *Vector3) GetMagnitude() float64
- func (v *Vector3) GetMagnitudeSquared() float64
- func (v *Vector3) GetNegative() *Vector3
- func (v *Vector3) GetNormalised() *Vector3
- func (v *Vector3) GetXComponent() *Vector3
- func (v *Vector3) GetYComponent() *Vector3
- func (v *Vector3) GetZComponent() *Vector3
- func (v *Vector3) HereToFloats(x, y, z float64) *Vector3
- func (v *Vector3) HereToVector3(v2 *Vector3) *Vector3
- func (v *Vector3) IsOrthogonalFloats(x, y, z float64) bool
- func (v *Vector3) IsOrthogonalVector3(v2 *Vector3) bool
- func (v *Vector3) IsZero() bool
- func (v *Vector3) Multiply(s float64) *Vector3
- func (v *Vector3) Negate() *Vector3
- func (v *Vector3) Normalise() float64
- func (v *Vector3) Product(s float64) *Vector3
- func (v *Vector3) Project(v2 *Vector3) *Vector3
- func (v *Vector3) SetFloats(x, y, z float64) *Vector3
- func (v *Vector3) SetMagnitude(magnitude float64) *Vector3
- func (v *Vector3) SetVector3(v2 *Vector3) *Vector3
- func (v *Vector3) SubtractFloats(x, y, z float64) *Vector3
- func (v *Vector3) SubtractVector3(v2 *Vector3) *Vector3
- func (v *Vector3) SumFloats(x, y, z float64) *Vector3
- func (v *Vector3) SumVector3(v2 *Vector3) *Vector3
- func (v *Vector3) Zero() *Vector3
- type Vertex
- type Wound
- type Wounder
- type WounderConvexer
Constants ¶
View Source
const ( EDGE_FEATURE_SELECTION_CRITERIA = 0.98 EDGE_FEATURE_EXPANSION_FACTOR = 0.1 )
View Source
const ( FEATURE_NOT_INDEXED = -1 FEATURE_EDGE = 0 FEATURE_VERTEX = 1 )
View Source
const ( NORMAL = iota INFINITE FIXED_ANGULAR_VELOCITY FIXED_LINEAR_VELOCITY )
View Source
const (
INERTIA_CONSTANT = math.Pi/8.0 - 8.0/(9.0*math.Pi)
)
Variables ¶
View Source
var ( X_AXIS = Vector2{1.0, 0.0} Y_AXIS = Vector2{0.0, 1.0} )
View Source
var INV_3 = 1.0 / 3.0
View Source
var INV_3_SQRT = 1.0 / math.Sqrt(3.0)
View Source
var TWO_PI = 2.0 * math.Pi
Functions ¶
func GetLocation ¶
func GetWinding ¶
func GetWindingFromList ¶
func IntervalClamp ¶
func ReverseSliceVector2 ¶
func ReverseSliceVector2(s []*Vector2)
func ReverseWinding ¶
func ReverseWinding(points ...*Vector2)
func ReverseWindingFromList ¶
func ReverseWindingFromList(points []*Vector2)
Types ¶
type AABB ¶
type AABB struct {
// contains filtered or unexported fields
}
func NewAABBFromAABB ¶
func NewAABBFromCenterRadius ¶
func NewAABBFromFloats ¶
func NewAABBFromRadius ¶
func NewAABBFromVector2 ¶
func (*AABB) ContainsAABB ¶
func (*AABB) ContainsVector2 ¶
func (*AABB) ContainsXY ¶
func (*AABB) GetExpanded ¶
func (*AABB) GetIntersection ¶
func (*AABB) GetPerimeter ¶
func (*AABB) GetTranslated ¶
func (*AABB) Intersection ¶
func (*AABB) IsDegenerate ¶
func (*AABB) IsDegenerateWithError ¶
type AbstractShape ¶
type AbstractShape struct {
// contains filtered or unexported fields
}
func (*AbstractShape) GetCenter ¶
func (a *AbstractShape) GetCenter() *Vector2
func (*AbstractShape) GetID ¶
func (a *AbstractShape) GetID() string
func (*AbstractShape) GetRadius ¶
func (a *AbstractShape) GetRadius() float64
func (*AbstractShape) GetUserData ¶
func (a *AbstractShape) GetUserData() interface{}
func (*AbstractShape) RotateAboutXY ¶
func (a *AbstractShape) RotateAboutXY(theta, x, y float64)
func (*AbstractShape) SetUserData ¶
func (a *AbstractShape) SetUserData(data interface{})
func (*AbstractShape) TranslateXY ¶
func (a *AbstractShape) TranslateXY(x, y float64)
type Capsule ¶
type Capsule struct { AbstractShape // contains filtered or unexported fields }
func CreateCapsule ¶
func NewCapsule ¶
func ScaleCapsule ¶
func (*Capsule) ContainsVector2 ¶
func (*Capsule) ContainsVector2Transform ¶
func (*Capsule) CreateAABB ¶
func (*Capsule) CreateAABBTransform ¶
func (*Capsule) CreateMass ¶
func (*Capsule) GetCapRadius ¶
func (*Capsule) GetFarthestFeature ¶
func (*Capsule) GetFarthestPoint ¶
func (*Capsule) GetRadiusVector2 ¶
func (*Capsule) GetRotation ¶
func (*Capsule) ProjectVector2 ¶
func (*Capsule) ProjectVector2Transform ¶
func (*Capsule) RotateAboutCenter ¶
func (*Capsule) RotateAboutOrigin ¶
func (*Capsule) RotateAboutVector2 ¶
func (*Capsule) RotateAboutXY ¶
func (*Capsule) TranslateVector2 ¶
func (*Capsule) TranslateXY ¶
type Circle ¶
type Circle struct {
AbstractShape
}
func CreateCircle ¶
func ScaleCircle ¶
func (*Circle) ContainsVector2 ¶
func (*Circle) ContainsVector2Transform ¶
func (*Circle) CreateAABB ¶
func (*Circle) CreateAABBTransform ¶
func (*Circle) CreateMass ¶
func (*Circle) GetFarthestFeature ¶
func (*Circle) GetFarthestPoint ¶
func (*Circle) GetRadiusVector2 ¶
func (*Circle) ProjectVector2 ¶
func (*Circle) ProjectVector2Transform ¶
func (*Circle) RotateAboutCenter ¶
func (*Circle) RotateAboutOrigin ¶
func (*Circle) RotateAboutVector2 ¶
func (*Circle) TranslateVector2 ¶
type Edge ¶
type Edge struct { Feature // contains filtered or unexported fields }
func (*Edge) GetMaximum ¶
func (*Edge) GetVertex1 ¶
func (*Edge) GetVertex2 ¶
type Ellipse ¶
type Ellipse struct { AbstractShape // contains filtered or unexported fields }
func CreateEllipse ¶
func NewEllipse ¶
func ScaleEllipse ¶
func (*Ellipse) ContainsVector2 ¶
func (*Ellipse) ContainsVector2Transform ¶
func (*Ellipse) CreateAABB ¶
func (*Ellipse) CreateAABBTransform ¶
func (*Ellipse) CreateMass ¶
func (*Ellipse) GetFarthestFeature ¶
func (*Ellipse) GetFarthestPoint ¶
func (*Ellipse) GetHalfHeight ¶
func (*Ellipse) GetHalfWidth ¶
func (*Ellipse) GetRadiusVector2 ¶
func (*Ellipse) GetRotation ¶
func (*Ellipse) ProjectVector2 ¶
func (*Ellipse) ProjectVector2Transform ¶
func (*Ellipse) RotateAboutCenter ¶
func (*Ellipse) RotateAboutOrigin ¶
func (*Ellipse) RotateAboutVector2 ¶
func (*Ellipse) RotateAboutXY ¶
func (*Ellipse) TranslateVector2 ¶
type Featurer ¶
func GetFarthestFeature ¶
type HalfEllipse ¶
type HalfEllipse struct { AbstractShape // contains filtered or unexported fields }
func CreateHalfEllipse ¶
func CreateHalfEllipse(width, height float64) *HalfEllipse
func CreateHalfEllipseAtOrigin ¶
func CreateHalfEllipseAtOrigin(width, height float64) *HalfEllipse
func NewHalfEllipse ¶
func NewHalfEllipse(width, height float64) *HalfEllipse
func ScaleHalfEllipse ¶
func ScaleHalfEllipse(halfEllipse *HalfEllipse, scale float64) *HalfEllipse
func (*HalfEllipse) ContainsVector2 ¶
func (h *HalfEllipse) ContainsVector2(v *Vector2) bool
func (*HalfEllipse) ContainsVector2Transform ¶
func (h *HalfEllipse) ContainsVector2Transform(point *Vector2, transform *Transform) bool
func (*HalfEllipse) CreateAABB ¶
func (h *HalfEllipse) CreateAABB() *AABB
func (*HalfEllipse) CreateAABBTransform ¶
func (h *HalfEllipse) CreateAABBTransform(transform *Transform) *AABB
func (*HalfEllipse) CreateMass ¶
func (h *HalfEllipse) CreateMass(density float64) *Mass
func (*HalfEllipse) GetAxes ¶
func (h *HalfEllipse) GetAxes(foci []*Vector2, transform *Transform) []*Vector2
func (*HalfEllipse) GetEllipseCenter ¶
func (h *HalfEllipse) GetEllipseCenter() *Vector2
func (*HalfEllipse) GetFarthestFeature ¶
func (h *HalfEllipse) GetFarthestFeature(n *Vector2, transform *Transform) Featurer
func (*HalfEllipse) GetFarthestPoint ¶
func (h *HalfEllipse) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2
func (*HalfEllipse) GetFoci ¶
func (h *HalfEllipse) GetFoci(transform *Transform) []*Vector2
func (*HalfEllipse) GetHalfWidth ¶
func (h *HalfEllipse) GetHalfWidth() float64
func (*HalfEllipse) GetHeight ¶
func (h *HalfEllipse) GetHeight() float64
func (*HalfEllipse) GetRadiusVector2 ¶
func (h *HalfEllipse) GetRadiusVector2(center *Vector2) float64
func (*HalfEllipse) GetRotation ¶
func (h *HalfEllipse) GetRotation() float64
func (*HalfEllipse) GetWidth ¶
func (h *HalfEllipse) GetWidth() float64
func (*HalfEllipse) ProjectVector2 ¶
func (h *HalfEllipse) ProjectVector2(v *Vector2) *Interval
func (*HalfEllipse) ProjectVector2Transform ¶
func (h *HalfEllipse) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval
func (*HalfEllipse) RotateAboutCenter ¶
func (h *HalfEllipse) RotateAboutCenter(theta float64)
func (*HalfEllipse) RotateAboutOrigin ¶
func (h *HalfEllipse) RotateAboutOrigin(theta float64)
func (*HalfEllipse) RotateAboutVector2 ¶
func (h *HalfEllipse) RotateAboutVector2(theta float64, v *Vector2)
func (*HalfEllipse) RotateAboutXY ¶
func (h *HalfEllipse) RotateAboutXY(theta, x, y float64)
func (*HalfEllipse) TranslateVector2 ¶
func (h *HalfEllipse) TranslateVector2(v *Vector2)
func (*HalfEllipse) TranslateXY ¶
func (h *HalfEllipse) TranslateXY(x, y float64)
type Interval ¶
type Interval struct {
// contains filtered or unexported fields
}
func NewIntervalFromInterval ¶
func NewIntervalFromMinMax ¶
func (*Interval) GetExpanded ¶
func (*Interval) GetIntersection ¶
func (*Interval) GetOverlap ¶
func (*Interval) IncludesExclusive ¶
func (*Interval) IncludesInclusive ¶
func (*Interval) IncludesInclusiveMax ¶
func (*Interval) IncludesInclusiveMin ¶
func (*Interval) Intersection ¶
func (*Interval) IsDegenerate ¶
func (*Interval) IsDegenerateWithError ¶
type Mass ¶
type Mass struct {
// contains filtered or unexported fields
}
func CreateMass ¶
func NewMassFromMass ¶
func (*Mass) GetInertia ¶
func (*Mass) GetInverseInertia ¶
func (*Mass) GetInverseMass ¶
func (*Mass) IsInfinite ¶
type Matrix22 ¶
type Matrix22 struct {
// contains filtered or unexported fields
}
func NewMatrix22FromFloats ¶
func NewMatrix22FromMatrix22 ¶
func (*Matrix22) AddMatrix22 ¶
func (*Matrix22) Determinant ¶
func (*Matrix22) DifferenceMatrix22 ¶
func (*Matrix22) GetInverse ¶
func (*Matrix22) GetTranspose ¶
func (*Matrix22) MultiplyMatrix22 ¶
func (*Matrix22) MultiplyScalar ¶
func (*Matrix22) MultiplyTVector2 ¶
func (*Matrix22) MultiplyVector2 ¶
func (*Matrix22) ProductMatrix22 ¶
func (*Matrix22) ProductScalar ¶
func (*Matrix22) ProductTVector2 ¶
func (*Matrix22) ProductVector2 ¶
func (*Matrix22) SubtractMatrix22 ¶
func (*Matrix22) SumMatrix22 ¶
type Matrix33 ¶
type Matrix33 struct {
// contains filtered or unexported fields
}
func NewMatrix33FromFloats ¶
func NewMatrix33FromMatrix33 ¶
func (*Matrix33) Determinant ¶
func (*Matrix33) Difference ¶
func (*Matrix33) GetInverse ¶
func (*Matrix33) GetTranspose ¶
func (*Matrix33) MultiplyMatrix33 ¶
func (*Matrix33) MultiplyScalar ¶
func (*Matrix33) MultiplyTVector3 ¶
func (*Matrix33) MultiplyVector3 ¶
func (*Matrix33) ProductMatrix33 ¶
func (*Matrix33) ProductScalar ¶
func (*Matrix33) ProductTVector3 ¶
func (*Matrix33) ProductVector3 ¶
type Polygon ¶
type Polygon struct {
Wound
}
func CreatePolygon ¶
func CreatePolygonAtOrigin ¶
func CreatePolygonalCapsule ¶
func CreatePolygonalCircle ¶
func CreatePolygonalEllipse ¶
func CreatePolygonalSlice ¶
func CreateUnitCirclePolygon ¶
func FlipAlongTheXAxis ¶
func FlipAlongTheYAxis ¶
func FlipVector2 ¶
func MinkowskiSum ¶
func MinkowskiSum(p1, p2 WounderConvexer) *Polygon
func NewPolygon ¶
func ScalePolygon ¶
func (*Polygon) ContainsVector2 ¶
func (*Polygon) ContainsVector2Transform ¶
func (*Polygon) CreateAABB ¶
func (*Polygon) CreateAABBTransform ¶
func (*Polygon) CreateMass ¶
func (*Polygon) GetFarthestFeature ¶
func (*Polygon) GetFarthestPoint ¶
func (*Polygon) ProjectVector2 ¶
func (*Polygon) ProjectVector2Transform ¶
func (*Polygon) RotateAboutCenter ¶
func (*Polygon) RotateAboutOrigin ¶
func (*Polygon) RotateAboutVector2 ¶
func (*Polygon) RotateAboutXY ¶
func (*Polygon) TranslateVector2 ¶
func (*Polygon) TranslateXY ¶
type Ray ¶
type Ray struct {
// contains filtered or unexported fields
}
func NewRayFromFloat ¶
func NewRayFromVector2 ¶
func NewRayFromVector2Float ¶
func (*Ray) GetDirectionFloat ¶
func (*Ray) GetDirectionVector2 ¶
func (*Ray) SetDirectionFloat ¶
func (*Ray) SetDirectionVector2 ¶
type Rectangle ¶
type Rectangle struct { Polygon // contains filtered or unexported fields }
func CreateRectangle ¶
func CreateSquare ¶
func NewRectangle ¶
func (*Rectangle) ContainsVector2 ¶
func (*Rectangle) ContainsVector2Transform ¶
func (*Rectangle) CreateAABB ¶
func (*Rectangle) CreateAABBTransform ¶
func (*Rectangle) CreateMass ¶
func (*Rectangle) GetFarthestFeature ¶
func (*Rectangle) GetFarthestPoint ¶
func (*Rectangle) GetNormals ¶
func (*Rectangle) GetRotation ¶
func (*Rectangle) GetUserData ¶
func (r *Rectangle) GetUserData() interface{}
func (*Rectangle) GetVertices ¶
func (*Rectangle) ProjectVector2 ¶
func (*Rectangle) ProjectVector2Transform ¶
func (*Rectangle) RotateAboutCenter ¶
func (*Rectangle) RotateAboutOrigin ¶
func (*Rectangle) RotateAboutVector2 ¶
func (*Rectangle) RotateAboutXY ¶
func (*Rectangle) SetUserData ¶
func (r *Rectangle) SetUserData(data interface{})
func (*Rectangle) TranslateVector2 ¶
func (*Rectangle) TranslateXY ¶
type Segment ¶
type Segment struct { Wound // contains filtered or unexported fields }
func CreateHorizontalSegment ¶
func CreateSegment ¶
func CreateSegmentAtOrigin ¶
func CreateSegmentEnd ¶
func CreateVerticalSegment ¶
func NewSegment ¶
func ScaleSegment ¶
func (*Segment) ContainsTransformRadius ¶
func (*Segment) ContainsVector2 ¶
func (*Segment) ContainsVector2Transform ¶
func (*Segment) CreateAABB ¶
func (*Segment) CreateAABBTransform ¶
func (*Segment) CreateMass ¶
func (*Segment) GetFarthestFeature ¶
func (*Segment) GetFarthestPoint ¶
func (*Segment) GetLineIntersection ¶
func (*Segment) GetPointOnLineClosestToPoint ¶
func (*Segment) GetPointOnSegmentClosestToPoint ¶
func (*Segment) GetRadiusVector2 ¶
func (*Segment) GetSegmentIntersection ¶
func (*Segment) ProjectVector2 ¶
func (*Segment) ProjectVector2Transform ¶
func (*Segment) RotateAboutCenter ¶
func (*Segment) RotateAboutOrigin ¶
func (*Segment) RotateAboutVector2 ¶
func (*Segment) RotateAboutXY ¶
func (*Segment) TranslateVector2 ¶
func (*Segment) TranslateXY ¶
type Shaper ¶
type Shaper interface { Transformer GetID() string GetCenter() *Vector2 GetRadius() float64 GetRadiusVector2(center *Vector2) float64 GetUserData() interface{} SetUserData(data interface{}) RotateAboutCenter(theta float64) ProjectVector2(v *Vector2) *Interval ProjectVector2Transform(v *Vector2, t *Transform) *Interval ContainsVector2(v *Vector2) bool ContainsVector2Transform(v *Vector2, t *Transform) bool CreateMass(density float64) *Mass CreateAABB() *AABB CreateAABBTransform(t *Transform) *AABB }
type Slice ¶
type Slice struct { AbstractShape // contains filtered or unexported fields }
func CreateSlice ¶
func CreateSliceAtOrigin ¶
func ScaleSlice ¶
func (*Slice) ContainsVector2 ¶
func (*Slice) ContainsVector2Transform ¶
func (*Slice) CreateAABB ¶
func (*Slice) CreateAABBTransform ¶
func (*Slice) CreateMass ¶
func (*Slice) GetCircleCenter ¶
func (*Slice) GetFarthestFeature ¶
func (*Slice) GetFarthestPoint ¶
func (*Slice) GetRadiusVector2 ¶
func (*Slice) GetRotation ¶
func (*Slice) GetSliceRadius ¶
func (*Slice) ProjectVector2 ¶
func (*Slice) ProjectVector2Transform ¶
func (*Slice) RotateAboutCenter ¶
func (*Slice) RotateAboutOrigin ¶
func (*Slice) RotateAboutVector2 ¶
func (*Slice) RotateAboutXY ¶
func (*Slice) TranslateVector2 ¶
func (*Slice) TranslateXY ¶
type Transform ¶
type Transform struct {
X, Y float64
// contains filtered or unexported fields
}
func NewTransform ¶
func NewTransform() *Transform
func (*Transform) GetInverseTransformedR ¶
func (*Transform) GetInverseTransformedRInDestination ¶
func (*Transform) GetInverseTransformedVector2 ¶
func (*Transform) GetInverseTransformedVector2InDestination ¶
func (*Transform) GetRotation ¶
func (*Transform) GetRotationTransform ¶
func (*Transform) GetTransformedR ¶
func (*Transform) GetTransformedRInDestination ¶
func (*Transform) GetTransformedVector2 ¶
func (*Transform) GetTransformedVector2InDestination ¶
func (*Transform) GetTranslation ¶
func (*Transform) GetTranslationTransform ¶
func (*Transform) InverseTransform ¶
func (*Transform) InverseTransformR ¶
func (*Transform) LerpDeltaInDestination ¶
func (*Transform) LerpInDestination ¶
func (*Transform) LerpedDelta ¶
func (*Transform) RotateAboutOrigin ¶
func (*Transform) RotateAboutVector2 ¶
func (*Transform) RotateAboutXY ¶
func (*Transform) SetRotation ¶
func (*Transform) SetTranslationFromVector2 ¶
func (*Transform) SetTranslationFromXY ¶
func (*Transform) TransformR ¶
func (*Transform) TranslateVector2 ¶
func (*Transform) TranslateXY ¶
type Transformer ¶
type Triangle ¶
type Triangle Polygon
func CreateIsoscelesTriangle ¶
func CreateRightTriangle ¶
func CreateTriangle ¶
func CreateTriangleAtOrigin ¶
func NewTriangle ¶
func (*Triangle) ContainsVector2 ¶
func (*Triangle) ContainsVector2Transform ¶
func (*Triangle) CreateAABB ¶
func (*Triangle) CreateAABBTransform ¶
func (*Triangle) CreateMass ¶
func (*Triangle) GetFarthestFeature ¶
func (*Triangle) GetFarthestPoint ¶
func (*Triangle) ProjectVector2 ¶
func (*Triangle) ProjectVector2Transform ¶
func (*Triangle) RotateAboutCenter ¶
func (*Triangle) RotateAboutOrigin ¶
func (*Triangle) RotateAboutVector2 ¶
func (*Triangle) RotateAboutXY ¶
func (*Triangle) TranslateVector2 ¶
func (*Triangle) TranslateXY ¶
type Vector2 ¶
type Vector2 struct {
X, Y float64
}
func GetAreaWeightedCenter ¶
func GetAverageCenter ¶
func GetFarthestPoint ¶
func GetLineIntersection ¶
func GetSegmentIntersection ¶
func NewVector2FromA2B ¶
func NewVector2FromA2B_XY ¶
func NewVector2FromDirection ¶
func NewVector2FromVector2 ¶
func NewVector2FromXY ¶
func Vector2TripleProduct ¶
func (*Vector2) AddVector2 ¶
func (*Vector2) CrossVector2 ¶
func (*Vector2) DifferenceVector2 ¶
func (*Vector2) DifferenceXY ¶
func (*Vector2) DistanceFromVector2 ¶
func (*Vector2) DistanceFromXY ¶
func (*Vector2) DistanceSquaredFromVector2 ¶
func (*Vector2) DistanceSquaredFromXY ¶
func (*Vector2) DotVector2 ¶
func (*Vector2) EqualsVector2 ¶
func (*Vector2) GetAngleBetween ¶
func (*Vector2) GetDirection ¶
func (*Vector2) GetLeftHandOrthogonalVector ¶
func (*Vector2) GetMagnitude ¶
func (*Vector2) GetMagnitudeSquared ¶
func (*Vector2) GetNegative ¶
func (*Vector2) GetNormalized ¶
func (*Vector2) GetRightHandOrthogonalVector ¶
func (*Vector2) GetXComponent ¶
func (*Vector2) GetYComponent ¶
func (*Vector2) HereToVector2 ¶
func (*Vector2) IsOrthogonalVector2 ¶
func (*Vector2) IsOrthogonalXY ¶
func (*Vector2) RotateAboutOrigin ¶
func (*Vector2) RotateAboutVector2 ¶
func (*Vector2) RotateAboutXY ¶
func (*Vector2) SetDirection ¶
func (*Vector2) SetMagnitude ¶
func (*Vector2) SetToVector2 ¶
func (*Vector2) SubtractVector2 ¶
func (*Vector2) SubtractXY ¶
func (*Vector2) SumVector2 ¶
type Vector3 ¶
type Vector3 struct {
X, Y, Z float64
}
func NewVector3FromFloats ¶
func NewVector3FromVector3 ¶
func Vector3TripleProduct ¶
func (*Vector3) AddVector3 ¶
func (*Vector3) CrossFloats ¶
func (*Vector3) CrossVector3 ¶
func (*Vector3) DifferenceFloats ¶
func (*Vector3) DifferenceVector3 ¶
func (*Vector3) DistanceFloats ¶
func (*Vector3) DistanceSquaredFloats ¶
func (*Vector3) DistanceSquaredVector3 ¶
func (*Vector3) DistanceVector3 ¶
func (*Vector3) DotVector3 ¶
func (*Vector3) GetMagnitude ¶
func (*Vector3) GetMagnitudeSquared ¶
func (*Vector3) GetNegative ¶
func (*Vector3) GetNormalised ¶
func (*Vector3) GetXComponent ¶
func (*Vector3) GetYComponent ¶
func (*Vector3) GetZComponent ¶
func (*Vector3) HereToFloats ¶
func (*Vector3) HereToVector3 ¶
func (*Vector3) IsOrthogonalFloats ¶
func (*Vector3) IsOrthogonalVector3 ¶
func (*Vector3) SetMagnitude ¶
func (*Vector3) SetVector3 ¶
func (*Vector3) SubtractFloats ¶
func (*Vector3) SubtractVector3 ¶
func (*Vector3) SumVector3 ¶
type Vertex ¶
type Vertex struct { Feature // contains filtered or unexported fields }
func NewVertexVector2 ¶
func NewVertexVector2Int ¶
type Wound ¶
type Wound struct { AbstractShape // contains filtered or unexported fields }
func (*Wound) GetNormals ¶
func (*Wound) GetRadiusVector2 ¶
func (*Wound) GetVertices ¶
type WounderConvexer ¶
Source Files ¶
- AABB.go
- AbstractShape.go
- Capsule.go
- Circle.go
- Convexer.go
- Edge.go
- Ellipse.go
- Feature.go
- Featurer.go
- Geometry.go
- HalfEllipse.go
- Interval.go
- Mass.go
- Matrix22.go
- Matrix33.go
- Polygon.go
- Ray.go
- Rectangle.go
- Segment.go
- Shaper.go
- Slice.go
- Transform.go
- Transformer.go
- Triangle.go
- Vector2.go
- Vector3.go
- Vertex.go
- Wound.go
- Wounder.go
- WounderConvexer.go
- misc.go
Click to show internal directories.
Click to hide internal directories.