Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a Box in threedimensional space.

Hierarchy

  • Box

Implements

Index

Constructors

constructor

  • Creates all WebGL buffers for the box 6 ------- 7 / | / | 3 ------- 2 | | | | | | 5 -----|- 4 | / | / 0 ------- 1 looking in negative z axis direction

    Parameters

    • gl: WebGL2RenderingContext

      The canvas' context

    • minPoint: Vector4

      The minimal x,y,z of the box

    • maxPoint: Vector4

      The maximal x,y,z of the box

    • colors: Vector4[]

    Returns Box

Properties

Private colorbuffer

colorbuffer: WebGLBuffer

The buffer containing the box's colors.

colors

colors: Vector4[]

Colors used to color the box.

elements

elements: number

The amount of indices.

Private gl

gl: WebGL2RenderingContext

The canvas' context

Private indexbuffer

indexbuffer: WebGLBuffer

The indices describing which vertices form a triangle.

max

max: Vector4

Maxpoint of the box.

min

min: Vector4

Minpoint of the box.

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