UNPKG

@awayjs/scene

Version:
157 lines 5.32 kB
import { AssetEvent } from '@awayjs/core'; import { ImageCube } from '@awayjs/stage'; import { PickingCollision, BoundingVolumeType, INode, IEntity, ContainerNode } from '@awayjs/view'; import { IAnimationSet, IMaterial, ITexture, Style, StyleEvent, IRenderContainer, ImageTextureCube } from '@awayjs/renderer'; import { DisplayObjectContainer } from './DisplayObjectContainer'; /** * A Skybox class is used to render a sky in the scene. It's always considered static and 'at infinity', and as * such it's always centered at the camera's position and sized to exactly fit within the camera's frustum, ensuring * the sky box is always as large as possible without being clipped. */ export declare class Skybox extends DisplayObjectContainer implements IMaterial { private _textures; static assetType: string; private _texture; private _animationSet; _blendMode: string; private _owners; private _onTextureInvalidateDelegate; animateUVs: boolean; bothSides: boolean; curves: boolean; imageRect: boolean; useColorTransform: boolean; alphaThreshold: number; alphaBlending: boolean; /** * */ get animationSet(): IAnimationSet; /** * The blend mode to use when drawing this renderable. The following blend modes are supported: * <ul> * <li>BlendMode.NORMAL: No blending, unless the material inherently needs it</li> * <li>BlendMode.LAYER: Force blending. * This will draw the object the same as NORMAL, but without writing depth writes.</li> * <li>BlendMode.MULTIPLY</li> * <li>BlendMode.ADD</li> * <li>BlendMode.ALPHA</li> * </ul> */ get blendMode(): string; set blendMode(value: string); /** * A list of the IRenderables that use this material * * @private */ get iOwners(): Array<IRenderContainer>; /** * The cube texture to use as the skybox. */ get texture(): ImageTextureCube; set texture(value: ImageTextureCube); getNumTextures(): number; getTextureAt(index: number): ITexture; /** * Create a new Skybox object. * * @param material The material with which to render the Skybox. */ constructor(image?: ImageCube, alpha?: number); constructor(color?: number, alpha?: number); getEntity(): IEntity; get assetType(): string; /** * Marks the shader programs for all passes as invalid, so they will be recompiled before the next use. * * @private */ invalidatePasses(): void; invalidateElements(): void; invalidateMaterial(): void; invalidateStyle(): void; addTexture(texture: ITexture): void; removeTexture(texture: ITexture): void; private onTextureInvalidate; _onInvalidateProperties(event: StyleEvent): void; _acceptTraverser(traverser: IEntityTraverser): void; iAddOwner(owner: IRenderContainer): void; /** * Removes an IEntity as owner. * @param owner * * @internal */ iRemoveOwner(owner: IRenderContainer): void; protected _getDefaultBoundingVolume(): BoundingVolumeType; testCollision(collision: PickingCollision, closestFlag: boolean): boolean; } import { _Render_RenderableBase, _Shader_TextureBase, ShaderBase, _Render_ElementsBase } from '@awayjs/renderer'; import { ShaderRegisterCache, ShaderRegisterData } from '@awayjs/stage'; import { _Render_MaterialPassBase } from '@awayjs/renderer'; import { _Stage_SkyboxElements } from '../elements/SkyboxElements'; /** * _Render_SkyboxMaterial forms an abstract base class for the default shaded materials provided by Stage, * using material methods to define their appearance. */ export declare class _Render_SkyboxMaterial extends _Render_MaterialPassBase { _skybox: Skybox; _texture: _Shader_TextureBase; init(skybox: Skybox, renderElements: _Render_ElementsBase): void; onClear(event: AssetEvent): void; /** * @inheritDoc */ _pUpdateRender(): void; _includeDependencies(shader: ShaderBase): void; /** * @inheritDoc */ _getFragmentCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; _setRenderState(renderable: _Render_RenderableBase): void; /** * @inheritDoc */ _activate(): void; } /** * @class away.pool._Render_Skybox */ export declare class _Render_Skybox extends _Render_RenderableBase { /** * */ private static _elements; /** * //TODO * * @returns {away.base.TriangleElements} * @private */ protected _getStageElements(): _Stage_SkyboxElements; protected _getRenderMaterial(): _Render_SkyboxMaterial; protected _getStyle(): Style; } import { Plane3D } from '@awayjs/core'; import { IEntityTraverser, PickGroup } from '@awayjs/view'; /** * SkyboxNode is a space partitioning leaf node that contains a Skybox object. * * @class away.partition.SkyboxNode */ export declare class SkyboxNode extends ContainerNode { /** * * @param planes * @param numPlanes * @returns {boolean} */ isInFrustum(rootEntity: INode, planes: Array<Plane3D>, numPlanes: number, pickGroup: PickGroup): boolean; /** * * @returns {boolean} */ isCastingShadow(): boolean; } //# sourceMappingURL=Skybox.d.ts.map