Gjsify LogoGjsify Logo

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.

record

Hierarchy

  • Vec4

Index

Constructors

Properties

name: string

Methods

  • 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.

    Parameters

    • b: Vec4

      a #graphene_vec4_t

    Returns Vec4

  • dot(b: Vec4): number
  • equal(v2: Vec4): boolean
  • free(): void
  • get_w(): number
  • get_x(): number
  • get_y(): number
  • get_z(): number
  • init(x: number, y: number, z: number, w: number): Vec4
  • Initializes a #graphene_vec4_t using the given values.

    This function can be called multiple times.

    Parameters

    • x: number

      the X field of the vector

    • y: number

      the Y field of the vector

    • z: number

      the Z field of the vector

    • w: number

      the W field of the vector

    Returns Vec4

  • init_from_float(src: number[]): Vec4
  • Initializes a #graphene_vec4_t with the values inside the given array.

    Parameters

    • src: number[]

      an array of four floating point values

    Returns Vec4

  • init_from_vec2(src: Vec2, z: number, w: number): Vec4
  • Initializes a #graphene_vec4_t using the components of a #graphene_vec2_t and the values of z and w.

    Parameters

    • src: Vec2

      a #graphene_vec2_t

    • z: number

      the value for the third component of v

    • w: number

      the value for the fourth component of v

    Returns Vec4

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

    Parameters

    • src: Graphene.Vec3

      a #graphene_vec3_t

    • w: number

      the value for the fourth component of v

    Returns Vec4

  • interpolate(v2: Vec4, factor: number): Vec4
  • length(): number
  • near(v2: Vec4, epsilon: number): boolean
  • Compares the two given #graphene_vec4_t vectors and checks whether their values are within the given epsilon.

    Parameters

    • v2: Vec4

      a #graphene_vec4_t

    • epsilon: number

      the threshold between the two vectors

    Returns boolean

  • scale(factor: number): 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.

    Parameters

    • b: Vec4

      a #graphene_vec4_t

    Returns Vec4

  • to_float(): number[]
  • Allocates a new #graphene_vec4_t structure.

    The contents of the returned structure are undefined.

    Use graphene_vec4_init() to initialize the vector.

    Returns Vec4

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method