Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Engine

Hierarchy

  • Engine

Index

Constructors

constructor

  • new Engine(div: HTMLDivElement): Engine

Properties

Private _loadedObjectsCount

_loadedObjectsCount: number = 0

Private _loadedTexturesCount

_loadedTexturesCount: number = 0

Private _objectsLoaded

_objectsLoaded: boolean = false

Private _objectsWithAlpha

_objectsWithAlpha: Array<Entity> = []

Private _objectsWithoutAlpha

_objectsWithoutAlpha: Array<Entity> = []

Private _onFrameHandlers

_onFrameHandlers: Array<Function> = []

Private _onObjectSelectedHandlers

_onObjectSelectedHandlers: Array<Function> = []

Private _onResourcesLoadedHandlers

_onResourcesLoadedHandlers: Array<Function> = []

Private _onRun

_onRun: Array<Function> = []

Private _resourcesLoaded

_resourcesLoaded: boolean = false

Private _running

_running: boolean = false

Private _texturesLoaded

_texturesLoaded: boolean = false

Private _ui

_ui: UI | null = null

camera

camera: Camera | null = null

canvas

canvas: HTMLCanvasElement

controls

controls: Controls | null = null

debugger

debugger: Debugger | null = null

div

div: HTMLDivElement

globalLightMinValue

globalLightMinValue: number = 0.5

height

height: number

lights

lights: Array<Light> = []

lightsPositions

lightsPositions: Array<number> = []

lightsRanges

lightsRanges: Array<number> = []

noTexture

noTexture: ColorTexture

reflections

reflections: boolean = false

selectedObject

selectedObject: Entity | null = null

shaders

shaders: Shaders

status

status: string = "Creating"

textures

textures: Array<Texture> = []

webgl

webgl: WebGLRenderingContext

width

width: number

Accessors

objects

objectsLoaded

  • get objectsLoaded(): boolean

resourcesLoaded

  • get resourcesLoaded(): boolean

running

  • get running(): boolean

texturesLoaded

  • get texturesLoaded(): boolean

ui

  • get ui(): UI | null
  • set ui(v: UI | null): void

Methods

addObject

  • addObject(object: Entity): void

addOnFrameHandler

  • addOnFrameHandler(callback: Function): Function
  • Parameters

    • callback: Function

    Returns Function

addOnObjectSelectedListener

  • addOnObjectSelectedListener(callback: Function): void
  • Parameters

    • callback: Function

    Returns void

addOnResourcesLoadedListener

  • addOnResourcesLoadedListener(callback: Function): void
  • Parameters

    • callback: Function

    Returns void

appendCanvas

  • appendCanvas(): void

Private beforeFrame

  • beforeFrame(): void

captureFrame

  • captureFrame(camera: Camera, options?: undefined | object): HTMLCanvasElement
  • Parameters

    • camera: Camera
    • Optional options: undefined | object

    Returns HTMLCanvasElement

Private draw

  • draw(): void

Private infoConsoleLog

  • infoConsoleLog(): void

objectLoaded

  • objectLoaded(object: Entity): void
  • Function should be executed when object loaded and ready to use.

    Parameters

    Returns void

onCanvasResized

  • onCanvasResized(): void
  • Update drawing parameters for correct drawing resized canvas. Use it when canvas resized.

    Returns void

removeObject

removeOnFrameHandler

  • removeOnFrameHandler(func: Function): void
  • Parameters

    • func: Function

    Returns void

render

  • render(): void

run

  • run(): void

setCamera

  • setCamera(camera: Camera): void

setDrawingRange

  • setDrawingRange(range: number): void

stop

  • stop(): void

textureLoaded

  • textureLoaded(texture: Texture): void
  • Function should be executed when texture loaded and ready to use.

    Parameters

    Returns void

Private update

  • update(): void

Generated using TypeDoc