Documentation ¶
Index ¶
- Variables
- func Abs[D Numeric](v D) D
- func Choose[D Integer](n D, m D) D
- func Clamp[D Numeric](v D, min D, max D) D
- func ClampLength[A Attr[A]](value A, min float32, max float32) A
- func Closest[A Attr[A]](start A, end A, point A, line bool) A
- func Cos[D Numeric](rad D) D
- func CubicCurve[A Attr[A]](delta float32, p0 A, p1 A, p2 A, p3 A, matrix [4][4]float32, inverse bool) A
- func Delta[A Attr[A]](start A, end A, point A) float32
- func DistanceFrom[A Attr[A]](start A, end A, point A, line bool) float32
- func Div[D Numeric](a D, b D) D
- func Factorial[D Numeric](x D) D
- func Floor[D Numeric](v D) D
- func Gcd[D Integer](a D, b D) D
- func GetTriangleHeight(base float32, side1 float32, side2 float32) float32
- func InterceptTime[A Attr[A]](shooter A, shooterSpeed float32, targetPosition A, targetVelocity A) float32
- func IsCircleInView[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, ...) bool
- func IsCircleInViewType[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, ...) bool
- func IsNormal[A Attr[A]](value A) bool
- func IsPointInView[A Attr[A]](origin A, direction A, fovCos float32, point A) bool
- func Lengthen[A Attr[A]](value A, length float32) A
- func Log10[D Numeric](v D) D
- func Max[D Numeric](a D, b D) D
- func Min[D Numeric](a D, b D) D
- func Normalize[A Attr[A]](value A, normal *A) float32
- func ParametricCubicCurve[A Attr[A]](delta float32, points []A, matrix [4][4]float32, weight float32, inverse bool, ...) A
- func QuadraticFormula(a, b, c, none float32) float32
- func Reflect[A Attr[A]](dir A, normal A) A
- func Refract[A Attr[A]](dir A, normal A) A
- func Sign[D Numeric](v D) int
- func Sin[D Numeric](rad D) D
- func Slerp[A Attr[A]](start A, end A, t float32) A
- func SlerpAngle[A Attr[A]](start A, end A, angle float32, t float32) A
- func SlerpNormal[A Attr[A]](start A, end A, t float32) A
- func Sqrt[D Numeric](v D) D
- type Attr
- type FieldOfView
- type Integer
- type ListenerEntry
- type ListenerOff
- type ListenerOffs
- type Listeners
- type Numeric
Constants ¶
This section is empty.
Variables ¶
View Source
var EPSILON = float32(0.00001)
Functions ¶
func ClampLength ¶
func CubicCurve ¶
func DistanceFrom ¶
func InterceptTime ¶
func IsCircleInView ¶
func IsCircleInViewType ¶
func IsPointInView ¶
func ParametricCubicCurve ¶
func QuadraticFormula ¶
func SlerpAngle ¶
func SlerpNormal ¶
Types ¶
type Attr ¶
type Attr[V any] interface { // distance between this and value Distance(value V) float32 // squared distance between this and value DistanceSq(value V) float32 // distance between this and zero Length() float32 // squared distance between this and zero LengthSq() float32 // dot product between this and value Dot(value V) float32 // the number of float components that make up this attribute Components() int // gets the float component at the given index GetComponent(index int) float32 // out[index] = value SetComponent(index int, value float32, out *V) // out[all] = value SetComponents(value float32, out *V) // out = this Set(out *V) // out = this + value Add(addend V, out *V) // out = this + value * scale AddScaled(value V, scale float32, out *V) // out = this - value Sub(subtrahend V, out *V) // out = this * value Mul(factor V, out *V) // out = this / value Div(factor V, out *V) // out = this * scale Scale(scale float32, out *V) // out = (end - start) * delta + start Interpolate(start V, end V, delta float32, out *V) }
type FieldOfView ¶
type FieldOfView string
const ( FieldOfViewIgnore FieldOfView = "ignore" FieldOfViewHalf FieldOfView = "half" FieldOfViewFull FieldOfView = "full" )
type ListenerEntry ¶
type ListenerEntry[L any] struct { // contains filtered or unexported fields }
func (*ListenerEntry[L]) Off ¶
func (entry *ListenerEntry[L]) Off()
type ListenerOff ¶
type ListenerOff func()
type ListenerOffs ¶
type ListenerOffs []ListenerOff
func (*ListenerOffs) Add ¶
func (offs *ListenerOffs) Add(off ListenerOff)
func (*ListenerOffs) Off ¶
func (offs *ListenerOffs) Off()
type Listeners ¶
type Listeners[L any] struct { // contains filtered or unexported fields }
func NewListeners ¶
func (*Listeners[L]) On ¶
func (l *Listeners[L]) On(listener L) ListenerOff
func (*Listeners[L]) OnCount ¶
func (l *Listeners[L]) OnCount(listener L, count int) ListenerOff
func (*Listeners[L]) Once ¶
func (l *Listeners[L]) Once(listener L) ListenerOff
Click to show internal directories.
Click to hide internal directories.