Table of Contents

Struct Float4x4

Namespace
Xui.GPU.Shaders.Types
Assembly
Xui.Core.dll

A 4x4 matrix of 32-bit floats. Used for transformations in shader code.

public struct Float4x4
Inherited Members

Constructors

Float4x4(Float4, Float4, Float4, Float4)

Initializes a new instance of the Float4x4 struct.

public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3)

Parameters

row0 Float4
row1 Float4
row2 Float4
row3 Float4

Fields

Row0

First row of the matrix.

public Float4 Row0

Field Value

Float4

Row1

Second row of the matrix.

public Float4 Row1

Field Value

Float4

Row2

Third row of the matrix.

public Float4 Row2

Field Value

Float4

Row3

Fourth row of the matrix.

public Float4 Row3

Field Value

Float4

Properties

Identity

Gets the identity matrix.

public static Float4x4 Identity { get; }

Property Value

Float4x4

Methods

CreateLookAt(Float3, Float3, Float3)

Creates a view matrix (look-at matrix).

public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up)

Parameters

eye Float3
target Float3
up Float3

Returns

Float4x4

CreatePerspective(F32, F32, F32, F32)

Creates a perspective projection matrix.

public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane)

Parameters

fovY F32

Field of view in the Y direction (in radians).

aspectRatio F32

Aspect ratio (width / height).

nearPlane F32

Near clipping plane distance.

farPlane F32

Far clipping plane distance.

Returns

Float4x4

Remarks

This uses a [0, 1] depth range (DirectX/Vulkan style) instead of OpenGL's [-1, 1]. The matrix maps the near plane to NDC Z = 0 and far plane to NDC Z = 1.

CreateRotationX(F32)

Creates a rotation matrix around the X axis.

public static Float4x4 CreateRotationX(F32 angle)

Parameters

angle F32

Returns

Float4x4

CreateRotationY(F32)

Creates a rotation matrix around the Y axis.

public static Float4x4 CreateRotationY(F32 angle)

Parameters

angle F32

Returns

Float4x4

CreateRotationZ(F32)

Creates a rotation matrix around the Z axis.

public static Float4x4 CreateRotationZ(F32 angle)

Parameters

angle F32

Returns

Float4x4

CreateTranslation(F32, F32, F32)

Creates a translation matrix.

public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z)

Parameters

x F32
y F32
z F32

Returns

Float4x4

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator *(Float4x4, Float4)

Multiplies a matrix by a vector.

public static Float4 operator *(Float4x4 matrix, Float4 vector)

Parameters

matrix Float4x4
vector Float4

Returns

Float4

operator *(Float4x4, Float4x4)

Multiplies two matrices.

public static Float4x4 operator *(Float4x4 left, Float4x4 right)

Parameters

left Float4x4
right Float4x4

Returns

Float4x4