Documentation ¶
Index ¶
- func Abs[T IT](a T) T
- func Area2[T IT](a, b, c []T) T
- func AssertTrue(value bool)
- func Between[T IT](a, b, c []T) bool
- func CalcAreaOfPolygon2D(verts []int32, nverts int32) int32
- func CircumCircle[T float64 | float32](p1, p2, p3, c []T, r *T) bool
- func Clamp[T cmp.Ordered](value, minInclusive, maxInclusive T) T
- func Collinear[T IT](a, b, c []T) bool
- func ComputeTileHash(x, y, mask int32) int32
- func ContourInCone(i, n int32, verts, pj []int32) bool
- func ContourdistancePtSeg[T int | int32](x, z, px, pz, qx, qz T) float32
- func Diagonal[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func DiagonalLoose[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func Diagonalie[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func DiagonalieLoose[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func DistPtTri[T float64 | float32](p, a, b, c []T) (res T)
- func DistToPoly[T float64 | float32](nvert int32, verts []T, p []T) (res T)
- func DistToTriMesh[T float64 | float32](p, verts []T, nverts int32, tris []int32, ntris int32) (res T)
- func DistancePtSeg[T float64 | float32](pt, p, q []T) T
- func DistancePtSeg2d[T float64 | float32](pt, p, q []T) T
- func DoWhile(do func() (stop bool), while func() bool)
- func DtOverlapBounds[T float64 | float32](amin, amax, bmin, bmax []T) bool
- func GetDirForOffset(offsetX, offsetZ int32) int32
- func GetDirOffsetX(direction int32) int32
- func GetDirOffsetY(direction int32) int32
- func GetTFloatMax[T float64 | float32](v T) T
- func GetVert2[T IT, T1 IIndex](verts []T, index T1) []T
- func GetVert3[T IT, T1 IIndex](verts []T, index T1) []T
- func GetVert4[T IT, T1 IIndex](verts []T, index T1) []T
- func GluProject[T1 int32 | int](obj []float64, projection, modelview []float64, view []T1) []float64
- func Ilog2(v uint32) uint32
- func InCone[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func InConeLoose[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
- func Intersect[T IT](a, b, c, d []T) bool
- func IntersectProp[T IT](a, b, c, d []T) bool
- func IntersectSegContour(d0, d1 []int32, i, n int32, verts []int32) bool
- func IsFinite(v float32) bool
- func IsTFloat64[T float64 | float32](v T) bool
- func Left[T IT](a, b, c []T) bool
- func LeftOn[T IT](a, b, c []T) bool
- func Next[T IT](i, n T) T
- func NextPow2(v uint32) uint32
- func PointInPoly(numVerts int32, verts []float32, point []float32) bool
- func Prev[T IT](i, n T) T
- func PushBack(v int32, arr []int32, an *int32)
- func PushFront(v int32, arr []int32, an *int32)
- func RcCalcBounds[T float64 | float32](verts []T, numVerts int, minBounds []T, maxBounds []T)
- func RcVequal[T IT](a, b []T) bool
- func SliceTToSlice[T1, T2 IT](v1 []T1) (v2 []T2)
- func Sqr[T IT](a T) T
- func Sqrt(x float64) float64
- func TriArea2D[T float64 | float32](a, b, c []T) T
- func Triangulate[T1 int32 | uint8 | int, T2 int32 | uint16 | int](n int32, verts []T1, indices []T2, tris []T2) int32
- func Uleft[T IT](a, b, c []T) bool
- func UnGluProject[T1 int32 | int](obj []float64, projection, modelview []float64, view []T1) ([]float64, error)
- func Vadd[T float64 | float32](res []T, v1, v2 []T)
- func Vcross[T float64 | float32](res []T, v1, v2 []T)
- func Vcross2[T float64 | float32](p1, p2, p3 []T) T
- func Vdist[T float64 | float32](v1, v2 []T) T
- func Vdist2[T float64 | float32](p, q []T) T
- func Vdist2D(v1, v2 []float32) float32
- func Vdist2DSqr(v1, v2 []float32) float32
- func VdistSq2[T float64 | float32](p, q []T) T
- func VdistSqr[T float64 | float32](v1, v2 []T) float64
- func Vdot[T float64 | float32](v1, v2 []T) T
- func Vdot2[T float64 | float32](a, b []T) T
- func Vdot2D(u, v []float32) float32
- func Vequal(p0 []float32, p1 []float32) bool
- func Visfinite(v []float32) bool
- func Visfinite2D(v []float32) bool
- func Vlen(v []float32) float32
- func VlenSqr(v []float32) float32
- func Vlerp(dest []float32, v1, v2 []float32, t float32) []float32
- func Vmad[T float64 | float32](res []T, v1, v2 []T, s T)
- func Vmax[T float64 | float32](mx, v []T)
- func Vmin[T float64 | float32](mn, v []T)
- func Vnormalize[T float64 | float32](v []T)
- func Vperp2D(u, v []float32) float32
- func Vscale[T float64 | float32](res []T, v []T, t T)
- func Vset(dest []float32, x, y, z float32)
- func Vsub[T float64 | float32](res, v1, v2 []T)
- func Xorb(x, y bool) bool
- type IIndex
- type IT
- type Vec2
- type Vec3
- type Vec4
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T IT](a T) T
/ Returns the absolute value. / @param[in] a The value. / @return The absolute value of the specified value.
func AssertTrue ¶
func AssertTrue(value bool)
func CalcAreaOfPolygon2D ¶
func CircumCircle ¶
func Clamp ¶
/ Clamps the value to the specified range. / @param[in] value The value to clamp. / @param[in] minInclusive The minimum permitted return value. / @param[in] maxInclusive The maximum permitted return value. / @return The value, clamped to the specified range.
func ComputeTileHash ¶
func ContourInCone ¶
func ContourdistancePtSeg ¶
func Diagonal ¶
func Diagonal[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
Returns T iff (v_i, v_j) is a proper internal diagonal of P.
func DiagonalLoose ¶
func Diagonalie ¶
func Diagonalie[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
Returns T iff (v_i, v_j) is a proper internal *or* external diagonal of P, *ignoring edges incident to v_i and v_j*.
func DiagonalieLoose ¶
func DistToPoly ¶
func DistToTriMesh ¶
func DistancePtSeg ¶
func DistancePtSeg2d ¶
func DtOverlapBounds ¶
/ Determines if two axis-aligned bounding boxes overlap. / @param[in] amin Minimum bounds of box A. [(x, y, z)] / @param[in] amax Maximum bounds of box A. [(x, y, z)] / @param[in] bmin Minimum bounds of box B. [(x, y, z)] / @param[in] bmax Maximum bounds of box B. [(x, y, z)] / @return True if the two AABB's overlap. / @see dtOverlapQuantBounds
func GetDirForOffset ¶
/ Gets the direction for the specified offset. One of x and y should be 0. / @param[in] offsetX The x offset. [Limits: -1 <= value <= 1] / @param[in] offsetZ The z offset. [Limits: -1 <= value <= 1] / @return The direction that represents the offset.
func GetDirOffsetX ¶
/ Gets the standard width (x-axis) offset for the specified direction. / @param[in] direction The direction. [Limits: 0 <= value < 4] / @return The width offset to apply to the current cell position to move in the direction.
func GetDirOffsetY ¶
TODO (graham): Rename this to rcGetDirOffsetZ / Gets the standard height (z-axis) offset for the specified direction. / @param[in] direction The direction. [Limits: 0 <= value < 4] / @return The height offset to apply to the current cell position to move in the direction.
func GetTFloatMax ¶
func GluProject ¶
func InCone ¶
func InCone[T1 IT, T2 int32 | uint8 | int, T3 int32 | uint16 | int](i, j, n T1, verts []T2, indices []T3) bool
Returns true iff the diagonal (i,j) is strictly internal to the polygon P in the neighborhood of the i endpoint.
func InConeLoose ¶
func IntersectProp ¶
Returns true iff ab properly intersects cd: they share a point interior to both segments. The properness of the intersection is ensured by using strict leftness.
func IsTFloat64 ¶
func PointInPoly ¶
TODO (graham): This is duplicated in the ConvexVolumeTool in RecastDemo / Checks if a point is contained within a polygon / / @param[in] numVerts Number of vertices in the polygon / @param[in] verts The polygon vertices / @param[in] point The point to check / @returns true if the point lies within the polygon, false otherwise.
func Prev ¶
func Prev[T IT](i, n T) T
Last time I checked the if version got compiled using cmov, which was a lot faster than module (with idiv).
func RcCalcBounds ¶
func SliceTToSlice ¶
func SliceTToSlice[T1, T2 IT](v1 []T1) (v2 []T2)
func Sqr ¶
func Sqr[T IT](a T) T
/ Returns the square of the value. / @param[in] a The value. / @return The square of the value.
func TriArea2D ¶
/ Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C. / @param[in] a Vertex A. [(x, y, z)] / @param[in] b Vertex B. [(x, y, z)] / @param[in] c Vertex C. [(x, y, z)] / @return The signed xz-plane area of the triangle.
func Triangulate ¶
func UnGluProject ¶
func Vadd ¶
/ Performs a vector addition. (@p v1 + @p v2) / @param[out] dest The result vector. [(x, y, z)] / @param[in] v1 The base vector. [(x, y, z)] / @param[in] v2 The vector to add to @p v1. [(x, y, z)]
func Vcross ¶
/ Derives the cross product of two vectors. (@p v1 x @p v2) / @param[out] dest The cross product. [(x, y, z)] / @param[in] v1 A Vector [(x, y, z)] / @param[in] v2 A vector [(x, y, z)]
func Vdist ¶
/ Returns the distance between two points. / @param[in] v1 A point. [(x, y, z)] / @param[in] v2 A point. [(x, y, z)] / @return The distance between the two points.
func Vdist2D ¶
/ Derives the distance between the specified points on the xz-plane. / @param[in] v1 A point. [(x, y, z)] / @param[in] v2 A point. [(x, y, z)] / @return The distance between the point on the xz-plane. / / The vectors are projected onto the xz-plane, so the y-values are ignored.
func Vdist2DSqr ¶
/ Derives the square of the distance between the specified points on the xz-plane. / @param[in] v1 A point. [(x, y, z)] / @param[in] v2 A point. [(x, y, z)] / @return The square of the distance between the point on the xz-plane.
func VdistSqr ¶
/ Returns the square of the distance between two points. / @param[in] v1 A point. [(x, y, z)] / @param[in] v2 A point. [(x, y, z)] / @return The square of the distance between the two points.
func Vdot ¶
/ Derives the dot product of two vectors. (@p v1 . @p v2) / @param[in] v1 A Vector [(x, y, z)] / @param[in] v2 A vector [(x, y, z)] / @return The dot product.
func Vdot2D ¶
/ Derives the dot product of two vectors on the xz-plane. (@p u . @p v) / @param[in] u A vector [(x, y, z)] / @param[in] v A vector [(x, y, z)] / @return The dot product on the xz-plane. / / The vectors are projected onto the xz-plane, so the y-values are ignored.
func Vequal ¶
/ Performs a 'sloppy' colocation check of the specified points. / @param[in] p0 A point. [(x, y, z)] / @param[in] p1 A point. [(x, y, z)] / @return True if the points are considered to be at the same location. / / Basically, this function will return true if the specified points are / close enough to eachother to be considered colocated.
func Visfinite ¶
/ Checks that the specified vector's components are all finite. / @param[in] v A point. [(x, y, z)] / @return True if all of the point's components are finite, i.e. not NaN / or any of the infinities.
func Visfinite2D ¶
/ Checks that the specified vector's 2D components are finite. / @param[in] v A point. [(x, y, z)]
func Vlen ¶
/ Derives the scalar length of the vector. / @param[in] v The vector. [(x, y, z)] / @return The scalar length of the vector.
func VlenSqr ¶
/ Derives the square of the scalar length of the vector. (len * len) / @param[in] v The vector. [(x, y, z)] / @return The square of the scalar length of the vector.
func Vlerp ¶
/ Performs a linear interpolation between two vectors. (@p v1 toward @p v2) / @param[out] dest The result vector. [(x, y, x)] / @param[in] v1 The starting vector. / @param[in] v2 The destination vector. / @param[in] t The interpolation factor. [Limits: 0 <= value <= 1.0]
func Vmad ¶
/ Performs a scaled vector addition. (@p v1 + (@p v2 * @p s)) / @param[out] dest The result vector. [(x, y, z)] / @param[in] v1 The base vector. [(x, y, z)] / @param[in] v2 The vector to scale and add to @p v1. [(x, y, z)] / @param[in] s The amount to scale @p v2 by before adding to @p v1.
func Vmax ¶
/ Selects the maximum value of each element from the specified vectors. / @param[in,out] mx A vector. (Will be updated with the result.) [(x, y, z)] / @param[in] v A vector. [(x, y, z)]
func Vmin ¶
/ Selects the minimum value of each element from the specified vectors. / @param[in,out] mn A vector. (Will be updated with the result.) [(x, y, z)] / @param[in] v A vector. [(x, y, z)]
func Vnormalize ¶
/ Normalizes the vector. / @param[in,out] v The vector to normalize. [(x, y, z)]
func Vperp2D ¶
/ Derives the xz-plane 2D perp product of the two vectors. (uz*vx - ux*vz) / @param[in] u The LHV vector [(x, y, z)] / @param[in] v The RHV vector [(x, y, z)] / @return The perp dot product on the xz-plane. / / The vectors are projected onto the xz-plane, so the y-values are ignored.
func Vscale ¶
/ Scales the vector by the specified value. (@p v * @p t) / @param[out] dest The result vector. [(x, y, z)] / @param[in] v The vector to scale. [(x, y, z)] / @param[in] t The scaling factor.
func Vset ¶
/ Sets the vector elements to the specified values. / @param[out] dest The result vector. [(x, y, z)] / @param[in] x The x-value of the vector. / @param[in] y The y-value of the vector. / @param[in] z The z-value of the vector.