Gjsify LogoGjsify Logo

A triangle.

record

Hierarchy

  • Triangle

Index

Constructors

Properties

name: string

Methods

  • contains_point(p: Point3D): boolean
  • free(): void
  • get_area(): number
  • Computes the barycentric coordinates of the given point p.

    The point p must lie on the same plane as the triangle t; if the point is not coplanar, the result of this function is undefined.

    If we place the origin in the coordinates of the triangle's A point, the barycentric coordinates are u, which is on the AC vector; and v which is on the AB vector:

    The returned #graphene_vec2_t contains the following values, in order:

    • res.x = u
    • res.y = v

    Parameters

    Returns [boolean, Vec2]

  • Computes the UV coordinates of the given point p.

    The point p must lie on the same plane as the triangle t; if the point is not coplanar, the result of this function is undefined. If p is %NULL, the point will be set in (0, 0, 0).

    The UV coordinates will be placed in the res vector:

    • res.x = u
    • res.y = v

    See also: graphene_triangle_get_barycoords()

    Parameters

    • p: Point3D

      a #graphene_point3d_t

    • uv_a: Vec2

      the UV coordinates of the first point

    • uv_b: Vec2

      the UV coordinates of the second point

    • uv_c: Vec2

      the UV coordinates of the third point

    Returns [boolean, Vec2]

  • init_from_float(a: number[], b: number[], c: number[]): Triangle
  • Initializes a #graphene_triangle_t using the three given arrays of floating point values, each representing the coordinates of a point in 3D space.

    Parameters

    • a: number[]

      an array of 3 floating point values

    • b: number[]

      an array of 3 floating point values

    • c: number[]

      an array of 3 floating point values

    Returns Triangle

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