Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a pyramid in 3D space.

Hierarchy

  • Pyramid

Implements

Index

Constructors

constructor

  • new Pyramid(gl: WebGL2RenderingContext, colors?: Vector4[], width?: number, height?: number): Pyramid
  • Parameters

    • gl: WebGL2RenderingContext
    • Default value colors: Vector4[] = ColorHelper.CreateColorArray(new Vector4(1, 0, 0, 1), 4)
    • Default value width: number = 1
    • Default value height: number = 1

    Returns Pyramid

Properties

basewidth

basewidth: number

Width of the basesquare.

Private colorbuffer

colorbuffer: WebGLBuffer

The buffer containing the box's colors.

colors

colors: Vector4[]

Colors used to color the pyramid.

Private elements

elements: number

The amount of indices.

Private gl

gl: WebGL2RenderingContext

height

height: number

Height of the top of the pyramid.

Private indexbuffer

indexbuffer: WebGLBuffer

The indices describing which vertices form a triangle.

Private normalbuffer

normalbuffer: WebGLBuffer

The buffer containing the box's normals.

Readonly shader

shader: string = "pvmcolor"

Key of the corresponding Shader in the Shadermanager.

Private vertexbuffer

vertexbuffer: WebGLBuffer

The buffer containing the box's vertices.

Methods

intersect

  • Used for drawing with the raytracer.

    Ignored by the Raytracer

    Parameters

    • ray: Ray

      Ray to intersect with.

    • transformation: Matrix4

      Transformation of the object into worldspace.

    Returns Intersection

render

  • render(shader: Shader): void
  • Method to used for drawing with rasterizer.

    Parameters

    • shader: Shader

      Shader used for rendering.

    Returns void

Generated using TypeDoc