Class Geometry

Hierarchy

  • Geometry

Constructors

Properties

faces: number[][]
normals: Vec[]
texCoords: Vec[]
vertices: Vec[]

Methods

  • converts to triangle array

    Returns number[]

  • Create a box geometry with the sizes a * b * c, centered at (0, 0, 0), 2 triangles per side.

    Name

    box

    Parameters

    • sizeA: number = 1.0
    • sizeB: number = 1.0
    • sizeC: number = 1.0

    Returns Geometry

  • Calculate the surface normal of a triangle

    Parameters

    • p1: Vec

      3d vector of point 1

    • p2: Vec

      3d vector of point 2

    • p3: Vec

      3d vector of point 3

    Returns Vec

  • create a plane grid mesh

    Parameters

    • x: number

      x-coord of the top left corner

    • y: number

      y-coord of the top left corner

    • width: number

      width of the plane

    • height: number

      height of the plane

    • rows: number

      number of rows

    • cols: number

      number of columns

    Returns Geometry

Generated using TypeDoc