Documentation
¶
Index ¶
- type Float32
- type Float64
- type Int
- type Int16
- type Int32
- type Int64
- type Int8
- type Rectangle
- func New[T rm.SignedNumber](position vector2.Vector[T], size vector2.Vector[T]) Rectangle[T]
- func NewSize[T rm.SignedNumber](size vector2.Vector[T]) Rectangle[T]
- func NewT[T rm.SignedNumber, PT, ST rm.SignedNumber](position vector2.Vector[PT], size vector2.Vector[ST]) Rectangle[T]
- func NewXYWH[T rm.SignedNumber](x, y, w, h T) Rectangle[T]
- func One[T rm.SignedNumber]() Rectangle[T]
- func Zero[T rm.SignedNumber]() Rectangle[T]
- func (r Rectangle[T]) A() vector2.Vector[T]
- func (r Rectangle[T]) Add(xy vector2.Vector[T], wh vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) AddHeight(dH T) Rectangle[T]
- func (r Rectangle[T]) AddPosition(dXY vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) AddPositionXY(x, y T) Rectangle[T]
- func (r Rectangle[T]) AddSize(dWH vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) AddSizeXY(width, height T) Rectangle[T]
- func (r Rectangle[T]) AddWidth(dW T) Rectangle[T]
- func (r Rectangle[T]) AddX(dX T) Rectangle[T]
- func (r Rectangle[T]) AddXYWH(x, y, w, h T) Rectangle[T]
- func (r Rectangle[T]) AddY(dY T) Rectangle[T]
- func (r Rectangle[T]) B() vector2.Vector[T]
- func (v Rectangle[T]) Ceil() Rectangle[T]
- func (v Rectangle[T]) CeilToInt() Rectangle[int]
- func (r Rectangle[T]) Center() vector2.Vector[T]
- func (r Rectangle[T]) Contains(v vector2.Vector[T]) bool
- func (r Rectangle[T]) EachUnitCell() iter.Seq[vector2.Vector[T]]
- func (v Rectangle[T]) Floor() Rectangle[T]
- func (v Rectangle[T]) FloorToInt() Rectangle[int]
- func (r Rectangle[T]) Grow(v T) Rectangle[T]
- func (r Rectangle[T]) GrowXYWH(left, top, right, bottom T) Rectangle[T]
- func (r Rectangle[T]) Height() T
- func (r Rectangle[T]) HorizontalLine(y T) (vector2.Vector[T], vector2.Vector[T])
- func (r Rectangle[T]) Inverse(v vector2.Float64) vector2.Float64
- func (r Rectangle[T]) InverseF(v vector2.Float32) vector2.Float32
- func (r Rectangle[T]) InverseLerp(v vector2.Float64) vector2.Float64
- func (r Rectangle[T]) InverseLerpF(v vector2.Float32) vector2.Float32
- func (v Rectangle[T]) IsZero() bool
- func (r Rectangle[T]) Lerp(t vector2.Float64) vector2.Vector[T]
- func (r Rectangle[T]) LerpF(t vector2.Float32) vector2.Vector[T]
- func (r Rectangle[T]) LerpXYF(x, y float32) vector2.Vector[T]
- func (r Rectangle[T]) Pivot(anchor vector2.Vector[T], xy vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) ResetPosition() Rectangle[T]
- func (v Rectangle[T]) Round() Rectangle[T]
- func (v Rectangle[T]) RoundToInt() Rectangle[int]
- func (r Rectangle[T]) Scale(f float64) Rectangle[T]
- func (r Rectangle[T]) ScaleByVector(f vector2.Float64) Rectangle[T]
- func (r Rectangle[T]) ScaleByVectorF(f vector2.Float32) Rectangle[T]
- func (r Rectangle[T]) ScaleByXY(x, y float64) Rectangle[T]
- func (r Rectangle[T]) ScaleByXYF(x, y float32) Rectangle[T]
- func (r Rectangle[T]) ScaleF(f float32) Rectangle[T]
- func (r Rectangle[T]) SetA(a vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) SetB(b vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) SetHeight(newH T) Rectangle[T]
- func (r Rectangle[T]) SetPosition(newXY vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) SetPositionXY(x, y T) Rectangle[T]
- func (r Rectangle[T]) SetSize(newWH vector2.Vector[T]) Rectangle[T]
- func (r Rectangle[T]) SetSizeXY(width, height T) Rectangle[T]
- func (r Rectangle[T]) SetWidth(newW T) Rectangle[T]
- func (r Rectangle[T]) SetX(newX T) Rectangle[T]
- func (r Rectangle[T]) SetY(newY T) Rectangle[T]
- func (r Rectangle[T]) ShrinkXYWH(left, top, right, bottom T) Rectangle[T]
- func (r Rectangle[T]) String() string
- func (v Rectangle[T]) ToFloat32() Rectangle[float32]
- func (v Rectangle[T]) ToFloat64() Rectangle[float64]
- func (v Rectangle[T]) ToInt() Rectangle[int]
- func (v Rectangle[T]) ToInt32() Rectangle[int32]
- func (v Rectangle[T]) ToInt64() Rectangle[int64]
- func (r Rectangle[T]) VerticalLine(x T) (vector2.Vector[T], vector2.Vector[T])
- func (r Rectangle[T]) Width() T
- func (r Rectangle[T]) X() T
- func (r Rectangle[T]) Y() T
- func (r Rectangle[T]) Zoom(f float64) Rectangle[T]
- func (r Rectangle[T]) ZoomByVector(f vector2.Float64) Rectangle[T]
- func (r Rectangle[T]) ZoomByVectorF(f vector2.Float32) Rectangle[T]
- func (r Rectangle[T]) ZoomByXY(x, y float64) Rectangle[T]
- func (r Rectangle[T]) ZoomByXYF(x, y float32) Rectangle[T]
- func (r Rectangle[T]) ZoomF(f float32) Rectangle[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Float32 ¶
func NewFloat32 ¶
type Float64 ¶
func NewFloat64 ¶
type Rectangle ¶
func NewT ¶
func NewT[T rm.SignedNumber, PT, ST rm.SignedNumber](position vector2.Vector[PT], size vector2.Vector[ST]) Rectangle[T]
func NewXYWH ¶
func NewXYWH[T rm.SignedNumber](x, y, w, h T) Rectangle[T]
func One ¶
func One[T rm.SignedNumber]() Rectangle[T]
func Zero ¶
func Zero[T rm.SignedNumber]() Rectangle[T]
func (Rectangle[T]) AddPosition ¶
func (Rectangle[T]) AddPositionXY ¶
func (Rectangle[T]) CeilToInt ¶
CeilToInt applies the ceil math operation to each component of the rectangle, and then casts it to a int
func (Rectangle[T]) Floor ¶
Floor applies the floor math operation to each component of the rectangle
func (Rectangle[T]) FloorToInt ¶
FloorToInt applies the floor math operation to each component of the rectangle, and then casts it to a int
func (Rectangle[T]) HorizontalLine ¶
func (Rectangle[T]) InverseLerp ¶
InverseLerp calculates the inverse lerp of a point within the rectangle, returning a normalized vector2.Vector[T].
func (Rectangle[T]) InverseLerpF ¶
InverseLerpF calculates the inverse lerp of a point within the rectangle, returning a normalized vector2.Float32.
func (Rectangle[T]) ResetPosition ¶
ResetPosition zero the xy component of the rectangle
func (Rectangle[T]) Round ¶
Round takes each component of the rectangle and rounds it to the nearest whole number
func (Rectangle[T]) RoundToInt ¶
RoundToInt takes each component of the rectangle and rounds it to the nearest whole number, and then casts it to a int
func (Rectangle[T]) ScaleByVector ¶
func (Rectangle[T]) ScaleByVectorF ¶
func (Rectangle[T]) ScaleByXYF ¶
func (Rectangle[T]) SetPosition ¶
SetPosition changes the xy component of the rectangle
func (Rectangle[T]) SetPositionXY ¶
SetPosition changes the xy component of the rectangle