Documentation
¶
Index ¶
- func DistanceFV2(a FixVector2, b FixVector2) Fix64
- func DistanceFV3(a, b *FixVector3) Fix64
- func DistanceSqrFV2(a FixVector2, b FixVector2) Fix64
- func DistanceSqrFV3(a, b FixVector3) Fix64
- func DistanceSqrV2(a Vector2, b Vector2) float32
- func DistanceSqrV3(a, b Vector3) float32
- func DistanceV2(a Vector2, b Vector2) float32
- func DistanceV3(a, b Vector3) float32
- type FixVector2
- func AddArrayFV2(vs []FixVector2, dv FixVector2) []FixVector2
- func AddFV2(a, b FixVector2) FixVector2
- func LerpFV2(a, b FixVector2, t Fix64) FixVector2
- func MultiplyFV2(v FixVector2, scalars []Fix64) []FixVector2
- func NegativeInfinityFV2() FixVector2
- func NewFixVector2(x, y Fix64) FixVector2
- func PositiveInfinityFV2() FixVector2
- func ScaleFV2(a, b FixVector2) FixVector2
- func SubFV2(a, b FixVector2) FixVector2
- func XAxisFV2() FixVector2
- func XYAxisFV2() FixVector2
- func YAxisFV2() FixVector2
- func ZeroFV2() FixVector2
- func (this *FixVector2) Add(v FixVector2)
- func (this *FixVector2) Clone() FixVector2
- func (this *FixVector2) Divide(scalar Fix64)
- func (this *FixVector2) Dot(v FixVector2) Fix64
- func (this *FixVector2) Equal(v FixVector2) bool
- func (this *FixVector2) Magnitude() Fix64
- func (this *FixVector2) Multiply(scalar Fix64)
- func (this *FixVector2) Nomalized() FixVector2
- func (this *FixVector2) Normalize()
- func (this *FixVector2) Scale(v FixVector2)
- func (this *FixVector2) ScaleToLength(newLength Fix64)
- func (this *FixVector2) ScaledToLength(newLength Fix64) FixVector2
- func (this *FixVector2) Set(x, y Fix64)
- func (this *FixVector2) SqrMagnitude() Fix64
- func (this *FixVector2) Sub(v FixVector2)
- func (a *FixVector2) Vector2() Vector2
- type FixVector3
- func AddFV3(a, b FixVector3) FixVector3
- func BackFix() FixVector3
- func CrossFV3(a, b FixVector3) FixVector3
- func DownFix() FixVector3
- func ForwardFix() FixVector3
- func LeftFix() FixVector3
- func LerpFV3(from, to FixVector3, factor Fix64) FixVector3
- func NewFixVector3(x, y, z Fix64) FixVector3
- func NormalizedFV3(a FixVector3) FixVector3
- func RightFix() FixVector3
- func ScaleFV3(a, b FixVector3) FixVector3
- func SubFV3(a, b FixVector3) FixVector3
- func UpFix() FixVector3
- func XAxisFix() FixVector3
- func XYAxisFix() FixVector3
- func XYZAxisFix() FixVector3
- func XZAxisFix() FixVector3
- func YAxisFix() FixVector3
- func YZAxisFix() FixVector3
- func ZAxisFix() FixVector3
- func ZeroFix() FixVector3
- func (this *FixVector3) Add(b FixVector3)
- func (this *FixVector3) Clone() FixVector3
- func (this *FixVector3) Cross(b FixVector3)
- func (this *FixVector3) Divide(b Fix64)
- func (this *FixVector3) Dot(b FixVector3) Fix64
- func (this *FixVector3) Equal(v FixVector3) bool
- func (this *FixVector3) Float() string
- func (this *FixVector3) FromVector3(v *Vector3)
- func (this FixVector3) GetHashCode() int64
- func (this *FixVector3) Magnitude() Fix64
- func (this *FixVector3) Multiply(b Fix64)
- func (this *FixVector3) Normalize()
- func (this *FixVector3) Normalized() FixVector3
- func (this *FixVector3) Scale(v FixVector3)
- func (this *FixVector3) ScaleToLength(newLength Fix64)
- func (this *FixVector3) ScaledToLength(newLength Fix64) FixVector3
- func (this *FixVector3) Set(x, y, z Fix64)
- func (this *FixVector3) SetVec(v FixVector3)
- func (this *FixVector3) SqrMagnitude() Fix64
- func (this *FixVector3) Sub(b FixVector3)
- func (this *FixVector3) ToString() string
- func (this *FixVector3) Vector2() Vector2
- func (this *FixVector3) Vector3() Vector3
- type POSKEY
- type Vec
- func (this *Vec[T]) Add(v Vec[T])
- func (this *Vec[T]) Clone() Vec[T]
- func (this *Vec[T]) Cross(v Vec[T]) Vec[T]
- func (this *Vec[T]) Divide(scalar T)
- func (this *Vec[T]) Dot(v Vec[T]) T
- func (this *Vec[T]) Equal(v Vec[T]) bool
- func (this *Vec[T]) Lerp(v Vec[T], t T) Vec[T]
- func (this *Vec[T]) Magnitude() T
- func (this *Vec[T]) MagnitudeSqr() T
- func (this *Vec[T]) Multiply(scalar T)
- func (this *Vec[T]) Normalize()
- func (this *Vec[T]) Normalized() Vec[T]
- func (this *Vec[T]) Scale(v Vec[T])
- func (this *Vec[T]) Set(x, y, z T)
- func (this *Vec[T]) Sub(v Vec[T])
- type Vec2
- func (this *Vec2[T]) Add(v Vec2[T])
- func (this *Vec2[T]) Angle(v Vec2[T]) T
- func (this *Vec2[T]) AngleDeg(v Vec2[T]) T
- func (this *Vec2[T]) Clone() Vec2[T]
- func (this *Vec2[T]) Distance(v Vec2[T]) T
- func (this *Vec2[T]) DistanceSqr(v Vec2[T]) T
- func (this *Vec2[T]) Divide(scalar T)
- func (this *Vec2[T]) Dot(v Vec2[T]) T
- func (this *Vec2[T]) Equal(v Vec2[T]) bool
- func (this *Vec2[T]) Magnitude() T
- func (this *Vec2[T]) MagnitudeSqr() T
- func (this *Vec2[T]) Multiply(scalar T)
- func (this *Vec2[T]) Normalize()
- func (this *Vec2[T]) Normalized() Vec2[T]
- func (this *Vec2[T]) Rotate(angle T)
- func (this *Vec2[T]) RotateDeg(angle T)
- func (this *Vec2[T]) Scale(v Vec2[T])
- func (this *Vec2[T]) ScaleToLength(newLength T)
- func (this *Vec2[T]) Set(x, y T)
- func (this *Vec2[T]) Sub(v Vec2[T])
- type Vector2
- func AddArrayV2(vs []Vector2, dv Vector2) []Vector2
- func AddV2(a, b Vector2) Vector2
- func LerpUnclampedV2(a, b Vector2, t float32) Vector2
- func LerpV2(a, b Vector2, t float32) Vector2
- func MultiplyV2(v Vector2, scalars []float32) []Vector2
- func NegativeInfinityV2() Vector2
- func NewVector2(x, y float32) Vector2
- func PositiveInfinityV2() Vector2
- func ScaleV2(a, b Vector3) Vector2
- func SubV2(a, b Vector2) Vector2
- func XAxisV2() Vector2
- func XYAxisV2() Vector2
- func YAxisV2() Vector2
- func ZeroV2() Vector2
- func (this *Vector2) Add(v1 Vector2)
- func (this *Vector2) Clone() Vector2
- func (this *Vector2) Divide(scalar float32)
- func (this *Vector2) Dot(v Vector2) float32
- func (this *Vector2) Equal(v1 Vector2) bool
- func (this *Vector2) Length() float32
- func (this *Vector2) Magnitude() float32
- func (this *Vector2) Multiply(scalar float32)
- func (this *Vector2) Normalize()
- func (this *Vector2) Normalized() Vector2
- func (this *Vector2) Scale(v Vector2)
- func (this *Vector2) ScaleToLength(newLength float32)
- func (this *Vector2) ScaledToLength(newLength float32) Vector2
- func (this *Vector2) Set(x, y float32)
- func (this *Vector2) SqrMagnitude() float32
- func (this *Vector2) Sub(v1 Vector2)
- type Vector2Int
- type Vector3
- func AddArrayV3(vs []Vector3, dv Vector3) []Vector3
- func AddV3(a, b Vector3) Vector3
- func BackV3() Vector3
- func CrossV3(a, b Vector3) Vector3
- func DownV3() Vector3
- func ForwardV3() Vector3
- func LeftV3() Vector3
- func LerpUnclampedV3(a, b Vector3, t float32) Vector3
- func LerpV3(a, b Vector3, t float32) Vector3
- func Max(a, b Vector3) Vector3
- func Min(a, b Vector3) Vector3
- func MultiplyV3(v Vector3, scalars []float32) []Vector3
- func NegativeInfinityV3() Vector3
- func NewVector3(x, y, z float32) Vector3
- func PositiveInfinityV3() Vector3
- func RightV3() Vector3
- func ScaleV3(a, b Vector3) Vector3
- func SubV3(a, b Vector3) Vector3
- func UpV3() Vector3
- func XAxisV3() Vector3
- func XYAxisV3() Vector3
- func XYZAxisV3() Vector3
- func XZAxisV3() Vector3
- func YAxisV3() Vector3
- func YZAxisV3() Vector3
- func ZAxisV3() Vector3
- func ZeroV3() Vector3
- func (this *Vector3) Add(v Vector3)
- func (this *Vector3) Clone() Vector3
- func (this *Vector3) Cross(v Vector3)
- func (this *Vector3) Divide(scalar float32)
- func (this *Vector3) Dot(v Vector3) float32
- func (this *Vector3) Equal(v Vector3) bool
- func (this *Vector3) Magnitude() float32
- func (this *Vector3) Multiply(scalar float32)
- func (this *Vector3) Normalize()
- func (this *Vector3) Normalized() Vector3
- func (this *Vector3) RotateYAnticlockwise(center Vector3, angle int) Vector3
- func (this *Vector3) RotateYClockwise(center Vector3, angle int) Vector3
- func (this *Vector3) Scale(v Vector3)
- func (this *Vector3) ScaleToLength(newLength float32)
- func (this *Vector3) ScaledToLength(newLength float32) Vector3
- func (this *Vector3) Set(x, y, z float32)
- func (this *Vector3) SetVec(v Vector3)
- func (this *Vector3) SqrMagnitude() float32
- func (this *Vector3) Sub(v Vector3)
- func (this *Vector3) Vector2() Vector2
- type Vector3Int
- func (this *Vector3Int) Add(v Vector3Int)
- func (this *Vector3Int) AddVal(v Vector3Int) Vector3Int
- func (this Vector3Int) Clone() Vector3Int
- func (this *Vector3Int) Equal(v Vector3Int) bool
- func (this *Vector3Int) IsZero() bool
- func (this *Vector3Int) Key() POSKEY
- func (this *Vector3Int) ManhattanDistance(v Vector3Int) int32
- func (this *Vector3Int) RotateX(angle int) Vector3Int
- func (this *Vector3Int) Set(x, y, z int32)
- func (this *Vector3Int) ShortKey() uint32
- func (this *Vector3Int) Sub(v Vector3Int)
- func (this *Vector3Int) SubVal(v Vector3Int) Vector3Int
- func (this Vector3Int) ToVector2Int() Vector2Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DistanceFV3 ¶
func DistanceFV3(a, b *FixVector3) Fix64
func DistanceSqrFV3 ¶
func DistanceSqrFV3(a, b FixVector3) Fix64
Types ¶
type FixVector2 ¶
type FixVector2 struct { X Fix64 `json:"x"` Y Fix64 `json:"y"` }
func AddArrayFV2 ¶
func AddArrayFV2(vs []FixVector2, dv FixVector2) []FixVector2
func MultiplyFV2 ¶
func MultiplyFV2(v FixVector2, scalars []Fix64) []FixVector2
func NegativeInfinityFV2 ¶
func NegativeInfinityFV2() FixVector2
func PositiveInfinityFV2 ¶
func PositiveInfinityFV2() FixVector2
func ScaleFV2 ¶
func ScaleFV2(a, b FixVector2) FixVector2
func XYAxisFV2 ¶
func XYAxisFV2() FixVector2
func (*FixVector2) Add ¶
func (this *FixVector2) Add(v FixVector2)
func (*FixVector2) Clone ¶
func (this *FixVector2) Clone() FixVector2
func (*FixVector2) Divide ¶
func (this *FixVector2) Divide(scalar Fix64)
func (*FixVector2) Equal ¶
func (this *FixVector2) Equal(v FixVector2) bool
func (*FixVector2) Multiply ¶
func (this *FixVector2) Multiply(scalar Fix64)
func (*FixVector2) ScaledToLength ¶
func (this *FixVector2) ScaledToLength(newLength Fix64) FixVector2
复制朝向定长
func (*FixVector2) Set ¶
func (this *FixVector2) Set(x, y Fix64)
func (*FixVector2) Sub ¶
func (this *FixVector2) Sub(v FixVector2)
func (*FixVector2) Vector2 ¶
func (a *FixVector2) Vector2() Vector2
type FixVector3 ¶
type FixVector3 struct { X Fix64 Y Fix64 Z Fix64 }
/ FixVector3
func AddFV3 ¶
func AddFV3(a, b FixVector3) FixVector3
func BackFix ¶
func BackFix() FixVector3
func DownFix ¶
func DownFix() FixVector3
func ForwardFix ¶
func ForwardFix() FixVector3
func LeftFix ¶
func LeftFix() FixVector3
func LerpFV3 ¶
func LerpFV3(from, to FixVector3, factor Fix64) FixVector3
func NewFixVector3 ¶
func NewFixVector3(x, y, z Fix64) FixVector3
func NormalizedFV3 ¶
func NormalizedFV3(a FixVector3) FixVector3
func RightFix ¶
func RightFix() FixVector3
func SubFV3 ¶
func SubFV3(a, b FixVector3) FixVector3
func UpFix ¶
func UpFix() FixVector3
func XYAxisFix ¶
func XYAxisFix() FixVector3
func XYZAxisFix ¶
func XYZAxisFix() FixVector3
func XZAxisFix ¶
func XZAxisFix() FixVector3
func YZAxisFix ¶
func YZAxisFix() FixVector3
func (*FixVector3) Add ¶
func (this *FixVector3) Add(b FixVector3)
func (*FixVector3) Clone ¶
func (this *FixVector3) Clone() FixVector3
func (*FixVector3) Cross ¶
func (this *FixVector3) Cross(b FixVector3)
func (*FixVector3) Divide ¶
func (this *FixVector3) Divide(b Fix64)
func (*FixVector3) Dot ¶
func (this *FixVector3) Dot(b FixVector3) Fix64
func (*FixVector3) Equal ¶
func (this *FixVector3) Equal(v FixVector3) bool
func (*FixVector3) Float ¶
func (this *FixVector3) Float() string
func (*FixVector3) FromVector3 ¶
func (this *FixVector3) FromVector3(v *Vector3)
func (FixVector3) GetHashCode ¶
func (this FixVector3) GetHashCode() int64
func (*FixVector3) Magnitude ¶
func (this *FixVector3) Magnitude() Fix64
func (*FixVector3) Multiply ¶
func (this *FixVector3) Multiply(b Fix64)
func (*FixVector3) Normalize ¶
func (this *FixVector3) Normalize()
func (*FixVector3) ScaledToLength ¶
func (this *FixVector3) ScaledToLength(newLength Fix64) FixVector3
复制朝向定长
func (*FixVector3) Set ¶
func (this *FixVector3) Set(x, y, z Fix64)
func (*FixVector3) SetVec ¶
func (this *FixVector3) SetVec(v FixVector3)
func (*FixVector3) SqrMagnitude ¶
func (this *FixVector3) SqrMagnitude() Fix64
func (*FixVector3) Sub ¶
func (this *FixVector3) Sub(b FixVector3)
func (*FixVector3) ToString ¶
func (this *FixVector3) ToString() string
func (*FixVector3) Vector2 ¶
func (this *FixVector3) Vector2() Vector2
func (*FixVector3) Vector3 ¶
func (this *FixVector3) Vector3() Vector3
type Vec ¶
type Vec[T constraints.Integer | constraints.Float] struct { X T `json:"x"` Y T `json:"y"` Z T `json:"z"` }
func (*Vec[T]) MagnitudeSqr ¶
func (this *Vec[T]) MagnitudeSqr() T
func (*Vec[T]) Normalized ¶
type Vec2 ¶
type Vec2[T constraints.Integer | constraints.Float] struct { X T `json:"x"` Y T `json:"y"` }
func (*Vec2[T]) DistanceSqr ¶
func (*Vec2[T]) MagnitudeSqr ¶
func (this *Vec2[T]) MagnitudeSqr() T
func (*Vec2[T]) Normalized ¶
func (*Vec2[T]) ScaleToLength ¶
func (this *Vec2[T]) ScaleToLength(newLength T)
type Vector2 ¶
func AddArrayV2 ¶
func LerpUnclampedV2 ¶
func MultiplyV2 ¶
func NegativeInfinityV2 ¶
func NegativeInfinityV2() Vector2
func PositiveInfinityV2 ¶
func PositiveInfinityV2() Vector2
func (*Vector2) ScaledToLength ¶
复制朝向定长
type Vector2Int ¶
func (*Vector2Int) Add ¶
func (this *Vector2Int) Add(v Vector2Int)
func (*Vector2Int) Clone ¶
func (this *Vector2Int) Clone() Vector2Int
func (*Vector2Int) Equal ¶
func (this *Vector2Int) Equal(v Vector2Int) bool
func (*Vector2Int) Key ¶
func (this *Vector2Int) Key() uint32
func (*Vector2Int) Sub ¶
func (this *Vector2Int) Sub(v Vector2Int)
func (*Vector2Int) ToVector3Int ¶
func (this *Vector2Int) ToVector3Int() Vector3Int
type Vector3 ¶
func AddArrayV3 ¶
func LerpUnclampedV3 ¶
func MultiplyV3 ¶
func NegativeInfinityV3 ¶
func NegativeInfinityV3() Vector3
func PositiveInfinityV3 ¶
func PositiveInfinityV3() Vector3
func (*Vector3) RotateYAnticlockwise ¶
绕(X,Z)平面绕center点逆时针旋转 anticlockwise
func (*Vector3) RotateYClockwise ¶
绕(X,Z)平面绕center点顺时针旋转 clockwise 与前端unity一致
func (*Vector3) ScaledToLength ¶
复制朝向定长
type Vector3Int ¶
func (*Vector3Int) Add ¶
func (this *Vector3Int) Add(v Vector3Int)
func (*Vector3Int) AddVal ¶
func (this *Vector3Int) AddVal(v Vector3Int) Vector3Int
func (Vector3Int) Clone ¶
func (this Vector3Int) Clone() Vector3Int
func (*Vector3Int) Equal ¶
func (this *Vector3Int) Equal(v Vector3Int) bool
func (*Vector3Int) IsZero ¶
func (this *Vector3Int) IsZero() bool
func (*Vector3Int) Key ¶
func (this *Vector3Int) Key() POSKEY
func (*Vector3Int) ManhattanDistance ¶
func (this *Vector3Int) ManhattanDistance(v Vector3Int) int32
func (*Vector3Int) RotateX ¶
func (this *Vector3Int) RotateX(angle int) Vector3Int
func (*Vector3Int) Set ¶
func (this *Vector3Int) Set(x, y, z int32)
func (*Vector3Int) ShortKey ¶
func (this *Vector3Int) ShortKey() uint32
func (*Vector3Int) Sub ¶
func (this *Vector3Int) Sub(v Vector3Int)
func (*Vector3Int) SubVal ¶
func (this *Vector3Int) SubVal(v Vector3Int) Vector3Int
func (Vector3Int) ToVector2Int ¶
func (this Vector3Int) ToVector2Int() Vector2Int
Click to show internal directories.
Click to hide internal directories.