Documentation ¶
Index ¶
- Variables
- func GaussVecDistNoNorm(a, b mat32.Vec2, sigma float32) float32
- func Max32i(a, b int) int
- func Min32i(a, b int) int
- type Dims
- type Vec2i
- func (v Vec2i) Add(other Vec2i) Vec2i
- func (v Vec2i) AddScalar(s int) Vec2i
- func (v *Vec2i) Clamp(min, max Vec2i)
- func (v *Vec2i) ClampScalar(minVal, maxVal int)
- func (v Vec2i) Dim(dim Dims) int
- func (v Vec2i) Div(other Vec2i) Vec2i
- func (v Vec2i) DivScalar(scalar int) Vec2i
- func (v *Vec2i) FromArray(array []int, offset int)
- func (v Vec2i) IsEqual(other Vec2i) bool
- func (v Vec2i) IsNil() bool
- func (v Vec2i) Max(other Vec2i) Vec2i
- func (v Vec2i) Min(other Vec2i) Vec2i
- func (v Vec2i) Mul(other Vec2i) Vec2i
- func (v Vec2i) MulScalar(s int) Vec2i
- func (v Vec2i) Negate() Vec2i
- func (v *Vec2i) Set(x, y int)
- func (v *Vec2i) SetAdd(other Vec2i)
- func (v *Vec2i) SetAddScalar(s int)
- func (v *Vec2i) SetByName(name string, value int)
- func (v *Vec2i) SetDim(dim Dims, value int)
- func (v *Vec2i) SetDiv(other Vec2i)
- func (v *Vec2i) SetDivScalar(s int)
- func (v *Vec2i) SetMax(other Vec2i)
- func (v *Vec2i) SetMin(other Vec2i)
- func (v *Vec2i) SetMul(other Vec2i)
- func (v *Vec2i) SetMulScalar(s int)
- func (v *Vec2i) SetNegate()
- func (v *Vec2i) SetScalar(s int)
- func (v *Vec2i) SetSub(other Vec2i)
- func (v *Vec2i) SetSubScalar(s int)
- func (v *Vec2i) SetZero()
- func (v Vec2i) Sub(other Vec2i) Vec2i
- func (v Vec2i) SubScalar(s int) Vec2i
- func (v Vec2i) ToArray(array []int, offset int)
Constants ¶
This section is empty.
Variables ¶
var KiT_Dims = kit.Enums.AddEnum(DimsN, kit.NotBitFlag, nil)
Functions ¶
func GaussVecDistNoNorm ¶
GaussVecDistNoNorm returns the gaussian of the distance between two 2D vectors using given sigma standard deviation, without normalizing area under gaussian (i.e., max value is 1 at dist = 0)
Types ¶
type Dims ¶
type Dims int
Dims is a list of vector dimension (component) names
func (*Dims) FromString ¶
type Vec2i ¶
Vec2i is a 2D vector/point with X and Y int components.
func NewVec2iScalar ¶
NewVec2iScalar returns a new Vec2i with all components set to scalar.
func (Vec2i) AddScalar ¶
AddScalar adds scalar s to each component of this vector and returns new vector.
func (*Vec2i) Clamp ¶
Clamp sets this vector components to be no less than the corresponding components of min and not greater than the corresponding component of max. Assumes min < max, if this assumption isn't true it will not operate correctly.
func (*Vec2i) ClampScalar ¶
ClampScalar sets this vector components to be no less than minVal and not greater than maxVal.
func (Vec2i) Div ¶
Div divides each component of this vector by the corresponding one from other vector and returns resulting vector.
func (Vec2i) DivScalar ¶
DivScalar divides each component of this vector by the scalar s and returns resulting vector. If scalar is zero, returns zero.
func (*Vec2i) FromArray ¶
FromArray sets this vector's components from the specified array and offset.
func (Vec2i) Mul ¶
Mul multiplies each component of this vector by the corresponding one from other and returns resulting vector.
func (Vec2i) MulScalar ¶
MulScalar multiplies each component of this vector by the scalar s and returns resulting vector.
func (*Vec2i) SetAddScalar ¶
SetAddScalar sets this to addition with scalar.
func (*Vec2i) SetByName ¶
SetByName sets this vector component value by its case insensitive name: "x" or "y".
func (*Vec2i) SetDivScalar ¶
SetDivScalar sets this to division by scalar.
func (*Vec2i) SetMax ¶
SetMax sets this vector components to the maximum value of itself and other vector.
func (*Vec2i) SetMin ¶
SetMin sets this vector components to the minimum values of itself and other vector.
func (*Vec2i) SetMul ¶
SetMul sets this to multiplication with other vector (i.e., *= or times-equals).
func (*Vec2i) SetMulScalar ¶
SetMulScalar sets this to multiplication by scalar.
func (*Vec2i) SetNegate ¶
func (v *Vec2i) SetNegate()
SetNegate negates each of this vector's components.
func (*Vec2i) SetSub ¶
SetSub sets this to subtraction with other vector (i.e., -= or minus-equals).
func (*Vec2i) SetSubScalar ¶
SetSubScalar sets this to subtraction of scalar.
func (*Vec2i) SetZero ¶
func (v *Vec2i) SetZero()
SetZero sets this vector X and Y components to be zero.