vec4

fun vec4(x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f, w: Float = 0.0f): Vector4

Constructs a new Vector4 instance. An equivalent of Vector4 constructor that supports Kotlin syntax features: named parameters with default values.

Return

a new Vector4 instance storing the passed values.

Parameters

x

the X component. Defaults to 0f.

y

the Y component. Defaults to 0f.

z

the Z component. Defaults to 0f.

w

the W component. Defaults to 0f.


fun vec4(xy: Vector2, z: Float = 0.0f, w: Float = 0.0f): Vector4

Constructs a new Vector4 instance. An equivalent of Vector4 constructor that supports Kotlin syntax features: named parameters with default values.

Return

a new Vector4 instance storing the passed values.

Parameters

xy

stores the X and Y components. Will be copied.

z

the Z component. Defaults to 0f.

w

the W component. Defaults to 0f.


fun vec4(xy: Vector2, zw: Vector2): Vector4

Constructs a new Vector4 instance copying values from the passed Vector2 instances.

Return

a new Vector4 instance storing the passed values.

Parameters

xy

stores the X and Y components. Will be copied.

zw

its X component will be used as Z, while the Y component will be copied as W.


fun vec4(xyz: Vector3, w: Float = 0.0f): Vector4

Constructs a new Vector4 instance copying values from the passed Vector3 instance. An equivalent of Vector4 constructor that supports Kotlin syntax features: named parameters with default values.

Return

a new Vector4 instance storing the passed values.

Parameters

xyz

stores the X, Y, and Z components. Will be copied.

w

the W component. Defaults to 0f.