Vec4

data class Vec4<T : Number, Comparable<T>>(val x: T, val y: T, val z: T, val w: T, val type: KClass<T>) : Vec<T>

4D vector with coordinates (x, y, z, w).

Can also be used to specify RGBA color values.

Constructors

Link copied to clipboard
constructor(x: T, y: T, z: T, w: T, type: KClass<T>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Returns a Compose Color representation of this Vec4.

Link copied to clipboard

Returns a color int representation of this Vec4.

Link copied to clipboard

Returns an array of coordinates of this vector.

Link copied to clipboard

Returns a 4D double-precision float vector equal to this vector.

Link copied to clipboard

Returns an array of coordinates of this vector.

Link copied to clipboard

Returns a 4D float vector equal to this vector.

Link copied to clipboard

Returns an array of coordinates of this vector.

Link copied to clipboard

Returns a 4D integer vector equal to this vector.

Link copied to clipboard
open override fun toList(): List<T>

Returns a list of coordinates of this vector.

Link copied to clipboard

Returns an array of coordinates of this vector.

Link copied to clipboard

Returns a 4D long integer vector equal to this vector.

Link copied to clipboard

Returns a 3D vector equivalent to this rational form.

Link copied to clipboard
fun toVec2(): Vec2<T>

Returns a 2D vector with x and y coordinates of this vector.

Link copied to clipboard
fun toVec3(): Vec3<T>

Returns a 3D vector with x, y and z coordinates of this vector.

Properties

Link copied to clipboard
val a: T

Alpha channel of RGBA color.

Link copied to clipboard
val b: T

Blue channel of RGBA color.

Link copied to clipboard
val g: T

Green channel of RGBA color.

Link copied to clipboard
val r: T

Red channel of RGBA color.

Link copied to clipboard
val type: KClass<T>

Type of vector coordinates.

Link copied to clipboard
val w: T

W coordinate of this vector.

Link copied to clipboard
val x: T

X coordinate of this vector.

Link copied to clipboard
val y: T

Y coordinate of this vector.

Link copied to clipboard
val z: T

Z coordinate of this vector.