Vec4

class Vec4(pointer: <Error class: unknown class><<Error class: unknown class>>)

A structure capable of holding a vector with four dimensions: x, y, z, and w.

The contents of the #graphene_vec4_t structure are private and should never be accessed directly.

Skipped during bindings generation

  • parameter src: Array parameter of type gfloat is not supported

  • parameter dest: dest: Out parameter is not supported

  • field value: Record field value is private

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val grapheneVec4Pointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun add(b: Vec4, res: Vec4)

Adds each component of the two given vectors.

Link copied to clipboard
fun divide(b: Vec4, res: Vec4)

Divides each component of the first operand @a by the corresponding component of the second operand @b, and places the results into the vector @res.

Link copied to clipboard
fun dot(b: Vec4): Float

Computes the dot product of the two given vectors.

Link copied to clipboard
fun equal(v2: Vec4): Boolean

Checks whether the two given #graphene_vec4_t are equal.

Link copied to clipboard
fun free()

Frees the resources allocated by @v

Link copied to clipboard
fun getW(): Float

Retrieves the value of the fourth component of the given #graphene_vec4_t.

Link copied to clipboard
fun getX(): Float

Retrieves the value of the first component of the given #graphene_vec4_t.

Link copied to clipboard
fun getXy(res: Vec2)

Creates a #graphene_vec2_t that contains the first two components of the given #graphene_vec4_t.

Link copied to clipboard
fun getXyz(res: Vec3)

Creates a #graphene_vec3_t that contains the first three components of the given #graphene_vec4_t.

Link copied to clipboard
fun getY(): Float

Retrieves the value of the second component of the given #graphene_vec4_t.

Link copied to clipboard
fun getZ(): Float

Retrieves the value of the third component of the given #graphene_vec4_t.

Link copied to clipboard
fun init(x: Float, y: Float, z: Float, w: Float): Vec4

Initializes a #graphene_vec4_t using the given values.

Link copied to clipboard
fun initFromVec2(src: Vec2, z: Float, w: Float): Vec4

Initializes a #graphene_vec4_t using the components of a #graphene_vec2_t and the values of @z and @w.

Link copied to clipboard
fun initFromVec3(src: Vec3, w: Float): Vec4

Initializes a #graphene_vec4_t using the components of a #graphene_vec3_t and the value of @w.

Link copied to clipboard

Initializes a #graphene_vec4_t using the components of another #graphene_vec4_t.

Link copied to clipboard
fun interpolate(v2: Vec4, factor: Double, res: Vec4)

Linearly interpolates @v1 and @v2 using the given @factor.

Link copied to clipboard
fun length(): Float

Computes the length of the given #graphene_vec4_t.

Link copied to clipboard
fun max(b: Vec4, res: Vec4)

Compares each component of the two given vectors and creates a vector that contains the maximum values.

Link copied to clipboard
fun min(b: Vec4, res: Vec4)

Compares each component of the two given vectors and creates a vector that contains the minimum values.

Link copied to clipboard
fun multiply(b: Vec4, res: Vec4)

Multiplies each component of the two given vectors.

Link copied to clipboard
fun near(v2: Vec4, epsilon: Float): Boolean

Compares the two given #graphene_vec4_t vectors and checks whether their values are within the given @epsilon.

Link copied to clipboard
fun negate(res: Vec4)

Negates the given #graphene_vec4_t.

Link copied to clipboard
fun normalize(res: Vec4)

Normalizes the given #graphene_vec4_t.

Link copied to clipboard
fun scale(factor: Float, res: Vec4)

Multiplies all components of the given vector with the given scalar @factor.

Link copied to clipboard
fun subtract(b: Vec4, res: Vec4)

Subtracts from each component of the first operand @a the corresponding component of the second operand @b and places each result into the components of @res.