API
Markdown API reference generated from TypeDoc.
Core
optional pixelRatio?: number Core.IViewerConfig exported from @manycore/aholo-viewer.
Function downloadTexturedownloadTexture(url): Promise<Texture2D> Core.downloadTexture exported from @manycore/aholo-viewer.
Function createViewercreateViewer(name, container, config): Viewer Core.createViewer exported from @manycore/aholo-viewer.
Function setViewerConfigsetViewerConfig(ctx, config): void Core.setViewerConfig exported from @manycore/aholo-viewer.
Interface Viewername: 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 Viewportreadonly name: string Core.Viewport exported from @manycore/aholo-viewer.
Class BufferAttributenew 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 InstancedBufferAttributenew InstancedBufferAttribute<T>(data, itemSize, meshPerAttribute?): InstancedBufferAttribute<T> An instanced version of BufferAttribute.
Class BufferGeometrynew BufferGeometry<T>(): BufferGeometry<T> Core.BufferGeometry exported from @manycore/aholo-viewer.
Class FatLineBufferGeometrynew FatLineBufferGeometry(geometry): FatLineBufferGeometry This is a dedicated geometry for FatLineSegments| FatLineSegments.
Class InstancedBufferGeometrynew InstancedBufferGeometry(): InstancedBufferGeometry Core.InstancedBufferGeometry exported from @manycore/aholo-viewer.
Interface MaterialisDynamicShape: 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 FatLineMaterialnew FatLineMaterial(p?): FatLineMaterial This material is specifically used to draw line or dash-line which has width more than 1 pixel.
Class LineMaterialnew LineMaterial(p?): LineBasicMaterial Give linear object a specific color.
Class MeshBasicMaterialnew MeshBasicMaterial(p?): MeshBasicMaterial A material for drawing geometries in a simple shaded way. This material is not affected by lights.
Class MeshPhongMaterialnew 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 PointsMaterialnew PointsMaterial(p?): PointsMaterial This material is specified used to change performance of Points
Class SpriteMaterialnew SpriteMaterial(p?): SpriteMaterial A dedicated material of Sprite| Sprite.
Enumeration FilterTargetAll: 0 Core.FilterTarget exported from @manycore/aholo-viewer.
Enumeration ToneMappingLinear: 0 Core.ToneMapping exported from @manycore/aholo-viewer.
Class SourceTexturenew SourceTexture(dimension, viewDimension, format, width, height, depthOrArrayLayers, mipmaps, autoGenerateMipmap): SourceTexture SourceTexture is texture which contains cpu data.
Enumeration TextureDimensionD2: 0 Core.TextureDimension exported from @manycore/aholo-viewer.
Enumeration TextureViewDimensionD2: 0 Core.TextureViewDimension exported from @manycore/aholo-viewer.
Enumeration TextureFormatR8Snorm: "r8snorm" Core.TextureFormat exported from @manycore/aholo-viewer.
Class Object3Dnew 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 Scene3Dnew 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 Camera3Dnew 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 OrthographicCameranew 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 PerspectiveCameranew 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 DrawableRenderModeDefault: 0 Core.DrawableRenderMode exported from @manycore/aholo-viewer.
Class FatLineSegmentsnew FatLineSegments(geometry, material): FatLineSegments This class is used to draw lines which has same width between each vertexes of Geometry on the surfaces.
Class InstanceMeshnew 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 Linenew 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 LineSegmentsnew 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 Meshnew 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 Pointsnew 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 Spritenew Sprite(material): Sprite A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
Class AmbientLightnew 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 DirectionalLightnew 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 Lightid: number This class is base class of all types of light source. Every lights have two basic attributes which are color and intensity.
Class PointLightnew 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 SpotLightnew 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 BackgroundModeBasicBackground: "basic" Core.BackgroundMode exported from @manycore/aholo-viewer.
Class CompressedSplatnew 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 SogSplatnew 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 SplatStateDeleted: 1 Core.SplatState exported from @manycore/aholo-viewer.
Class Splatnew 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 SuperCompressedSplatnew 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 Layersnew 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 Intersectionobject: Object3D The attributes of this Intersection used to record the result of calculation.
Class Raycasternew 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 TypeAssertnew 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 SideFrontSide: 0 Specified the showing side of objects, which the fround side is normal vector's direction.
Enumeration BlendingNoBlending: 0 Specified the color blending mode for transparent effect.
Enumeration DepthModesNeverDepth: 0 The depth test function.
Enumeration DrawModePoints: 0 This is used to decide how the vertex array is drawing.
Enumeration SamplerWrapRepeat: 10497 These define the texture's wrapS and wrapT properties, which define horizontal and vertical texture wrapping.
Enumeration SamplerFilterNearest: 9728 With MirroredRepeatWrapping the texture will repeats to infinity, mirroring on each repeat.
Enumeration BlendingEquationAdd: 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 BlendingFactorZero: 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 StencilOpZeroStencilOp: 0 The stencilOp method of the WebGL API sets both the front and back-facing stencil test actions.
Enumeration StencilFuncNeverStencilFunc: 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
const AnimationFinishEvent: EventType<{ action: AnimationAction; }> Animation.AnimationFinishEvent exported from @manycore/aholo-viewer.
Class AnimationActionnew AnimationAction(root, clip, ctx, mixer): AnimationAction An instance schedules the playback of an animation stored in AnimationClip
Class AnimationMixernew AnimationMixer(root, useCache?): AnimationMixer The class is a player for animations on a particular object called root
Variable SkeletonUpdatedEventconst SkeletonUpdatedEvent: EventType<never> Animation.SkeletonUpdatedEvent exported from @manycore/aholo-viewer.
Class AnimationPluginnew AnimationPlugin(): AnimationPlugin A special viewer plugin responsible for animation and skeleton updating.
Class Skeletonnew Skeleton(bones, boneInverses): Skeleton A special class used by SkinnedMesh containing an array of bones.
Enumeration LoopOnce: 2200 Animation.Loop exported from @manycore/aholo-viewer.
Enumeration InterpolationModeDiscrete: 2300 Animation.InterpolationMode exported from @manycore/aholo-viewer.
Interface KeyframeTrackpath: string Animation.KeyframeTrack exported from @manycore/aholo-viewer.
Enumeration BlendNormal: 2500 Animation.Blend exported from @manycore/aholo-viewer.
Interface AnimationClipname: string Animation.AnimationClip exported from @manycore/aholo-viewer.
Loaders
enableParseMesh: boolean DracoLoader.ParseConfig exported from @manycore/aholo-viewer.
DracoLoader · Function parseDracoBufferparseDracoBuffer(buffer, config?): Promise<IDracoGeometry> DracoLoader.parseDracoBuffer exported from @manycore/aholo-viewer.
GLTFLoader · Interface LoaderConfigtextureLoader: (url) => Promise<Texture> GLTFLoader.LoaderConfig exported from @manycore/aholo-viewer.
GLTFLoader · Interface ParseResultsource: GLTF GLTFLoader.ParseResult exported from @manycore/aholo-viewer.
GLTFLoader · Function loadGLTFloadGLTF(data, config): Promise<ParseResult> GLTFLoader.loadGLTF exported from @manycore/aholo-viewer.
SplatLoader · Class KsplatFilenew KsplatFile(): KsplatFile SplatLoader.KsplatFile exported from @manycore/aholo-viewer.
SplatLoader · Class LccFilenew LccFile(): LccFile SplatLoader.LccFile exported from @manycore/aholo-viewer.
SplatLoader · Class PlyFilenew PlyFile(): PlyFile SplatLoader.PlyFile exported from @manycore/aholo-viewer.
SplatLoader · Class SogFilenew SogFile(): SogFile SplatLoader.SogFile exported from @manycore/aholo-viewer.
SplatLoader · Class SplatFilenew SplatFile(): SplatFile SplatLoader.SplatFile exported from @manycore/aholo-viewer.
SplatLoader · Class SpzFilenew SpzFile(): SpzFile SplatLoader.SpzFile exported from @manycore/aholo-viewer.
SplatLoader · Interface IFileread(stream, contentLength, data): Promise<void> SplatLoader.IFile exported from @manycore/aholo-viewer.
SplatLoader · Function parseSplatDataparseSplatData(type, input, packType?, extras?): Promise<SplatData> SplatLoader.parseSplatData exported from @manycore/aholo-viewer.
SplatLoader · Class CompressedSplatDatanew CompressedSplatData(maxShDegree?, maxTextureSize?, blockCounts?): CompressedSplatData SplatLoader.CompressedSplatData exported from @manycore/aholo-viewer.
SplatLoader · Class RawSplatDatanew RawSplatData(maxShDegree?, maxTextureSize?, blockCounts?): RawSplatData SplatLoader.RawSplatData exported from @manycore/aholo-viewer.
SplatLoader · Class SogSplatDatanew SogSplatData(maxShDegree?, maxTextureSize?, blockCounts?): SogSplatData SplatLoader.SogSplatData exported from @manycore/aholo-viewer.
SplatLoader · Class SplatDatanew SplatData(maxShDegree?, maxTextureSize?, blockCounts?): SplatData SplatLoader.SplatData exported from @manycore/aholo-viewer.
SplatLoader · Class SuperCompressedSplatDatanew SuperCompressedSplatData(maxShDegree?, maxTextureSize?, blockCounts?): SuperCompressedSplatData SplatLoader.SuperCompressedSplatData exported from @manycore/aholo-viewer.
SplatLoader · Enumeration ISamplerFormatRG_INT: 0 SplatLoader.ISamplerFormat exported from @manycore/aholo-viewer.
SplatLoader · Interface ISamplerwidth: number SplatLoader.ISampler exported from @manycore/aholo-viewer.
SplatLoader · Interface ISingleSplatx: number SplatLoader.ISingleSplat exported from @manycore/aholo-viewer.
SplatLoader · Enumeration SplatFileTypePLY: 0 SplatLoader.SplatFileType exported from @manycore/aholo-viewer.
SplatLoader · Enumeration SplatPackTypeRaw: 0 SplatLoader.SplatPackType exported from @manycore/aholo-viewer.
SplatLoader · Function detectSplatFileTypedetectSplatFileType(filename, buffer): SplatFileType | undefined SplatLoader.detectSplatFileType exported from @manycore/aholo-viewer.
Events
const SplatRenderingStabilityChangedEvent: EventType<boolean> Events.SplatRenderingStabilityChangedEvent exported from @manycore/aholo-viewer.
Variable SplatSortedEventconst SplatSortedEvent: EventType<never> Events.SplatSortedEvent exported from @manycore/aholo-viewer.
Math
new Box3(min?, max?): Box3 A 3D box represents by min and max.
Class Colornew Color(color_or_r?, g?, b?): Color Class representing a color.
Type Alias ReadonlyColorReadonlyColor = PickReadonly<Color, "g" | "r" | "b" | "isColor" | "equals" | "getHex" | "getSerializeData"> Math.ReadonlyColor exported from @manycore/aholo-viewer.
Class Eulernew Euler(x?, y?, z?, order?): Euler Math.Euler exported from @manycore/aholo-viewer.
Class Frustumnew Frustum(p0?, p1?, p2?, p3?, p4?, p5?): Frustum Math.Frustum exported from @manycore/aholo-viewer.
Class Matrix3new Matrix3(): Matrix3 A class representing a 3x3 matrix|).
Type Alias ReadonlyMatrix3ReadonlyMatrix3 = PickReadonly<Matrix3, "elements" | "equals" | "getSerializeData" | "applyToBufferAttribute" | "determinant" | "transposeIntoArray" | "applyToArray" | "applyInverse" | "getNumberCount" | "toArray" | "decompose"> Math.ReadonlyMatrix3 exported from @manycore/aholo-viewer.
Class Matrix4new Matrix4(): Matrix4 Math.Matrix4 exported from @manycore/aholo-viewer.
Type Alias ReadonlyMatrix4ReadonlyMatrix4 = PickReadonly<Matrix4, "elements" | "equals" | "getSerializeData" | "applyToBufferAttribute" | "determinant" | "extractBasis" | "applyToArray" | "getPosition" | "getMaxScaleOnAxis" | "decompose" | "decompose2D" | "getNumberCount" | "toArray"> Math.ReadonlyMatrix4 exported from @manycore/aholo-viewer.
Class Planenew 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 Quaternionnew Quaternion(x?, y?, z?, w?): Quaternion Implementation of a quaternion. Quaternions are used to represent rotations.
Class Raynew 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 Spherenew 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 Vector2new Vector2(_x?, _y?): Vector2 Class representing a 2D vector. A 2D vector is an ordered pair of numbers (labeled x and y).
Type Alias ReadonlyVector2ReadonlyVector2 = 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 Vector3new 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 ReadonlyVector3ReadonlyVector3 = 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 Vector4new 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 ReadonlyVector4ReadonlyVector4 = PickReadonly<Vector4, "x" | "y" | "z" | "w" | "getSerializeData" | "dot" | "lengthSq" | "length" | "manhattanLength" | "getNumberCount" | "equals" | "toArray"> Math.ReadonlyVector4 exported from @manycore/aholo-viewer.
Utils
Outside: 0 SplatUtils.IntersectContainment exported from @manycore/aholo-viewer.
SplatUtils · Class SplatBVHnew SplatBVH(operator, maxLeafSize?): SplatBVH splat model space bvh
SplatUtils · Function createSplatModifyDatacreateSplatModifyData(splat): ISplatModifyData SplatUtils.createSplatModifyData exported from @manycore/aholo-viewer.
SplatUtils · Function createSplatcreateSplat(data): Promise<Splat> SplatUtils.createSplat exported from @manycore/aholo-viewer.
SplatUtils · Function createSplatDatacreateSplatData(splat): SplatData SplatUtils.createSplatData exported from @manycore/aholo-viewer.
SplatUtils · Function combineSplatDatacombineSplatData(source): SplatData SplatUtils.combineSplatData exported from @manycore/aholo-viewer.
SplatUtils · Function transformSplatFiletransformSplatFile(source, outType): ReadableStream<Uint8Array<ArrayBufferLike>> SplatUtils.transformSplatFile exported from @manycore/aholo-viewer.
SplatUtils · Class SplatOperatornew SplatOperator(splat, data): SplatOperator SplatUtils.SplatOperator exported from @manycore/aholo-viewer.
SplatUtils · Interface LodMetamagicCode: 2500660 SplatUtils.LodMeta exported from @manycore/aholo-viewer.
SplatUtils · Interface LodConfigminLevel: number SplatUtils.LodConfig exported from @manycore/aholo-viewer.
SplatUtils · Class LodSplatnew LodSplat(meta, config?, viewerCtx?, loadResource?): LodSplat SplatUtils.LodSplat exported from @manycore/aholo-viewer.
SplatUtils · Function computeDenseBoxcomputeDenseBox(operator, ratio?): object SplatUtils.computeDenseBox exported from @manycore/aholo-viewer.