common

package
v0.0.0-...-a60ced3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AI_FAST_ATOF_RELAVANT_DECIMALS = 15

------------------------------------------------------------------------------------ ! Provides a fast function for converting a string into a float, ! about 6 times faster than atof in win32. If you find any bugs, please send them to me, niko (at) irrlicht3d.org. ------------------------------------------------------------------------------------ Number of relevant decimals for floating-point parsing.

View Source
const AiEpsilon = 1e-6
View Source
const NumItems = 16

Variables

This section is empty.

Functions

func AiAssert

func AiAssert(ok bool, msg ...string)

func AiSAtrToPrintable

func AiSAtrToPrintable(in string, placeholders ...uint8) string

--------------------------------------------------------------------------------- / @brief Make a string printable by replacing all non-printable characters with / the specified placeholder character. / @param in The incoming string. / @param placeholder Placeholder character, default is a question mark. / @return The string, with all non-printable characters replaced.

func ArrayBounds

func ArrayBounds[T any](in []T, boundMin, boundMax func(a T, b T) T) (min, max any)

func ChooseMinMaxAiQuatKey

func ChooseMinMaxAiQuatKey(min, max *AiQuatKey)

func ChooseMinMaxAiVertexWeight

func ChooseMinMaxAiVertexWeight(min, max *AiVertexWeight)

func ChooseMinMaxDouble

func ChooseMinMaxDouble() (min, max float64)

func ChooseMinMaxFloat

func ChooseMinMaxFloat() (min, max float32)

------------------------------------------------------------------------------- Start points for ArrayBounds<T> for all supported Ts

func ChooseMinMaxUint32

func ChooseMinMaxUint32() (min, max uint32)

func ClearQuotationMark

func ClearQuotationMark(s string) string

func FastAtorealMove

func FastAtorealMove(cData []byte, check_commas ...bool) (res float64, index int, err error)

func GetArea2D

func GetArea2D(v1, v2, v3 *AiVector2D) float64

func GetBytesOrder

func GetBytesOrder() binary.ByteOrder

func HexDigitToDecimal

func HexDigitToDecimal(in byte) (out uint)

------------------------------------------------------------------------------------ Convert just one hex digit Return value is UINT_MAX if the input character is not a hex digit. ------------------------------------------------------------------------------------

func IsCCW

func IsCCW(in []*AiVector2D) bool

func IsLittleEndian

func IsLittleEndian() bool

func LowerBound

func LowerBound(begin, end int, less func(index int) bool) int

find >=

func Max

func Max[T Number](a, b T) T

func Min

func Min[T Number](a, b T) T

func OnLeftSideOfLine2D

func OnLeftSideOfLine2D(p0, p1, p2 *AiVector2D) int

func PointInTriangle2D

func PointInTriangle2D(p0, p1, p2, pp *AiVector2D) bool

func SliceAiVector3DToFloatArr

func SliceAiVector3DToFloatArr(in []*AiVector3D) (out []float32)

func StrTol10

func StrTol10(inData string) (value int32, index int)

------------------------------------------------------------------------------------ signed variant of strtoul10 ------------------------------------------------------------------------------------

func StrTol10_64

func StrTol10_64(cData []byte, max_inout *uint32) (value uint64, index int, err error)

func StrToul10_64

func StrToul10_64(cData []byte, max_inout *uint32) (value uint64, index int, err error)

func Strtoul10

func Strtoul10(in string) (value int32, index int)

------------------------------------------------------------------------------------ Convert a string in decimal format to a number ------------------------------------------------------------------------------------

Types

type AiColor3D

type AiColor3D struct {
	R, G, B float32
}

func NewAiColor3D

func NewAiColor3D(R, G, B float32) *AiColor3D

func (*AiColor3D) Clone

func (ai *AiColor3D) Clone() *AiColor3D

func (*AiColor3D) FromPbMsg

func (ai *AiColor3D) FromPbMsg(data *pb_msg.AiColor3D) *AiColor3D

func (*AiColor3D) Mul

func (ai *AiColor3D) Mul(f float32) *AiColor3D

* Multiply with a scalar

func (*AiColor3D) MulColor3D

func (ai *AiColor3D) MulColor3D(c *AiColor3D) *AiColor3D

* Component-wise multiplication

func (*AiColor3D) ToPbMsg

func (ai *AiColor3D) ToPbMsg() *pb_msg.AiColor3D

type AiColor4D

type AiColor4D struct {
	R, G, B, A float32
}

func ChooseMinMaxAiColor4D

func ChooseMinMaxAiColor4D() (min, max *AiColor4D)

func NewAiColor4D

func NewAiColor4D(R, G, B, A float32) *AiColor4D

func NewAiColor4D0

func NewAiColor4D0() *AiColor4D

func (*AiColor4D) Add

func (ai *AiColor4D) Add(o *AiColor4D) *AiColor4D

func (*AiColor4D) BoundMax

func (ai *AiColor4D) BoundMax(a, b *AiColor4D) *AiColor4D

func (*AiColor4D) BoundMin

func (ai *AiColor4D) BoundMin(a, b *AiColor4D) *AiColor4D

func (*AiColor4D) Clone

func (ai *AiColor4D) Clone() *AiColor4D

func (*AiColor4D) DivValue

func (ai *AiColor4D) DivValue(f float32) *AiColor4D

func (*AiColor4D) Equal

func (ai *AiColor4D) Equal(other *AiColor4D) bool

func (*AiColor4D) FromPbMsg

func (ai *AiColor4D) FromPbMsg(data *pb_msg.AiColor4D) *AiColor4D

func (*AiColor4D) Index

func (ai *AiColor4D) Index(i int) float32

------------------------------------------------------------------------------------------------

func (*AiColor4D) Mul

func (ai *AiColor4D) Mul(v2 *AiColor4D) *AiColor4D

func (*AiColor4D) MulValue

func (ai *AiColor4D) MulValue(f float32) *AiColor4D

func (*AiColor4D) NotEqual

func (ai *AiColor4D) NotEqual(other *AiColor4D) bool

------------------------------------------------------------------------------------------------

func (*AiColor4D) Sub

func (ai *AiColor4D) Sub(o *AiColor4D) *AiColor4D

func (*AiColor4D) ToPbMsg

func (ai *AiColor4D) ToPbMsg() *pb_msg.AiColor4D

type AiMatrix3x3

type AiMatrix3x3 struct {
	A1, A2, A3 float32
	B1, B2, B3 float32
	C1, C2, C3 float32
}

func NewAiMatrix3x3

func NewAiMatrix3x3() *AiMatrix3x3

func NewAiMatrix3x3WithValues

func NewAiMatrix3x3WithValues(
	_a1, _a2, _a3,
	_b1, _b2, _b3,
	_c1, _c2, _c3 float32) *AiMatrix3x3

func (*AiMatrix3x3) Determinant

func (ai *AiMatrix3x3) Determinant() float32

func (*AiMatrix3x3) EpsEqual

func (ai *AiMatrix3x3) EpsEqual(m *AiMatrix3x3, epsilon float64) bool

func (*AiMatrix3x3) Equal

func (ai *AiMatrix3x3) Equal(m *AiMatrix3x3) bool

func (*AiMatrix3x3) Index

func (ai *AiMatrix3x3) Index(p_iIndex int, j int) float32

func (*AiMatrix3x3) Inverse

func (ai *AiMatrix3x3) Inverse() *AiMatrix3x3

func (*AiMatrix3x3) MulMatrix3x3

func (ai *AiMatrix3x3) MulMatrix3x3(m *AiMatrix3x3) *AiMatrix3x3

func (*AiMatrix3x3) MulVector3d

func (ai *AiMatrix3x3) MulVector3d(pVector *AiVector3D) *AiVector3D

func (*AiMatrix3x3) NotEqual

func (ai *AiMatrix3x3) NotEqual(m *AiMatrix3x3) bool

func (*AiMatrix3x3) Rotation

func (ai *AiMatrix3x3) Rotation(a float32, axis *AiVector3D, out AiMatrix3x3) AiMatrix3x3

func (*AiMatrix3x3) RotationZ

func (ai *AiMatrix3x3) RotationZ(a float32, out *AiMatrix3x3) *AiMatrix3x3

func (*AiMatrix3x3) SetByIndex

func (ai *AiMatrix3x3) SetByIndex(i, j int, value float32)

func (*AiMatrix3x3) Translation

func (ai *AiMatrix3x3) Translation(v *AiVector2D) *AiMatrix3x3

type AiMatrix4x4

type AiMatrix4x4 struct {
	A1, A2, A3, A4 float32
	B1, B2, B3, B4 float32
	C1, C2, C3, C4 float32
	D1, D2, D3, D4 float32
}

func NewAiMatrix4x4FromAiMatrix3x3

func NewAiMatrix4x4FromAiMatrix3x3(m *AiMatrix3x3) *AiMatrix4x4

func NewAiMatrix4x4FromValues

func NewAiMatrix4x4FromValues(_a1, _a2, _a3, _a4, _b1, _b2, _b3, _b4,
	_c1, _c2, _c3, _c4,
	_d1, _d2, _d3, _d4 float32) *AiMatrix4x4

func NewAiMatrix4x4Identify

func NewAiMatrix4x4Identify() *AiMatrix4x4

func (*AiMatrix4x4) AddMatrix4x4

func (ai *AiMatrix4x4) AddMatrix4x4(m *AiMatrix4x4) *AiMatrix4x4

func (*AiMatrix4x4) Clone

func (ai *AiMatrix4x4) Clone() *AiMatrix4x4

func (*AiMatrix4x4) Determinant

func (ai *AiMatrix4x4) Determinant() float32

func (*AiMatrix4x4) Equal

func (ai *AiMatrix4x4) Equal(m *AiMatrix4x4, tepsilon float32) bool

func (*AiMatrix4x4) FromEulerAnglesXYZ

func (ai *AiMatrix4x4) FromEulerAnglesXYZ(x, y, z float32) *AiMatrix4x4

func (*AiMatrix4x4) FromPbMsg

func (ai *AiMatrix4x4) FromPbMsg(p *pb_msg.AiMatrix4X4) *AiMatrix4x4

func (*AiMatrix4x4) Index

func (ai *AiMatrix4x4) Index(p_iIndex int, j int) float32

func (*AiMatrix4x4) Inverse

func (ai *AiMatrix4x4) Inverse() *AiMatrix4x4

func (*AiMatrix4x4) MulAiMatrix4x4

func (ai *AiMatrix4x4) MulAiMatrix4x4(m *AiMatrix4x4) *AiMatrix4x4

func (*AiMatrix4x4) MulAiVector3D

func (ai *AiMatrix4x4) MulAiVector3D(pVector *AiVector3D) *AiVector3D

func (*AiMatrix4x4) MulFloat32

func (ai *AiMatrix4x4) MulFloat32(aFloat float32) *AiMatrix4x4

func (*AiMatrix4x4) NotEqual

func (ai *AiMatrix4x4) NotEqual(m *AiMatrix4x4, tepsilon float32) bool

func (*AiMatrix4x4) Set

func (ai *AiMatrix4x4) Set(p_iIndex int, j int, value float32)

func (*AiMatrix4x4) ToPbMsg

func (ai *AiMatrix4x4) ToPbMsg() *pb_msg.AiMatrix4X4

func (*AiMatrix4x4) Transpose

func (mat *AiMatrix4x4) Transpose() *AiMatrix4x4

type AiPropertyStore

type AiPropertyStore struct {
	Sentinel uint8
}

type AiQuatKey

type AiQuatKey struct {
	/** The time of this key */
	Time float64

	/** The value of this key */
	Value *AiQuaternion
}

func (*AiQuatKey) BoundMax

func (ai *AiQuatKey) BoundMax(b *AiQuatKey) *AiQuatKey

func (*AiQuatKey) BoundMin

func (ai *AiQuatKey) BoundMin(b *AiQuatKey) *AiQuatKey

func (*AiQuatKey) Clone

func (ai *AiQuatKey) Clone() *AiQuatKey

func (*AiQuatKey) FromPbMsg

func (ai *AiQuatKey) FromPbMsg(p *pb_msg.AiQuatKey) *AiQuatKey

func (*AiQuatKey) ToPbMsg

func (ai *AiQuatKey) ToPbMsg() *pb_msg.AiQuatKey

type AiQuaternion

type AiQuaternion struct {
	W, X, Y, Z float32
}

func ChooseMinMaxAiQuaternion

func ChooseMinMaxAiQuaternion() (min, max *AiQuaternion)

func NewAiQuaternion

func NewAiQuaternion(pw, px, py, pz float32) *AiQuaternion

func NewAiQuaternion0

func NewAiQuaternion0() *AiQuaternion

func (*AiQuaternion) BoundMax

func (ai *AiQuaternion) BoundMax(b *AiQuaternion) *AiQuaternion

func (*AiQuaternion) BoundMin

func (ai *AiQuaternion) BoundMin(b *AiQuaternion) *AiQuaternion

func (*AiQuaternion) Clone

func (ai *AiQuaternion) Clone() *AiQuaternion

func (*AiQuaternion) FromPbMsg

func (ai *AiQuaternion) FromPbMsg(p *pb_msg.AiQuaternion) *AiQuaternion

func (*AiQuaternion) ToPbMsg

func (ai *AiQuaternion) ToPbMsg() *pb_msg.AiQuaternion

type AiVector2D

type AiVector2D struct {
	X, Y float32
}

func ChooseMinMaxAiVector2D

func ChooseMinMaxAiVector2D() (min, max *AiVector2D)

func NewAiVector2D

func NewAiVector2D(X, Y float32) *AiVector2D

func SliceAiVector3DToAiVector2D

func SliceAiVector3DToAiVector2D(in []*AiVector3D) (out []*AiVector2D)

------------------------------------------------------------------------------- * Check whether the winding order of a given polygon is counter-clockwise.

func (*AiVector2D) BoundMax

func (ai *AiVector2D) BoundMax(b *AiVector2D) *AiVector2D

func (*AiVector2D) BoundMin

func (ai *AiVector2D) BoundMin(b *AiVector2D) *AiVector2D

func (*AiVector2D) Clone

func (ai *AiVector2D) Clone() *AiVector2D

func (*AiVector2D) Div

func (ai *AiVector2D) Div(f float32) *AiVector2D

func (*AiVector2D) FromPbMsg

func (ai *AiVector2D) FromPbMsg(data *pb_msg.AiVector2D) *AiVector2D

func (*AiVector2D) Length

func (ai *AiVector2D) Length() float32

func (*AiVector2D) Mul

func (ai *AiVector2D) Mul(v2 *AiVector2D) float32

func (*AiVector2D) Normalize

func (ai *AiVector2D) Normalize() *AiVector2D

func (*AiVector2D) Set

func (ai *AiVector2D) Set(pX, pY float32)

func (*AiVector2D) SquareLength

func (ai *AiVector2D) SquareLength() float32

func (*AiVector2D) Sub

func (ai *AiVector2D) Sub(v2 *AiVector2D) *AiVector2D

func (*AiVector2D) ToPbMsg

func (ai *AiVector2D) ToPbMsg() *pb_msg.AiVector2D

type AiVector3D

type AiVector3D struct {
	X, Y, Z float32
}

func ChooseMinMaxAiVector3D

func ChooseMinMaxAiVector3D() (min, max *AiVector3D)

func NewAiVector3D

func NewAiVector3D() *AiVector3D

/ @brief The default class constructor.

func NewAiVector3D1

func NewAiVector3D1(_xyz float32) *AiVector3D

/ @brief The class constructor with a default value. / @param _xyz The value for x, y and z.

func NewAiVector3D3

func NewAiVector3D3(_x, _y, _z float32) *AiVector3D

/ @brief The class constructor with the components. / @param _x The x-component for the vector. / @param _y The y-component for the vector. / @param _z The z-component for the vector.

func NewellNormal

func NewellNormal(num int, x, y, z []float32, ofs_x, ofs_y, ofs_z int) (out *AiVector3D)

func (*AiVector3D) Add

func (ai *AiVector3D) Add(o *AiVector3D) *AiVector3D

func (*AiVector3D) BoundMax

func (ai *AiVector3D) BoundMax(b *AiVector3D) *AiVector3D

func (*AiVector3D) BoundMin

func (ai *AiVector3D) BoundMin(b *AiVector3D) *AiVector3D

func (*AiVector3D) Clone

func (ai *AiVector3D) Clone() *AiVector3D

func (*AiVector3D) Div

func (ai *AiVector3D) Div(f float64) *AiVector3D

func (*AiVector3D) Equal

func (ai *AiVector3D) Equal(other *AiVector3D) bool

func (*AiVector3D) Equal1

func (ai *AiVector3D) Equal1(other *AiVector3D, epsilon float32)

func (*AiVector3D) FromPbMsg

func (ai *AiVector3D) FromPbMsg(data *pb_msg.AiVector3D) *AiVector3D

func (*AiVector3D) Index

func (ai *AiVector3D) Index(i int) float32

func (*AiVector3D) Length

func (ai *AiVector3D) Length() float64

func (*AiVector3D) Less

func (ai *AiVector3D) Less(other *AiVector3D) bool

func (*AiVector3D) Mul

func (ai *AiVector3D) Mul(f float32) *AiVector3D

func (*AiVector3D) MulAiVector3D

func (ai *AiVector3D) MulAiVector3D(v2 *AiVector3D) float64

func (*AiVector3D) MulMatrix3x3

func (ai *AiVector3D) MulMatrix3x3(mat *AiMatrix3x3)

func (*AiVector3D) MulMatrix4x4

func (ai *AiVector3D) MulMatrix4x4(mat *AiMatrix4x4)

func (*AiVector3D) NegationOperationSymbol

func (ai *AiVector3D) NegationOperationSymbol(v2 *AiVector3D) *AiVector3D

func (*AiVector3D) Normalize

func (ai *AiVector3D) Normalize() *AiVector3D

func (*AiVector3D) NotEqual

func (ai *AiVector3D) NotEqual(other *AiVector3D) bool

func (*AiVector3D) Set

func (ai *AiVector3D) Set(pX, pY, pZ float32)

func (*AiVector3D) SquareLength

func (ai *AiVector3D) SquareLength() float64

func (*AiVector3D) Sub

func (ai *AiVector3D) Sub(o *AiVector3D) *AiVector3D

func (*AiVector3D) ToPbMsg

func (ai *AiVector3D) ToPbMsg() *pb_msg.AiVector3D

type AiVector4D

type AiVector4D [4]float32

func NewAiVector4D

func NewAiVector4D() *AiVector4D

func (*AiVector4D) FromPbMsg

func (ai *AiVector4D) FromPbMsg(data *pb_msg.AiVector4D) *AiVector4D

func (AiVector4D) ToPbMsg

func (ai AiVector4D) ToPbMsg() *pb_msg.AiVector4D

type AiVectorKey

type AiVectorKey struct {
	/** The time of this key */
	Time float64

	/** The value of this key */
	Value *AiVector3D
}

* A time-value pair specifying a certain 3D vector for the given time.

func ChooseMinMaxAiVectorKey

func ChooseMinMaxAiVectorKey() (min, max *AiVectorKey)

func (*AiVectorKey) BoundMax

func (ai *AiVectorKey) BoundMax(b *AiVectorKey) *AiVectorKey

func (*AiVectorKey) BoundMin

func (ai *AiVectorKey) BoundMin(b *AiVectorKey) *AiVectorKey

func (*AiVectorKey) Clone

func (ai *AiVectorKey) Clone() *AiVectorKey

func (*AiVectorKey) FromPbMsg

func (ai *AiVectorKey) FromPbMsg(p *pb_msg.AiVectorKey) *AiVectorKey

func (*AiVectorKey) ToPbMsg

func (ai *AiVectorKey) ToPbMsg() *pb_msg.AiVectorKey

type AiVertexWeight

type AiVertexWeight struct {
	//! Index of the vertex which is influenced by the bone.
	VertexId uint32

	//! The strength of the influence in the range (0...1).
	//! The influence from all bones at one vertex amounts to 1.
	Weight float32
}

func (*AiVertexWeight) BoundMax

func (ai *AiVertexWeight) BoundMax(a, b *AiVertexWeight) *AiVertexWeight

func (*AiVertexWeight) BoundMin

func (ai *AiVertexWeight) BoundMin(b *AiVertexWeight) *AiVertexWeight

func (*AiVertexWeight) Clone

func (ai *AiVertexWeight) Clone() *AiVertexWeight

func (*AiVertexWeight) FromPbMsg

func (*AiVertexWeight) ToPbMsg

func (ai *AiVertexWeight) ToPbMsg() *pb_msg.AiVertexWeight

type Number

type Number interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
		~float32 | ~float64
}

type Pair

type Pair[T1 any, T2 any] struct {
	First  T1
	Second T2
}

func NewPair

func NewPair[T1 any, T2 any](first T1, Second T2) *Pair[T1, T2]

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T any]() *Queue[T]

func (*Queue[T]) FindIndex

func (q *Queue[T]) FindIndex(v T, eq func(v1, v2 T) bool) (i int)

func (*Queue[T]) Front

func (q *Queue[T]) Front() (v T)

func (*Queue[T]) Index

func (q *Queue[T]) Index(i int) T

func (*Queue[T]) PopBack

func (q *Queue[T]) PopBack() (v T)

func (*Queue[T]) PushBack

func (q *Queue[T]) PushBack(v T)

func (*Queue[T]) PushFront

func (q *Queue[T]) PushFront(v T)

func (*Queue[T]) Range

func (q *Queue[T]) Range(fn func(v T))

func (*Queue[T]) Size

func (q *Queue[T]) Size() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL