Gjsify LogoGjsify Logo

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.

record

Hierarchy

  • Vec3

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

    Returns Graphene.Vec3

  • free(): void
  • getX(): number
  • Creates a #graphene_vec2_t that contains the first and second components of the given #graphene_vec3_t.

    Returns Vec2

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

    Returns Graphene.Vec3

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

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

    Returns Vec4

  • getXyzw(w: number): Vec4
  • Converts a #graphene_vec3_t in a #graphene_vec4_t using w as the value of the fourth component of the resulting vector.

    Parameters

    • w: number

      the value of the W component

    Returns Vec4

  • getY(): number
  • getZ(): number
  • Initializes a #graphene_vec3_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

    Returns Graphene.Vec3

  • Initializes a #graphene_vec3_t with the values from an array.

    Parameters

    • src: number[]

      an array of 3 floating point values

    Returns Graphene.Vec3

  • length(): number
  • Compares the two given #graphene_vec3_t vectors and checks whether their values are within the given epsilon.

    Parameters

    • v2: Graphene.Vec3

      a #graphene_vec3_t

    • epsilon: number

      the threshold between the two vectors

    Returns boolean

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

    Parameters

    • factor: number

      the scalar factor

    Returns Graphene.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.

    Parameters

    Returns Graphene.Vec3

  • toFloat(): number[]
  • Copies the components of a #graphene_vec3_t into the given array.

    Returns number[]

  • Allocates a new #graphene_vec3_t structure.

    The contents of the returned structure are undefined.

    Use graphene_vec3_init() to initialize the vector.

    Returns Graphene.Vec3

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