Gjsify LogoGjsify Logo

A triangle.

record

Hierarchy

  • Triangle

Index

Constructors

Properties

name: string

Methods

  • Checks whether the given triangle t contains the point p.

    Parameters

    Returns boolean

  • Checks whether the two given #graphene_triangle_t are equal.

    Parameters

    Returns boolean

  • free(): void
  • getArea(): 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 coordinates of the midpoint of the given #graphene_triangle_t.

    The midpoint G is the centroid of the triangle, i.e. the intersection of its medians.

    Returns Point3D

  • 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

    • uvA: Vec2

      the UV coordinates of the first point

    • uvB: Vec2

      the UV coordinates of the second point

    • uvC: Vec2

      the UV coordinates of the third point

    Returns [boolean, Vec2]

  • initFromFloat(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