API

由 TypeDoc 生成的 API 参考。

Core

ClassAmbientLightnew AmbientLight(color?: string | number, intensity?: number): AmbientLight

This light's color gets applied to all the objects in the scene globally. The color of this light can influence object's natural color.

EnumerationBackgroundModeenum BackgroundMode

Background modes supported by the viewer.

EnumerationBlendingenum Blending

Specified the color blending mode for transparent effect.

EnumerationBlendingEquationenum BlendingEquation

The blendEquation method of the WebGL API is used to set both the RGB blend equation and alpha blend equation to a single equation.

EnumerationBlendingFactorenum BlendingFactor

The following constants can be used for sfactor and dfactor. The formula for the blending color can be described like this: color(RGBA) = (sourceColor * sfactor) + (destinationColor * dfactor). The RBGA values are between 0 and 1.

ClassBox3new Box3(min?: Vector3, max?: Vector3): Box3

A 3D box represents by min and max.

ClassBufferAttributenew BufferAttribute(array: T, itemSize: number): BufferAttribute<T>

This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes ) associated with a BufferGeometry , which allows for more efficient passing of data to the GPU. See that page for details and a usage example.<br /><br /> Data is stored as vectors of any length (defined by itemSize), and in general in the methods outlined below if passing in an index, this is automatically multiplied by the vector length.

ClassBufferGeometrynew BufferGeometry(): BufferGeometry<T>

GPU-friendly geometry container backed by buffer attributes.

ClassBVHnew BVH(source: BVHSource<TPrimitive>, maxLeafSize?: number): BVH<TPrimitive>

BVH over source-provided primitive bounds in model space.

InterfaceBVHNodeinterface BVHNode

Core.BVHNode exported from @manycore/aholo-viewer.

InterfaceBVHSourceinterface BVHSource

Core.BVHSource exported from @manycore/aholo-viewer.

ClassCamera3Dnew Camera3D(): Camera3D

Abstract base class for cameras. This class should always be inherited when you build a new camera, such as perspective and orthographic camera. The abstracted function need to respectively implement for different types of cameras.

ClassColornew Color(color_or_r?: string | number | Color, g?: number, b?: number): Color

Class representing a color.

ClassCompressedSplatnew CompressedSplat(counts: number, shDegree: number, splat1Tex: SourceTexture, splat2Tex: SourceTexture, sh1Tex?: SourceTexture, sh2Tex?: SourceTexture, sh3Tex?: SourceTexture, sh4Tex?: SourceTexture): CompressedSplat

Base scene object for Gaussian splat renderables.

FunctioncreateViewercreateViewer(name: string, container: HTMLElement, config: EngineInitializeConfig): Viewer

Core.createViewer exported from @manycore/aholo-viewer.

FunctioncreateViewerContextcreateViewerContext(viewer: Viewer, viewport?: Viewport): IViewerContext

Creates a viewer context for a viewer and viewport.

EnumerationDepthModesenum DepthModes

The depth test function.

ClassDirectionalLightnew DirectionalLight(color?: string | number, intensity?: number): DirectionalLight

This class is base class of all types of light source. Every lights have two basic attributes which are color and intensity.

FunctiondownloadTexturedownloadTexture(url: string | string[] | URL | URL[], options?: LoaderOptions): Promise<SourceTexture>

Core.downloadTexture exported from @manycore/aholo-viewer.

EnumerationDrawableRenderModeenum DrawableRenderMode

Render placement mode used by drawable scene objects.

EnumerationDrawModeenum DrawMode

This is used to decide how the vertex array is drawing.

ClassEulernew Euler(x?: number, y?: number, z?: number, order?: string): Euler

Euler-angle rotation represented by x, y, z radians and an order.

ClassFatLineBufferGeometrynew FatLineBufferGeometry(geometry: BufferGeometry<LineList>): FatLineBufferGeometry

This is a dedicated geometry for FatLineSegments .

ClassFatLineMaterialnew FatLineMaterial(p?: FatLineMaterialParameter): FatLineMaterial

This material is specifically used to draw line or dash-line which has width more than 1 pixel.

ClassFatLineSegmentsnew FatLineSegments(geometry: FatLineBufferGeometry, material: FatLineMaterial): FatLineSegments

This class is used to draw lines which has same width between each vertexes of Geometry on the surfaces. <br />

EnumerationFilterTargetenum FilterTarget

Target region selected by a filter material.

ClassFrustumnew Frustum(p0?: Plane, p1?: Plane, p2?: Plane, p3?: Plane, p4?: Plane, p5?: Plane): Frustum

Viewing frustum represented by six clipping planes.

InterfaceIBackgroundPluginConfiginterface IBackgroundPluginConfig

Core.IBackgroundPluginConfig exported from @manycore/aholo-viewer.

InterfaceIBasicBackgroundConfiginterface IBasicBackgroundConfig

Core.IBasicBackgroundConfig exported from @manycore/aholo-viewer.

InterfaceICompositePluginConfiginterface ICompositePluginConfig

Core.ICompositePluginConfig exported from @manycore/aholo-viewer.

InterfaceIEnvMapBackgroundConfiginterface IEnvMapBackgroundConfig

Core.IEnvMapBackgroundConfig exported from @manycore/aholo-viewer.

InterfaceIGradientBackgroundConfiginterface IGradientBackgroundConfig

Core.IGradientBackgroundConfig exported from @manycore/aholo-viewer.

ClassInstancedBufferAttributenew InstancedBufferAttribute(data: T, itemSize: number, meshPerAttribute?: number): InstancedBufferAttribute<T>

An instanced version of BufferAttribute .

ClassInstancedBufferGeometrynew InstancedBufferGeometry(): InstancedBufferGeometry

GPU-friendly geometry container backed by buffer attributes.

ClassInstanceMeshnew InstanceMesh(meshes: Mesh<Material, BufferGeometry<TriangleList>>[]): InstanceMesh

A special version of Mesh with instanced rendering supported. Use InstancedMesh if you have to render a large number of objects with the same geometry and material but with different world transformations. The usage of InstancedMesh will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.

EnumerationIntersectContainmentenum IntersectContainment

Core.IntersectContainment exported from @manycore/aholo-viewer.

InterfaceIntersectioninterface Intersection

The attributes of this Intersection used to record the result of calculation.

InterfaceIPipelineConfiginterface IPipelineConfig

Core.IPipelineConfig exported from @manycore/aholo-viewer.

InterfaceISkyBackgroundConfiginterface ISkyBackgroundConfig

Core.ISkyBackgroundConfig exported from @manycore/aholo-viewer.

InterfaceISplattingPluginConfiginterface ISplattingPluginConfig

Core.ISplattingPluginConfig exported from @manycore/aholo-viewer.

InterfaceITaaPluginConfiginterface ITaaPluginConfig

Core.ITaaPluginConfig exported from @manycore/aholo-viewer.

InterfaceIViewerConfiginterface IViewerConfig

Core.IViewerConfig exported from @manycore/aholo-viewer.

InterfaceIViewerContextinterface IViewerContext

Context object for viewport

ClassLayersnew Layers(): Layers

A Layers object assigns an Object3D to 1 or more of 32 layers numbered 0 to 31 - internally the layers are stored as a bit mask, and by default all Object3Ds are a member of layer 0. This can be used to control visibility - an object must share a layer with a camera to be visible when that camera's view is renderered. All classes that inherit from Object3D have an layers property which is an instance of this class.

InterfaceLightinterface Light

This class is base class of all types of light source. Every lights have two basic attributes which are color and intensity.

ClassLinenew Line(geometry?: BufferGeometry<LineStrip>, material?: M | M[]): Line<M>

This class is used to link points as one by one and draw a continuous line between them. It supports any type of geometry, but only line material is supported. The segment and loop line also need to extend this class.

ClassLineMaterialnew LineMaterial(p?: LineBasicMaterialParameters): LineMaterial

Give linear object a specific color.

ClassLineSegmentsnew LineSegments(geometry?: BufferGeometry<LineList>, material?: M | M[]): LineSegments<M>

This class is used to link points as pair and draw a segmented line between them. It supports any type of geometry, but only line material is supported.

InterfaceLoaderOptionsinterface LoaderOptions

Core.LoaderOptions exported from @manycore/aholo-viewer.

InterfaceMaterialinterface Material

A base class for all materials with some abstract functions. Materials describe the appearance of the objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer. The following properties and methods are inherited by all other material types (although they may have different defaults).

ClassMatrix3new Matrix3(): Matrix3

A class representing a 3x3 matrix.

ClassMatrix4new Matrix4(): Matrix4

4x4 matrix used for 3D transformations and projections.

ClassMeshnew Mesh(geometry?: G, material?: M | M[]): Mesh<M, G>

This class is used to connect every three points into a triangle and draws every meshes as corresponding material in the scene.

VariableMeshBasicMaterialconst MeshBasicMaterial: typeof MeshBasicMaterial_2

Core.MeshBasicMaterial exported from @manycore/aholo-viewer.

VariableMeshPhongMaterialconst MeshPhongMaterial: typeof MeshPhongMaterial_2

Core.MeshPhongMaterial exported from @manycore/aholo-viewer.

ClassObject3Dnew Object3D(): Object3D

This class is a base class of every objects which can be added into scene tree for the 3d rendering. As a basic class, it has implemented event listening and serialization for every objects of scene. Each object has position, rotation and scale attribute to represent the spatial transform in a 3D coordinate.

ClassOrthographicCameranew OrthographicCamera(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number): OrthographicCamera

The orthographic camera class, which has no "bigger when it's closer, small when it's far" effect. Size will not be affected by the distance.

ClassPerspectiveCameranew PerspectiveCamera(fov?: number, aspect?: number, near?: number, far?: number): PerspectiveCamera

Camera that uses perspective projection. This projection mode is designed to mimic the way the human eye sees. It is the most common projection mode used for rendering a 3D scene.

ClassPlanenew Plane(normal?: Vector3, constant?: number): Plane

A two dimensional surface that extends infinitely in 3d space, represented in Hessian normal form by a unit length normal vector and a constant.

ClassPointLightnew PointLight(color?: string | number, intensity?: number, distance?: number, decay?: number, isIESEnabled?: boolean, textureIES?: T, iesIntensityScale?: number, iesTextureResolution?: Vector2): PointLight<T>

A light that gets emitted from a single point in all directions. A common use case for this is to replicate the light emitted from a bare lightbulb.

ClassPointsnew Points(geometry?: BufferGeometry<PointList>, material?: M | M[]): Points<M>

This class is used to draw all vertexes of geometry as a series of independent points. It supports any type of geometry, but only PointsMaterial is supported.

ClassPointsMaterialnew PointsMaterial(p?: PointsMaterialParameters): PointsMaterial

This material is specified used to change performance of Points

ClassQuaternionnew Quaternion(x?: number, y?: number, z?: number, w?: number): Quaternion

Implementation of a quaternion. Quaternions are used to represent rotations.

ClassRaynew Ray(origin?: Vector3, direction?: Vector3): Ray

A ray that emits from an origin in a certain direction. This is used by the Raycaster to assist with ray casting. Raycaster is used for mouse picking (working out what objects in the 3D space the mouse is over) amongst other things.

ClassRaycasternew Raycaster(origin?: Vector3, direction?: Vector3, near?: number, far?: number): Raycaster

This class is designed to assist with raycasting. Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.

Type AliasReadonlyColortype ReadonlyColor = PickReadonly<Color, "g" | "r" | "b" | "isColor" | "equals" | "getHex">

Readonly view of the public Color API.

Type AliasReadonlyMatrix3type ReadonlyMatrix3 = PickReadonly<Matrix3, "elements" | "equals" | "applyToBufferAttribute" | "determinant" | "transposeIntoArray" | "applyToArray" | "applyInverse" | "getNumberCount" | "toArray" | "decompose">

Readonly view of the public Matrix3 API.

Type AliasReadonlyMatrix4type ReadonlyMatrix4 = PickReadonly<Matrix4, "elements" | "equals" | "applyToBufferAttribute" | "determinant" | "extractBasis" | "applyToArray" | "getPosition" | "getMaxScaleOnAxis" | "decompose" | "decompose2D" | "getNumberCount" | "toArray">

Readonly view of the public Matrix4 API.

Type AliasReadonlyVector2type ReadonlyVector2 = PickReadonly<Vector2, "x" | "y" | "width" | "height" | "isVector2" | "dot" | "cross" | "lengthSq" | "length" | "angle" | "manhattanLength" | "distanceTo" | "distanceToSquared" | "manhattanDistanceTo" | "getNumberCount" | "equals" | "toArray" | "intoSize">

Readonly view of the public Vector2 API.

Type AliasReadonlyVector3type ReadonlyVector3 = PickReadonly<Vector3, "x" | "y" | "z" | "dot" | "angleTo" | "lengthSq" | "length" | "distanceTo" | "manhattanLength" | "distanceToSquared" | "manhattanDistanceTo" | "getNumberCount" | "equals" | "toArray">

Readonly view of the public Vector3 API.

Type AliasReadonlyVector4type ReadonlyVector4 = PickReadonly<Vector4, "x" | "y" | "z" | "w" | "dot" | "lengthSq" | "length" | "manhattanLength" | "getNumberCount" | "equals" | "toArray">

Readonly view of the public Vector4 API.

EnumerationSamplerFilterenum SamplerFilter

With MirroredRepeatWrapping the texture will repeats to infinity, mirroring on each repeat.

EnumerationSamplerWrapenum SamplerWrap

These define the texture's wrapS and wrapT properties, which define horizontal and vertical texture wrapping.

ClassScene3Dnew Scene3D(): Scene3D

Scene3D is a root node of 3d scene graph, other kinds of 3D object need to be add as children into it. This class provides operating functions to control nodes in scene tree and record which nodes are changed in current frame. The effect and renderable content also can be managed here.

FunctionsetViewerConfigsetViewerConfig(ctx: Viewer | Viewport, config: IViewerConfig): void

Core.setViewerConfig exported from @manycore/aholo-viewer.

EnumerationSideenum Side

Specified the showing side of objects, which the fround side is normal vector's direction.

ClassSogSplatnew SogSplat(meta: SogSplatMeta, meansL: SourceTexture, meansU: SourceTexture, quats: SourceTexture, scales: SourceTexture, colors: SourceTexture, _shNLabels?: SourceTexture, _shNCentroids?: SourceTexture): SogSplat

Base scene object for Gaussian splat renderables.

ClassSourceTexturenew SourceTexture(dimension: TextureDimension, viewDimension: TextureViewDimension, format: TextureFormat, width: number, height: number, depthOrArrayLayers: number, mipmaps: boolean, autoGenerateMipmap: boolean): SourceTexture

SourceTexture is texture which contains cpu data.

ClassSpherenew Sphere(center?: Vector3, radius?: number): Sphere

A two dimensional surface that extends infinitely in 3d space, represented in Hessian normal form by a unit length normal vector and a constant.

ClassSplatnew Splat(counts: number, shDegree: number): Splat

Base scene object for Gaussian splat renderables.

EnumerationSplatStateenum SplatState

Bit flags that describe splat selection state.

ClassSpotLightnew SpotLight(color?: string | number, intensity?: number, distance?: number, angle?: number, penumbra?: number, decay?: number, isIESEnabled?: boolean, textureIES?: T, iesIntensityScale?: number, iesTextureResolution?: Vector2): SpotLight<T>

This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.

ClassSpritenew Sprite(material: SpriteMaterial_2<T>): Sprite<T>

A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.

VariableSpriteMaterialconst SpriteMaterial: typeof SpriteMaterial_2

Core.SpriteMaterial exported from @manycore/aholo-viewer.

EnumerationStencilFuncenum StencilFunc

The stencilFunc method of the WebGL API sets the front and back function and reference value for stencil testing. Stenciling enables and disables drawing on a per-pixel basis. It is typically used in multipass rendering to achieve special effects.

EnumerationStencilOpenum StencilOp

The stencilOp method of the WebGL API sets both the front and back-facing stencil test actions.

ClassSuperCompressedSplatnew SuperCompressedSplat(counts: number, shDegree: number, splatTex: SourceTexture, sh1Tex?: SourceTexture, sh2Tex?: SourceTexture): SuperCompressedSplat

Base scene object for Gaussian splat renderables.

EnumerationTextureDimensionenum TextureDimension

Dimensionality of texture storage.

EnumerationTextureFormatenum TextureFormat

Texture formats values same as GPUTextureFormat sorted by channels, channel type, [unorm, snorm, uint, sint, float]

EnumerationTextureViewDimensionenum TextureViewDimension

View shape used when sampling a texture.

EnumerationToneMappingenum ToneMapping

Tone mapping functions

ClassTypeAssertnew TypeAssert(): TypeAssert

All functions in this class is static and is used to recognize if an object belongs to certain class. Every value as return is boolean variable.

ClassVector2new Vector2(_x?: number, _y?: number): Vector2

Class representing a 2D vector. A 2D vector is an ordered pair of numbers (labeled x and y).

ClassVector3new Vector3(_x?: number, _y?: number, _z?: number): Vector3

Class representing a 3D vector. A 3D vector is an ordered triplet of numbers (labeled x, y, and z).

ClassVector4new Vector4(_x?: number, _y?: number, _z?: number, _w?: number): Vector4

Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers (labeled x, y, z, and w).

InterfaceViewerinterface Viewer

This class is used to set up the configuration and canvas for RenderEngine. It also contains instance of grid-like ground, background and Coordinate System.

InterfaceViewportinterface Viewport

Named rendering viewport managed by a viewer.

Events

Animation

SplatLoader

ClassCompressedSplatDatanew CompressedSplatData(maxShDegree?: number, maxTextureSize?: number, blockCounts?: number): CompressedSplatData

SplatLoader.CompressedSplatData exported from @manycore/aholo-viewer.

FunctiondetectSplatFileTypedetectSplatFileType(filename: string, buffer: Uint8Array): SplatFileType | undefined

SplatLoader.detectSplatFileType exported from @manycore/aholo-viewer.

InterfaceIFileinterface IFile

SplatLoader.IFile exported from @manycore/aholo-viewer.

InterfaceISamplerinterface ISampler

SplatLoader.ISampler exported from @manycore/aholo-viewer.

EnumerationISamplerFormatenum ISamplerFormat

SplatLoader.ISamplerFormat exported from @manycore/aholo-viewer.

InterfaceISingleSplatinterface ISingleSplat

SplatLoader.ISingleSplat exported from @manycore/aholo-viewer.

ClassKsplatFilenew KsplatFile(): KsplatFile

SplatLoader.KsplatFile exported from @manycore/aholo-viewer.

ClassLccFilenew LccFile(): LccFile

SplatLoader.LccFile exported from @manycore/aholo-viewer.

FunctionparseSplatDataparseSplatData(type: SplatFileType, input: string | Uint8Array<ArrayBufferLike> | File | { stream: ReadableStream<Uint8Array<ArrayBufferLike>>; contentLength: number }, packType?: SplatPackType, extras?: Partial<ParseExtras>): Promise<SplatData>

SplatLoader.parseSplatData exported from @manycore/aholo-viewer.

ClassPlyFilenew PlyFile(): PlyFile

SplatLoader.PlyFile exported from @manycore/aholo-viewer.

ClassRawSplatDatanew RawSplatData(maxShDegree?: number, maxTextureSize?: number, blockCounts?: number): RawSplatData

SplatLoader.RawSplatData exported from @manycore/aholo-viewer.

ClassSogFilenew SogFile(): SogFile

SplatLoader.SogFile exported from @manycore/aholo-viewer.

ClassSogSplatDatanew SogSplatData(maxShDegree?: number, maxTextureSize?: number, blockCounts?: number): SogSplatData

SplatLoader.SogSplatData exported from @manycore/aholo-viewer.

ClassSplatDatanew SplatData(maxShDegree?: number, maxTextureSize?: number, blockCounts?: number): SplatData

SplatLoader.SplatData exported from @manycore/aholo-viewer.

ClassSplatFilenew SplatFile(): SplatFile

SplatLoader.SplatFile exported from @manycore/aholo-viewer.

EnumerationSplatFileTypeenum SplatFileType

SplatLoader.SplatFileType exported from @manycore/aholo-viewer.

EnumerationSplatPackTypeenum SplatPackType

SplatLoader.SplatPackType exported from @manycore/aholo-viewer.

ClassSpzFilenew SpzFile(): SpzFile

SplatLoader.SpzFile exported from @manycore/aholo-viewer.

ClassSuperCompressedSplatDatanew SuperCompressedSplatData(maxShDegree?: number, maxTextureSize?: number, blockCounts?: number): SuperCompressedSplatData

SplatLoader.SuperCompressedSplatData exported from @manycore/aholo-viewer.

DracoLoader

GLTFLoader

SplatUtils

FunctioncombineSplatDatacombineSplatData(source: SplatData[], target?: SplatData): SplatData

SplatUtils.combineSplatData exported from @manycore/aholo-viewer.

FunctioncomputeDenseBoxcomputeDenseBox(operator: SplatOperator, ratio?: number): { boxMin: number[]; boxMax: number[] }

SplatUtils.computeDenseBox exported from @manycore/aholo-viewer.

FunctioncreateSplatcreateSplat(data: SplatData): Promise<Splat>

SplatUtils.createSplat exported from @manycore/aholo-viewer.

FunctioncreateSplatDatacreateSplatData(splat: Splat): SplatData

SplatUtils.createSplatData exported from @manycore/aholo-viewer.

FunctioncreateSplatModifyDatacreateSplatModifyData(splat: Splat): ISplatModifyData

SplatUtils.createSplatModifyData exported from @manycore/aholo-viewer.

InterfaceLodConfiginterface LodConfig

SplatUtils.LodConfig exported from @manycore/aholo-viewer.

InterfaceLodMetainterface LodMeta

SplatUtils.LodMeta exported from @manycore/aholo-viewer.

ClassLodSplatnew LodSplat(meta: LodMeta, config?: Partial<LodConfig>, viewerCtx?: IViewerContext, loadResource?: (url: string) => Promise<SplatData>): LodSplat

SplatUtils.LodSplat exported from @manycore/aholo-viewer.

InterfaceSplatCenterPrimitiveinterface SplatCenterPrimitive

SplatUtils.SplatCenterPrimitive exported from @manycore/aholo-viewer.

ClassSplatCenterPrimitiveSourcenew SplatCenterPrimitiveSource(operator: SplatOperator): SplatCenterPrimitiveSource

SplatUtils.SplatCenterPrimitiveSource exported from @manycore/aholo-viewer.

Type AliasSplatEllipsoidPrimitivetype SplatEllipsoidPrimitive = ISingleSplat

SplatUtils.SplatEllipsoidPrimitive exported from @manycore/aholo-viewer.

ClassSplatEllipsoidPrimitiveSourcenew SplatEllipsoidPrimitiveSource(operator: SplatOperator, radiusScale?: number): SplatEllipsoidPrimitiveSource

SplatUtils.SplatEllipsoidPrimitiveSource exported from @manycore/aholo-viewer.

ClassSplatOperatornew SplatOperator(splat: Splat, data: SplatData): SplatOperator

SplatUtils.SplatOperator exported from @manycore/aholo-viewer.

FunctiontransformSplatFiletransformSplatFile(source: SplatData, outType: SplatFileType): ReadableStream<Uint8Array<ArrayBufferLike>>

SplatUtils.transformSplatFile exported from @manycore/aholo-viewer.