Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a textured box in 3D Space.

Hierarchy

  • TextureBox

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

    • texture: string
    • minPoint: Vector4

      The minimal x,y,z of the box

    • maxPoint: Vector4

      The maximal x,y,z of the box

    Returns TextureBox

Properties

Private coordbuffer

coordbuffer: WebGLBuffer

The buffer containing the box's texturecoordinates.

Private 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 = "TextureColor"

Key of the corresponding Shader in the Shadermanager.

texture

texture: string

The key of the corresponding Texture in the Texturemanager.

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