Documentation
¶
Index ¶
- Constants
- Variables
- func CatmullRom[T constraints.Float](t, p0, p1, p2, p3 T) T
- func CeilPowerOfTwo[T constraints.Integer](value T) T
- func Clamp[T constraints.Float](value, min, max T) T
- func CubicBezier[T constraints.Float](t, p0, p1, p2, p3 T) T
- func CubicBezierP0[T constraints.Float](t, p T) T
- func CubicBezierP1[T constraints.Float](t, p T) T
- func CubicBezierP2[T constraints.Float](t, p T) T
- func CubicBezierP3[T constraints.Float](t, p T) T
- func Damp[T constraints.Float](x, y, lambda, dt T) T
- func DegToRad[T constraints.Float](degrees T) T
- func EuclideanModulo[T constraints.Float](n, m T) T
- func FloorPowerOfTwo[T constraints.Integer](value T) T
- func InverseLerp[T constraints.Float](x, y, value T) T
- func IsPowerOfTwo[T constraints.Integer](value T) bool
- func Lerp[T constraints.Float](x, y, t T) T
- func MapLinear[T constraints.Float](x, a1, a2, b1, b2 T) T
- func PingPong[T constraints.Float](x, length T) T
- func QuadraticBezier[T constraints.Float](t, p0, p1, p2 T) T
- func QuadraticBezierP0[T constraints.Float](t, p T) T
- func QuadraticBezierP1[T constraints.Float](t, p T) T
- func QuadraticBezierP2[T constraints.Float](t, p T) T
- func RadToDeg[T constraints.Float](radians T) T
- func RandFloatSpread[T constraints.Float](rng T) T
- func SetQuaternionFromProperEuler[T constraints.Float](q *Quaternion[T], a, b, c T, order string)
- func Smootherstep[T constraints.Float](x, min, max T) T
- func Smoothstep[T constraints.Float](x, min, max T) T
- type ArcCurve
- type Box2
- func (b *Box2[T]) ClampPoint(point Vector2[T], target *Vector2[T]) *Vector2[T]
- func (b *Box2[T]) Clone() *Box2[T]
- func (b *Box2[T]) ContainsBox(box *Box2[T]) bool
- func (b *Box2[T]) ContainsPoint(point Vector2[T]) bool
- func (b *Box2[T]) Copy(box *Box2[T]) *Box2[T]
- func (b *Box2[T]) DistanceToPoint(point Vector2[T]) T
- func (b *Box2[T]) Equals(box *Box2[T]) bool
- func (b *Box2[T]) ExpandByPoint(point Vector2[T]) *Box2[T]
- func (b *Box2[T]) ExpandByScalar(scalar T) *Box2[T]
- func (b *Box2[T]) ExpandByVector(vector Vector2[T]) *Box2[T]
- func (b *Box2[T]) GetCenter(target *Vector2[T]) *Vector2[T]
- func (b *Box2[T]) GetParameter(point Vector2[T], target *Vector2[T]) *Vector2[T]
- func (b *Box2[T]) GetSize(target *Vector2[T]) *Vector2[T]
- func (b *Box2[T]) Intersect(box *Box2[T]) *Box2[T]
- func (b *Box2[T]) IntersectsBox(box *Box2[T]) bool
- func (b *Box2[T]) IsEmpty() bool
- func (b *Box2[T]) MakeEmpty() *Box2[T]
- func (b *Box2[T]) Set(min, max Vector2[T]) *Box2[T]
- func (b *Box2[T]) SetFromCenterAndSize(center, size Vector2[T]) *Box2[T]
- func (b *Box2[T]) SetFromPoints(points []Vector2[T]) *Box2[T]
- func (b *Box2[T]) Translate(offset Vector2[T]) *Box2[T]
- func (b *Box2[T]) Union(box *Box2[T]) *Box2[T]
- type Box3
- func (b *Box3[T]) ApplyMatrix4(matrix Matrix4[T]) *Box3[T]
- func (b *Box3[T]) Center() Vector3[T]
- func (b *Box3[T]) ClampPoint(point Vector3[T]) (target *Vector3[T])
- func (b *Box3[T]) Clone() *Box3[T]
- func (b *Box3[T]) ContainsBox(box Box3[T]) bool
- func (b *Box3[T]) ContainsPoint(point Vector3[T]) bool
- func (b *Box3[T]) Copy(box *Box3[T]) *Box3[T]
- func (b *Box3[T]) DistanceToPoint(point Vector3[T]) T
- func (b *Box3[T]) Equals(box Box3[T]) bool
- func (b *Box3[T]) ExpandByPoint(point Vector3[T]) *Box3[T]
- func (b *Box3[T]) ExpandByScalar(scalar T) *Box3[T]
- func (b *Box3[T]) ExpandByVector(vector Vector3[T]) *Box3[T]
- func (b *Box3[T]) GetBoundingSphere() *Sphere[T]
- func (b *Box3[T]) GetParameter(point Vector3[T]) (target Vector3[T])
- func (b *Box3[T]) Intersect(box Box3[T]) *Box3[T]
- func (b *Box3[T]) IntersectsBox(box Box3[T]) bool
- func (b *Box3[T]) IntersectsPlane(plane Plane[T]) bool
- func (b *Box3[T]) IntersectsSphere(sphere Sphere[T]) bool
- func (b *Box3[T]) IntersectsTriangle(triangle Triangle[T]) bool
- func (b *Box3[T]) IsEmpty() bool
- func (b *Box3[T]) MakeEmpty() *Box3[T]
- func (b *Box3[T]) Set(min, max Vector3[T]) *Box3[T]
- func (b *Box3[T]) SetFromCenterAndSize(center, size Vector3[T]) *Box3[T]
- func (b *Box3[T]) SetFromPoints(points ...Vector3[T]) *Box3[T]
- func (b *Box3[T]) Size() *Vector3[T]
- func (b *Box3[T]) Translate(offset Vector3[T]) *Box3[T]
- func (b *Box3[T]) Union(box Box3[T]) *Box3[T]
- type CatmullRomCurve3
- func (c *CatmullRomCurve3) Clone() *baseCurve[T]
- func (c *CatmullRomCurve3) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3[T]
- func (c *CatmullRomCurve3[T]) Copy(source *CatmullRomCurve3[T]) *CatmullRomCurve3[T]
- func (c *CatmullRomCurve3[T]) GetPoint(t T, optionalTarget *Vector3[T]) *Vector3[T]
- func (c *CatmullRomCurve3) Length() T
- func (c *CatmullRomCurve3) Lengths(divisions int) []T
- func (c *CatmullRomCurve3) LengthsDefault() []T
- func (c *CatmullRomCurve3) Point(t T) *Vector3[T]
- func (c *CatmullRomCurve3) PointAt(u T) *Vector3[T]
- func (c *CatmullRomCurve3) Points(divisions int) []Vector3[T]
- func (c *CatmullRomCurve3) SpacedPoints(divisions int) []Vector3[T]
- func (c *CatmullRomCurve3) Tangent(t T) *Vector3[T]
- func (c *CatmullRomCurve3) TangentAt(u T) *Vector3[T]
- func (c *CatmullRomCurve3) UpdateArcLengths()
- type CoordinateSystem
- type CubicBezierCurve
- func (c *CubicBezierCurve) Clone() *baseCurve[T]
- func (c *CubicBezierCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3[T]
- func (c *CubicBezierCurve) Copy(source baseCurve[T]) *baseCurve[T]
- func (c *CubicBezierCurve[T]) Length() T
- func (c *CubicBezierCurve[T]) Lengths(divisions int) []T
- func (c *CubicBezierCurve[T]) LengthsDefault() []T
- func (c *CubicBezierCurve[T]) Point(t T) *Vector3[T]
- func (c *CubicBezierCurve[T]) PointAt(u T) *Vector3[T]
- func (c *CubicBezierCurve[T]) Points(divisions int) []Vector3[T]
- func (c *CubicBezierCurve[T]) SpacedPoints(divisions int) []Vector3[T]
- func (c *CubicBezierCurve) Tangent(t T) *Vector3[T]
- func (c *CubicBezierCurve) TangentAt(u T) *Vector3[T]
- func (c *CubicBezierCurve[T]) UpdateArcLengths()
- type Curve
- type CurvePath
- func (c *CurvePath[T]) Add(curve Curve[T])
- func (c *CurvePath[T]) ClosePath() *CurvePath[T]
- func (c *CurvePath[T]) Copy(source *CurvePath[T]) *CurvePath[T]
- func (c *CurvePath[T]) Length() T
- func (c *CurvePath[T]) Lengths() []T
- func (c *CurvePath[T]) Point(t T) *Vector3[T]
- func (c *CurvePath[T]) Points(divisions int) []Vector3[T]
- func (c *CurvePath[T]) SpacedPoints(divisions int) []*Vector3[T]
- func (c *CurvePath[T]) UpdateArcLengths()
- type CurveType
- type Cylindrical
- func (c *Cylindrical[T]) Clone() *Cylindrical[T]
- func (c *Cylindrical[T]) Copy(other *Cylindrical[T]) *Cylindrical[T]
- func (c *Cylindrical[T]) Set(radius, theta, y T) *Cylindrical[T]
- func (c *Cylindrical[T]) SetFromCartesianCoords(x, y, z T) *Cylindrical[T]
- func (c *Cylindrical[T]) SetFromVector3(v *Vector3[T]) *Cylindrical[T]
- type EllipseCurve
- func (c *EllipseCurve) Clone() *baseCurve[T]
- func (c *EllipseCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3[T]
- func (c *EllipseCurve[T]) Copy(source *EllipseCurve[T]) *EllipseCurve[T]
- func (c *EllipseCurve[T]) Length() T
- func (c *EllipseCurve[T]) Lengths(divisions int) []T
- func (c *EllipseCurve[T]) LengthsDefault() []T
- func (c *EllipseCurve[T]) Point(t T) *Vector3[T]
- func (c *EllipseCurve[T]) PointAt(u T) *Vector3[T]
- func (c *EllipseCurve[T]) Points(divisions int) []Vector3[T]
- func (c *EllipseCurve[T]) SpacedPoints(divisions int) []Vector3[T]
- func (c *EllipseCurve) Tangent(t T) *Vector3[T]
- func (c *EllipseCurve) TangentAt(u T) *Vector3[T]
- func (c *EllipseCurve[T]) UpdateArcLengths()
- type Euler
- func (e *Euler[T]) Clone() *Euler[T]
- func (e *Euler[T]) Copy(euler *Euler[T]) *Euler[T]
- func (e *Euler[T]) Equals(euler *Euler[T]) bool
- func (e *Euler[T]) FromArray(array []T) *Euler[T]
- func (e *Euler[T]) Reorder(newOrder EulerOrder) *Euler[T]
- func (e *Euler[T]) Set(x, y, z T, order EulerOrder) *Euler[T]
- func (e *Euler[T]) SetFromQuaternion(q Quaternion[T], order EulerOrder, update bool) *Euler[T]
- func (e *Euler[T]) SetFromRotationMatrix(m Matrix4[T], order EulerOrder, update bool) *Euler[T]
- func (e *Euler[T]) SetFromVector3(v Vector3[T], order EulerOrder) *Euler[T]
- func (e *Euler[T]) ToArray(array []T, offset int) []T
- type EulerOrder
- type FilterFunc
- type Line3
- func (l *Line3[T]) ApplyMatrix4(matrix Matrix4[T]) *Line3[T]
- func (l *Line3[T]) At(t T) *Vector3[T]
- func (l *Line3[T]) Center() *Vector3[T]
- func (l *Line3[T]) Clone() *Line3[T]
- func (l *Line3[T]) ClosestPointToPoint(point Vector3[T], clampToLine bool) *Vector3[T]
- func (l *Line3[T]) ClosestPointToPointParameter(point Vector3[T], clampToLine bool) T
- func (l *Line3[T]) Copy(line Line3[T]) *Line3[T]
- func (l *Line3[T]) Delta() *Vector3[T]
- func (l *Line3[T]) Distance() T
- func (l *Line3[T]) DistanceSq() T
- func (l *Line3[T]) Equals(line Line3[T]) bool
- func (l *Line3[T]) Set(start, end Vector3[T]) *Line3[T]
- type LineCurve
- func (c *LineCurve) Clone() *baseCurve[T]
- func (c *LineCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3[T]
- func (c *LineCurve) Copy(source baseCurve[T]) *baseCurve[T]
- func (c *LineCurve[T]) Length() T
- func (c *LineCurve[T]) Lengths(divisions int) []T
- func (c *LineCurve[T]) LengthsDefault() []T
- func (c *LineCurve[T]) Point(t T) *Vector3[T]
- func (c *LineCurve[T]) PointAt(u T) *Vector3[T]
- func (c *LineCurve[T]) Points(divisions int) []Vector3[T]
- func (c *LineCurve[T]) SpacedPoints(divisions int) []Vector3[T]
- func (c *LineCurve) Tangent(t T) *Vector3[T]
- func (c *LineCurve) TangentAt(u T) *Vector3[T]
- func (c *LineCurve[T]) UpdateArcLengths()
- type Matrix3
- func (m *Matrix3[T]) Clone() *Matrix3[T]
- func (m *Matrix3[T]) Copy(matrix Matrix3[T]) *Matrix3[T]
- func (m *Matrix3[T]) Demrminant() T
- func (m *Matrix3[T]) Equals(matrix Matrix3[T]) bool
- func (m *Matrix3[T]) FromArray(array []T, offset int) *Matrix3[T]
- func (m *Matrix3[T]) Identity() *Matrix3[T]
- func (m *Matrix3[T]) Invert() *Matrix3[T]
- func (m *Matrix3[T]) MakeRotation(theta T) *Matrix3[T]
- func (m *Matrix3[T]) MakeScale(x, y T) *Matrix3[T]
- func (m *Matrix3[T]) MakeTranslation(x, y T) *Matrix3[T]
- func (m *Matrix3[T]) Multiply(matrix Matrix3[T]) *Matrix3[T]
- func (m *Matrix3[T]) MultiplyScalar(s T) *Matrix3[T]
- func (m *Matrix3[T]) NormalMatrix(matrix4 Matrix4[T]) *Matrix3[T]
- func (m *Matrix3[T]) Premultiply(matrix Matrix3[T]) *Matrix3[T]
- func (m *Matrix3[T]) Rotam(theta T) *Matrix3[T]
- func (m *Matrix3[T]) Scale(sx, sy T) *Matrix3[T]
- func (m *Matrix3[T]) Set(n11, n12, n13, n21, n22, n23, n31, n32, n33 T) *Matrix3[T]
- func (m *Matrix3[T]) SetFromMatrix4(me Matrix4[T]) *Matrix3[T]
- func (m *Matrix3[T]) SetUvTransform(tx, ty, sx, sy, rotation, cx, cy T) *Matrix3[T]
- func (m *Matrix3[T]) ToArray(array []T, offset int) []T
- func (m *Matrix3[T]) Translam(tx, ty T) *Matrix3[T]
- func (m *Matrix3[T]) Transpose() *Matrix3[T]
- func (m *Matrix3[T]) TransposeIntoArray(r []T) *Matrix3[T]
- type Matrix4
- func (m *Matrix4[T]) Clone() *Matrix4[T]
- func (m *Matrix4[T]) Compose(position Vector3[T], rotation Quaternion[T], scale Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) Copy(matrix Matrix4[T]) *Matrix4[T]
- func (m *Matrix4[T]) CopyPosition(matrix Matrix4[T]) *Matrix4[T]
- func (m *Matrix4[T]) Decompose() (position Vector3[T], rotation Quaternion[T], scale Vector3[T])
- func (m *Matrix4[T]) Demrminant() T
- func (m *Matrix4[T]) Equals(matrix Matrix4[T]) bool
- func (m *Matrix4[T]) ExtractBasis() (xAxis, yAxis, zAxis Vector3[T])
- func (m *Matrix4[T]) ExtractRotation(matrix Matrix4[T]) *Matrix4[T]
- func (m *Matrix4[T]) FromArray(array []T, offset int) *Matrix4[T]
- func (m *Matrix4[T]) Identity() *Matrix4[T]
- func (m *Matrix4[T]) Invert() *Matrix4[T]
- func (m *Matrix4[T]) LookAt(eye, target, up Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) MakeBasis(xAxis, yAxis, zAxis Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) MakeOrthographic(left, right, top, bottom, near, far T) *Matrix4[T]
- func (m *Matrix4[T]) MakePerspective(left, right, top, bottom, near, far T) *Matrix4[T]
- func (m *Matrix4[T]) MakeRotationAxis(axis Vector3[T], angle T) *Matrix4[T]
- func (m *Matrix4[T]) MakeRotationFromEuler(euler Euler[T]) *Matrix4[T]
- func (m *Matrix4[T]) MakeRotationX(theta T) *Matrix4[T]
- func (m *Matrix4[T]) MakeRotationY(theta T) *Matrix4[T]
- func (m *Matrix4[T]) MakeRotationZ(theta T) *Matrix4[T]
- func (m *Matrix4[T]) MakeScale(v Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) MakeShear(xy, xz, yx, yz, zx, zy T) *Matrix4[T]
- func (m *Matrix4[T]) MakeTranslation(v Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) MaxScaleOnAxis() T
- func (m *Matrix4[T]) Multiply(m2 Matrix4[T]) *Matrix4[T]
- func (m *Matrix4[T]) MultiplyScalar(s T) *Matrix4[T]
- func (m *Matrix4[T]) Premultiply(m2 Matrix4[T]) *Matrix4[T]
- func (m *Matrix4[T]) Scale(v Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) Set(...) *Matrix4[T]
- func (m *Matrix4[T]) SetFromMatrix3(matrix Matrix3[T]) *Matrix4[T]
- func (m *Matrix4[T]) SetPosition(v Vector3[T]) *Matrix4[T]
- func (m *Matrix4[T]) ToArray(array []T, offset int) []T
- func (m *Matrix4[T]) Transpose() *Matrix4[T]
- type Plane
- func (p *Plane[T]) ApplyMatrix4(matrix Matrix4[T], optionalNormalMatrix *Matrix3[T]) *Plane[T]
- func (p *Plane[T]) Clone() *Plane[T]
- func (p *Plane[T]) CoplanarPoint() *Vector3[T]
- func (p *Plane[T]) Copy(plane Plane[T]) *Plane[T]
- func (p *Plane[T]) DistanceToPoint(point Vector3[T]) T
- func (p *Plane[T]) DistanceToSphere(sphere Sphere[T]) T
- func (p *Plane[T]) Equals(plane Plane[T]) bool
- func (p *Plane[T]) IntersectLine(line Line3[T]) *Vector3[T]
- func (p *Plane[T]) IntersectsBox(box Box3[T]) bool
- func (p *Plane[T]) IntersectsLine(line Line3[T]) bool
- func (p *Plane[T]) IntersectsSphere(sphere Sphere[T]) bool
- func (p *Plane[T]) Negate() *Plane[T]
- func (p *Plane[T]) Normalize() *Plane[T]
- func (p *Plane[T]) ProjectPoint(point Vector3[T]) *Vector3[T]
- func (p *Plane[T]) Set(normal Vector3[T], constant T) *Plane[T]
- func (p *Plane[T]) SetComponents(x, y, z, w T) *Plane[T]
- func (p *Plane[T]) SetFromCoplanarPoints(a, b, c Vector3[T]) *Plane[T]
- func (p *Plane[T]) SetFromNormalAndCoplanarPoint(normal, point Vector3[T]) *Plane[T]
- func (p *Plane[T]) Translate(offset Vector3[T]) *Plane[T]
- type Quadtree
- func (q *Quadtree[T]) Add(p Vector2er[T]) error
- func (q *Quadtree[T]) Bound() Box2[T]
- func (q *Quadtree[T]) Find(p Vector2[T]) Vector2er[T]
- func (q *Quadtree[T]) InBound(buf []Vector2er[T], b Box2[T]) []Vector2er[T]
- func (q *Quadtree[T]) InBoundMatching(buf []Vector2er[T], b Box2[T], f FilterFunc[T]) []Vector2er[T]
- func (q *Quadtree[T]) KNearest(buf []Vector2er[T], p Vector2[T], k int, maxDistance ...T) []Vector2er[T]
- func (q *Quadtree[T]) KNearestMatching(buf []Vector2er[T], p Vector2[T], k int, f FilterFunc[T], maxDistance ...T) []Vector2er[T]
- func (q *Quadtree[T]) Matching(p Vector2[T], f FilterFunc[T]) Vector2er[T]
- func (q *Quadtree[T]) Remove(p Vector2er[T], eq FilterFunc[T]) bool
- type Quaternion
- func (q *Quaternion[T]) AngleTo(qb Quaternion[T]) T
- func (q *Quaternion[T]) Clone() *Quaternion[T]
- func (q *Quaternion[T]) Conjugate() *Quaternion[T]
- func (q *Quaternion[T]) Copy(quaternion Quaternion[T]) *Quaternion[T]
- func (q *Quaternion[T]) Dot(v Quaternion[T]) T
- func (q *Quaternion[T]) Equals(quaternion Quaternion[T]) bool
- func (q *Quaternion[T]) FromArray(array []T, offset int) *Quaternion[T]
- func (q *Quaternion[T]) Identity() *Quaternion[T]
- func (q *Quaternion[T]) Invert() *Quaternion[T]
- func (q *Quaternion[T]) Length() T
- func (q *Quaternion[T]) LengthSq() T
- func (q *Quaternion[T]) Multiply(qb Quaternion[T]) *Quaternion[T]
- func (q *Quaternion[T]) MultiplyQuaternionsFlat(dst []T, dstOffset int, src0 []T, srcOffset0 int, src1 []T, srcOffset1 int) []T
- func (q *Quaternion[T]) Normalize() *Quaternion[T]
- func (q *Quaternion[T]) Premultiply(qb Quaternion[T]) *Quaternion[T]
- func (q *Quaternion[T]) RotateTowards(qb Quaternion[T], step T) *Quaternion[T]
- func (q *Quaternion[T]) Set(x, y, z, w T) *Quaternion[T]
- func (q *Quaternion[T]) SetFromAxisAngle(axis Vector3[T], angle T) *Quaternion[T]
- func (q *Quaternion[T]) SetFromEuler(euler Euler[T]) *Quaternion[T]
- func (q *Quaternion[T]) SetFromRotationMatrix(m Matrix4[T]) *Quaternion[T]
- func (q *Quaternion[T]) SetFromUnitVectors(vFrom, vTo Vector3[T]) *Quaternion[T]
- func (q *Quaternion[T]) Slerp(qb Quaternion[T], t T) *Quaternion[T]
- func (q *Quaternion[T]) SlerpFlat(dst []T, dstOffset int, src0 []T, srcOffset0 int, src1 []T, srcOffset1 int, ...)
- func (q *Quaternion[T]) ToArray(array []T, offset int) []T
- type Ray
- func (r *Ray[T]) ApplyMatrix4(matrix4 Matrix4[T]) *Ray[T]
- func (r *Ray[T]) At(t T) *Vector3[T]
- func (r *Ray[T]) Clone() *Ray[T]
- func (r *Ray[T]) ClosestPointToPoint(point Vector3[T]) *Vector3[T]
- func (r *Ray[T]) Copy(ray *Ray[T]) *Ray[T]
- func (r *Ray[T]) DistanceSqToPoint(point Vector3[T]) T
- func (r *Ray[T]) DistanceSqToSegment(v0, v1 Vector3[T], optionalPointOnRay, optionalPointOnSegment *Vector3[T]) T
- func (r *Ray[T]) DistanceToPlane(plane *Plane[T]) T
- func (r *Ray[T]) DistanceToPoint(point Vector3[T]) T
- func (r *Ray[T]) Equals(ray Ray[T]) bool
- func (r *Ray[T]) IntersectBox(box *Box3[T]) *Vector3[T]
- func (r *Ray[T]) IntersectPlane(plane *Plane[T]) *Vector3[T]
- func (r *Ray[T]) IntersectSphere(sphere *Sphere[T], target *Vector3[T]) *Vector3[T]
- func (r *Ray[T]) IntersectTriangle(a, b, c Vector3[T], backfaceCulling bool) *Vector3[T]
- func (r *Ray[T]) IntersectsBox(box *Box3[T]) bool
- func (r *Ray[T]) IntersectsPlane(plane *Plane[T]) bool
- func (r *Ray[T]) IntersectsSphere(sphere *Sphere[T]) bool
- func (r *Ray[T]) LookAt(v *Vector3[T]) *Ray[T]
- func (r *Ray[T]) Recast(t T) *Ray[T]
- func (r *Ray[T]) Set(origin, dir Vector3[T]) *Ray[T]
- type Sphere
- func (s *Sphere[T]) ApplyMatrix4(matrix Matrix4[T]) *Sphere[T]
- func (s *Sphere[T]) BoundingBox() *Box3[T]
- func (s *Sphere[T]) ClampPoint(point Vector3[T]) *Vector3[T]
- func (s *Sphere[T]) Clone() *Sphere[T]
- func (s *Sphere[T]) ContainsPoint(point Vector3[T]) bool
- func (s *Sphere[T]) Copy(sphere Sphere[T]) *Sphere[T]
- func (s *Sphere[T]) DistanceToPoint(point Vector3[T]) T
- func (s *Sphere[T]) Equals(sphere Sphere[T]) bool
- func (s *Sphere[T]) ExpandByPoint(point Vector3[T]) *Sphere[T]
- func (s *Sphere[T]) IntersectsBox(box Box3[T]) bool
- func (s *Sphere[T]) IntersectsPlane(plane Plane[T]) bool
- func (s *Sphere[T]) IntersectsSphere(sphere Sphere[T]) bool
- func (s *Sphere[T]) IsEmpty() bool
- func (s *Sphere[T]) MakeEmpty() *Sphere[T]
- func (s *Sphere[T]) Set(center Vector3[T], radius T) *Sphere[T]
- func (s *Sphere[T]) SetFromPoints(points []Vector3[T], optionalCenter *Vector3[T]) *Sphere[T]
- func (s *Sphere[T]) Translate(offset Vector3[T]) *Sphere[T]
- func (s *Sphere[T]) Union(sphere Sphere[T]) *Sphere[T]
- type Spherical
- func (s *Spherical[T]) Clone() *Spherical[T]
- func (s *Spherical[T]) Copy(other *Spherical[T]) *Spherical[T]
- func (s *Spherical[T]) MakeSafe() *Spherical[T]
- func (s *Spherical[T]) Set(radius, phi, theta T) *Spherical[T]
- func (s *Spherical[T]) SetFromCartesianCoords(x, y, z T) *Spherical[T]
- func (s *Spherical[T]) SetFromVector3(v *Vector3[T]) *Spherical[T]
- type SphericalHarmonics3
- func (sh *SphericalHarmonics3[T]) Add(sh2 SphericalHarmonics3[T]) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) AddScaledSH(sh2 SphericalHarmonics3[T], s T) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) BasisAt(normal Vector3[T], shBasis []T) []T
- func (sh *SphericalHarmonics3[T]) Clone() *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) Copy(sh2 SphericalHarmonics3[T]) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) Equals(sh2 SphericalHarmonics3[T]) bool
- func (sh *SphericalHarmonics3[T]) FromArray(array []T, offset int) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) GetAt(normal *Vector3[T]) *Vector3[T]
- func (sh *SphericalHarmonics3[T]) GetIrradianceAt(normal Vector3[T]) *Vector3[T]
- func (sh *SphericalHarmonics3[T]) Lerp(sh2 SphericalHarmonics3[T], alpha T) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) Scale(s T) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) Set(coefficients ...Vector3[T]) *SphericalHarmonics3[T]
- func (sh *SphericalHarmonics3[T]) ToArray(array []T, offset int) []T
- func (sh *SphericalHarmonics3[T]) Zero() *SphericalHarmonics3[T]
- type SplineCurve
- func (c *SplineCurve) Clone() *baseCurve[T]
- func (c *SplineCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3[T]
- func (c *SplineCurve) Copy(source baseCurve[T]) *baseCurve[T]
- func (c *SplineCurve[T]) Length() T
- func (c *SplineCurve[T]) Lengths(divisions int) []T
- func (c *SplineCurve[T]) LengthsDefault() []T
- func (c *SplineCurve[T]) Point(t T) *Vector3[T]
- func (c *SplineCurve[T]) PointAt(u T) *Vector3[T]
- func (c *SplineCurve[T]) Points(divisions int) []Vector3[T]
- func (c *SplineCurve[T]) SpacedPoints(divisions int) []Vector3[T]
- func (c *SplineCurve) Tangent(t T) *Vector3[T]
- func (c *SplineCurve) TangentAt(u T) *Vector3[T]
- func (c *SplineCurve[T]) UpdateArcLengths()
- type Triangle
- func (t *Triangle[T]) Area() T
- func (t *Triangle[T]) Barycoord(point Vector3[T]) *Vector3[T]
- func (t *Triangle[T]) Clone() Triangle[T]
- func (t *Triangle[T]) ClosestPointToPoint(p Vector3[T]) *Vector3[T]
- func (t *Triangle[T]) ContainsPoint(point Vector3[T]) bool
- func (t *Triangle[T]) Copy(triangle Triangle[T]) *Triangle[T]
- func (t *Triangle[T]) Equals(triangle Triangle[T]) bool
- func (t *Triangle[T]) Interpolation(point, p1, p2, p3, v1, v2, v3 Vector3[T]) *Vector3[T]
- func (t *Triangle[T]) IsFrontFacing(direction Vector3[T]) bool
- func (t *Triangle[T]) Midpoint() *Vector3[T]
- func (t *Triangle[T]) Normal() *Vector3[T]
- func (t *Triangle[T]) Plane() *Plane[T]
- func (t *Triangle[T]) Set(a, b, c Vector3[T]) *Triangle[T]
- func (t *Triangle[T]) SetFromPointsAndIndices(points []Vector3[T], i0, i1, i2 int) *Triangle[T]
- type Vector2
- func AddScaledVector2[T constraints.Float](vector Vector2[T], scalar T) *Vector2[T]
- func AddVector2s[T constraints.Float](a, b Vector2[T]) *Vector2[T]
- func LerpVectors[T constraints.Float](v1, v2 Vector2[T], alpha T) *Vector2[T]
- func NewOneVector2[T constraints.Float]() *Vector2[T]
- func NewVector2[T constraints.Float](x, y T) *Vector2[T]
- func NewZeroVector2[T constraints.Float]() *Vector2[T]
- func SubVector2s[T constraints.Float](a, b Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) Add(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) AddScalar(scalar T) *Vector2[T]
- func (v *Vector2[T]) Angle() T
- func (v *Vector2[T]) AngleTo(vector Vector2[T]) T
- func (v *Vector2[T]) ApplyMatrix3(m Matrix3[T]) *Vector2[T]
- func (v *Vector2[T]) Ceil() *Vector2[T]
- func (v *Vector2[T]) Clamp(minVal, maxVal Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) ClampLength(minVal, maxVal T) *Vector2[T]
- func (v *Vector2[T]) ClampScalar(minVal, maxVal T) *Vector2[T]
- func (v *Vector2[T]) Clone() *Vector2[T]
- func (v *Vector2[T]) Component(index int) T
- func (v *Vector2[T]) Copy(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) Cross(vector Vector2[T]) T
- func (v *Vector2[T]) DistanceTo(vector Vector2[T]) T
- func (v *Vector2[T]) DistanceToSquared(vector Vector2[T]) T
- func (v *Vector2[T]) Divide(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) DivideScalar(scalar T) *Vector2[T]
- func (v *Vector2[T]) Dot(vector Vector2[T]) T
- func (v *Vector2[T]) Equals(vector Vector2[T]) bool
- func (v *Vector2[T]) Floor() *Vector2[T]
- func (v *Vector2[T]) FromArray(array []T, offset int) *Vector2[T]
- func (v *Vector2[T]) Height() T
- func (v *Vector2[T]) Length() T
- func (v *Vector2[T]) LengthSq() T
- func (v *Vector2[T]) Lerp(vector Vector2[T], alpha T) *Vector2[T]
- func (v *Vector2[T]) ManhattanDistanceTo(vector Vector2[T]) T
- func (v *Vector2[T]) ManhattanLength() T
- func (v *Vector2[T]) Max(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) Min(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) Multiply(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) MultiplyScalar(scalar T) *Vector2[T]
- func (v *Vector2[T]) Negate() *Vector2[T]
- func (v *Vector2[T]) Normalize() *Vector2[T]
- func (v *Vector2[T]) Random() *Vector2[T]
- func (v *Vector2[T]) RotateAround(center Vector2[T], angle T) *Vector2[T]
- func (v *Vector2[T]) Round() *Vector2[T]
- func (v *Vector2[T]) RoundToZero() *Vector2[T]
- func (v *Vector2[T]) Set(x, y T) *Vector2[T]
- func (v *Vector2[T]) SetComponent(index int, value T) *Vector2[T]
- func (v *Vector2[T]) SetHeight(value T) *Vector2[T]
- func (v *Vector2[T]) SetLength(length T) *Vector2[T]
- func (v *Vector2[T]) SetScalar(scalar T) *Vector2[T]
- func (v *Vector2[T]) SetWidth(value T) *Vector2[T]
- func (v *Vector2[T]) SetX(x T) *Vector2[T]
- func (v *Vector2[T]) SetY(y T) *Vector2[T]
- func (v *Vector2[T]) Sub(vector Vector2[T]) *Vector2[T]
- func (v *Vector2[T]) SubScalar(scalar T) *Vector2[T]
- func (v *Vector2[T]) ToArray(array []T, offset int) []T
- func (v *Vector2[T]) Width() T
- type Vector2er
- type Vector3
- func AddVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
- func CrossVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
- func LerpVector3s[T constraints.Float](v1, v2 Vector3[T], alpha T) *Vector3[T]
- func MultiplyVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
- func NewOneVector3[T constraints.Float]() *Vector3[T]
- func NewVector3[T constraints.Float](x, y, z T) *Vector3[T]
- func NewZeroVector3[T constraints.Float]() *Vector3[T]
- func SubVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Add(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) AddScalar(scalar T) *Vector3[T]
- func (v *Vector3[T]) AddScaledVector(vector Vector3[T], scalar T) *Vector3[T]
- func (v *Vector3[T]) AngleTo(v2 Vector3[T]) T
- func (v *Vector3[T]) ApplyAxisAngle(axis Vector3[T], angle T) *Vector3[T]
- func (v *Vector3[T]) ApplyEuler(e Euler[T]) *Vector3[T]
- func (v *Vector3[T]) ApplyMatrix3(m Matrix3[T]) *Vector3[T]
- func (v *Vector3[T]) ApplyMatrix4(m Matrix4[T]) *Vector3[T]
- func (v *Vector3[T]) ApplyNormalMatrix(m Matrix3[T]) *Vector3[T]
- func (v *Vector3[T]) ApplyQuaternion(q Quaternion[T]) *Vector3[T]
- func (v *Vector3[T]) Ceil() *Vector3[T]
- func (v *Vector3[T]) Clamp(minVal, maxVal Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) ClampLength(minVal, maxVal T) *Vector3[T]
- func (v *Vector3[T]) ClampScalar(minVal, maxVal T) *Vector3[T]
- func (v *Vector3[T]) Clone() *Vector3[T]
- func (v *Vector3[T]) Component(index int) T
- func (v *Vector3[T]) Copy(vector Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Cross(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) DistanceTo(v2 Vector3[T]) T
- func (v *Vector3[T]) DistanceToSquared(v2 Vector3[T]) T
- func (v *Vector3[T]) Divide(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) DivideScalar(scalar T) *Vector3[T]
- func (v *Vector3[T]) Dot(v2 Vector3[T]) T
- func (v *Vector3[T]) Equals(v2 Vector3[T]) bool
- func (v *Vector3[T]) Floor() *Vector3[T]
- func (v *Vector3[T]) FromArray(array []T, offset int) *Vector3[T]
- func (v *Vector3[T]) Length() T
- func (v *Vector3[T]) LengthSq() T
- func (v *Vector3[T]) Lerp(v2 Vector3[T], alpha T) *Vector3[T]
- func (v *Vector3[T]) ManhattanDistanceTo(v2 Vector3[T]) T
- func (v *Vector3[T]) Max(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Min(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Multiply(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) MultiplyScalar(scalar T) *Vector3[T]
- func (v *Vector3[T]) Negate() *Vector3[T]
- func (v *Vector3[T]) Normalize() *Vector3[T]
- func (v *Vector3[T]) ProjectOnPlane(planeNormal Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) ProjectOnVector(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Random() *Vector3[T]
- func (v *Vector3[T]) RandomDirection() *Vector3[T]
- func (v *Vector3[T]) Reflect(normal Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) Round() *Vector3[T]
- func (v *Vector3[T]) RoundToZero() *Vector3[T]
- func (v *Vector3[T]) Set(x, y, z T) *Vector3[T]
- func (v *Vector3[T]) SetComponent(index int, value T) *Vector3[T]
- func (v *Vector3[T]) SetFromCylindrical(c Cylindrical[T]) *Vector3[T]
- func (v *Vector3[T]) SetFromCylindricalCoords(radius, theta, y T) *Vector3[T]
- func (v *Vector3[T]) SetFromMatrixColumn(m Matrix4[T], index int) *Vector3[T]
- func (v *Vector3[T]) SetFromMatrixPosition(m Matrix4[T]) *Vector3[T]
- func (v *Vector3[T]) SetFromMatrixScale(m Matrix4[T]) *Vector3[T]
- func (v *Vector3[T]) SetFromSpherical(s Spherical[T]) *Vector3[T]
- func (v *Vector3[T]) SetFromSphericalCoords(radius, phi, theta T) *Vector3[T]
- func (v *Vector3[T]) SetLength(length T) *Vector3[T]
- func (v *Vector3[T]) SetScalar(scalar T) *Vector3[T]
- func (v *Vector3[T]) Sub(v2 Vector3[T]) *Vector3[T]
- func (v *Vector3[T]) SubScalar(scalar T) *Vector3[T]
- func (v *Vector3[T]) ToArray(array []T, offset int) []T
- func (v *Vector3[T]) TransformDirection(m Matrix4[T]) *Vector3[T]
Constants ¶
const ( DEG2RAD = math.Pi / 180 RAD2DEG = 180 / math.Pi EPSILON = 7.0/3 - 4.0/3 - 1.0 )
Variables ¶
var ( V3Zero32 = *NewZeroVector3[float32]() V3One32 = *NewOneVector3[float32]() V3Zero64 = *NewZeroVector3[float64]() V3One64 = *NewOneVector3[float64]() )
var ( // ErrPointOutsideOfBounds is returned when trying to add a point // to a quadtree and the point is outside the bounds used to create the tree. ErrPointOutsideOfBounds = fmt.Errorf("quadtree: point outside of bounds") )
Package quadtree implements a quadtree using rectangular partitions. Each point exists in a unique node in the tree or as leaf nodes. This implementation is based off of the d3 implementation: https://github.com/mbostock/d3/wiki/Quadtree-Geom
Functions ¶
func CatmullRom ¶
func CatmullRom[T constraints.Float](t, p0, p1, p2, p3 T) T
func CeilPowerOfTwo ¶
func CeilPowerOfTwo[T constraints.Integer](value T) T
func Clamp ¶
func Clamp[T constraints.Float](value, min, max T) T
func CubicBezier ¶
func CubicBezier[T constraints.Float](t, p0, p1, p2, p3 T) T
func CubicBezierP0 ¶
func CubicBezierP0[T constraints.Float](t, p T) T
func CubicBezierP1 ¶
func CubicBezierP1[T constraints.Float](t, p T) T
func CubicBezierP2 ¶
func CubicBezierP2[T constraints.Float](t, p T) T
func CubicBezierP3 ¶
func CubicBezierP3[T constraints.Float](t, p T) T
func Damp ¶
func Damp[T constraints.Float](x, y, lambda, dt T) T
http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/
func DegToRad ¶
func DegToRad[T constraints.Float](degrees T) T
func EuclideanModulo ¶
func EuclideanModulo[T constraints.Float](n, m T) T
compute euclidean modulo of m % n https://en.wikipedia.org/wiki/Modulo_operation
func FloorPowerOfTwo ¶
func FloorPowerOfTwo[T constraints.Integer](value T) T
func InverseLerp ¶
func InverseLerp[T constraints.Float](x, y, value T) T
func IsPowerOfTwo ¶
func IsPowerOfTwo[T constraints.Integer](value T) bool
func Lerp ¶
func Lerp[T constraints.Float](x, y, t T) T
func MapLinear ¶
func MapLinear[T constraints.Float](x, a1, a2, b1, b2 T) T
Linear mapping from range <a1, a2> to range <b1, b2>
func PingPong ¶
func PingPong[T constraints.Float](x, length T) T
func QuadraticBezier ¶
func QuadraticBezier[T constraints.Float](t, p0, p1, p2 T) T
func QuadraticBezierP0 ¶
func QuadraticBezierP0[T constraints.Float](t, p T) T
func QuadraticBezierP1 ¶
func QuadraticBezierP1[T constraints.Float](t, p T) T
func QuadraticBezierP2 ¶
func QuadraticBezierP2[T constraints.Float](t, p T) T
func RadToDeg ¶
func RadToDeg[T constraints.Float](radians T) T
func RandFloatSpread ¶
func RandFloatSpread[T constraints.Float](rng T) T
Random float from <-range/2, range/2> interval
func SetQuaternionFromProperEuler ¶
func SetQuaternionFromProperEuler[T constraints.Float](q *Quaternion[T], a, b, c T, order string)
func Smootherstep ¶
func Smootherstep[T constraints.Float](x, min, max T) T
func Smoothstep ¶
func Smoothstep[T constraints.Float](x, min, max T) T
Types ¶
type ArcCurve ¶
type ArcCurve[T constraints.Float] struct { EllipseCurve[T] }
func NewArcCurve ¶
func NewArcCurve[T constraints.Float](aX, aY, aRadius, aStartAngle, aEndAngle T, aClockwise bool) *ArcCurve[T]
func (*ArcCurve) ComputeFrenetFrames ¶ added in v0.0.6
type Box2 ¶
type Box2[T constraints.Float] struct { Min Vector2[T] Max Vector2[T] }
func NewBox2 ¶
func NewBox2[T constraints.Float]() *Box2[T]
func (*Box2[T]) ClampPoint ¶
func (*Box2[T]) ContainsBox ¶
func (*Box2[T]) ContainsPoint ¶
func (*Box2[T]) DistanceToPoint ¶
func (*Box2[T]) ExpandByPoint ¶
func (*Box2[T]) ExpandByScalar ¶
func (*Box2[T]) ExpandByVector ¶
func (*Box2[T]) GetParameter ¶
func (*Box2[T]) IntersectsBox ¶
func (*Box2[T]) SetFromCenterAndSize ¶
func (*Box2[T]) SetFromPoints ¶
type Box3 ¶
type Box3[T constraints.Float] struct { Min Vector3[T] Max Vector3[T] }
func (*Box3[T]) ApplyMatrix4 ¶
func (*Box3[T]) ClampPoint ¶
func (*Box3[T]) ContainsBox ¶
func (*Box3[T]) ContainsPoint ¶
func (*Box3[T]) DistanceToPoint ¶
func (*Box3[T]) ExpandByPoint ¶
func (*Box3[T]) ExpandByScalar ¶
func (*Box3[T]) ExpandByVector ¶
func (*Box3[T]) GetBoundingSphere ¶
func (*Box3[T]) GetParameter ¶
func (*Box3[T]) IntersectsBox ¶
func (*Box3[T]) IntersectsPlane ¶
func (*Box3[T]) IntersectsSphere ¶
func (*Box3[T]) IntersectsTriangle ¶
func (*Box3[T]) SetFromCenterAndSize ¶
func (*Box3[T]) SetFromPoints ¶
type CatmullRomCurve3 ¶
type CatmullRomCurve3[T constraints.Float] struct { Points []*Vector3[T] Closed bool CurveType CurveType Tension T // contains filtered or unexported fields }
func NewCatmullRomCurve3 ¶
func NewCatmullRomCurve3[T constraints.Float](points []*Vector3[T], closed bool, curveType CurveType, tension T) *CatmullRomCurve3[T]
func (*CatmullRomCurve3) ComputeFrenetFrames ¶ added in v0.0.6
func (*CatmullRomCurve3[T]) Copy ¶
func (c *CatmullRomCurve3[T]) Copy(source *CatmullRomCurve3[T]) *CatmullRomCurve3[T]
func (*CatmullRomCurve3[T]) GetPoint ¶
func (c *CatmullRomCurve3[T]) GetPoint(t T, optionalTarget *Vector3[T]) *Vector3[T]
func (*CatmullRomCurve3) Lengths ¶
func (c *CatmullRomCurve3) Lengths(divisions int) []T
Get list of cumulative segment lengths
func (*CatmullRomCurve3) LengthsDefault ¶
func (c *CatmullRomCurve3) LengthsDefault() []T
func (*CatmullRomCurve3) Point ¶
func (c *CatmullRomCurve3) Point(t T) *Vector3[T]
Virtual base class method to overwrite and implement in subclasses
- t [0 .. 1]
func (*CatmullRomCurve3) PointAt ¶
func (c *CatmullRomCurve3) PointAt(u T) *Vector3[T]
Get point at relative position in curve according to arc length - u [0 .. 1]
func (*CatmullRomCurve3) SpacedPoints ¶
Get sequence of points using getPointAt( u )
func (*CatmullRomCurve3) Tangent ¶ added in v0.0.6
func (c *CatmullRomCurve3) Tangent(t T) *Vector3[T]
Returns a unit vector tangent at t In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
func (*CatmullRomCurve3) TangentAt ¶ added in v0.0.6
func (c *CatmullRomCurve3) TangentAt(u T) *Vector3[T]
func (*CatmullRomCurve3) UpdateArcLengths ¶
func (c *CatmullRomCurve3) UpdateArcLengths()
type CoordinateSystem ¶
type CoordinateSystem int
const ( CoordinateSystemWebGL CoordinateSystem = iota CoordinateSystemWebGPU )
type CubicBezierCurve ¶
type CubicBezierCurve[T constraints.Float] struct { V0, V1, V2, V3 Vector3[T] // contains filtered or unexported fields }
func NewCubicBezierCurve3 ¶
func NewCubicBezierCurve3[T constraints.Float](v0, v1, v2, v3 Vector3[T]) *CubicBezierCurve[T]
func (*CubicBezierCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*CubicBezierCurve[T]) Length ¶
func (c *CubicBezierCurve[T]) Length() T
func (*CubicBezierCurve[T]) Lengths ¶
func (c *CubicBezierCurve[T]) Lengths(divisions int) []T
func (*CubicBezierCurve[T]) LengthsDefault ¶
func (c *CubicBezierCurve[T]) LengthsDefault() []T
func (*CubicBezierCurve[T]) Point ¶
func (c *CubicBezierCurve[T]) Point(t T) *Vector3[T]
func (*CubicBezierCurve[T]) PointAt ¶
func (c *CubicBezierCurve[T]) PointAt(u T) *Vector3[T]
func (*CubicBezierCurve[T]) Points ¶
func (c *CubicBezierCurve[T]) Points(divisions int) []Vector3[T]
func (*CubicBezierCurve[T]) SpacedPoints ¶
func (c *CubicBezierCurve[T]) SpacedPoints(divisions int) []Vector3[T]
func (*CubicBezierCurve) Tangent ¶ added in v0.0.6
func (c *CubicBezierCurve) Tangent(t T) *Vector3[T]
Returns a unit vector tangent at t In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
func (*CubicBezierCurve) TangentAt ¶ added in v0.0.6
func (c *CubicBezierCurve) TangentAt(u T) *Vector3[T]
func (*CubicBezierCurve[T]) UpdateArcLengths ¶
func (c *CubicBezierCurve[T]) UpdateArcLengths()
type CurvePath ¶
type CurvePath[T constraints.Float] struct { // contains filtered or unexported fields }
func NewCurvePath ¶
func NewCurvePath[T constraints.Float]() *CurvePath[T]
func (*CurvePath[T]) SpacedPoints ¶
func (*CurvePath[T]) UpdateArcLengths ¶
func (c *CurvePath[T]) UpdateArcLengths()
type Cylindrical ¶
type Cylindrical[T constraints.Float] struct { Radius T // distance from the origin to a point in the x-z plane Theta T // counterclockwise angle in the x-z plane measured in radians from the positive z-axis Y T // height above the x-z plane }
func NewCylindrical ¶
func NewCylindrical[T constraints.Float](radius, theta, y T) *Cylindrical[T]
func (*Cylindrical[T]) Clone ¶
func (c *Cylindrical[T]) Clone() *Cylindrical[T]
func (*Cylindrical[T]) Copy ¶
func (c *Cylindrical[T]) Copy(other *Cylindrical[T]) *Cylindrical[T]
func (*Cylindrical[T]) Set ¶
func (c *Cylindrical[T]) Set(radius, theta, y T) *Cylindrical[T]
func (*Cylindrical[T]) SetFromCartesianCoords ¶
func (c *Cylindrical[T]) SetFromCartesianCoords(x, y, z T) *Cylindrical[T]
func (*Cylindrical[T]) SetFromVector3 ¶
func (c *Cylindrical[T]) SetFromVector3(v *Vector3[T]) *Cylindrical[T]
type EllipseCurve ¶
type EllipseCurve[T constraints.Float] struct { // contains filtered or unexported fields }
func NewEllipseCurve ¶
func NewEllipseCurve[T constraints.Float](aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aRotation T, aClockwise bool) *EllipseCurve[T]
func (*EllipseCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*EllipseCurve[T]) Copy ¶
func (c *EllipseCurve[T]) Copy(source *EllipseCurve[T]) *EllipseCurve[T]
func (*EllipseCurve[T]) Length ¶
func (c *EllipseCurve[T]) Length() T
func (*EllipseCurve[T]) Lengths ¶
func (c *EllipseCurve[T]) Lengths(divisions int) []T
func (*EllipseCurve[T]) LengthsDefault ¶
func (c *EllipseCurve[T]) LengthsDefault() []T
func (*EllipseCurve[T]) Point ¶
func (c *EllipseCurve[T]) Point(t T) *Vector3[T]
func (*EllipseCurve[T]) PointAt ¶
func (c *EllipseCurve[T]) PointAt(u T) *Vector3[T]
func (*EllipseCurve[T]) Points ¶
func (c *EllipseCurve[T]) Points(divisions int) []Vector3[T]
func (*EllipseCurve[T]) SpacedPoints ¶
func (c *EllipseCurve[T]) SpacedPoints(divisions int) []Vector3[T]
func (*EllipseCurve) Tangent ¶ added in v0.0.6
func (c *EllipseCurve) Tangent(t T) *Vector3[T]
Returns a unit vector tangent at t In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
func (*EllipseCurve[T]) UpdateArcLengths ¶
func (c *EllipseCurve[T]) UpdateArcLengths()
type Euler ¶
type Euler[T constraints.Float] struct { X T Y T Z T Order EulerOrder }
func NewEuler ¶
func NewEuler[T constraints.Float](x, y, z T, order EulerOrder) *Euler[T]
func (*Euler[T]) Reorder ¶
func (e *Euler[T]) Reorder(newOrder EulerOrder) *Euler[T]
func (*Euler[T]) Set ¶
func (e *Euler[T]) Set(x, y, z T, order EulerOrder) *Euler[T]
func (*Euler[T]) SetFromQuaternion ¶
func (e *Euler[T]) SetFromQuaternion(q Quaternion[T], order EulerOrder, update bool) *Euler[T]
func (*Euler[T]) SetFromRotationMatrix ¶
func (e *Euler[T]) SetFromRotationMatrix(m Matrix4[T], order EulerOrder, update bool) *Euler[T]
func (*Euler[T]) SetFromVector3 ¶
func (e *Euler[T]) SetFromVector3(v Vector3[T], order EulerOrder) *Euler[T]
type EulerOrder ¶
type EulerOrder int
const ( EULER_ORDER_XYZ EulerOrder = iota EULER_ORDER_YXZ EULER_ORDER_ZXY EULER_ORDER_ZYX EULER_ORDER_YZX EULER_ORDER_XZY EULER_ORDER_DEFAULT = EULER_ORDER_XYZ )
type FilterFunc ¶ added in v0.4.5
type FilterFunc[T constraints.Float] func(p Vector2er[T]) bool
A FilterFunc is a function that filters the points to search for.
type Line3 ¶
type Line3[T constraints.Float] struct { Start, End Vector3[T] }
func (*Line3[T]) ApplyMatrix4 ¶
func (*Line3[T]) ClosestPointToPoint ¶
func (*Line3[T]) ClosestPointToPointParameter ¶
func (*Line3[T]) DistanceSq ¶
func (l *Line3[T]) DistanceSq() T
type LineCurve ¶
type LineCurve[T constraints.Float] struct { V1, V2 Vector3[T] // contains filtered or unexported fields }
func NewLineCurve3 ¶
func NewLineCurve3[T constraints.Float](v1, v2 Vector3[T]) *LineCurve[T]
func (*LineCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*LineCurve[T]) LengthsDefault ¶
func (c *LineCurve[T]) LengthsDefault() []T
func (*LineCurve[T]) SpacedPoints ¶
func (*LineCurve) Tangent ¶ added in v0.0.6
func (c *LineCurve) Tangent(t T) *Vector3[T]
Returns a unit vector tangent at t In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
func (*LineCurve[T]) UpdateArcLengths ¶
func (c *LineCurve[T]) UpdateArcLengths()
type Matrix3 ¶
type Matrix3[T constraints.Float] [9]T
func MultiplyMatrices ¶
func MultiplyMatrices[T constraints.Float](a, b Matrix3[T]) *Matrix3[T]
func NewMatrix3 ¶
func NewMatrix3[T constraints.Float](n11, n12, n13, n21, n22, n23, n31, n32, n33 T) *Matrix3[T]
func NewMatrix3Identity ¶
func NewMatrix3Identity[T constraints.Float]() *Matrix3[T]
func (*Matrix3[T]) Demrminant ¶
func (m *Matrix3[T]) Demrminant() T
func (*Matrix3[T]) MakeRotation ¶
func (*Matrix3[T]) MakeTranslation ¶
func (*Matrix3[T]) MultiplyScalar ¶
func (*Matrix3[T]) NormalMatrix ¶
func (*Matrix3[T]) Premultiply ¶
func (*Matrix3[T]) SetFromMatrix4 ¶
func (*Matrix3[T]) SetUvTransform ¶
func (*Matrix3[T]) TransposeIntoArray ¶
type Matrix4 ¶
type Matrix4[T constraints.Float] [16]T
func MakeRotationFromQuaternion ¶
func MakeRotationFromQuaternion[T constraints.Float](q Quaternion[T]) *Matrix4[T]
func MultiplyMatrice4s ¶
func MultiplyMatrice4s[T constraints.Float](a, b Matrix4[T]) *Matrix4[T]
func NewMatrix4 ¶
func NewMatrix4[T constraints.Float](n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 T) *Matrix4[T]
func NewMatrix4Identity ¶
func NewMatrix4Identity[T constraints.Float]() *Matrix4[T]
func (*Matrix4[T]) Compose ¶
func (m *Matrix4[T]) Compose(position Vector3[T], rotation Quaternion[T], scale Vector3[T]) *Matrix4[T]
func (*Matrix4[T]) CopyPosition ¶
func (*Matrix4[T]) Decompose ¶
func (m *Matrix4[T]) Decompose() (position Vector3[T], rotation Quaternion[T], scale Vector3[T])
func (*Matrix4[T]) Demrminant ¶
func (m *Matrix4[T]) Demrminant() T
func (*Matrix4[T]) ExtractBasis ¶
func (*Matrix4[T]) ExtractRotation ¶
func (*Matrix4[T]) MakeOrthographic ¶
func (*Matrix4[T]) MakePerspective ¶
func (*Matrix4[T]) MakeRotationAxis ¶
func (*Matrix4[T]) MakeRotationFromEuler ¶
func (*Matrix4[T]) MakeRotationX ¶
func (*Matrix4[T]) MakeRotationY ¶
func (*Matrix4[T]) MakeRotationZ ¶
func (*Matrix4[T]) MakeTranslation ¶
func (*Matrix4[T]) MaxScaleOnAxis ¶
func (m *Matrix4[T]) MaxScaleOnAxis() T
func (*Matrix4[T]) MultiplyScalar ¶
func (*Matrix4[T]) Premultiply ¶
func (*Matrix4[T]) SetFromMatrix3 ¶
func (*Matrix4[T]) SetPosition ¶
type Plane ¶
type Plane[T constraints.Float] struct { Normal Vector3[T] Constant T }
func (*Plane[T]) ApplyMatrix4 ¶
func (*Plane[T]) CoplanarPoint ¶
func (*Plane[T]) DistanceToPoint ¶
func (*Plane[T]) DistanceToSphere ¶
func (*Plane[T]) IntersectLine ¶
func (*Plane[T]) IntersectsBox ¶
func (*Plane[T]) IntersectsLine ¶
func (*Plane[T]) IntersectsSphere ¶
func (*Plane[T]) ProjectPoint ¶
func (*Plane[T]) SetComponents ¶
func (*Plane[T]) SetFromCoplanarPoints ¶
func (*Plane[T]) SetFromNormalAndCoplanarPoint ¶
type Quadtree ¶ added in v0.4.5
type Quadtree[T constraints.Float] struct { // contains filtered or unexported fields }
Quadtree implements a two-dimensional recursive spatial subdivision of Vector2er[T]s. This implementation uses rectangular partitions.
func New ¶ added in v0.4.5
func New[T constraints.Float](bound Box2[T]) *Quadtree[T]
New creates a new quadtree for the given bound. Added points must be within this bound.
func (*Quadtree[T]) Add ¶ added in v0.4.5
Add puts an object into the quad tree, must be within the quadtree bounds. This function is not thread-safe, ie. multiple goroutines cannot insert into a single quadtree.
func (*Quadtree[T]) Find ¶ added in v0.4.5
Find returns the closest Value/Pointer in the quadtree. This function is thread safe. Multiple goroutines can read from a pre-created tree.
func (*Quadtree[T]) InBound ¶ added in v0.4.5
InBound returns a slice with all the pointers in the quadtree that are within the given bound. An optional buffer parameter is provided to allow for the reuse of result slice memory. This function is thread safe. Multiple goroutines can read from a pre-created tree.
func (*Quadtree[T]) InBoundMatching ¶ added in v0.4.5
func (q *Quadtree[T]) InBoundMatching(buf []Vector2er[T], b Box2[T], f FilterFunc[T]) []Vector2er[T]
InBoundMatching returns a slice with all the pointers in the quadtree that are within the given bound and matching the give filter function. An optional buffer parameter is provided to allow for the reuse of result slice memory. This function is thread safe. Multiple goroutines can read from a pre-created tree.
func (*Quadtree[T]) KNearest ¶ added in v0.4.5
func (q *Quadtree[T]) KNearest(buf []Vector2er[T], p Vector2[T], k int, maxDistance ...T) []Vector2er[T]
KNearest returns k closest Value/Pointer in the quadtree. This function is thread safe. Multiple goroutines can read from a pre-created tree. An optional buffer parameter is provided to allow for the reuse of result slice memory. The points are returned in a sorted order, nearest first. This function allows defining a maximum distance in order to reduce search iterations.
func (*Quadtree[T]) KNearestMatching ¶ added in v0.4.5
func (q *Quadtree[T]) KNearestMatching(buf []Vector2er[T], p Vector2[T], k int, f FilterFunc[T], maxDistance ...T) []Vector2er[T]
KNearestMatching returns k closest Value/Pointer in the quadtree for which the given filter function returns true. This function is thread safe. Multiple goroutines can read from a pre-created tree. An optional buffer parameter is provided to allow for the reuse of result slice memory. The points are returned in a sorted order, nearest first. This function allows defining a maximum distance in order to reduce search iterations.
func (*Quadtree[T]) Matching ¶ added in v0.4.5
func (q *Quadtree[T]) Matching(p Vector2[T], f FilterFunc[T]) Vector2er[T]
Matching returns the closest Value/Pointer in the quadtree for which the given filter function returns true. This function is thread safe. Multiple goroutines can read from a pre-created tree.
func (*Quadtree[T]) Remove ¶ added in v0.4.5
func (q *Quadtree[T]) Remove(p Vector2er[T], eq FilterFunc[T]) bool
Remove will remove the pointer from the quadtree. By default it'll match using the points, but a FilterFunc can be provided for a more specific test if there are elements with the same point value in the tree. For example:
func(pointer Vector2er[T]) {
return pointer.(*MyType).ID == lookingFor.ID
}
type Quaternion ¶
type Quaternion[T constraints.Float] struct { X, Y, Z, W T }
func MultiplyQuaternions ¶
func MultiplyQuaternions[T constraints.Float](a, b Quaternion[T]) *Quaternion[T]
func NewIdentityQuaternion ¶
func NewIdentityQuaternion[T constraints.Float]() *Quaternion[T]
func NewQuaternion ¶
func NewQuaternion[T constraints.Float](x, y, z, w T) *Quaternion[T]
func (*Quaternion[T]) AngleTo ¶
func (q *Quaternion[T]) AngleTo(qb Quaternion[T]) T
func (*Quaternion[T]) Clone ¶
func (q *Quaternion[T]) Clone() *Quaternion[T]
func (*Quaternion[T]) Conjugate ¶
func (q *Quaternion[T]) Conjugate() *Quaternion[T]
func (*Quaternion[T]) Copy ¶
func (q *Quaternion[T]) Copy(quaternion Quaternion[T]) *Quaternion[T]
func (*Quaternion[T]) Dot ¶
func (q *Quaternion[T]) Dot(v Quaternion[T]) T
func (*Quaternion[T]) Equals ¶
func (q *Quaternion[T]) Equals(quaternion Quaternion[T]) bool
func (*Quaternion[T]) FromArray ¶
func (q *Quaternion[T]) FromArray(array []T, offset int) *Quaternion[T]
func (*Quaternion[T]) Identity ¶
func (q *Quaternion[T]) Identity() *Quaternion[T]
func (*Quaternion[T]) Invert ¶
func (q *Quaternion[T]) Invert() *Quaternion[T]
func (*Quaternion[T]) Length ¶
func (q *Quaternion[T]) Length() T
func (*Quaternion[T]) LengthSq ¶
func (q *Quaternion[T]) LengthSq() T
func (*Quaternion[T]) Multiply ¶
func (q *Quaternion[T]) Multiply(qb Quaternion[T]) *Quaternion[T]
func (*Quaternion[T]) MultiplyQuaternionsFlat ¶
func (q *Quaternion[T]) MultiplyQuaternionsFlat(dst []T, dstOffset int, src0 []T, srcOffset0 int, src1 []T, srcOffset1 int) []T
func (*Quaternion[T]) Normalize ¶
func (q *Quaternion[T]) Normalize() *Quaternion[T]
func (*Quaternion[T]) Premultiply ¶
func (q *Quaternion[T]) Premultiply(qb Quaternion[T]) *Quaternion[T]
func (*Quaternion[T]) RotateTowards ¶
func (q *Quaternion[T]) RotateTowards(qb Quaternion[T], step T) *Quaternion[T]
func (*Quaternion[T]) Set ¶
func (q *Quaternion[T]) Set(x, y, z, w T) *Quaternion[T]
func (*Quaternion[T]) SetFromAxisAngle ¶
func (q *Quaternion[T]) SetFromAxisAngle(axis Vector3[T], angle T) *Quaternion[T]
func (*Quaternion[T]) SetFromEuler ¶
func (q *Quaternion[T]) SetFromEuler(euler Euler[T]) *Quaternion[T]
func (*Quaternion[T]) SetFromRotationMatrix ¶
func (q *Quaternion[T]) SetFromRotationMatrix(m Matrix4[T]) *Quaternion[T]
func (*Quaternion[T]) SetFromUnitVectors ¶
func (q *Quaternion[T]) SetFromUnitVectors(vFrom, vTo Vector3[T]) *Quaternion[T]
func (*Quaternion[T]) Slerp ¶
func (q *Quaternion[T]) Slerp(qb Quaternion[T], t T) *Quaternion[T]
func (*Quaternion[T]) SlerpFlat ¶
func (q *Quaternion[T]) SlerpFlat(dst []T, dstOffset int, src0 []T, srcOffset0 int, src1 []T, srcOffset1 int, t T)
func (*Quaternion[T]) ToArray ¶
func (q *Quaternion[T]) ToArray(array []T, offset int) []T
type Ray ¶
type Ray[T constraints.Float] struct { Origin, Dir Vector3[T] }
func (*Ray[T]) ApplyMatrix4 ¶
func (*Ray[T]) ClosestPointToPoint ¶
func (*Ray[T]) DistanceSqToPoint ¶
func (*Ray[T]) DistanceSqToSegment ¶
func (*Ray[T]) DistanceToPlane ¶
func (*Ray[T]) DistanceToPoint ¶
func (*Ray[T]) IntersectBox ¶
func (*Ray[T]) IntersectPlane ¶
func (*Ray[T]) IntersectSphere ¶
func (*Ray[T]) IntersectTriangle ¶
func (*Ray[T]) IntersectsBox ¶
func (*Ray[T]) IntersectsPlane ¶
func (*Ray[T]) IntersectsSphere ¶
type Sphere ¶
type Sphere[T constraints.Float] struct { Center Vector3[T] Radius T }
func (*Sphere[T]) ApplyMatrix4 ¶
func (*Sphere[T]) BoundingBox ¶
func (*Sphere[T]) ClampPoint ¶
func (*Sphere[T]) ContainsPoint ¶
func (*Sphere[T]) DistanceToPoint ¶
func (*Sphere[T]) ExpandByPoint ¶
func (*Sphere[T]) IntersectsBox ¶
func (*Sphere[T]) IntersectsPlane ¶
func (*Sphere[T]) IntersectsSphere ¶
func (*Sphere[T]) SetFromPoints ¶
type Spherical ¶
type Spherical[T constraints.Float] struct { Radius, Phi, Theta T }
func NewSpherical ¶
func NewSpherical[T constraints.Float](radius, phi, theta T) *Spherical[T]
func (*Spherical[T]) SetFromCartesianCoords ¶
func (*Spherical[T]) SetFromVector3 ¶
type SphericalHarmonics3 ¶
type SphericalHarmonics3[T constraints.Float] [9]Vector3[T]
func NewSphericalHarmonics3 ¶
func NewSphericalHarmonics3[T constraints.Float]() *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) Add ¶
func (sh *SphericalHarmonics3[T]) Add(sh2 SphericalHarmonics3[T]) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) AddScaledSH ¶
func (sh *SphericalHarmonics3[T]) AddScaledSH(sh2 SphericalHarmonics3[T], s T) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) BasisAt ¶
func (sh *SphericalHarmonics3[T]) BasisAt(normal Vector3[T], shBasis []T) []T
GetBasisAt evaluates the basis functions
func (*SphericalHarmonics3[T]) Clone ¶
func (sh *SphericalHarmonics3[T]) Clone() *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) Copy ¶
func (sh *SphericalHarmonics3[T]) Copy(sh2 SphericalHarmonics3[T]) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) Equals ¶
func (sh *SphericalHarmonics3[T]) Equals(sh2 SphericalHarmonics3[T]) bool
func (*SphericalHarmonics3[T]) FromArray ¶
func (sh *SphericalHarmonics3[T]) FromArray(array []T, offset int) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) GetAt ¶
func (sh *SphericalHarmonics3[T]) GetAt(normal *Vector3[T]) *Vector3[T]
GetAt returns the radiance in the direction of the normal
func (*SphericalHarmonics3[T]) GetIrradianceAt ¶
func (sh *SphericalHarmonics3[T]) GetIrradianceAt(normal Vector3[T]) *Vector3[T]
GetIrradianceAt returns the irradiance (radiance convolved with cosine lobe) in the direction of the normal
func (*SphericalHarmonics3[T]) Lerp ¶
func (sh *SphericalHarmonics3[T]) Lerp(sh2 SphericalHarmonics3[T], alpha T) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) Scale ¶
func (sh *SphericalHarmonics3[T]) Scale(s T) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) Set ¶
func (sh *SphericalHarmonics3[T]) Set(coefficients ...Vector3[T]) *SphericalHarmonics3[T]
func (*SphericalHarmonics3[T]) ToArray ¶
func (sh *SphericalHarmonics3[T]) ToArray(array []T, offset int) []T
func (*SphericalHarmonics3[T]) Zero ¶
func (sh *SphericalHarmonics3[T]) Zero() *SphericalHarmonics3[T]
type SplineCurve ¶
type SplineCurve[T constraints.Float] struct { // contains filtered or unexported fields }
func NewSplineCurve ¶
func NewSplineCurve[T constraints.Float](points ...Vector3[T]) *SplineCurve[T]
func (*SplineCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*SplineCurve[T]) Length ¶
func (c *SplineCurve[T]) Length() T
func (*SplineCurve[T]) Lengths ¶
func (c *SplineCurve[T]) Lengths(divisions int) []T
func (*SplineCurve[T]) LengthsDefault ¶
func (c *SplineCurve[T]) LengthsDefault() []T
func (*SplineCurve[T]) Point ¶
func (c *SplineCurve[T]) Point(t T) *Vector3[T]
func (*SplineCurve[T]) PointAt ¶
func (c *SplineCurve[T]) PointAt(u T) *Vector3[T]
func (*SplineCurve[T]) Points ¶
func (c *SplineCurve[T]) Points(divisions int) []Vector3[T]
func (*SplineCurve[T]) SpacedPoints ¶
func (c *SplineCurve[T]) SpacedPoints(divisions int) []Vector3[T]
func (*SplineCurve) Tangent ¶ added in v0.0.6
func (c *SplineCurve) Tangent(t T) *Vector3[T]
Returns a unit vector tangent at t In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
func (*SplineCurve[T]) UpdateArcLengths ¶
func (c *SplineCurve[T]) UpdateArcLengths()
type Triangle ¶
type Triangle[T constraints.Float] struct { A, B, C Vector3[T] }
func NewTriangle ¶
func NewTriangle[T constraints.Float](a, b, c Vector3[T]) Triangle[T]
func (*Triangle[T]) ClosestPointToPoint ¶
func (*Triangle[T]) ContainsPoint ¶
func (*Triangle[T]) Interpolation ¶
func (*Triangle[T]) IsFrontFacing ¶
type Vector2 ¶
type Vector2[T constraints.Float] struct { X T Y T }
func AddScaledVector2 ¶
func AddScaledVector2[T constraints.Float](vector Vector2[T], scalar T) *Vector2[T]
func AddVector2s ¶
func AddVector2s[T constraints.Float](a, b Vector2[T]) *Vector2[T]
func LerpVectors ¶
func LerpVectors[T constraints.Float](v1, v2 Vector2[T], alpha T) *Vector2[T]
func NewOneVector2 ¶
func NewOneVector2[T constraints.Float]() *Vector2[T]
func NewVector2 ¶
func NewVector2[T constraints.Float](x, y T) *Vector2[T]
func NewZeroVector2 ¶
func NewZeroVector2[T constraints.Float]() *Vector2[T]
func SubVector2s ¶
func SubVector2s[T constraints.Float](a, b Vector2[T]) *Vector2[T]
func (*Vector2[T]) ApplyMatrix3 ¶
func (*Vector2[T]) ClampLength ¶
func (*Vector2[T]) ClampScalar ¶
func (*Vector2[T]) DistanceTo ¶
func (*Vector2[T]) DistanceToSquared ¶
func (*Vector2[T]) DivideScalar ¶
func (*Vector2[T]) ManhattanDistanceTo ¶
func (*Vector2[T]) ManhattanLength ¶
func (v *Vector2[T]) ManhattanLength() T
func (*Vector2[T]) MultiplyScalar ¶
func (*Vector2[T]) RotateAround ¶
func (*Vector2[T]) RoundToZero ¶
func (*Vector2[T]) SetComponent ¶
type Vector2er ¶ added in v0.4.5
type Vector2er[T constraints.Float] interface { Vector2() Vector2[T] }
type Vector3 ¶
type Vector3[T constraints.Float] struct { X, Y, Z T }
func AddVector3s ¶
func AddVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
func CrossVector3s ¶
func CrossVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
func LerpVector3s ¶
func LerpVector3s[T constraints.Float](v1, v2 Vector3[T], alpha T) *Vector3[T]
func MultiplyVector3s ¶
func MultiplyVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
func NewOneVector3 ¶
func NewOneVector3[T constraints.Float]() *Vector3[T]
func NewVector3 ¶
func NewVector3[T constraints.Float](x, y, z T) *Vector3[T]
func NewZeroVector3 ¶
func NewZeroVector3[T constraints.Float]() *Vector3[T]
func SubVector3s ¶
func SubVector3s[T constraints.Float](a, b Vector3[T]) *Vector3[T]
func (*Vector3[T]) AddScaledVector ¶
func (*Vector3[T]) ApplyAxisAngle ¶
func (*Vector3[T]) ApplyEuler ¶
func (*Vector3[T]) ApplyMatrix3 ¶
func (*Vector3[T]) ApplyMatrix4 ¶
func (*Vector3[T]) ApplyNormalMatrix ¶
func (*Vector3[T]) ApplyQuaternion ¶
func (v *Vector3[T]) ApplyQuaternion(q Quaternion[T]) *Vector3[T]
func (*Vector3[T]) ClampLength ¶
func (*Vector3[T]) ClampScalar ¶
func (*Vector3[T]) DistanceTo ¶
func (*Vector3[T]) DistanceToSquared ¶
func (*Vector3[T]) DivideScalar ¶
func (*Vector3[T]) ManhattanDistanceTo ¶
func (*Vector3[T]) MultiplyScalar ¶
func (*Vector3[T]) ProjectOnPlane ¶
func (*Vector3[T]) ProjectOnVector ¶
func (*Vector3[T]) RandomDirection ¶
func (*Vector3[T]) RoundToZero ¶
func (*Vector3[T]) SetComponent ¶
func (*Vector3[T]) SetFromCylindrical ¶
func (v *Vector3[T]) SetFromCylindrical(c Cylindrical[T]) *Vector3[T]
func (*Vector3[T]) SetFromCylindricalCoords ¶
func (*Vector3[T]) SetFromMatrixColumn ¶
func (*Vector3[T]) SetFromMatrixPosition ¶
func (*Vector3[T]) SetFromMatrixScale ¶
func (*Vector3[T]) SetFromSpherical ¶
func (*Vector3[T]) SetFromSphericalCoords ¶
func (*Vector3[T]) TransformDirection ¶
Source Files
¶
- box2.go
- box3.go
- curve.go
- curve_arc.go
- curve_bezier.go
- curve_catmullrom.go
- curve_ellipse.go
- curve_line.go
- curve_path.go
- curve_spline.go
- cylindrical.go
- euler.go
- interpolation.go
- line3.go
- matrix3.go
- matrix4.go
- plane.go
- quadtree.go
- quaternion.go
- ray.go
- sphere.go
- spherical.go
- spherical_harmonics3.go
- triangle.go
- utils.go
- vector2.go
- vector3.go