Vec2

class Vec2(val grapheneVec2Pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

A structure capable of holding a vector with two dimensions, x and y.

The contents of the #graphene_vec2_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

Constructors

Link copied to clipboard
constructor()

Allocate a new Vec2.

constructor(scope: <Error class: unknown class>)

Allocate a new Vec2 using the provided AutofreeScope.

constructor(grapheneVec2Pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Types

Link copied to clipboard
object Companion

Properties

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

Functions

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

Adds each component of the two passed vectors and places each result into the components of @res.

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

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: Vec2): <Error class: unknown class>

Computes the dot product of the two given vectors.

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

Checks whether the two given #graphene_vec2_t are equal.

Link copied to clipboard
fun free()

Frees the resources allocated by @v

Link copied to clipboard
fun getX(): <Error class: unknown class>

Retrieves the X component of the #graphene_vec2_t.

Link copied to clipboard
fun getY(): <Error class: unknown class>

Retrieves the Y component of the #graphene_vec2_t.

Link copied to clipboard
fun init(x: <Error class: unknown class>, y: <Error class: unknown class>): Vec2

Initializes a #graphene_vec2_t using the given values.

Link copied to clipboard

Copies the contents of @src into @v.

Link copied to clipboard
fun interpolate(v2: Vec2, factor: <Error class: unknown class>, res: Vec2)

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

Link copied to clipboard
fun length(): <Error class: unknown class>

Computes the length of the given vector.

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

Compares the two given vectors and places the maximum values of each component into @res.

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

Compares the two given vectors and places the minimum values of each component into @res.

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

Multiplies each component of the two passed vectors and places each result into the components of @res.

Link copied to clipboard
fun near(v2: Vec2, epsilon: <Error class: unknown class>): Boolean

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

Link copied to clipboard
fun negate(res: Vec2)

Negates the given #graphene_vec2_t.

Link copied to clipboard
fun normalize(res: Vec2)

Computes the normalized vector for the given vector @v.

Link copied to clipboard
fun scale(factor: <Error class: unknown class>, res: Vec2)

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

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

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.