Documentation
¶
Index ¶
- Constants
- Variables
- func CatmullRom(t, p0, p1, p2, p3 float64) float64
- func CeilPowerOfTwo(value int) int
- func Clamp(value, min, max float64) float64
- func CubicBezier(t, p0, p1, p2, p3 float64) float64
- func CubicBezierP0(t, p float64) float64
- func CubicBezierP1(t, p float64) float64
- func CubicBezierP2(t, p float64) float64
- func CubicBezierP3(t, p float64) float64
- func Damp(x, y, lambda, dt float64) float64
- func DegToRad(degrees float64) float64
- func EuclideanModulo(n, m float64) float64
- func FloorPowerOfTwo(value int) int
- func InverseLerp(x, y, value float64) float64
- func IsPowerOfTwo(value int) bool
- func Lerp(x, y, t float64) float64
- func MapLinear(x, a1, a2, b1, b2 float64) float64
- func PingPong(x, length float64) float64
- func QuadraticBezier(t, p0, p1, p2 float64) float64
- func QuadraticBezierP0(t, p float64) float64
- func QuadraticBezierP1(t, p float64) float64
- func QuadraticBezierP2(t, p float64) float64
- func RadToDeg(radians float64) float64
- func RandFloatSpread(rng float64) float64
- func SetQuaternionFromProperEuler(q *Quaternion, a, b, c float64, order string)
- func Smootherstep(x, min, max float64) float64
- func Smoothstep(x, min, max float64) float64
- type ArcCurve
- type Box2
- func (b *Box2) ClampPoint(point Vector2, target *Vector2) *Vector2
- func (b *Box2) Clone() *Box2
- func (b *Box2) ContainsBox(box *Box2) bool
- func (b *Box2) ContainsPoint(point Vector2) bool
- func (b *Box2) Copy(box *Box2) *Box2
- func (b *Box2) DistanceToPoint(point Vector2) float64
- func (b *Box2) Equals(box *Box2) bool
- func (b *Box2) ExpandByPoint(point Vector2) *Box2
- func (b *Box2) ExpandByScalar(scalar float64) *Box2
- func (b *Box2) ExpandByVector(vector Vector2) *Box2
- func (b *Box2) GetCenter(target *Vector2) *Vector2
- func (b *Box2) GetParameter(point Vector2, target *Vector2) *Vector2
- func (b *Box2) GetSize(target *Vector2) *Vector2
- func (b *Box2) Intersect(box *Box2) *Box2
- func (b *Box2) IntersectsBox(box *Box2) bool
- func (b *Box2) IsEmpty() bool
- func (b *Box2) MakeEmpty() *Box2
- func (b *Box2) Set(min, max Vector2) *Box2
- func (b *Box2) SetFromCenterAndSize(center, size Vector2) *Box2
- func (b *Box2) SetFromPoints(points []Vector2) *Box2
- func (b *Box2) Translate(offset Vector2) *Box2
- func (b *Box2) Union(box *Box2) *Box2
- type Box3
- func (b *Box3) ApplyMatrix4(matrix Matrix4) *Box3
- func (b *Box3) Center() Vector3
- func (b *Box3) ClampPoint(point Vector3) (target *Vector3)
- func (b *Box3) Clone() *Box3
- func (b *Box3) ContainsBox(box Box3) bool
- func (b *Box3) ContainsPoint(point Vector3) bool
- func (b *Box3) Copy(box *Box3) *Box3
- func (b *Box3) DistanceToPoint(point Vector3) float64
- func (b *Box3) Equals(box Box3) bool
- func (b *Box3) ExpandByPoint(point Vector3) *Box3
- func (b *Box3) ExpandByScalar(scalar float64) *Box3
- func (b *Box3) ExpandByVector(vector Vector3) *Box3
- func (b *Box3) GetBoundingSphere() *Sphere
- func (b *Box3) GetParameter(point Vector3) (target Vector3)
- func (b *Box3) Intersect(box Box3) *Box3
- func (b *Box3) IntersectsBox(box Box3) bool
- func (b *Box3) IntersectsPlane(plane Plane) bool
- func (b *Box3) IntersectsSphere(sphere Sphere) bool
- func (b *Box3) IntersectsTriangle(triangle Triangle) bool
- func (b *Box3) IsEmpty() bool
- func (b *Box3) MakeEmpty() *Box3
- func (b *Box3) Set(min, max Vector3) *Box3
- func (b *Box3) SetFromCenterAndSize(center, size Vector3) *Box3
- func (b *Box3) SetFromPoints(points ...Vector3) *Box3
- func (b *Box3) Size() *Vector3
- func (b *Box3) Translate(offset Vector3) *Box3
- func (b *Box3) Union(box Box3) *Box3
- type CatmullRomCurve3
- func (c *CatmullRomCurve3) Clone() *baseCurve
- func (c *CatmullRomCurve3) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3
- func (c *CatmullRomCurve3) Copy(source *CatmullRomCurve3) *CatmullRomCurve3
- func (c *CatmullRomCurve3) GetPoint(t float64, optionalTarget *Vector3) *Vector3
- func (c *CatmullRomCurve3) Length() float64
- func (c *CatmullRomCurve3) Lengths(divisions int) []float64
- func (c *CatmullRomCurve3) LengthsDefault() []float64
- func (c *CatmullRomCurve3) Point(t float64) *Vector3
- func (c *CatmullRomCurve3) PointAt(u float64) *Vector3
- func (c *CatmullRomCurve3) Points(divisions int) []Vector3
- func (c *CatmullRomCurve3) SpacedPoints(divisions int) []Vector3
- func (c *CatmullRomCurve3) Tangent(t float64) *Vector3
- func (c *CatmullRomCurve3) TangentAt(u float64) *Vector3
- func (c *CatmullRomCurve3) UpdateArcLengths()
- type CoordinateSystem
- type CubicBezierCurve
- func (c *CubicBezierCurve) Clone() *baseCurve
- func (c *CubicBezierCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3
- func (c *CubicBezierCurve) Copy(source baseCurve) *baseCurve
- func (c *CubicBezierCurve) Length() float64
- func (c *CubicBezierCurve) Lengths(divisions int) []float64
- func (c *CubicBezierCurve) LengthsDefault() []float64
- func (c *CubicBezierCurve) Point(t float64) *Vector3
- func (c *CubicBezierCurve) PointAt(u float64) *Vector3
- func (c *CubicBezierCurve) Points(divisions int) []Vector3
- func (c *CubicBezierCurve) SpacedPoints(divisions int) []Vector3
- func (c *CubicBezierCurve) Tangent(t float64) *Vector3
- func (c *CubicBezierCurve) TangentAt(u float64) *Vector3
- func (c *CubicBezierCurve) UpdateArcLengths()
- type Curve
- type CurvePath
- func (c *CurvePath) Add(curve Curve)
- func (c *CurvePath) ClosePath() *CurvePath
- func (c *CurvePath) Copy(source *CurvePath) *CurvePath
- func (c *CurvePath) Length() float64
- func (c *CurvePath) Lengths() []float64
- func (c *CurvePath) Point(t float64) *Vector3
- func (c *CurvePath) Points(divisions int) []Vector3
- func (c *CurvePath) SpacedPoints(divisions int) []*Vector3
- func (c *CurvePath) UpdateArcLengths()
- type CurveType
- type Cylindrical
- func (c *Cylindrical) Clone() *Cylindrical
- func (c *Cylindrical) Copy(other *Cylindrical) *Cylindrical
- func (c *Cylindrical) Set(radius, theta, y float64) *Cylindrical
- func (c *Cylindrical) SetFromCartesianCoords(x, y, z float64) *Cylindrical
- func (c *Cylindrical) SetFromVector3(v *Vector3) *Cylindrical
- type EllipseCurve
- func (c *EllipseCurve) Clone() *baseCurve
- func (c *EllipseCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3
- func (c *EllipseCurve) Copy(source *EllipseCurve) *EllipseCurve
- func (c *EllipseCurve) Length() float64
- func (c *EllipseCurve) Lengths(divisions int) []float64
- func (c *EllipseCurve) LengthsDefault() []float64
- func (c *EllipseCurve) Point(t float64) *Vector3
- func (c *EllipseCurve) PointAt(u float64) *Vector3
- func (c *EllipseCurve) Points(divisions int) []Vector3
- func (c *EllipseCurve) SpacedPoints(divisions int) []Vector3
- func (c *EllipseCurve) Tangent(t float64) *Vector3
- func (c *EllipseCurve) TangentAt(u float64) *Vector3
- func (c *EllipseCurve) UpdateArcLengths()
- type Euler
- func (e *Euler) Clone() *Euler
- func (e *Euler) Copy(euler *Euler) *Euler
- func (e *Euler) Equals(euler *Euler) bool
- func (e *Euler) FromArray(array []float64) *Euler
- func (e *Euler) Reorder(newOrder EulerOrder) *Euler
- func (e *Euler) Set(x, y, z float64, order EulerOrder) *Euler
- func (e *Euler) SetFromQuaternion(q Quaternion, order EulerOrder, update bool) *Euler
- func (e *Euler) SetFromRotationMatrix(m Matrix4, order EulerOrder, update bool) *Euler
- func (e *Euler) SetFromVector3(v Vector3, order EulerOrder) *Euler
- func (e *Euler) ToArray(array []float64, offset int) []float64
- type EulerOrder
- type Line3
- func (l *Line3) ApplyMatrix4(matrix Matrix4) *Line3
- func (l *Line3) At(t float64) *Vector3
- func (l *Line3) Center() *Vector3
- func (l *Line3) Clone() *Line3
- func (l *Line3) ClosestPointToPoint(point Vector3, clampToLine bool) *Vector3
- func (l *Line3) ClosestPointToPointParameter(point Vector3, clampToLine bool) float64
- func (l *Line3) Copy(line Line3) *Line3
- func (l *Line3) Delta() *Vector3
- func (l *Line3) Distance() float64
- func (l *Line3) DistanceSq() float64
- func (l *Line3) Equals(line Line3) bool
- func (l *Line3) Set(start, end Vector3) *Line3
- type LineCurve
- func (c *LineCurve) Clone() *baseCurve
- func (c *LineCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3
- func (c *LineCurve) Copy(source baseCurve) *baseCurve
- func (c *LineCurve) Length() float64
- func (c *LineCurve) Lengths(divisions int) []float64
- func (c *LineCurve) LengthsDefault() []float64
- func (c *LineCurve) Point(t float64) *Vector3
- func (c *LineCurve) PointAt(u float64) *Vector3
- func (c *LineCurve) Points(divisions int) []Vector3
- func (c *LineCurve) SpacedPoints(divisions int) []Vector3
- func (c *LineCurve) Tangent(t float64) *Vector3
- func (c *LineCurve) TangentAt(u float64) *Vector3
- func (c *LineCurve) UpdateArcLengths()
- type Matrix3
- func (m *Matrix3) Clone() *Matrix3
- func (m *Matrix3) Copy(matrix Matrix3) *Matrix3
- func (m *Matrix3) Demrminant() float64
- func (m *Matrix3) Equals(matrix Matrix3) bool
- func (m *Matrix3) FromArray(array []float64, offset int) *Matrix3
- func (m *Matrix3) Identity() *Matrix3
- func (m *Matrix3) Invert() *Matrix3
- func (m *Matrix3) MakeRotation(theta float64) *Matrix3
- func (m *Matrix3) MakeScale(x, y float64) *Matrix3
- func (m *Matrix3) MakeTranslation(x, y float64) *Matrix3
- func (m *Matrix3) Multiply(matrix Matrix3) *Matrix3
- func (m *Matrix3) MultiplyScalar(s float64) *Matrix3
- func (m *Matrix3) NormalMatrix(matrix4 Matrix4) *Matrix3
- func (m *Matrix3) Premultiply(matrix Matrix3) *Matrix3
- func (m *Matrix3) Rotam(theta float64) *Matrix3
- func (m *Matrix3) Scale(sx, sy float64) *Matrix3
- func (m *Matrix3) Set(n11, n12, n13, n21, n22, n23, n31, n32, n33 float64) *Matrix3
- func (m *Matrix3) SetFromMatrix4(me Matrix4) *Matrix3
- func (m *Matrix3) SetUvTransform(tx, ty, sx, sy, rotation, cx, cy float64) *Matrix3
- func (m *Matrix3) ToArray(array []float64, offset int) []float64
- func (m *Matrix3) Translam(tx, ty float64) *Matrix3
- func (m *Matrix3) Transpose() *Matrix3
- func (m *Matrix3) TransposeIntoArray(r []float64) *Matrix3
- type Matrix4
- func (m *Matrix4) Clone() *Matrix4
- func (m *Matrix4) Compose(position Vector3, rotation Quaternion, scale Vector3) *Matrix4
- func (m *Matrix4) Copy(matrix Matrix4) *Matrix4
- func (m *Matrix4) CopyPosition(matrix Matrix4) *Matrix4
- func (m *Matrix4) Decompose() (position Vector3, rotation Quaternion, scale Vector3)
- func (m *Matrix4) Demrminant() float64
- func (m *Matrix4) Equals(matrix Matrix4) bool
- func (m *Matrix4) ExtractBasis() (xAxis, yAxis, zAxis Vector3)
- func (m *Matrix4) ExtractRotation(matrix Matrix4) *Matrix4
- func (m *Matrix4) FromArray(array []float64, offset int) *Matrix4
- func (m *Matrix4) Identity() *Matrix4
- func (m *Matrix4) Invert() *Matrix4
- func (m *Matrix4) LookAt(eye, target, up Vector3) *Matrix4
- func (m *Matrix4) MakeBasis(xAxis, yAxis, zAxis Vector3) *Matrix4
- func (m *Matrix4) MakeOrthographic(left, right, top, bottom, near, far float64) *Matrix4
- func (m *Matrix4) MakePerspective(left, right, top, bottom, near, far float64) *Matrix4
- func (m *Matrix4) MakeRotationAxis(axis Vector3, angle float64) *Matrix4
- func (m *Matrix4) MakeRotationFromEuler(euler Euler) *Matrix4
- func (m *Matrix4) MakeRotationX(theta float64) *Matrix4
- func (m *Matrix4) MakeRotationY(theta float64) *Matrix4
- func (m *Matrix4) MakeRotationZ(theta float64) *Matrix4
- func (m *Matrix4) MakeScale(v Vector3) *Matrix4
- func (m *Matrix4) MakeShear(xy, xz, yx, yz, zx, zy float64) *Matrix4
- func (m *Matrix4) MakeTranslation(v Vector3) *Matrix4
- func (m *Matrix4) MaxScaleOnAxis() float64
- func (m *Matrix4) Multiply(m2 Matrix4) *Matrix4
- func (m *Matrix4) MultiplyScalar(s float64) *Matrix4
- func (m *Matrix4) Premultiply(m2 Matrix4) *Matrix4
- func (m *Matrix4) Scale(v Vector3) *Matrix4
- func (m *Matrix4) Set(...) *Matrix4
- func (m *Matrix4) SetFromMatrix3(matrix Matrix3) *Matrix4
- func (m *Matrix4) SetPosition(v Vector3) *Matrix4
- func (m *Matrix4) ToArray(array []float64, offset int) []float64
- func (m *Matrix4) Transpose() *Matrix4
- type Plane
- func (p *Plane) ApplyMatrix4(matrix Matrix4, optionalNormalMatrix *Matrix3) *Plane
- func (p *Plane) Clone() *Plane
- func (p *Plane) CoplanarPoint() *Vector3
- func (p *Plane) Copy(plane Plane) *Plane
- func (p *Plane) DistanceToPoint(point Vector3) float64
- func (p *Plane) DistanceToSphere(sphere Sphere) float64
- func (p *Plane) Equals(plane Plane) bool
- func (p *Plane) IntersectLine(line Line3) *Vector3
- func (p *Plane) IntersectsBox(box Box3) bool
- func (p *Plane) IntersectsLine(line Line3) bool
- func (p *Plane) IntersectsSphere(sphere Sphere) bool
- func (p *Plane) Negate() *Plane
- func (p *Plane) Normalize() *Plane
- func (p *Plane) ProjectPoint(point Vector3) *Vector3
- func (p *Plane) Set(normal Vector3, constant float64) *Plane
- func (p *Plane) SetComponents(x, y, z, w float64) *Plane
- func (p *Plane) SetFromCoplanarPoints(a, b, c Vector3) *Plane
- func (p *Plane) SetFromNormalAndCoplanarPoint(normal, point Vector3) *Plane
- func (p *Plane) Translate(offset Vector3) *Plane
- type Quaternion
- func (q *Quaternion) AngleTo(qb Quaternion) float64
- func (q *Quaternion) Clone() *Quaternion
- func (q *Quaternion) Conjugate() *Quaternion
- func (q *Quaternion) Copy(quaternion Quaternion) *Quaternion
- func (q *Quaternion) Dot(v Quaternion) float64
- func (q *Quaternion) Equals(quaternion Quaternion) bool
- func (q *Quaternion) FromArray(array []float64, offset int) *Quaternion
- func (q *Quaternion) Identity() *Quaternion
- func (q *Quaternion) Invert() *Quaternion
- func (q *Quaternion) Length() float64
- func (q *Quaternion) LengthSq() float64
- func (q *Quaternion) Multiply(qb Quaternion) *Quaternion
- func (q *Quaternion) MultiplyQuaternionsFlat(dst []float64, dstOffset int, src0 []float64, srcOffset0 int, src1 []float64, ...) []float64
- func (q *Quaternion) Normalize() *Quaternion
- func (q *Quaternion) Premultiply(qb Quaternion) *Quaternion
- func (q *Quaternion) RotateTowards(qb Quaternion, step float64) *Quaternion
- func (q *Quaternion) Set(x, y, z, w float64) *Quaternion
- func (q *Quaternion) SetFromAxisAngle(axis Vector3, angle float64) *Quaternion
- func (q *Quaternion) SetFromEuler(euler Euler) *Quaternion
- func (q *Quaternion) SetFromRotationMatrix(m Matrix4) *Quaternion
- func (q *Quaternion) SetFromUnitVectors(vFrom, vTo Vector3) *Quaternion
- func (q *Quaternion) Slerp(qb Quaternion, t float64) *Quaternion
- func (q *Quaternion) SlerpFlat(dst []float64, dstOffset int, src0 []float64, srcOffset0 int, src1 []float64, ...)
- func (q *Quaternion) ToArray(array []float64, offset int) []float64
- type Ray
- func (r *Ray) ApplyMatrix4(matrix4 Matrix4) *Ray
- func (r *Ray) At(t float64) *Vector3
- func (r *Ray) Clone() *Ray
- func (r *Ray) ClosestPointToPoint(point Vector3) *Vector3
- func (r *Ray) Copy(ray *Ray) *Ray
- func (r *Ray) DistanceSqToPoint(point Vector3) float64
- func (r *Ray) DistanceSqToSegment(v0, v1 Vector3, optionalPointOnRay, optionalPointOnSegment *Vector3) float64
- func (r *Ray) DistanceToPlane(plane *Plane) float64
- func (r *Ray) DistanceToPoint(point Vector3) float64
- func (r *Ray) Equals(ray Ray) bool
- func (r *Ray) IntersectBox(box *Box3) *Vector3
- func (r *Ray) IntersectPlane(plane *Plane) *Vector3
- func (r *Ray) IntersectSphere(sphere *Sphere, target *Vector3) *Vector3
- func (r *Ray) IntersectTriangle(a, b, c Vector3, backfaceCulling bool) *Vector3
- func (r *Ray) IntersectsBox(box *Box3) bool
- func (r *Ray) IntersectsPlane(plane *Plane) bool
- func (r *Ray) IntersectsSphere(sphere *Sphere) bool
- func (r *Ray) LookAt(v *Vector3) *Ray
- func (r *Ray) Recast(t float64) *Ray
- func (r *Ray) Set(origin, dir Vector3) *Ray
- type Sphere
- func (s *Sphere) ApplyMatrix4(matrix Matrix4) *Sphere
- func (s *Sphere) BoundingBox() *Box3
- func (s *Sphere) ClampPoint(point Vector3) *Vector3
- func (s *Sphere) Clone() *Sphere
- func (s *Sphere) ContainsPoint(point Vector3) bool
- func (s *Sphere) Copy(sphere Sphere) *Sphere
- func (s *Sphere) DistanceToPoint(point Vector3) float64
- func (s *Sphere) Equals(sphere Sphere) bool
- func (s *Sphere) ExpandByPoint(point Vector3) *Sphere
- func (s *Sphere) IntersectsBox(box Box3) bool
- func (s *Sphere) IntersectsPlane(plane Plane) bool
- func (s *Sphere) IntersectsSphere(sphere Sphere) bool
- func (s *Sphere) IsEmpty() bool
- func (s *Sphere) MakeEmpty() *Sphere
- func (s *Sphere) Set(center Vector3, radius float64) *Sphere
- func (s *Sphere) SetFromPoints(points []Vector3, optionalCenter *Vector3) *Sphere
- func (s *Sphere) Translate(offset Vector3) *Sphere
- func (s *Sphere) Union(sphere Sphere) *Sphere
- type Spherical
- func (s *Spherical) Clone() *Spherical
- func (s *Spherical) Copy(other *Spherical) *Spherical
- func (s *Spherical) MakeSafe() *Spherical
- func (s *Spherical) Set(radius, phi, theta float64) *Spherical
- func (s *Spherical) SetFromCartesianCoords(x, y, z float64) *Spherical
- func (s *Spherical) SetFromVector3(v *Vector3) *Spherical
- type SphericalHarmonics3
- func (sh *SphericalHarmonics3) Add(sh2 SphericalHarmonics3) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) AddScaledSH(sh2 SphericalHarmonics3, s float64) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) BasisAt(normal Vector3, shBasis []float64) []float64
- func (sh *SphericalHarmonics3) Clone() *SphericalHarmonics3
- func (sh *SphericalHarmonics3) Copy(sh2 SphericalHarmonics3) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) Equals(sh2 SphericalHarmonics3) bool
- func (sh *SphericalHarmonics3) FromArray(array []float64, offset int) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) GetAt(normal *Vector3) *Vector3
- func (sh *SphericalHarmonics3) GetIrradianceAt(normal Vector3) *Vector3
- func (sh *SphericalHarmonics3) Lerp(sh2 SphericalHarmonics3, alpha float64) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) Scale(s float64) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) Set(coefficients ...Vector3) *SphericalHarmonics3
- func (sh *SphericalHarmonics3) ToArray(array []float64, offset int) []float64
- func (sh *SphericalHarmonics3) Zero() *SphericalHarmonics3
- type SplineCurve
- func (c *SplineCurve) Clone() *baseCurve
- func (c *SplineCurve) ComputeFrenetFrames(segments int, closed bool) map[string][]Vector3
- func (c *SplineCurve) Copy(source baseCurve) *baseCurve
- func (c *SplineCurve) Length() float64
- func (c *SplineCurve) Lengths(divisions int) []float64
- func (c *SplineCurve) LengthsDefault() []float64
- func (c *SplineCurve) Point(t float64) *Vector3
- func (c *SplineCurve) PointAt(u float64) *Vector3
- func (c *SplineCurve) Points(divisions int) []Vector3
- func (c *SplineCurve) SpacedPoints(divisions int) []Vector3
- func (c *SplineCurve) Tangent(t float64) *Vector3
- func (c *SplineCurve) TangentAt(u float64) *Vector3
- func (c *SplineCurve) UpdateArcLengths()
- type Triangle
- func (t *Triangle) Area() float64
- func (t *Triangle) Barycoord(point Vector3) *Vector3
- func (t *Triangle) Clone() Triangle
- func (t *Triangle) ClosestPointToPoint(p Vector3) *Vector3
- func (t *Triangle) ContainsPoint(point Vector3) bool
- func (t *Triangle) Copy(triangle Triangle) *Triangle
- func (t *Triangle) Equals(triangle Triangle) bool
- func (t *Triangle) Interpolation(point, p1, p2, p3, v1, v2, v3 Vector3) *Vector3
- func (t *Triangle) IsFrontFacing(direction Vector3) bool
- func (t *Triangle) Midpoint() *Vector3
- func (t *Triangle) Normal() *Vector3
- func (t *Triangle) Plane() *Plane
- func (t *Triangle) Set(a, b, c Vector3) *Triangle
- func (t *Triangle) SetFromPointsAndIndices(points []Vector3, i0, i1, i2 int) *Triangle
- type Vector2
- func (v *Vector2) Add(vector Vector2) *Vector2
- func (v *Vector2) AddScalar(scalar float64) *Vector2
- func (v *Vector2) Angle() float64
- func (v *Vector2) AngleTo(vector Vector2) float64
- func (v *Vector2) ApplyMatrix3(m Matrix3) *Vector2
- func (v *Vector2) Ceil() *Vector2
- func (v *Vector2) Clamp(minVal, maxVal Vector2) *Vector2
- func (v *Vector2) ClampLength(minVal, maxVal float64) *Vector2
- func (v *Vector2) ClampScalar(minVal, maxVal float64) *Vector2
- func (v *Vector2) Clone() *Vector2
- func (v *Vector2) Component(index int) float64
- func (v *Vector2) Copy(vector Vector2) *Vector2
- func (v *Vector2) Cross(vector Vector2) float64
- func (v *Vector2) DistanceTo(vector Vector2) float64
- func (v *Vector2) DistanceToSquared(vector Vector2) float64
- func (v *Vector2) Divide(vector Vector2) *Vector2
- func (v *Vector2) DivideScalar(scalar float64) *Vector2
- func (v *Vector2) Dot(vector Vector2) float64
- func (v *Vector2) Equals(vector Vector2) bool
- func (v *Vector2) Floor() *Vector2
- func (v *Vector2) FromArray(array []float64, offset int) *Vector2
- func (v *Vector2) Height() float64
- func (v *Vector2) Length() float64
- func (v *Vector2) LengthSq() float64
- func (v *Vector2) Lerp(vector Vector2, alpha float64) *Vector2
- func (v *Vector2) ManhattanDistanceTo(vector Vector2) float64
- func (v *Vector2) ManhattanLength() float64
- func (v *Vector2) Max(vector Vector2) *Vector2
- func (v *Vector2) Min(vector Vector2) *Vector2
- func (v *Vector2) Multiply(vector Vector2) *Vector2
- func (v *Vector2) MultiplyScalar(scalar float64) *Vector2
- func (v *Vector2) Negate() *Vector2
- func (v *Vector2) Normalize() *Vector2
- func (v *Vector2) Random() *Vector2
- func (v *Vector2) RotateAround(center Vector2, angle float64) *Vector2
- func (v *Vector2) Round() *Vector2
- func (v *Vector2) RoundToZero() *Vector2
- func (v *Vector2) Set(x, y float64) *Vector2
- func (v *Vector2) SetComponent(index int, value float64) *Vector2
- func (v *Vector2) SetHeight(value float64) *Vector2
- func (v *Vector2) SetLength(length float64) *Vector2
- func (v *Vector2) SetScalar(scalar float64) *Vector2
- func (v *Vector2) SetWidth(value float64) *Vector2
- func (v *Vector2) SetX(x float64) *Vector2
- func (v *Vector2) SetY(y float64) *Vector2
- func (v *Vector2) Sub(vector Vector2) *Vector2
- func (v *Vector2) SubScalar(scalar float64) *Vector2
- func (v *Vector2) ToArray(array []float64, offset int) []float64
- func (v *Vector2) Width() float64
- type Vector3
- func AddVector3s(a, b Vector3) *Vector3
- func CrossVector3s(a, b Vector3) *Vector3
- func LerpVector3s(v1, v2 Vector3, alpha float64) *Vector3
- func MultiplyVector3s(a, b Vector3) *Vector3
- func NewOneVector3() *Vector3
- func NewVector3(x, y, z float64) *Vector3
- func NewZeroVector3() *Vector3
- func SubVector3s(a, b Vector3) *Vector3
- func (v *Vector3) Add(v2 Vector3) *Vector3
- func (v *Vector3) AddScalar(scalar float64) *Vector3
- func (v *Vector3) AddScaledVector(vector Vector3, scalar float64) *Vector3
- func (v *Vector3) AngleTo(v2 Vector3) float64
- func (v *Vector3) ApplyAxisAngle(axis Vector3, angle float64) *Vector3
- func (v *Vector3) ApplyEuler(e Euler) *Vector3
- func (v *Vector3) ApplyMatrix3(m Matrix3) *Vector3
- func (v *Vector3) ApplyMatrix4(m Matrix4) *Vector3
- func (v *Vector3) ApplyNormalMatrix(m Matrix3) *Vector3
- func (v *Vector3) ApplyQuaternion(q Quaternion) *Vector3
- func (v *Vector3) Ceil() *Vector3
- func (v *Vector3) Clamp(minVal, maxVal Vector3) *Vector3
- func (v *Vector3) ClampLength(minVal, maxVal float64) *Vector3
- func (v *Vector3) ClampScalar(minVal, maxVal float64) *Vector3
- func (v *Vector3) Clone() *Vector3
- func (v *Vector3) Component(index int) float64
- func (v *Vector3) Copy(vector Vector3) *Vector3
- func (v *Vector3) Cross(v2 Vector3) *Vector3
- func (v *Vector3) DistanceTo(v2 Vector3) float64
- func (v *Vector3) DistanceToSquared(v2 Vector3) float64
- func (v *Vector3) Divide(v2 Vector3) *Vector3
- func (v *Vector3) DivideScalar(scalar float64) *Vector3
- func (v *Vector3) Dot(v2 Vector3) float64
- func (v *Vector3) Equals(v2 Vector3) bool
- func (v *Vector3) Floor() *Vector3
- func (v *Vector3) FromArray(array []float64, offset int) *Vector3
- func (v *Vector3) Length() float64
- func (v *Vector3) LengthSq() float64
- func (v *Vector3) Lerp(v2 Vector3, alpha float64) *Vector3
- func (v *Vector3) ManhattanDistanceTo(v2 Vector3) float64
- func (v *Vector3) Max(v2 Vector3) *Vector3
- func (v *Vector3) Min(v2 Vector3) *Vector3
- func (v *Vector3) Multiply(v2 Vector3) *Vector3
- func (v *Vector3) MultiplyScalar(scalar float64) *Vector3
- func (v *Vector3) Negate() *Vector3
- func (v *Vector3) Normalize() *Vector3
- func (v *Vector3) ProjectOnPlane(planeNormal Vector3) *Vector3
- func (v *Vector3) ProjectOnVector(v2 Vector3) *Vector3
- func (v *Vector3) Random() *Vector3
- func (v *Vector3) RandomDirection() *Vector3
- func (v *Vector3) Reflect(normal Vector3) *Vector3
- func (v *Vector3) Round() *Vector3
- func (v *Vector3) RoundToZero() *Vector3
- func (v *Vector3) Set(x, y, z float64) *Vector3
- func (v *Vector3) SetComponent(index int, value float64) *Vector3
- func (v *Vector3) SetFromCylindrical(c Cylindrical) *Vector3
- func (v *Vector3) SetFromCylindricalCoords(radius, theta, y float64) *Vector3
- func (v *Vector3) SetFromMatrixColumn(m Matrix4, index int) *Vector3
- func (v *Vector3) SetFromMatrixPosition(m Matrix4) *Vector3
- func (v *Vector3) SetFromMatrixScale(m Matrix4) *Vector3
- func (v *Vector3) SetFromSpherical(s Spherical) *Vector3
- func (v *Vector3) SetFromSphericalCoords(radius, phi, theta float64) *Vector3
- func (v *Vector3) SetLength(length float64) *Vector3
- func (v *Vector3) SetScalar(scalar float64) *Vector3
- func (v *Vector3) Sub(v2 Vector3) *Vector3
- func (v *Vector3) SubScalar(scalar float64) *Vector3
- func (v *Vector3) ToArray(array []float64, offset int) []float64
- func (v *Vector3) TransformDirection(m Matrix4) *Vector3
Constants ¶
Variables ¶
var ( V3Zero = *NewZeroVector3() V3One = *NewOneVector3() )
var Box2Empty = Box2{ Min: Vector2{X: math.MaxFloat64, Y: math.MaxFloat64}, Max: Vector2{X: -math.MaxFloat64, Y: -math.MaxFloat64}, }
var Box3Empty = Box3{ Min: Vector3{X: math.MaxFloat64, Y: math.MaxFloat64, Z: math.MaxFloat64}, Max: Vector3{X: -math.MaxFloat64, Y: -math.MaxFloat64, Z: -math.MaxFloat64}, }
Functions ¶
func CatmullRom ¶
func CeilPowerOfTwo ¶
func CubicBezier ¶
func CubicBezierP0 ¶
func CubicBezierP1 ¶
func CubicBezierP2 ¶
func CubicBezierP3 ¶
func EuclideanModulo ¶
compute euclidean modulo of m % n https://en.wikipedia.org/wiki/Modulo_operation
func FloorPowerOfTwo ¶
func InverseLerp ¶
func IsPowerOfTwo ¶
func QuadraticBezier ¶
func QuadraticBezierP0 ¶
func QuadraticBezierP1 ¶
func QuadraticBezierP2 ¶
func RandFloatSpread ¶
Random float from <-range/2, range/2> interval
func SetQuaternionFromProperEuler ¶
func SetQuaternionFromProperEuler(q *Quaternion, a, b, c float64, order string)
func Smootherstep ¶
func Smoothstep ¶
Types ¶
type ArcCurve ¶
type ArcCurve struct {
EllipseCurve
}
func NewArcCurve ¶
func (*ArcCurve) ComputeFrenetFrames ¶ added in v0.0.6
type Box2 ¶
func (*Box2) ContainsBox ¶
func (*Box2) ContainsPoint ¶
func (*Box2) DistanceToPoint ¶
func (*Box2) ExpandByPoint ¶
func (*Box2) ExpandByScalar ¶
func (*Box2) ExpandByVector ¶
func (*Box2) IntersectsBox ¶
func (*Box2) SetFromCenterAndSize ¶
func (*Box2) SetFromPoints ¶
type Box3 ¶
func (*Box3) ApplyMatrix4 ¶
func (*Box3) ClampPoint ¶
func (*Box3) ContainsBox ¶
func (*Box3) ContainsPoint ¶
func (*Box3) DistanceToPoint ¶
func (*Box3) ExpandByPoint ¶
func (*Box3) ExpandByScalar ¶
func (*Box3) ExpandByVector ¶
func (*Box3) GetBoundingSphere ¶
func (*Box3) GetParameter ¶
func (*Box3) IntersectsBox ¶
func (*Box3) IntersectsPlane ¶
func (*Box3) IntersectsSphere ¶
func (*Box3) IntersectsTriangle ¶
func (*Box3) SetFromCenterAndSize ¶
func (*Box3) SetFromPoints ¶
type CatmullRomCurve3 ¶
type CatmullRomCurve3 struct {
Points []*Vector3
Closed bool
CurveType CurveType
Tension float64
// contains filtered or unexported fields
}
func NewCatmullRomCurve3 ¶
func NewCatmullRomCurve3(points []*Vector3, closed bool, curveType CurveType, tension float64) *CatmullRomCurve3
func (*CatmullRomCurve3) ComputeFrenetFrames ¶ added in v0.0.6
func (*CatmullRomCurve3) Copy ¶
func (c *CatmullRomCurve3) Copy(source *CatmullRomCurve3) *CatmullRomCurve3
func (*CatmullRomCurve3) GetPoint ¶
func (c *CatmullRomCurve3) GetPoint(t float64, optionalTarget *Vector3) *Vector3
func (*CatmullRomCurve3) Length ¶
func (c *CatmullRomCurve3) Length() float64
Get total curve arc length
func (*CatmullRomCurve3) LengthsDefault ¶
func (c *CatmullRomCurve3) LengthsDefault() []float64
func (*CatmullRomCurve3) Point ¶
Virtual base class method to overwrite and implement in subclasses
- t [0 .. 1]
func (*CatmullRomCurve3) PointAt ¶
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
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) UpdateArcLengths ¶
func (c *CatmullRomCurve3) UpdateArcLengths()
type CoordinateSystem ¶
type CoordinateSystem int
const ( CoordinateSystemWebGL CoordinateSystem = iota CoordinateSystemWebGPU )
type CubicBezierCurve ¶
type CubicBezierCurve struct {
V0, V1, V2, V3 Vector3
// contains filtered or unexported fields
}
func NewCubicBezierCurve3 ¶
func NewCubicBezierCurve3(v0, v1, v2, v3 Vector3) *CubicBezierCurve
func (*CubicBezierCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*CubicBezierCurve) Length ¶
func (c *CubicBezierCurve) Length() float64
func (*CubicBezierCurve) Lengths ¶
func (c *CubicBezierCurve) Lengths(divisions int) []float64
func (*CubicBezierCurve) LengthsDefault ¶
func (c *CubicBezierCurve) LengthsDefault() []float64
func (*CubicBezierCurve) Point ¶
func (c *CubicBezierCurve) Point(t float64) *Vector3
func (*CubicBezierCurve) PointAt ¶
func (c *CubicBezierCurve) PointAt(u float64) *Vector3
func (*CubicBezierCurve) Points ¶
func (c *CubicBezierCurve) Points(divisions int) []Vector3
func (*CubicBezierCurve) SpacedPoints ¶
func (c *CubicBezierCurve) SpacedPoints(divisions int) []Vector3
func (*CubicBezierCurve) Tangent ¶ added in v0.0.6
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) UpdateArcLengths ¶
func (c *CubicBezierCurve) UpdateArcLengths()
type CurvePath ¶
type CurvePath struct {
// contains filtered or unexported fields
}
func NewCurvePath ¶
func NewCurvePath() *CurvePath
func (*CurvePath) SpacedPoints ¶
func (*CurvePath) UpdateArcLengths ¶
func (c *CurvePath) UpdateArcLengths()
type Cylindrical ¶
type Cylindrical struct {
Radius float64 // distance from the origin to a point in the x-z plane
Theta float64 // counterclockwise angle in the x-z plane measured in radians from the positive z-axis
Y float64 // height above the x-z plane
}
func NewCylindrical ¶
func NewCylindrical(radius, theta, y float64) *Cylindrical
func (*Cylindrical) Clone ¶
func (c *Cylindrical) Clone() *Cylindrical
func (*Cylindrical) Copy ¶
func (c *Cylindrical) Copy(other *Cylindrical) *Cylindrical
func (*Cylindrical) Set ¶
func (c *Cylindrical) Set(radius, theta, y float64) *Cylindrical
func (*Cylindrical) SetFromCartesianCoords ¶
func (c *Cylindrical) SetFromCartesianCoords(x, y, z float64) *Cylindrical
func (*Cylindrical) SetFromVector3 ¶
func (c *Cylindrical) SetFromVector3(v *Vector3) *Cylindrical
type EllipseCurve ¶
type EllipseCurve struct {
// contains filtered or unexported fields
}
func NewEllipseCurve ¶
func NewEllipseCurve(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aRotation float64, aClockwise bool) *EllipseCurve
func (*EllipseCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*EllipseCurve) Copy ¶
func (c *EllipseCurve) Copy(source *EllipseCurve) *EllipseCurve
func (*EllipseCurve) Length ¶
func (c *EllipseCurve) Length() float64
func (*EllipseCurve) Lengths ¶
func (c *EllipseCurve) Lengths(divisions int) []float64
func (*EllipseCurve) LengthsDefault ¶
func (c *EllipseCurve) LengthsDefault() []float64
func (*EllipseCurve) Point ¶
func (c *EllipseCurve) Point(t float64) *Vector3
func (*EllipseCurve) PointAt ¶
func (c *EllipseCurve) PointAt(u float64) *Vector3
func (*EllipseCurve) Points ¶
func (c *EllipseCurve) Points(divisions int) []Vector3
func (*EllipseCurve) SpacedPoints ¶
func (c *EllipseCurve) SpacedPoints(divisions int) []Vector3
func (*EllipseCurve) Tangent ¶ added in v0.0.6
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) UpdateArcLengths ¶
func (c *EllipseCurve) UpdateArcLengths()
type Euler ¶
type Euler struct {
X float64
Y float64
Z float64
Order EulerOrder
}
func NewEuler ¶
func NewEuler(x, y, z float64, order EulerOrder) *Euler
func (*Euler) Reorder ¶
func (e *Euler) Reorder(newOrder EulerOrder) *Euler
func (*Euler) SetFromQuaternion ¶
func (e *Euler) SetFromQuaternion(q Quaternion, order EulerOrder, update bool) *Euler
func (*Euler) SetFromRotationMatrix ¶
func (e *Euler) SetFromRotationMatrix(m Matrix4, order EulerOrder, update bool) *Euler
func (*Euler) SetFromVector3 ¶
func (e *Euler) SetFromVector3(v Vector3, order EulerOrder) *Euler
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 Line3 ¶
type Line3 struct {
Start, End Vector3
}
func (*Line3) ApplyMatrix4 ¶
func (*Line3) ClosestPointToPoint ¶
func (*Line3) ClosestPointToPointParameter ¶
func (*Line3) DistanceSq ¶
type LineCurve ¶
type LineCurve struct {
V1, V2 Vector3
// contains filtered or unexported fields
}
func NewLineCurve3 ¶
func (*LineCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*LineCurve) LengthsDefault ¶
func (*LineCurve) SpacedPoints ¶
func (*LineCurve) Tangent ¶ added in v0.0.6
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) UpdateArcLengths ¶
func (c *LineCurve) UpdateArcLengths()
type Matrix3 ¶
type Matrix3 [9]float64
func MultiplyMatrices ¶
func NewMatrix3 ¶
func NewMatrix3Identity ¶
func NewMatrix3Identity() *Matrix3
func (*Matrix3) Demrminant ¶
func (*Matrix3) MakeRotation ¶
func (*Matrix3) MakeTranslation ¶
func (*Matrix3) MultiplyScalar ¶
func (*Matrix3) NormalMatrix ¶
func (*Matrix3) Premultiply ¶
func (*Matrix3) SetFromMatrix4 ¶
func (*Matrix3) SetUvTransform ¶
func (*Matrix3) TransposeIntoArray ¶
type Matrix4 ¶
type Matrix4 [16]float64
func MakeRotationFromQuaternion ¶
func MakeRotationFromQuaternion(q Quaternion) *Matrix4
func MultiplyMatrice4s ¶
func NewMatrix4 ¶
func NewMatrix4Identity ¶
func NewMatrix4Identity() *Matrix4
func (*Matrix4) Compose ¶
func (m *Matrix4) Compose(position Vector3, rotation Quaternion, scale Vector3) *Matrix4
func (*Matrix4) CopyPosition ¶
func (*Matrix4) Decompose ¶
func (m *Matrix4) Decompose() (position Vector3, rotation Quaternion, scale Vector3)
func (*Matrix4) Demrminant ¶
func (*Matrix4) ExtractBasis ¶
func (*Matrix4) ExtractRotation ¶
func (*Matrix4) MakeOrthographic ¶
func (*Matrix4) MakePerspective ¶
func (*Matrix4) MakeRotationAxis ¶
func (*Matrix4) MakeRotationFromEuler ¶
func (*Matrix4) MakeRotationX ¶
func (*Matrix4) MakeRotationY ¶
func (*Matrix4) MakeRotationZ ¶
func (*Matrix4) MakeTranslation ¶
func (*Matrix4) MaxScaleOnAxis ¶
func (*Matrix4) MultiplyScalar ¶
func (*Matrix4) Premultiply ¶
func (*Matrix4) SetFromMatrix3 ¶
func (*Matrix4) SetPosition ¶
type Plane ¶
func (*Plane) ApplyMatrix4 ¶
func (*Plane) CoplanarPoint ¶
func (*Plane) DistanceToPoint ¶
func (*Plane) DistanceToSphere ¶
func (*Plane) IntersectLine ¶
func (*Plane) IntersectsBox ¶
func (*Plane) IntersectsLine ¶
func (*Plane) IntersectsSphere ¶
func (*Plane) ProjectPoint ¶
func (*Plane) SetComponents ¶
func (*Plane) SetFromCoplanarPoints ¶
func (*Plane) SetFromNormalAndCoplanarPoint ¶
type Quaternion ¶
type Quaternion struct {
X, Y, Z, W float64
}
func MultiplyQuaternions ¶
func MultiplyQuaternions(a, b Quaternion) *Quaternion
func NewIdentityQuaternion ¶
func NewIdentityQuaternion() *Quaternion
func NewQuaternion ¶
func NewQuaternion(x, y, z, w float64) *Quaternion
func (*Quaternion) AngleTo ¶
func (q *Quaternion) AngleTo(qb Quaternion) float64
func (*Quaternion) Clone ¶
func (q *Quaternion) Clone() *Quaternion
func (*Quaternion) Conjugate ¶
func (q *Quaternion) Conjugate() *Quaternion
func (*Quaternion) Copy ¶
func (q *Quaternion) Copy(quaternion Quaternion) *Quaternion
func (*Quaternion) Dot ¶
func (q *Quaternion) Dot(v Quaternion) float64
func (*Quaternion) Equals ¶
func (q *Quaternion) Equals(quaternion Quaternion) bool
func (*Quaternion) FromArray ¶
func (q *Quaternion) FromArray(array []float64, offset int) *Quaternion
func (*Quaternion) Identity ¶
func (q *Quaternion) Identity() *Quaternion
func (*Quaternion) Invert ¶
func (q *Quaternion) Invert() *Quaternion
func (*Quaternion) Length ¶
func (q *Quaternion) Length() float64
func (*Quaternion) LengthSq ¶
func (q *Quaternion) LengthSq() float64
func (*Quaternion) Multiply ¶
func (q *Quaternion) Multiply(qb Quaternion) *Quaternion
func (*Quaternion) MultiplyQuaternionsFlat ¶
func (*Quaternion) Normalize ¶
func (q *Quaternion) Normalize() *Quaternion
func (*Quaternion) Premultiply ¶
func (q *Quaternion) Premultiply(qb Quaternion) *Quaternion
func (*Quaternion) RotateTowards ¶
func (q *Quaternion) RotateTowards(qb Quaternion, step float64) *Quaternion
func (*Quaternion) Set ¶
func (q *Quaternion) Set(x, y, z, w float64) *Quaternion
func (*Quaternion) SetFromAxisAngle ¶
func (q *Quaternion) SetFromAxisAngle(axis Vector3, angle float64) *Quaternion
func (*Quaternion) SetFromEuler ¶
func (q *Quaternion) SetFromEuler(euler Euler) *Quaternion
func (*Quaternion) SetFromRotationMatrix ¶
func (q *Quaternion) SetFromRotationMatrix(m Matrix4) *Quaternion
func (*Quaternion) SetFromUnitVectors ¶
func (q *Quaternion) SetFromUnitVectors(vFrom, vTo Vector3) *Quaternion
func (*Quaternion) Slerp ¶
func (q *Quaternion) Slerp(qb Quaternion, t float64) *Quaternion
type Ray ¶
type Ray struct {
Origin, Dir Vector3
}
func (*Ray) ApplyMatrix4 ¶
func (*Ray) ClosestPointToPoint ¶
func (*Ray) DistanceSqToPoint ¶
func (*Ray) DistanceSqToSegment ¶
func (*Ray) DistanceToPlane ¶
func (*Ray) DistanceToPoint ¶
func (*Ray) IntersectBox ¶
func (*Ray) IntersectPlane ¶
func (*Ray) IntersectSphere ¶
func (*Ray) IntersectTriangle ¶
func (*Ray) IntersectsBox ¶
func (*Ray) IntersectsPlane ¶
func (*Ray) IntersectsSphere ¶
type Sphere ¶
func (*Sphere) ApplyMatrix4 ¶
func (*Sphere) BoundingBox ¶
func (*Sphere) ClampPoint ¶
func (*Sphere) ContainsPoint ¶
func (*Sphere) DistanceToPoint ¶
func (*Sphere) ExpandByPoint ¶
func (*Sphere) IntersectsBox ¶
func (*Sphere) IntersectsPlane ¶
func (*Sphere) IntersectsSphere ¶
func (*Sphere) SetFromPoints ¶
type Spherical ¶
type Spherical struct {
Radius, Phi, Theta float64
}
func NewSpherical ¶
func (*Spherical) SetFromCartesianCoords ¶
func (*Spherical) SetFromVector3 ¶
type SphericalHarmonics3 ¶
type SphericalHarmonics3 [9]Vector3
func NewSphericalHarmonics3 ¶
func NewSphericalHarmonics3() *SphericalHarmonics3
func (*SphericalHarmonics3) Add ¶
func (sh *SphericalHarmonics3) Add(sh2 SphericalHarmonics3) *SphericalHarmonics3
func (*SphericalHarmonics3) AddScaledSH ¶
func (sh *SphericalHarmonics3) AddScaledSH(sh2 SphericalHarmonics3, s float64) *SphericalHarmonics3
func (*SphericalHarmonics3) BasisAt ¶
func (sh *SphericalHarmonics3) BasisAt(normal Vector3, shBasis []float64) []float64
GetBasisAt evaluates the basis functions
func (*SphericalHarmonics3) Clone ¶
func (sh *SphericalHarmonics3) Clone() *SphericalHarmonics3
func (*SphericalHarmonics3) Copy ¶
func (sh *SphericalHarmonics3) Copy(sh2 SphericalHarmonics3) *SphericalHarmonics3
func (*SphericalHarmonics3) Equals ¶
func (sh *SphericalHarmonics3) Equals(sh2 SphericalHarmonics3) bool
func (*SphericalHarmonics3) FromArray ¶
func (sh *SphericalHarmonics3) FromArray(array []float64, offset int) *SphericalHarmonics3
func (*SphericalHarmonics3) GetAt ¶
func (sh *SphericalHarmonics3) GetAt(normal *Vector3) *Vector3
GetAt returns the radiance in the direction of the normal
func (*SphericalHarmonics3) GetIrradianceAt ¶
func (sh *SphericalHarmonics3) GetIrradianceAt(normal Vector3) *Vector3
GetIrradianceAt returns the irradiance (radiance convolved with cosine lobe) in the direction of the normal
func (*SphericalHarmonics3) Lerp ¶
func (sh *SphericalHarmonics3) Lerp(sh2 SphericalHarmonics3, alpha float64) *SphericalHarmonics3
func (*SphericalHarmonics3) Scale ¶
func (sh *SphericalHarmonics3) Scale(s float64) *SphericalHarmonics3
func (*SphericalHarmonics3) Set ¶
func (sh *SphericalHarmonics3) Set(coefficients ...Vector3) *SphericalHarmonics3
func (*SphericalHarmonics3) ToArray ¶
func (sh *SphericalHarmonics3) ToArray(array []float64, offset int) []float64
func (*SphericalHarmonics3) Zero ¶
func (sh *SphericalHarmonics3) Zero() *SphericalHarmonics3
type SplineCurve ¶
type SplineCurve struct {
// contains filtered or unexported fields
}
func NewSplineCurve ¶
func NewSplineCurve(points ...Vector3) *SplineCurve
func (*SplineCurve) ComputeFrenetFrames ¶ added in v0.0.6
func (*SplineCurve) Length ¶
func (c *SplineCurve) Length() float64
func (*SplineCurve) Lengths ¶
func (c *SplineCurve) Lengths(divisions int) []float64
func (*SplineCurve) LengthsDefault ¶
func (c *SplineCurve) LengthsDefault() []float64
func (*SplineCurve) Point ¶
func (c *SplineCurve) Point(t float64) *Vector3
func (*SplineCurve) PointAt ¶
func (c *SplineCurve) PointAt(u float64) *Vector3
func (*SplineCurve) Points ¶
func (c *SplineCurve) Points(divisions int) []Vector3
func (*SplineCurve) SpacedPoints ¶
func (c *SplineCurve) SpacedPoints(divisions int) []Vector3
func (*SplineCurve) Tangent ¶ added in v0.0.6
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) UpdateArcLengths ¶
func (c *SplineCurve) UpdateArcLengths()
type Triangle ¶
type Triangle struct {
A, B, C Vector3
}
func NewTriangle ¶
func (*Triangle) ClosestPointToPoint ¶
func (*Triangle) ContainsPoint ¶
func (*Triangle) Interpolation ¶
func (*Triangle) IsFrontFacing ¶
type Vector2 ¶
func AddScaledVector2 ¶
func AddVector2s ¶
func LerpVectors ¶
func NewOneVector2 ¶
func NewOneVector2() *Vector2
func NewVector2 ¶
func NewZeroVector2 ¶
func NewZeroVector2() *Vector2
func SubVector2s ¶
func (*Vector2) ApplyMatrix3 ¶
func (*Vector2) ClampLength ¶
func (*Vector2) ClampScalar ¶
func (*Vector2) DistanceTo ¶
func (*Vector2) DistanceToSquared ¶
func (*Vector2) DivideScalar ¶
func (*Vector2) ManhattanDistanceTo ¶
func (*Vector2) ManhattanLength ¶
func (*Vector2) MultiplyScalar ¶
func (*Vector2) RotateAround ¶
func (*Vector2) RoundToZero ¶
type Vector3 ¶
type Vector3 struct {
X, Y, Z float64
}
func AddVector3s ¶
func CrossVector3s ¶
func LerpVector3s ¶
func MultiplyVector3s ¶
func NewOneVector3 ¶
func NewOneVector3() *Vector3
func NewVector3 ¶
func NewZeroVector3 ¶
func NewZeroVector3() *Vector3
func SubVector3s ¶
func (*Vector3) AddScaledVector ¶
func (*Vector3) ApplyAxisAngle ¶
func (*Vector3) ApplyEuler ¶
func (*Vector3) ApplyMatrix3 ¶
func (*Vector3) ApplyMatrix4 ¶
func (*Vector3) ApplyNormalMatrix ¶
func (*Vector3) ApplyQuaternion ¶
func (v *Vector3) ApplyQuaternion(q Quaternion) *Vector3
func (*Vector3) ClampLength ¶
func (*Vector3) ClampScalar ¶
func (*Vector3) DistanceTo ¶
func (*Vector3) DistanceToSquared ¶
func (*Vector3) DivideScalar ¶
func (*Vector3) ManhattanDistanceTo ¶
func (*Vector3) MultiplyScalar ¶
func (*Vector3) ProjectOnPlane ¶
func (*Vector3) ProjectOnVector ¶
func (*Vector3) RandomDirection ¶
func (*Vector3) RoundToZero ¶
func (*Vector3) SetFromCylindrical ¶
func (v *Vector3) SetFromCylindrical(c Cylindrical) *Vector3
func (*Vector3) SetFromCylindricalCoords ¶
func (*Vector3) SetFromMatrixColumn ¶
func (*Vector3) SetFromMatrixPosition ¶
func (*Vector3) SetFromMatrixScale ¶
func (*Vector3) SetFromSpherical ¶
func (*Vector3) SetFromSphericalCoords ¶
func (*Vector3) 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
- quaternion.go
- ray.go
- sphere.go
- spherical.go
- spherical_harmonics3.go
- triangle.go
- utils.go
- vector2.go
- vector3.go