the-world-engine
Version:
three.js based, unity like game engine for browser
79 lines (78 loc) • 2.48 kB
TypeScript
import type { IPhysics2D } from "..";
import type { IReadonlyGameState } from "./GameState";
import type { Scene } from "./hierarchy_object/Scene";
import { InputHandler } from "./input/InputHandler";
import { Instantiater } from "./Instantiater";
import type { IReadonlyCameraContainer } from "./render/CameraContainer";
import type { IReadonlyGameScreen } from "./render/IReadonlyGameScreen";
import type { WebGLGlobalObject } from "./render/WebGLGlobalObject";
import type { Time } from "./time/Time";
/**
* do not drive this class
*/
export declare class EngineGlobalObject {
private readonly _scene;
private readonly _cameraContainer;
private readonly _time;
private readonly _inputHandler;
private readonly _instantiater;
private readonly _gameState;
private readonly _screen;
private readonly _physics2DProcessor;
private readonly _domElement;
private _webGLGlobalObject;
private readonly _sceneProcessor;
private readonly _coroutineProcessor;
private readonly _transformMatrixProcessor;
/**
* game scene. You can add objects to the scene.
*/
get scene(): Scene;
/**
* You can get the camera through the camera container.
*
* `cameraContainer.camera` value is null until the `onEnable()` message of the camera is called.
*
* This problem can be solved by placing the components that use the camera at the bottom of the tree rather than the Camera components.
*/
get cameraContainer(): IReadonlyCameraContainer;
/**
* game screen. You can get the screen size.
*/
get screen(): IReadonlyGameScreen;
/**
* game standard input system.
* If possible, use this rather than implementing the input system yourself.
*/
get input(): InputHandler;
/**
* time information.
*
* typically used to get delta time.
*/
get time(): Time;
/**
* physics2D related operations.
*/
get physics(): IPhysics2D;
/**
* game state.
*/
get gameState(): IReadonlyGameState;
/**
* You can instantiate object through instantiater
*/
get instantiater(): Instantiater;
/**
* dom element.
*
* You can use it when you want to receive the event directly from the dom element.
*/
get domElement(): HTMLElement;
/**
* webGL object.
*
* if you not use WebGL, this value is null.
*/
get webGL(): WebGLGlobalObject | null;
}