Documentation ¶
Index ¶
- func DegToRad[T constraints.Float](d T) T
- func Morton2u32(x, y uint16) uint32
- func Morton3u32(x, y, z uint16) uint32
- func RadToDeg[T constraints.Float](r T) T
- type Bounds3f
- type Bounds3f32
- type Bounds3f64
- type Bounds3i
- type Bounds3i32
- type Bounds3i64
- type Bounds3int
- type Camera
- type Cameraf32
- type Cameraf64
- type Extent3
- type Extent3f32
- type Extent3f64
- type Extent3i32
- type Extent3i64
- type Extent3int
- type Extent3u32
- type Extent3u64
- type Extent3uint
- type Grid
- type Grid32
- type Grid64
- type GridCell
- type GridCelli32
- type GridCelli64
- type Matrix4x4f
- type Matrix4x4f32
- type Matrix4x4f64
- type PerspectiveCamera
- func (c *PerspectiveCamera[T]) ProjectionInverseMatrix() Matrix4x4f[T]
- func (c *PerspectiveCamera[T]) ProjectionMatrix() Matrix4x4f[T]
- func (c *PerspectiveCamera[T]) ScreenPointToRay(x, y int) Ray[T]
- func (c *PerspectiveCamera[T]) ViewInverseMatrix() Matrix4x4f[T]
- func (c *PerspectiveCamera[T]) ViewMatrix() Matrix4x4f[T]
- type PerspectiveCameraf32
- type PerspectiveCameraf64
- type Point3f
- type Point3f32
- type Point3f64
- type Point3i
- type Point3i32
- type Point3i64
- type Point3int
- type Quaternion
- type Quaternionf32
- type Quaternionf64
- type Ray
- type Rayf32
- type Rayf64
- type Rect
- type Rectf32
- type Rectf64
- type Recti32
- type Recti64
- type Rectint
- type Transform
- func (t *Transform[T]) LookAt(up Vector3f[T], target Point3f[T])
- func (t *Transform[T]) ModelInverseMatrix() Matrix4x4f[T]
- func (t *Transform[T]) ModelMatrix() Matrix4x4f[T]
- func (t *Transform[T]) PivotMatrix() Matrix4x4f[T]
- func (t *Transform[T]) RotationMatrix() Matrix4x4f[T]
- func (t *Transform[T]) ScaleMatrix() Matrix4x4f[T]
- func (t *Transform[T]) TransformDirection(v Vector3f[T]) Vector3f[T]
- func (t *Transform[T]) TransformPoint(p Point3f[T]) Point3f[T]
- func (t *Transform[T]) TransformVector(v Vector3f[T]) Vector3f[T]
- func (t *Transform[T]) TranslationMatrix() Matrix4x4f[T]
- type Transformf32
- type Transformf64
- type Vector3f
- func (v Vector3f[T]) Abs() Vector3f[T]
- func (v Vector3f[T]) Add(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) AddUniform(f T) Vector3f[T]
- func (v Vector3f[T]) Angle(v2 Vector3f[T]) T
- func (v Vector3f[T]) AngleAxis(v2 Vector3f[T]) (T, Vector3f[T])
- func (v Vector3f[T]) Clamp(lo, hi Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) Cross(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) Dot(v2 Vector3f[T]) T
- func (v Vector3f[T]) IsNAN() bool
- func (v Vector3f[T]) Magnitude() T
- func (v Vector3f[T]) Max(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) Min(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) Normalize() Vector3f[T]
- func (v Vector3f[T]) OrthoNormalize(tangent Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) Scale(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) ScaleInverse(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) ScaleInverseUniform(s T) Vector3f[T]
- func (v Vector3f[T]) ScaleUniform(s T) Vector3f[T]
- func (v Vector3f[T]) Subtract(v2 Vector3f[T]) Vector3f[T]
- func (v Vector3f[T]) SubtractUniform(f T) Vector3f[T]
- func (v Vector3f[T]) ToArray() [3]T
- func (v Vector3f[T]) ToArrayf32() [3]float32
- type Vector3f32
- type Vector3f64
- type Vector3i
- func (v Vector3i[T]) Abs() Vector3i[T]
- func (v Vector3i[T]) Add(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) AddUniform(i T) Vector3i[T]
- func (v Vector3i[T]) Clamp(lo, hi Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) Max(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) Min(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) Scale(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) ScaleInverse(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) ScaleInverseUniform(s T) Vector3i[T]
- func (v Vector3i[T]) ScaleUniform(s T) Vector3i[T]
- func (v Vector3i[T]) Subtract(v2 Vector3i[T]) Vector3i[T]
- func (v Vector3i[T]) SubtractUniform(i T) Vector3i[T]
- func (v Vector3i[T]) ToArray() [3]T
- func (v Vector3i[T]) ToArrayi32() [3]int32
- type Vector3i32
- type Vector3i64
- type Vector3int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DegToRad ¶
func DegToRad[T constraints.Float](d T) T
func Morton2u32 ¶
func RadToDeg ¶
func RadToDeg[T constraints.Float](r T) T
Types ¶
type Bounds3f32 ¶
type Bounds3f64 ¶
type Bounds3i32 ¶
type Bounds3i64 ¶
type Bounds3int ¶
type Camera ¶
type Camera[T constraints.Float] interface { ScreenPointToRay(x, y int) Ray[T] ViewMatrix() Matrix4x4f[T] ViewInverseMatrix() Matrix4x4f[T] ProjectionMatrix() Matrix4x4f[T] ProjectionInverseMatrix() Matrix4x4f[T] }
type Extent3 ¶
type Extent3[T constraints.Integer | constraints.Float] struct { X, Y, Z T }
type Extent3f32 ¶
type Extent3f64 ¶
type Extent3i32 ¶
type Extent3i64 ¶
type Extent3int ¶
type Extent3u32 ¶
type Extent3u64 ¶
type Extent3uint ¶
type Grid ¶
type Grid[T constraints.Float, U constraints.Integer] struct { Pos Point3f[T] Bounds Bounds3f[T] Scale T CellBounds Bounds3i[U] }
func (*Grid[T, U]) CellToWorldPos ¶
func (*Grid[T, U]) WorldPosToCell ¶
type GridCell ¶
type GridCell[T constraints.Integer] struct { X T Y T Z T }
type GridCelli32 ¶
type GridCelli64 ¶
type Matrix4x4f ¶
type Matrix4x4f[T constraints.Float] [4][4]T
func (Matrix4x4f[T]) Invert ¶
func (m Matrix4x4f[T]) Invert() Matrix4x4f[T]
func (Matrix4x4f[T]) Multiply ¶
func (m Matrix4x4f[T]) Multiply(m2 Matrix4x4f[T]) Matrix4x4f[T]
func (Matrix4x4f[T]) ToArrayf32 ¶
func (m Matrix4x4f[T]) ToArrayf32() [4][4]float32
func (Matrix4x4f[T]) Transpose ¶
func (m Matrix4x4f[T]) Transpose() Matrix4x4f[T]
func (Matrix4x4f[T]) TransposedToArrayf32 ¶
func (m Matrix4x4f[T]) TransposedToArrayf32() [4][4]float32
type Matrix4x4f32 ¶
type Matrix4x4f32 = Matrix4x4f[float32]
type Matrix4x4f64 ¶
type Matrix4x4f64 = Matrix4x4f[float64]
type PerspectiveCamera ¶
type PerspectiveCamera[T constraints.Float] struct { Transform[T] SizeX T SizeY T FOV T ZNear T }
func (*PerspectiveCamera[T]) ProjectionInverseMatrix ¶
func (c *PerspectiveCamera[T]) ProjectionInverseMatrix() Matrix4x4f[T]
func (*PerspectiveCamera[T]) ProjectionMatrix ¶
func (c *PerspectiveCamera[T]) ProjectionMatrix() Matrix4x4f[T]
func (*PerspectiveCamera[T]) ScreenPointToRay ¶
func (c *PerspectiveCamera[T]) ScreenPointToRay(x, y int) Ray[T]
func (*PerspectiveCamera[T]) ViewInverseMatrix ¶
func (c *PerspectiveCamera[T]) ViewInverseMatrix() Matrix4x4f[T]
func (*PerspectiveCamera[T]) ViewMatrix ¶
func (c *PerspectiveCamera[T]) ViewMatrix() Matrix4x4f[T]
type PerspectiveCameraf32 ¶
type PerspectiveCameraf32 = PerspectiveCamera[float32]
type PerspectiveCameraf64 ¶
type PerspectiveCameraf64 = PerspectiveCamera[float64]
type Point3f ¶
type Point3f[T constraints.Float] struct { X, Y, Z T }
func Point3fFromArray ¶
func Point3fFromArray[T constraints.Float](a [3]T) Point3f[T]
func (Point3f[T]) ToArrayf32 ¶
type Point3i ¶
type Point3i[T constraints.Integer] struct { X, Y, Z T }
func Point3iFromArray ¶
func Point3iFromArray[T constraints.Integer](a [3]T) Point3i[T]
type Quaternion ¶
type Quaternion[T constraints.Float] struct { X, Y, Z, W T }
func QuaternionFromAngleAxis ¶
func QuaternionFromAngleAxis[T constraints.Float](t T, axis Vector3f[T]) Quaternion[T]
func QuaternionFromEuler ¶
func QuaternionFromEuler[T constraints.Float](x, y, z T) Quaternion[T]
QuaternionFromEuler is creates a quaternion from euler rotation in the z x y order.
func (Quaternion[T]) Magnitude ¶
func (q Quaternion[T]) Magnitude() T
func (Quaternion[T]) Multiply ¶
func (q Quaternion[T]) Multiply(q2 Quaternion[T]) Quaternion[T]
func (Quaternion[T]) Normalize ¶
func (q Quaternion[T]) Normalize() Quaternion[T]
func (Quaternion[T]) Rotate ¶
func (q Quaternion[T]) Rotate(v Vector3f[T]) Vector3f[T]
type Quaternionf32 ¶
type Quaternionf32 = Quaternion[float32]
type Quaternionf64 ¶
type Quaternionf64 = Quaternion[float64]
type Ray ¶
type Ray[T constraints.Float] struct { Dir Vector3f[T] InvDir Vector3f[T] Org Point3f[T] }
func (*Ray[T]) IntersectionAABB ¶
type Rect ¶
type Rect[T constraints.Integer | constraints.Float] struct { X, Y, W, H T }
type Transform ¶
type Transform[T constraints.Float] struct { Pos Point3f[T] Rot Quaternion[T] Scale Vector3f[T] Pivot Point3f[T] }
func (*Transform[T]) ModelInverseMatrix ¶
func (t *Transform[T]) ModelInverseMatrix() Matrix4x4f[T]
func (*Transform[T]) ModelMatrix ¶
func (t *Transform[T]) ModelMatrix() Matrix4x4f[T]
func (*Transform[T]) PivotMatrix ¶
func (t *Transform[T]) PivotMatrix() Matrix4x4f[T]
func (*Transform[T]) RotationMatrix ¶
func (t *Transform[T]) RotationMatrix() Matrix4x4f[T]
func (*Transform[T]) ScaleMatrix ¶
func (t *Transform[T]) ScaleMatrix() Matrix4x4f[T]
func (*Transform[T]) TransformDirection ¶
func (*Transform[T]) TransformPoint ¶
func (*Transform[T]) TransformVector ¶
func (*Transform[T]) TranslationMatrix ¶
func (t *Transform[T]) TranslationMatrix() Matrix4x4f[T]
type Transformf32 ¶
type Transformf64 ¶
type Vector3f ¶
type Vector3f[T constraints.Float] struct { X, Y, Z T }
func Vector3fFromArray ¶
func Vector3fFromArray[T constraints.Float](a [3]T) Vector3f[T]
func (Vector3f[T]) AddUniform ¶
func (Vector3f[T]) OrthoNormalize ¶
func (Vector3f[T]) ScaleInverse ¶
func (Vector3f[T]) ScaleInverseUniform ¶
func (Vector3f[T]) ScaleUniform ¶
func (Vector3f[T]) SubtractUniform ¶
func (Vector3f[T]) ToArrayf32 ¶
type Vector3f32 ¶
type Vector3f64 ¶
type Vector3i ¶
type Vector3i[T constraints.Integer] struct { X, Y, Z T }
func Vector3iFromArray ¶
func Vector3iFromArray[T constraints.Integer](a [3]T) Vector3i[T]
func (Vector3i[T]) AddUniform ¶
func (Vector3i[T]) ScaleInverse ¶
func (Vector3i[T]) ScaleInverseUniform ¶
func (Vector3i[T]) ScaleUniform ¶
func (Vector3i[T]) SubtractUniform ¶
func (Vector3i[T]) ToArrayi32 ¶
type Vector3i32 ¶
type Vector3i64 ¶
type Vector3int ¶
Click to show internal directories.
Click to hide internal directories.