API

Markdown API reference generated from TypeDoc.

Core

Interface IViewerConfig optional pixelRatio?: number

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

Function downloadTexture downloadTexture(url): Promise<Texture2D>

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

Function createViewer createViewer(name, container, config): Viewer

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

Function setViewerConfig setViewerConfig(ctx, config): void

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

Interface Viewer name: string

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.

Interface Viewport readonly name: string

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

Class BufferAttribute new BufferAttribute<T>(array, itemSize): 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. 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.

Class InstancedBufferAttribute new InstancedBufferAttribute<T>(data, itemSize, meshPerAttribute?): InstancedBufferAttribute<T>

An instanced version of BufferAttribute.

Class BufferGeometry new BufferGeometry<T>(): BufferGeometry<T>

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

Class FatLineBufferGeometry new FatLineBufferGeometry(geometry): FatLineBufferGeometry

This is a dedicated geometry for FatLineSegments| FatLineSegments.

Class InstancedBufferGeometry new InstancedBufferGeometry(): InstancedBufferGeometry

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

Interface Material isDynamicShape: boolean

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).

Class FatLineMaterial new FatLineMaterial(p?): FatLineMaterial

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

Class LineMaterial new LineMaterial(p?): LineBasicMaterial

Give linear object a specific color.

Class MeshBasicMaterial new MeshBasicMaterial(p?): MeshBasicMaterial

A material for drawing geometries in a simple shaded way. This material is not affected by lights.

Class MeshPhongMaterial new MeshPhongMaterial(p?): MeshPhongMaterial

This material can apply illumination on model surface, which makes model looks shiny and specular. Performance will generally be greater when using this material over the PBRMaterial| PBRMaterial, at the cost of some graphical accuracy.

Class PointsMaterial new PointsMaterial(p?): PointsMaterial

This material is specified used to change performance of Points

Class SpriteMaterial new SpriteMaterial(p?): SpriteMaterial

A dedicated material of Sprite| Sprite.

Enumeration FilterTarget All: 0

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

Enumeration ToneMapping Linear: 0

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

Class SourceTexture new SourceTexture(dimension, viewDimension, format, width, height, depthOrArrayLayers, mipmaps, autoGenerateMipmap): SourceTexture

SourceTexture is texture which contains cpu data.

Enumeration TextureDimension D2: 0

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

Enumeration TextureViewDimension D2: 0

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

Enumeration TextureFormat R8Snorm: "r8snorm"

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

Class Object3D new 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.

Class Scene3D new 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.

Class Camera3D new 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.

Class OrthographicCamera new OrthographicCamera(left?, right?, top?, bottom?, near?, far?): 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.

Class PerspectiveCamera new PerspectiveCamera(fov?, aspect?, near?, far?): 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.

Enumeration DrawableRenderMode Default: 0

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

Class FatLineSegments new FatLineSegments(geometry, material): FatLineSegments

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

Class InstanceMesh new InstanceMesh(meshes): 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.

Class Line new Line<M>(geometry?, material?): 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.

Class LineSegments new LineSegments<M>(geometry?, material?): 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.

Class Mesh new Mesh<M, G>(geometry?, material?): 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.

Class Points new Points<M>(geometry?, material?): 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.

Class Sprite new Sprite(material): Sprite

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

Class AmbientLight new AmbientLight(color?, intensity?): 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.

Class DirectionalLight new DirectionalLight(color?, intensity?): DirectionalLight

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

Interface Light id: number

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

Class PointLight new PointLight(color?, intensity?, distance?, decay?, isIESEnabled?, textureIES?, iesIntensityScale?, iesTextureResolution?): PointLight

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.

Class SpotLight new SpotLight(color?, intensity?, distance?, angle?, penumbra?, decay?, isIESEnabled?, textureIES?, iesIntensityScale?, iesTextureResolution?): SpotLight

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.

Enumeration BackgroundMode BasicBackground: "basic"

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

Class CompressedSplat new CompressedSplat(counts, shDegree, splat1Tex, splat2Tex, sh1Tex?, sh2Tex?, sh3Tex?, sh4Tex?): CompressedSplat

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.

Class SogSplat new SogSplat(meta, meansL, meansU, quats, scales, colors, _shNLabels?, _shNCentroids?): SogSplat

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.

Enumeration SplatState Deleted: 1

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

Class Splat new Splat(counts, shDegree): Splat

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.

Class SuperCompressedSplat new SuperCompressedSplat(counts, shDegree, splatTex, sh1Tex?, sh2Tex?): SuperCompressedSplat

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.

Class Layers new 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 Object3D.layers| layers property which is an instance of this class.

Interface Intersection object: Object3D

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

Class Raycaster new Raycaster(origin?, direction?, near?, far?): 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.

Class TypeAssert new 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.

Enumeration Side FrontSide: 0

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

Enumeration Blending NoBlending: 0

Specified the color blending mode for transparent effect.

Enumeration DepthModes NeverDepth: 0

The depth test function.

Enumeration DrawMode Points: 0

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

Enumeration SamplerWrap Repeat: 10497

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

Enumeration SamplerFilter Nearest: 9728

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

Enumeration BlendingEquation Add: 32774

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

Enumeration BlendingFactor Zero: 0

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.

Enumeration StencilOp ZeroStencilOp: 0

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

Enumeration StencilFunc NeverStencilFunc: 512

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.

Animation

Loaders

DracoLoader · Interface ParseConfig enableParseMesh: boolean

DracoLoader.ParseConfig exported from @manycore/aholo-viewer.

DracoLoader · Function parseDracoBuffer parseDracoBuffer(buffer, config?): Promise<IDracoGeometry>

DracoLoader.parseDracoBuffer exported from @manycore/aholo-viewer.

GLTFLoader · Interface LoaderConfig textureLoader: (url) => Promise<Texture>

GLTFLoader.LoaderConfig exported from @manycore/aholo-viewer.

GLTFLoader · Interface ParseResult source: GLTF

GLTFLoader.ParseResult exported from @manycore/aholo-viewer.

GLTFLoader · Function loadGLTF loadGLTF(data, config): Promise<ParseResult>

GLTFLoader.loadGLTF exported from @manycore/aholo-viewer.

SplatLoader · Class KsplatFile new KsplatFile(): KsplatFile

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

SplatLoader · Class LccFile new LccFile(): LccFile

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

SplatLoader · Class PlyFile new PlyFile(): PlyFile

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

SplatLoader · Class SogFile new SogFile(): SogFile

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

SplatLoader · Class SplatFile new SplatFile(): SplatFile

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

SplatLoader · Class SpzFile new SpzFile(): SpzFile

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

SplatLoader · Interface IFile read(stream, contentLength, data): Promise<void>

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

SplatLoader · Function parseSplatData parseSplatData(type, input, packType?, extras?): Promise<SplatData>

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

SplatLoader · Class CompressedSplatData new CompressedSplatData(maxShDegree?, maxTextureSize?, blockCounts?): CompressedSplatData

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

SplatLoader · Class RawSplatData new RawSplatData(maxShDegree?, maxTextureSize?, blockCounts?): RawSplatData

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

SplatLoader · Class SogSplatData new SogSplatData(maxShDegree?, maxTextureSize?, blockCounts?): SogSplatData

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

SplatLoader · Class SplatData new SplatData(maxShDegree?, maxTextureSize?, blockCounts?): SplatData

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

SplatLoader · Class SuperCompressedSplatData new SuperCompressedSplatData(maxShDegree?, maxTextureSize?, blockCounts?): SuperCompressedSplatData

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

SplatLoader · Enumeration ISamplerFormat RG_INT: 0

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

SplatLoader · Interface ISampler width: number

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

SplatLoader · Interface ISingleSplat x: number

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

SplatLoader · Enumeration SplatFileType PLY: 0

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

SplatLoader · Enumeration SplatPackType Raw: 0

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

SplatLoader · Function detectSplatFileType detectSplatFileType(filename, buffer): SplatFileType | undefined

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

Events

Math

Class Box3 new Box3(min?, max?): Box3

A 3D box represents by min and max.

Class Color new Color(color_or_r?, g?, b?): Color

Class representing a color.

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

Math.ReadonlyColor exported from @manycore/aholo-viewer.

Class Euler new Euler(x?, y?, z?, order?): Euler

Math.Euler exported from @manycore/aholo-viewer.

Class Frustum new Frustum(p0?, p1?, p2?, p3?, p4?, p5?): Frustum

Math.Frustum exported from @manycore/aholo-viewer.

Class Matrix3 new Matrix3(): Matrix3

A class representing a 3x3 matrix|).

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

Math.ReadonlyMatrix3 exported from @manycore/aholo-viewer.

Class Matrix4 new Matrix4(): Matrix4

Math.Matrix4 exported from @manycore/aholo-viewer.

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

Math.ReadonlyMatrix4 exported from @manycore/aholo-viewer.

Class Plane new Plane(normal?, constant?): 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.

Class Quaternion new Quaternion(x?, y?, z?, w?): Quaternion

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

Class Ray new Ray(origin?, direction?): Ray

A ray that emits from an origin in a certain direction. This is used by the Raycaster| 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.

Class Sphere new Sphere(center?, radius?): 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.

Class Vector2 new Vector2(_x?, _y?): Vector2

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

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

Math.ReadonlyVector2 exported from @manycore/aholo-viewer.

Class Vector3 new Vector3(_x?, _y?, _z?): Vector3

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

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

Math.ReadonlyVector3 exported from @manycore/aholo-viewer.

Class Vector4 new Vector4(_x?, _y?, _z?, _w?): Vector4

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

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

Math.ReadonlyVector4 exported from @manycore/aholo-viewer.

Utils

SplatUtils · Enumeration IntersectContainment Outside: 0

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

SplatUtils · Class SplatBVH new SplatBVH(operator, maxLeafSize?): SplatBVH

splat model space bvh

SplatUtils · Function createSplatModifyData createSplatModifyData(splat): ISplatModifyData

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

SplatUtils · Function createSplat createSplat(data): Promise<Splat>

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

SplatUtils · Function createSplatData createSplatData(splat): SplatData

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

SplatUtils · Function combineSplatData combineSplatData(source): SplatData

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

SplatUtils · Function transformSplatFile transformSplatFile(source, outType): ReadableStream<Uint8Array<ArrayBufferLike>>

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

SplatUtils · Class SplatOperator new SplatOperator(splat, data): SplatOperator

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

SplatUtils · Interface LodMeta magicCode: 2500660

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

SplatUtils · Interface LodConfig minLevel: number

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

SplatUtils · Class LodSplat new LodSplat(meta, config?, viewerCtx?, loadResource?): LodSplat

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

SplatUtils · Function computeDenseBox computeDenseBox(operator, ratio?): object

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