@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
369 lines (368 loc) • 16.5 kB
TypeScript
export function inherits(Self: any, Super: any): {
(arg1: any, arg2: any, arg3: any, arg4: any, arg5: any, arg6: any, arg7: any, arg8: any): void;
_super: any;
prototype: any;
};
export function makeArray(arr: any): any;
export function createStyle(cssString: any): HTMLStyleElement;
export function UnsupportedBrowserError(message: any): void;
export class UnsupportedBrowserError {
constructor(message: any);
name: string;
message: any;
}
export function ContextCreationError(message: any): void;
export class ContextCreationError {
constructor(message: any);
name: string;
message: any;
}
export function createSphere(device: any, opts: any): Mesh;
export function createPlane(device: any, opts: any): Mesh;
export function createBox(device: any, opts: any): Mesh;
export function createTorus(device: any, opts: any): Mesh;
export function createCapsule(device: any, opts: any): Mesh;
export function createCone(device: any, opts: any): Mesh;
export function createCylinder(device: any, opts: any): Mesh;
export function createMesh(device: any, positions: any, opts?: {}): Mesh;
export function drawFullscreenQuad(device: any, target: any, vertexBuffer: any, shader: any, rect: any): void;
export function basisSetDownloadConfig(glueUrl: any, wasmUrl: any, fallbackUrl: any): void;
export function prefilterCubemap(options: any): void;
export const LINEBATCH_WORLD: 0;
export const LINEBATCH_OVERLAY: 1;
export const LINEBATCH_GIZMO: 2;
export namespace log {
function write(text: any): void;
function open(): void;
function info(text: any): void;
function debug(text: any): void;
function error(text: any): void;
function warning(text: any): void;
function alert(text: any): void;
function assert(condition: any, text: any): void;
}
export namespace time {
export { now };
export { Timer };
}
export namespace shape {
export { BoundingBox as Aabb };
export { BoundingSphere as Sphere };
export { Plane };
}
export const ELEMENTTYPE_INT8: number;
export const ELEMENTTYPE_UINT8: number;
export const ELEMENTTYPE_INT16: number;
export const ELEMENTTYPE_UINT16: number;
export const ELEMENTTYPE_INT32: number;
export const ELEMENTTYPE_UINT32: number;
export const ELEMENTTYPE_FLOAT32: number;
export const PIXELFORMAT_L8_A8: number;
export const PIXELFORMAT_R5_G6_B5: number;
export const PIXELFORMAT_R5_G5_B5_A1: number;
export const PIXELFORMAT_R4_G4_B4_A4: number;
export const PIXELFORMAT_R8_G8_B8: number;
export const PIXELFORMAT_R8_G8_B8_A8: number;
export const BLENDMODE_CONSTANT_COLOR: number;
export const BLENDMODE_ONE_MINUS_CONSTANT_COLOR: number;
export const BLENDMODE_CONSTANT_ALPHA: number;
export const BLENDMODE_ONE_MINUS_CONSTANT_ALPHA: number;
export namespace programlib {
let begin: typeof ShaderGenerator.begin;
let dummyFragmentCode: typeof ShaderUtils.dummyFragmentCode;
let end: typeof ShaderGenerator.end;
let fogCode: typeof ShaderGenerator.fogCode;
let gammaCode: typeof ShaderGenerator.gammaCode;
let precisionCode: typeof ShaderUtils.precisionCode;
let skinCode: typeof ShaderGenerator.skinCode;
let tonemapCode: typeof ShaderGenerator.tonemapCode;
let versionCode: typeof ShaderUtils.versionCode;
}
export namespace gfx {
export { ADDRESS_CLAMP_TO_EDGE };
export { ADDRESS_MIRRORED_REPEAT };
export { ADDRESS_REPEAT };
export { BLENDMODE_ZERO };
export { BLENDMODE_ONE };
export { BLENDMODE_SRC_COLOR };
export { BLENDMODE_ONE_MINUS_SRC_COLOR };
export { BLENDMODE_DST_COLOR };
export { BLENDMODE_ONE_MINUS_DST_COLOR };
export { BLENDMODE_SRC_ALPHA };
export { BLENDMODE_SRC_ALPHA_SATURATE };
export { BLENDMODE_ONE_MINUS_SRC_ALPHA };
export { BLENDMODE_DST_ALPHA };
export { BLENDMODE_ONE_MINUS_DST_ALPHA };
export { BUFFER_STATIC };
export { BUFFER_DYNAMIC };
export { BUFFER_STREAM };
export { CULLFACE_NONE };
export { CULLFACE_BACK };
export { CULLFACE_FRONT };
export { CULLFACE_FRONTANDBACK };
export { TYPE_INT8 as ELEMENTTYPE_INT8 };
export { TYPE_UINT8 as ELEMENTTYPE_UINT8 };
export { TYPE_INT16 as ELEMENTTYPE_INT16 };
export { TYPE_UINT16 as ELEMENTTYPE_UINT16 };
export { TYPE_INT32 as ELEMENTTYPE_INT32 };
export { TYPE_UINT32 as ELEMENTTYPE_UINT32 };
export { TYPE_FLOAT32 as ELEMENTTYPE_FLOAT32 };
export { FILTER_NEAREST };
export { FILTER_LINEAR };
export { FILTER_NEAREST_MIPMAP_NEAREST };
export { FILTER_NEAREST_MIPMAP_LINEAR };
export { FILTER_LINEAR_MIPMAP_NEAREST };
export { FILTER_LINEAR_MIPMAP_LINEAR };
export { INDEXFORMAT_UINT8 };
export { INDEXFORMAT_UINT16 };
export { INDEXFORMAT_UINT32 };
export { PIXELFORMAT_RGB565 };
export { PIXELFORMAT_RGB8 };
export { PIXELFORMAT_RGBA8 };
export { PRIMITIVE_POINTS };
export { PRIMITIVE_LINES };
export { PRIMITIVE_LINELOOP };
export { PRIMITIVE_LINESTRIP };
export { PRIMITIVE_TRIANGLES };
export { PRIMITIVE_TRISTRIP };
export { PRIMITIVE_TRIFAN };
export { SEMANTIC_POSITION };
export { SEMANTIC_NORMAL };
export { SEMANTIC_COLOR };
export { SEMANTIC_TEXCOORD };
export { SEMANTIC_TEXCOORD0 };
export { SEMANTIC_TEXCOORD1 };
export { SEMANTIC_ATTR0 };
export { SEMANTIC_ATTR1 };
export { SEMANTIC_ATTR2 };
export { SEMANTIC_ATTR3 };
export { TEXTURELOCK_READ };
export { TEXTURELOCK_WRITE };
export { drawQuadWithShader };
export { programlib };
export { shaderChunks };
export { ContextCreationError };
export { GraphicsDevice as Device };
export { IndexBuffer };
export { ProgramLibrary };
export { RenderTarget };
export { ScopeId };
export { Shader };
export { WebglShaderInput as ShaderInput };
export { Texture };
export { UnsupportedBrowserError };
export { VertexBuffer };
export { VertexFormat };
export { VertexIterator };
}
export namespace posteffect {
export function createFullscreenQuad(device: any): any;
export { drawFullscreenQuad };
export { PostEffect };
export { PostEffectQueue };
}
export const PhongMaterial: typeof StandardMaterial;
export const LitOptions: typeof LitShaderOptions;
export namespace scene {
export namespace procedural {
export { calculateTangents };
export { createMesh };
export { createTorus };
export { createCylinder };
export { createCapsule };
export { createCone };
export { createSphere };
export { createPlane };
export { createBox };
}
export { BasicMaterial };
export { ForwardRenderer };
export { GraphNode };
export { Material };
export { Mesh };
export { MeshInstance };
export { Model };
export { ParticleEmitter };
export { StandardMaterial as PhongMaterial };
export { Picker };
export namespace Projection {
export { PROJECTION_ORTHOGRAPHIC as ORTHOGRAPHIC };
export { PROJECTION_PERSPECTIVE as PERSPECTIVE };
}
export { Scene };
export { Skin };
export { SkinInstance };
}
export namespace anim {
export { Animation };
export { Key };
export { Node };
export { Skeleton };
}
export namespace audio {
export { SoundManager as AudioManager };
export { Channel };
export { Channel3d };
export { Listener };
export { Sound };
}
export namespace asset {
let ASSET_ANIMATION: string;
let ASSET_AUDIO: string;
let ASSET_IMAGE: string;
let ASSET_JSON: string;
let ASSET_MODEL: string;
let ASSET_MATERIAL: string;
let ASSET_TEXT: string;
let ASSET_TEXTURE: string;
let ASSET_CUBEMAP: string;
let ASSET_SCRIPT: string;
}
export namespace input {
export { getTouchTargetCoords };
export { Controller };
export { GamePads };
export { Keyboard };
export { KeyboardEvent };
export { Mouse };
export { MouseEvent };
export { Touch };
export { TouchDevice };
export { TouchEvent };
}
export const RIGIDBODY_TYPE_STATIC: string;
export const RIGIDBODY_TYPE_DYNAMIC: string;
export const RIGIDBODY_TYPE_KINEMATIC: string;
export const RIGIDBODY_CF_STATIC_OBJECT: 1;
export const RIGIDBODY_CF_KINEMATIC_OBJECT: 2;
export const RIGIDBODY_CF_NORESPONSE_OBJECT: 4;
export const RIGIDBODY_ACTIVE_TAG: 1;
export const RIGIDBODY_ISLAND_SLEEPING: 2;
export const RIGIDBODY_WANTS_DEACTIVATION: 3;
export const RIGIDBODY_DISABLE_DEACTIVATION: 4;
export const RIGIDBODY_DISABLE_SIMULATION: 5;
import { Mesh } from '../scene/mesh.js';
import { now } from '../core/time.js';
declare class Timer {
_isRunning: boolean;
_a: number;
_b: number;
start(): void;
stop(): void;
getMilliseconds(): number;
}
import { BoundingBox } from '../core/shape/bounding-box.js';
import { BoundingSphere } from '../core/shape/bounding-sphere.js';
import { Plane } from '../core/shape/plane.js';
import { ShaderGenerator } from '../scene/shader-lib/programs/shader-generator.js';
import { ShaderUtils } from '../platform/graphics/shader-utils.js';
import { ADDRESS_CLAMP_TO_EDGE } from '../platform/graphics/constants.js';
import { ADDRESS_MIRRORED_REPEAT } from '../platform/graphics/constants.js';
import { ADDRESS_REPEAT } from '../platform/graphics/constants.js';
import { BLENDMODE_ZERO } from '../platform/graphics/constants.js';
import { BLENDMODE_ONE } from '../platform/graphics/constants.js';
import { BLENDMODE_SRC_COLOR } from '../platform/graphics/constants.js';
import { BLENDMODE_ONE_MINUS_SRC_COLOR } from '../platform/graphics/constants.js';
import { BLENDMODE_DST_COLOR } from '../platform/graphics/constants.js';
import { BLENDMODE_ONE_MINUS_DST_COLOR } from '../platform/graphics/constants.js';
import { BLENDMODE_SRC_ALPHA } from '../platform/graphics/constants.js';
import { BLENDMODE_SRC_ALPHA_SATURATE } from '../platform/graphics/constants.js';
import { BLENDMODE_ONE_MINUS_SRC_ALPHA } from '../platform/graphics/constants.js';
import { BLENDMODE_DST_ALPHA } from '../platform/graphics/constants.js';
import { BLENDMODE_ONE_MINUS_DST_ALPHA } from '../platform/graphics/constants.js';
import { BUFFER_STATIC } from '../platform/graphics/constants.js';
import { BUFFER_DYNAMIC } from '../platform/graphics/constants.js';
import { BUFFER_STREAM } from '../platform/graphics/constants.js';
import { CULLFACE_NONE } from '../platform/graphics/constants.js';
import { CULLFACE_BACK } from '../platform/graphics/constants.js';
import { CULLFACE_FRONT } from '../platform/graphics/constants.js';
import { CULLFACE_FRONTANDBACK } from '../platform/graphics/constants.js';
import { TYPE_INT8 } from '../platform/graphics/constants.js';
import { TYPE_UINT8 } from '../platform/graphics/constants.js';
import { TYPE_INT16 } from '../platform/graphics/constants.js';
import { TYPE_UINT16 } from '../platform/graphics/constants.js';
import { TYPE_INT32 } from '../platform/graphics/constants.js';
import { TYPE_UINT32 } from '../platform/graphics/constants.js';
import { TYPE_FLOAT32 } from '../platform/graphics/constants.js';
import { FILTER_NEAREST } from '../platform/graphics/constants.js';
import { FILTER_LINEAR } from '../platform/graphics/constants.js';
import { FILTER_NEAREST_MIPMAP_NEAREST } from '../platform/graphics/constants.js';
import { FILTER_NEAREST_MIPMAP_LINEAR } from '../platform/graphics/constants.js';
import { FILTER_LINEAR_MIPMAP_NEAREST } from '../platform/graphics/constants.js';
import { FILTER_LINEAR_MIPMAP_LINEAR } from '../platform/graphics/constants.js';
import { INDEXFORMAT_UINT8 } from '../platform/graphics/constants.js';
import { INDEXFORMAT_UINT16 } from '../platform/graphics/constants.js';
import { INDEXFORMAT_UINT32 } from '../platform/graphics/constants.js';
import { PIXELFORMAT_RGB565 } from '../platform/graphics/constants.js';
import { PIXELFORMAT_RGB8 } from '../platform/graphics/constants.js';
import { PIXELFORMAT_RGBA8 } from '../platform/graphics/constants.js';
import { PRIMITIVE_POINTS } from '../platform/graphics/constants.js';
import { PRIMITIVE_LINES } from '../platform/graphics/constants.js';
import { PRIMITIVE_LINELOOP } from '../platform/graphics/constants.js';
import { PRIMITIVE_LINESTRIP } from '../platform/graphics/constants.js';
import { PRIMITIVE_TRIANGLES } from '../platform/graphics/constants.js';
import { PRIMITIVE_TRISTRIP } from '../platform/graphics/constants.js';
import { PRIMITIVE_TRIFAN } from '../platform/graphics/constants.js';
import { SEMANTIC_POSITION } from '../platform/graphics/constants.js';
import { SEMANTIC_NORMAL } from '../platform/graphics/constants.js';
import { SEMANTIC_COLOR } from '../platform/graphics/constants.js';
import { SEMANTIC_TEXCOORD } from '../platform/graphics/constants.js';
import { SEMANTIC_TEXCOORD0 } from '../platform/graphics/constants.js';
import { SEMANTIC_TEXCOORD1 } from '../platform/graphics/constants.js';
import { SEMANTIC_ATTR0 } from '../platform/graphics/constants.js';
import { SEMANTIC_ATTR1 } from '../platform/graphics/constants.js';
import { SEMANTIC_ATTR2 } from '../platform/graphics/constants.js';
import { SEMANTIC_ATTR3 } from '../platform/graphics/constants.js';
import { TEXTURELOCK_READ } from '../platform/graphics/constants.js';
import { TEXTURELOCK_WRITE } from '../platform/graphics/constants.js';
import { drawQuadWithShader } from '../scene/graphics/quad-render-utils.js';
import { shaderChunks } from '../scene/shader-lib/chunks/chunks.js';
import { GraphicsDevice } from '../platform/graphics/graphics-device.js';
import { IndexBuffer } from '../platform/graphics/index-buffer.js';
import { ProgramLibrary } from '../scene/shader-lib/program-library.js';
import { RenderTarget } from '../platform/graphics/render-target.js';
import { ScopeId } from '../platform/graphics/scope-id.js';
import { Shader } from '../platform/graphics/shader.js';
import { WebglShaderInput } from '../platform/graphics/webgl/webgl-shader-input.js';
import { Texture } from '../platform/graphics/texture.js';
import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
import { VertexFormat } from '../platform/graphics/vertex-format.js';
import { VertexIterator } from '../platform/graphics/vertex-iterator.js';
import { PostEffect } from '../scene/graphics/post-effect.js';
import { PostEffectQueue } from '../framework/components/camera/post-effect-queue.js';
import { StandardMaterial } from '../scene/materials/standard-material.js';
import { LitShaderOptions } from '../scene/shader-lib/programs/lit-shader-options.js';
import { calculateTangents } from '../scene/geometry/geometry-utils.js';
import { BasicMaterial } from '../scene/materials/basic-material.js';
import { ForwardRenderer } from '../scene/renderer/forward-renderer.js';
import { GraphNode } from '../scene/graph-node.js';
import { Material } from '../scene/materials/material.js';
import { MeshInstance } from '../scene/mesh-instance.js';
import { Model } from '../scene/model.js';
import { ParticleEmitter } from '../scene/particle-system/particle-emitter.js';
import { Picker } from '../framework/graphics/picker.js';
import { PROJECTION_ORTHOGRAPHIC } from '../scene/constants.js';
import { PROJECTION_PERSPECTIVE } from '../scene/constants.js';
import { Scene } from '../scene/scene.js';
import { Skin } from '../scene/skin.js';
import { SkinInstance } from '../scene/skin-instance.js';
import { Animation } from '../scene/animation/animation.js';
import { Key } from '../scene/animation/animation.js';
import { Node } from '../scene/animation/animation.js';
import { Skeleton } from '../scene/animation/skeleton.js';
import { SoundManager } from '../platform/sound/manager.js';
import { Channel } from '../platform/audio/channel.js';
import { Channel3d } from '../platform/audio/channel3d.js';
import { Listener } from '../platform/sound/listener.js';
import { Sound } from '../platform/sound/sound.js';
import { getTouchTargetCoords } from '../platform/input/touch-event.js';
import { Controller } from '../platform/input/controller.js';
import { GamePads } from '../platform/input/game-pads.js';
import { Keyboard } from '../platform/input/keyboard.js';
import { KeyboardEvent } from '../platform/input/keyboard-event.js';
import { Mouse } from '../platform/input/mouse.js';
import { MouseEvent } from '../platform/input/mouse-event.js';
import { Touch } from '../platform/input/touch-event.js';
import { TouchDevice } from '../platform/input/touch-device.js';
import { TouchEvent } from '../platform/input/touch-event.js';
export {};