Documentation ¶
Index ¶
- Variables
- func Abs[T Numbers](v T) T
- func Clamp[T Numbers](v, minv, maxv T) T
- func Max[T Numbers](v1, v2 T) T
- func Min[T Numbers](v1, v2 T) T
- type Animation
- type BitMask
- func (mask *BitMask) Clear()
- func (mask *BitMask) Disable(flag BitMask)
- func (mask *BitMask) Enable(flag BitMask)
- func (mask *BitMask) EnableIf(flag BitMask, cond bool)
- func (mask BitMask) Has(flag BitMask) bool
- func (mask BitMask) HasOnly(flag BitMask) bool
- func (mask BitMask) String() string
- func (mask *BitMask) Toggle(flag BitMask)
- type Color
- type Floats
- type Integers
- type Numbers
- type Rectangle
- type UnsignedIntegers
- type Vector2
- func (v Vector2[T]) Add(v1 Vector2[T]) Vector2[T]
- func (v Vector2[T]) Area() float32
- func (v Vector2[T]) Distance(v2 Vector2[T]) float32
- func (v Vector2[T]) DistanceSquared(v2 Vector2[T]) float32
- func (v Vector2[T]) Div(v1 Vector2[T]) Vector2[T]
- func (v Vector2[T]) DivS(S T) Vector2[T]
- func (v Vector2[T]) Equals(v1 Vector2[T]) bool
- func (v Vector2[T]) Height() T
- func (v Vector2[T]) IsHorizontal() bool
- func (v Vector2[T]) IsInRect(rect Rectangle[T]) bool
- func (v Vector2[T]) Length() float32
- func (v Vector2[T]) LengthSquared() float32
- func (v Vector2[T]) Mul(v1 Vector2[T]) Vector2[T]
- func (v Vector2[T]) MulS(S T) Vector2[T]
- func (v Vector2[T]) Normalized() Vector2[T]
- func (v Vector2[T]) Perpendicular() Vector2[T]
- func (v Vector2[T]) String() string
- func (v Vector2[T]) Sub(v1 Vector2[T]) Vector2[T]
- func (v Vector2[T]) ToInt() Vector2[int]
- func (v Vector2[T]) Width() T
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ZeroRectangleF32 = Rectangle[float32]{} ZeroRectangleINT = Rectangle[int]{} )
Zero values for reducing allocations
View Source
var ( ZeroVector2F32 = Vector2[float32]{} ZeroVector2INT = Vector2[int]{} )
Zero values for reducing allocations
View Source
var (
ZeroColor = Color{}
)
Zero values for reducing allocations
Functions ¶
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
Animation used for calculating positions of animated objects (points)
func NewAnimation ¶
Lifetime is the life of the animation. Animation speed is depends of the delta time and lifetime. For lifeTime parameter, 1.0 value is 1 seconds
func (*Animation) IsFinished ¶
type BitMask ¶
type BitMask uint32
This is just for making code more readable Can hold up to 32 enums
type Numbers ¶
type Numbers interface { Integers | UnsignedIntegers | Floats }
type Vector2 ¶
type Vector2[T Numbers] struct { X, Y T }
func (Vector2[T]) DistanceSquared ¶
Does not applies sqrt, faster
func (Vector2[T]) IsHorizontal ¶
Returns true if the vector is horizontal
func (Vector2[T]) LengthSquared ¶
Does not applies sqrt, faster
func (Vector2[T]) Normalized ¶
func (Vector2[T]) Perpendicular ¶
Returns the perpenicular vector of v
Click to show internal directories.
Click to hide internal directories.