IMat4Ops

Description

[StaticTemplate]
interface Tinman.Core.Math.Vectors.IMat4Ops
<TVector4 out val>
<TVector3 val>
<TElement in val>

Extended by

Mat4D struct
Mat4F struct

Defines common operations for 4x4 matrix values.

Public / Methods

Mul


[Pure]
public method Mul → (4)

in : TElement

X-component of vector.

in : TElement

Y-component of vector.

in : TElement

Z-component of vector.

in : TElement

W-component of vector.

returns → TVector4

The resulting vector.

Multiplies this matrix (left-side) with the given vector (right-side): result = this * v.

Mul​W

2 overloads


[Pure]
public method MulW1 → (2)

in : TVector3

The vector.

in : TElement

The W-component to assume.

returns → TVector3

The resulting vector, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given homogeneous 3D vector (right-side): result = this * v.


[Pure]
public method MulW2 → (4)

in : TElement

X-component of vector.

in : TElement

Y-component of vector.

in : TElement

Z-component of vector.

in : TElement

The W-component to assume.

returns → TVector3

The resulting vector, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given homogeneous 3D vector (right-side): result = this * v.

Mul​W0

2 overloads


[Pure]
public method MulW01 → (1)

in : TVector3

The vector.

returns → TVector3

The resulting vector, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given 3D vector (right-side): result = this * (v.X, v.Y, v.Z, 0).

See also

IMat4Ops.MulW1


[Pure]
public method MulW02 → (3)

in : TElement

X-component of vector.

in : TElement

Y-component of vector.

in : TElement

Z-component of vector.

returns → TVector3

The resulting vector, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given 3D vector (right-side): result = this * (x, y, z, 0).

See also

IMat4Ops.MulW2

Mul​W1

2 overloads


[Pure]
public method MulW11 → (1)

in : TVector3

The point.

returns → TVector3

The resulting point, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given 3D point (right-side): result = this * (v.X, v.Y, v.Z, 1).

See also

IMat4Ops.MulW1


[Pure]
public method MulW12 → (3)

in : TElement

X-component of point.

in : TElement

Y-component of point.

in : TElement

Y-component of point.

returns → TVector3

The resulting point, scaled by 1/result.W.

Multiplies this matrix (left-side) with the given 3D point (right-side): result = this * (x, y, z, 1).

See also

IMat4Ops.MulW2

Perspective​Ray


[Pure]
public method PerspectiveRay → (6)

translation in : TVector3

The translation components, if they have been omitted in the view projection, otherwise Vec3D.Zero.

pixelX in : TElement

Pixel X-coordinate (see remarks).

pixelY in : TElement

Pixel Y-coordinate (see remarks).

screenWidth in : int32

Screen width, in pixels.

screenHeight in : int32

Screen height, in pixels.

nearAtZero in : bool

When true, the near clipping plane will be mapped to 0 in clip-space (e.g. Direct3D); when false it will be mapped to -1 (e.g. OpenGL).

returns → Ray

The ray

Computes a ray for a screen-pixel.

This matrix must be the inverse of a combined world-view-projection matrix (for example, Mat4D.PerspectiveFov). The pixel coordinates (0,0) refer to the top-left corner of the top-left screen pixel. The pixel coordinates (w,h) refer to the bottom-right corner of the bottom-right screen pixel (where w and h are the screen width resp. height). If you want to cast rays for pixel centers, you have to add an offset of 0.5 to the pixel coordinates.