Vec3

class Vec3(val grapheneVec3Pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

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

The contents of the #graphene_vec3_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 Vec3.

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

Allocate a new Vec3 using the provided AutofreeScope.

constructor(grapheneVec3Pointer: <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 grapheneVec3Pointer: <Error class: unknown class><<Error class: unknown class>>

Functions

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

Adds each component of the two given vectors.

Link copied to clipboard
fun cross(b: Vec3, res: Vec3)

Computes the cross product of the two given vectors.

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

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

Computes the dot product of the two given vectors.

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

Checks whether the two given #graphene_vec3_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 first component of the given vector @v.

Link copied to clipboard
fun getXy(res: Vec2)

Creates a #graphene_vec2_t that contains the first and second components of the given #graphene_vec3_t.

Link copied to clipboard
fun getXy0(res: Vec3)

Creates a #graphene_vec3_t that contains the first two components of the given #graphene_vec3_t, and the third component set to 0.

Link copied to clipboard
fun getXyz0(res: Vec4)

Converts a #graphene_vec3_t in a #graphene_vec4_t using 0.0 as the value for the fourth component of the resulting vector.

Link copied to clipboard
fun getXyz1(res: Vec4)

Converts a #graphene_vec3_t in a #graphene_vec4_t using 1.0 as the value for the fourth component of the resulting vector.

Link copied to clipboard
fun getXyzw(w: <Error class: unknown class>, res: Vec4)

Converts a #graphene_vec3_t in a #graphene_vec4_t using @w as the value of the fourth component of the resulting vector.

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

Retrieves the second component of the given vector @v.

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

Retrieves the third component of the given vector @v.

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

Initializes a #graphene_vec3_t using the given values.

Link copied to clipboard

Initializes a #graphene_vec3_t with the values of another #graphene_vec3_t.

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

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

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

Retrieves the length of the given vector @v.

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

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

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

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

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

Multiplies each component of the two given vectors.

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

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

Link copied to clipboard
fun negate(res: Vec3)

Negates the given #graphene_vec3_t.

Link copied to clipboard
fun normalize(res: Vec3)

Normalizes the given #graphene_vec3_t.

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

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

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

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.