Documentation ¶
Index ¶
- Constants
- func AbsFloat64(val float64) float64
- func AbsI16(val int16) int16
- func AbsI32(val int32) int32
- func Ceil(v float64) int32
- func Distance(a, b Vector3) float64
- func DistanceSq(a, b Vector3) float64
- func Floor(v float64) int32
- func GetAngle(v1, v2 Vector3) (angel float64)
- func GetRad(v1, v2 Vector3) (angel float64)
- func LimitFloat32Min(value, min float32) float32
- func LimitFloat64(value float64, min float64, max float64) float64
- func LimitFloat64Max(value, max float64) float64
- func LimitFloat64Min(value, min float64) float64
- func LimitInt(value int, min int, max int) int
- func LimitInt16(value int16, min int16, max int16) int16
- func LimitInt16Max(value int16, max int16) int16
- func LimitInt16Min(value int16, min int16) int16
- func LimitInt32(value int32, min int32, max int32) int32
- func LimitInt32Max(value int32, max int32) int32
- func LimitInt32Min(value int32, min int32) int32
- func LimitInt64(value int64, min int64, max int64) int64
- func LimitInt64Max(value int64, max int64) int64
- func LimitInt64Min(value int64, min int64) int64
- func LimitIntMax(value int, max int) int
- func LimitIntMin(value int, min int) int
- func MaxFloat64(a, b float64) float64
- func MaxInt16(a, b int16) int16
- func MaxInt32(a, b int32) int32
- func MinFloat64(a, b float64) float64
- func MinInt16(a, b int16) int16
- func MinInt32(a, b int32) int32
- func Random(min int, max int) int
- func Random16(min int16, max int16) int16
- func Random32(min int32, max int32) int32
- func Random64(min int64, max int64) int64
- func RandomMatched(rate int32) bool
- func RandomMatchedPercent(rate int32) bool
- func RandomRate() int32
- func RandomU32(min uint32, max uint32) uint32
- func Round(f float64, n int) float64
- func RoundInt32(v float64) int32
- type RotateAxis
- type Vector2D
- func (this *Vector2D) Add(v *Vector2D) *Vector2D
- func (this *Vector2D) Angle(v *Vector2D) float64
- func (this *Vector2D) Clear()
- func (this *Vector2D) ContainInRange(v *Vector2D, r float32) bool
- func (this *Vector2D) ContainInRectRange(v *Vector2D, r float32) bool
- func (this *Vector2D) Copy() *Vector2D
- func (this *Vector2D) Cross(op *Vector2D) float64
- func (this *Vector2D) Distance(v *Vector2D) float64
- func (this *Vector2D) DistanceSq(v *Vector2D) float64
- func (this *Vector2D) Div(v float32) *Vector2D
- func (this *Vector2D) Dot(op *Vector2D) float64
- func (this *Vector2D) Equal(v *Vector2D) bool
- func (this *Vector2D) IsZero() bool
- func (this *Vector2D) Length() float32
- func (this *Vector2D) LengthSq() float64
- func (this *Vector2D) Mul(v float32) *Vector2D
- func (this *Vector2D) Norm() *Vector2D
- func (this *Vector2D) Orth() *Vector2D
- func (this *Vector2D) Radian(v *Vector2D) float64
- func (this *Vector2D) Reverse() *Vector2D
- func (this *Vector2D) Rotate(alpha float64) *Vector2D
- func (this *Vector2D) RotateAngle(angle float64) *Vector2D
- func (this *Vector2D) Sub(v *Vector2D) *Vector2D
- func (this *Vector2D) ToAngle() float64
- func (this *Vector2D) ToRadian() float64
- type Vector3
- func Add3(a, b Vector3) Vector3
- func AddArray3(vs []Vector3, dv Vector3) []Vector3
- func Cross3(a, b Vector3) Vector3
- func Multiply(v Vector3, scalars float64) Vector3
- func Multiply3(v Vector3, scalars []float64) []Vector3
- func NewVector3(x, y, z float64) Vector3
- func Normalize3(a Vector3) Vector3
- func Sub3(a, b Vector3) Vector3
- func XAxis3() Vector3
- func XYAxis3() Vector3
- func XYZAxis3() Vector3
- func XZAxis3() Vector3
- func YAxis3() Vector3
- func YZAxis3() Vector3
- func ZAxis3() Vector3
- func Zero3() Vector3
- func (this *Vector3) Add(v Vector3)
- func (this *Vector3) Clone() Vector3
- func (this *Vector3) Cross(v Vector3)
- func (this *Vector3) Divide(scalar float64)
- func (this *Vector3) Dot(v Vector3) float64
- func (this *Vector3) Equal(v Vector3) bool
- func (this *Vector3) FormatFloatFloor(decimal int)
- func (this *Vector3) IsZero() bool
- func (this *Vector3) Length() float64
- func (this *Vector3) LengthSq() float64
- func (this *Vector3) Multiply(scalar float64)
- func (this *Vector3) Normalize()
- func (this *Vector3) Rotate(axis RotateAxis, alpha float64) (v Vector3)
- func (this *Vector3) RotateAngle(axis RotateAxis, angle float64) Vector3
- func (this *Vector3) Set(x, y, z float64)
- func (this *Vector3) Sub(v Vector3)
Constants ¶
View Source
const RATE_DENOMINATOR int32 = 10000
Variables ¶
This section is empty.
Functions ¶
func AbsFloat64 ¶
func LimitFloat32Min ¶
func LimitFloat64 ¶
//////////////////--LimitFloat64--/////////////////////////
func LimitFloat64Max ¶
func LimitFloat64Min ¶
func LimitInt16 ¶
//////////////////--LimitInt16--/////////////////////////
func LimitInt16Max ¶
func LimitInt16Min ¶
func LimitInt32 ¶
//////////////////--LimitInt32--/////////////////////////
func LimitInt32Max ¶
func LimitInt32Min ¶
func LimitInt64 ¶
//////////////////--LimitInt64--/////////////////////////
func LimitInt64Max ¶
func LimitInt64Min ¶
func LimitIntMax ¶
func LimitIntMin ¶
func MaxFloat64 ¶
func MinFloat64 ¶
func RandomMatched ¶
概率为Rate的随机,是否随到。 范围为RATE_DENOMINATOR(10000)
func RoundInt32 ¶
Types ¶
type RotateAxis ¶
type RotateAxis uint
const ( ROTATE_AXIS_X RotateAxis = 0 ROTATE_AXIS_Y RotateAxis = 1 ROTATE_AXIS_Z RotateAxis = 2 )
type Vector2D ¶
func (*Vector2D) ContainInRectRange ¶
func (*Vector2D) DistanceSq ¶
func (*Vector2D) RotateAngle ¶
type Vector3 ¶
三维向量:(x,y,z)
func (*Vector3) FormatFloatFloor ¶
格式化数据(取小数点后decimal位有效四舍五入后的数据)
func (*Vector3) Rotate ¶
func (this *Vector3) Rotate(axis RotateAxis, alpha float64) (v Vector3)
沿 axis 轴顺时针旋转 alpha 弧度
func (*Vector3) RotateAngle ¶
func (this *Vector3) RotateAngle(axis RotateAxis, angle float64) Vector3
沿 axis 轴顺时针旋转 angle 欧拉角度
Click to show internal directories.
Click to hide internal directories.