Module THREE

Index

Variables

Enumerations

Interfaces

Classes

Variables

AddEquation: BlendingEquation

AddOperation: Combine

AdditiveBlending: Blending

AlphaFormat: PixelFormat

AnimationHandler: { CATMULLROM: THREE.AnimationInterpolation; CATMULLROM_FORWARD: THREE.AnimationInterpolation; LINEAR: THREE.AnimationInterpolation; remove(name: string): void; removeFromUpdate(animation: THREE.Animation): void; get(name: string): THREE.AnimationData; update(deltaTimeMS: number): void; parse(root: THREE.Mesh): THREE.Object3D[]; add(data: THREE.AnimationData): void; addToUpdate(animation: THREE.Animation): void; }

public AnimationHandler.CATMULLROM: AnimationInterpolation

public AnimationHandler.CATMULLROM_FORWARD: AnimationInterpolation

public AnimationHandler.LINEAR: AnimationInterpolation

public add()

.data.data: AnimationData

public addToUpdate()

.animation.animation: Animation

public get(): AnimationData

Returns

AnimationData

.name.name: string

public parse(): Object3D[]

Returns

Object3D[]

.root.root: Mesh

public remove()

.name.name: string

public removeFromUpdate()

.animation.animation: Animation

public update()

.deltaTimeMS.deltaTimeMS: number

BackSide: Side

BasicShadowMap: ShadowMapType

ByteType: TextureDataType

ClampToEdgeWrapping: Wrapping

CubeReflectionMapping: MappingConstructor

CubeRefractionMapping: MappingConstructor

CullFaceBack: CullFace

CullFaceFront: CullFace

CullFaceFrontBack: CullFace

CullFaceNone: CullFace

CustomBlending: Blending

DoubleSide: Side

DstAlphaFactor: BlendingDstFactor

DstColorFactor: BlendingSrcFactor

FaceColors: Colors

FlatShading: Shading

FloatType: TextureDataType

FontUtils: { divisions: number; style: string; weight: string; face: string; faces: { [weight: string]: { [style: string]: THREE.Face3; }; }; size: number; drawText(text: string): { paths: THREE.Path[]; offset: number; }; Triangulate: { area(contour: THREE.Vector2[]): number; (contour: THREE.Vector2[], indices: boolean): THREE.Vector2[]; }; extractGlyphPoints(c: string, face: THREE.Face3, scale: number, offset: number, path: THREE.Path): { offset: number; path: THREE.Path; }; generateShapes(text: string, parameters?: { size?: number; curveSegments?: number; font?: string; weight?: string; style?: string; }): THREE.Shape[]; loadFace(data: THREE.TypefaceData): THREE.TypefaceData; getFace(): THREE.Face3; }

(): Vector2[]

Returns

Vector2[]

(): { [style: string]: THREE.Face3; }

Returns

{ [style: string]: THREE.Face3; }

public FontUtils.Triangulate: { area(contour: THREE.Vector2[]): number; (contour: THREE.Vector2[], indices: boolean): THREE.Vector2[]; }

public FontUtils.divisions: number

public FontUtils.face: string

public FontUtils.faces: { [weight: string]: { [style: string]: THREE.Face3; }; }

public FontUtils.size: number

public FontUtils.style: string

public FontUtils.weight: string

public drawText(): { paths: THREE.Path[]; offset: number; }

Returns

{ paths: THREE.Path[]; offset: number; }

.text.text: string

public extractGlyphPoints(): { offset: number; path: THREE.Path; }

Returns

{ offset: number; path: THREE.Path; }

.c.c: string

.face.face: Face3

.offset.offset: number

.path.path: Path

.scale.scale: number

public generateShapes(): Shape[]

Returns

Shape[]

optional .parameters.parameters?: { size?: number; curveSegments?: number; font?: string; weight?: string; style?: string; }

.text.text: string

optional public parameters.curveSegments?: number

optional public parameters.font?: string

optional public parameters.size?: number

optional public parameters.style?: string

optional public parameters.weight?: string

public getFace(): Face3

Returns

Face3

public loadFace(): TypefaceData

Returns

TypefaceData

.data.data: TypefaceData

public area(): number

Returns

number

.contour.contour: Vector2[]

FrontFaceDirectionCCW: FrontFaceDirection

FrontFaceDirectionCW: FrontFaceDirection

FrontSide: Side

GeometryUtils: { merge(geometry1: THREE.Geometry, object2: THREE.Mesh, materialIndexOffset?: number): void; merge(geometry1: THREE.Geometry, object2: THREE.Geometry, materialIndexOffset?: number): void; randomPointInTriangle(vectorA: THREE.Vector3, vectorB: THREE.Vector3, vectorC: THREE.Vector3): THREE.Vector3; randomPointInFace(face: THREE.Face3, geometry: THREE.Geometry, useCachedAreas: boolean): THREE.Vector3; randomPointsInGeometry(geometry: THREE.Geometry, points: number): THREE.Vector3; triangleArea(vectorA: THREE.Vector3, vectorB: THREE.Vector3, vectorC: THREE.Vector3): number; center(geometry: THREE.Geometry): THREE.Vector3; }

public center(): Vector3

Returns

Vector3

.geometry.geometry: Geometry

public merge()

.geometry1.geometry1: Geometry

optional .materialIndexOffset.materialIndexOffset?: number

.object2.object2: Mesh

public merge()

.geometry1.geometry1: Geometry

optional .materialIndexOffset.materialIndexOffset?: number

.object2.object2: Geometry

public randomPointInFace(): Vector3

Returns

Vector3

.face.face: Face3

.geometry.geometry: Geometry

.useCachedAreas.useCachedAreas: boolean

public randomPointInTriangle(): Vector3

Returns

Vector3

.vectorA.vectorA: Vector3

.vectorB.vectorB: Vector3

.vectorC.vectorC: Vector3

public randomPointsInGeometry(): Vector3

Returns

Vector3

.geometry.geometry: Geometry

.points.points: number

public triangleArea(): number

Returns

number

.vectorA.vectorA: Vector3

.vectorB.vectorB: Vector3

.vectorC.vectorC: Vector3

ImageUtils: { crossOrigin: string; generateDataTexture(width: number, height: number, color: THREE.Color): THREE.DataTexture; parseDDS(buffer: ArrayBuffer, loadMipmaps: boolean): { mipmaps: { data: Uint8Array; width: number; height: number; }[]; width: number; height: number; format: number; mipmapCount: number; }; loadCompressedTexture(url: string, mapping?: THREE.Mapping, onLoad?: (texture: THREE.Texture) => void, onError?: (message: string) => void): THREE.Texture; loadTexture(url: string, mapping?: THREE.Mapping, onLoad?: (texture: THREE.Texture) => void, onError?: (message: string) => void): THREE.Texture; getNormalMap(image: HTMLImageElement, depth?: number): HTMLCanvasElement; loadCompressedTextureCube(array: string[], mapping?: THREE.Mapping, onLoad?: () => void, onError?: (message: string) => void): THREE.Texture; loadTextureCube(array: string[], mapping?: THREE.Mapping, onLoad?: () => void, onError?: (message: string) => void): THREE.Texture; }

public ImageUtils.crossOrigin: string

public generateDataTexture(): DataTexture

Returns

DataTexture

.color.color: Color

.height.height: number

.width.width: number

public getNormalMap(): HTMLCanvasElement

Returns

HTMLCanvasElement

optional .depth.depth?: number

.image.image: HTMLImageElement

public loadCompressedTexture(): Texture

Returns

Texture

optional .mapping.mapping?: Mapping

optional .onError.onError?: (message: string) => void

optional .onLoad.onLoad?: (texture: THREE.Texture) => void

.url.url: string

public loadCompressedTextureCube(): Texture

Returns

Texture

.array.array: Array<string>

optional .mapping.mapping?: Mapping

optional .onError.onError?: (message: string) => void

optional .onLoad.onLoad?: () => void

public loadTexture(): Texture

Returns

Texture

optional .mapping.mapping?: Mapping

optional .onError.onError?: (message: string) => void

optional .onLoad.onLoad?: (texture: THREE.Texture) => void

.url.url: string

public loadTextureCube(): Texture

Returns

Texture

.array.array: Array<string>

optional .mapping.mapping?: Mapping

optional .onError.onError?: (message: string) => void

optional .onLoad.onLoad?: () => void

public parseDDS(): { mipmaps: { data: Uint8Array; width: number; height: number; }[]; width: number; height: number; format: number; mipmapCount: number; }

Returns

{ mipmaps: { data: Uint8Array; width: number; height: number; }[]; width: number; height: number; format: number; mipmapCount: number; }

.buffer.buffer: ArrayBuffer

.loadMipmaps.loadMipmaps: boolean

IntType: TextureDataType

LinePieces: LineType

LineStrip: LineType

LinearFilter: TextureFilter

LinearMipMapLinearFilter: TextureFilter

LinearMipMapNearestFilter: TextureFilter

LuminanceAlphaFormat: PixelFormat

LuminanceFormat: PixelFormat

Math: Math

see

src/math/Math.js

public clamp(x: number, a: number, b: number): number

Clamps the x to be between a and b.

Parameters

  • x: number

    Value to be clamped.

  • a: number

    Minimum value

  • b: number

    Maximum value.

Returns

number

public clampBottom(x: number, a: number): number

Clamps the x to be larger than a.

Parameters

  • x: number

    — Value to be clamped.

  • a: number

    — Minimum value

Returns

number

public degToRad(degrees: number): number

Parameters

  • degrees: number

Returns

number

public mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number

Linear mapping of x from range [a1, a2] to range [b1, b2].

Parameters

  • x: number

    Value to be mapped.

  • a1: number

    Minimum value for range A.

  • a2: number

    Maximum value for range A.

  • b1: number

    Minimum value for range B.

  • b2: number

    Maximum value for range B.

Returns

number

public radToDeg(radians: number): number

Parameters

  • radians: number

Returns

number

public randFloat(low: number, high: number): number

Random float from low to high interval.

Parameters

  • low: number
  • high: number

Returns

number

public randFloatSpread(range: number): number

Random float from - range / 2 to range / 2 interval.

Parameters

  • range: number

Returns

number

public randInt(low: number, high: number): number

Random integer from low to high interval.

Parameters

  • low: number
  • high: number

Returns

number

public random16(): number

Random float from 0 to 1 with 16 bits of randomness. Standard Math.random() creates repetitive patterns when applied over larger space.

Returns

number

public sign(x: number): number

Returns -1 if x is less than 0, 1 if x is greater than 0, and 0 if x is zero.

Parameters

  • x: number

Returns

number

public smootherstep(x: number, min: number, max: number): number

Parameters

  • x: number
  • min: number
  • max: number

Returns

number

public smoothstep(x: number, min: number, max: number): number

Parameters

  • x: number
  • min: number
  • max: number

Returns

number

MirroredRepeatWrapping: Wrapping

MixOperation: Combine

MultiplyBlending: Blending

MultiplyOperation: Combine

NearestFilter: TextureFilter

NearestMipMapLinearFilter: TextureFilter

NearestMipMapNearestFilter: TextureFilter

NoBlending: Blending

NoColors: Colors

NoShading: Shading

NormalBlending: Blending

OneFactor: BlendingDstFactor

OneMinusDstAlphaFactor: BlendingDstFactor

OneMinusDstColorFactor: BlendingSrcFactor

OneMinusSrcAlphaFactor: BlendingDstFactor

OneMinusSrcColorFactor: BlendingDstFactor

PCFShadowMap: ShadowMapType

PCFSoftShadowMap: ShadowMapType

REVISION: string

RGBAFormat: PixelFormat

RGBA_S3TC_DXT1_Format: CompressedPixelFormat

RGBA_S3TC_DXT3_Format: CompressedPixelFormat

RGBA_S3TC_DXT5_Format: CompressedPixelFormat

RGBFormat: PixelFormat

RGB_S3TC_DXT1_Format: CompressedPixelFormat

RepeatWrapping: Wrapping

ReverseSubtractEquation: BlendingEquation

SceneUtils: { createMultiMaterialObject(geometry: THREE.Geometry, materials: THREE.Material[]): THREE.Object3D; attach(child: THREE.Object3D, scene: THREE.Scene, parent: THREE.Object3D): void; detach(child: THREE.Object3D, parent: THREE.Object3D, scene: THREE.Scene): void; }

public attach()

.child.child: Object3D

.parent.parent: Object3D

.scene.scene: Scene

public createMultiMaterialObject(): Object3D

Returns

Object3D

.geometry.geometry: Geometry

.materials.materials: Material[]

public detach()

.child.child: Object3D

.parent.parent: Object3D

.scene.scene: Scene

ShaderChunk: ShaderChunk

(name: string): string

Parameters

  • name: string

Returns

string

public alphatest_fragment: string

public bumpmap_pars_fragment: string

public color_fragment: string

public color_pars_fragment: string

public color_pars_vertex: string

public color_vertex: string

public default_vertex: string

public defaultnormal_vertex: string

public envmap_fragment: string

public envmap_pars_fragment: string

public envmap_pars_vertex: string

public envmap_vertex: string

public fog_fragment: string

public fog_pars_fragment: string

public lightmap_fragment: string

public lightmap_pars_fragment: string

public lightmap_pars_vertex: string

public lightmap_vertex: string

public lights_lambert_pars_vertex: string

public lights_lambert_vertex: string

public lights_phong_fragment: string

public lights_phong_pars_fragment: string

public lights_phong_pars_vertex: string

public lights_phong_vertex: string

public linear_to_gamma_fragment: string

public map_fragment: string

public map_pars_fragment: string

public map_pars_vertex: string

public map_particle_fragment: string

public map_particle_pars_fragment: string

public map_vertex: string

public morphnormal_vertex: string

public morphtarget_pars_vertex: string

public morphtarget_vertex: string

public normalmap_pars_fragment: string

public shadowmap_fragment: string

public shadowmap_pars_fragment: string

public shadowmap_pars_vertex: string

public shadowmap_vertex: string

public skinbase_vertex: string

public skinning_pars_vertex: string

public skinning_vertex: string

public skinnormal_vertex: string

public specularmap_fragment: string

public specularmap_pars_fragment: string

public worldpos_vertex: string

ShaderFlares: { 'lensFlareVertexTexture': { vertexShader: string; fragmentShader: string; }; 'lensFlare': { vertexShader: string; fragmentShader: string; }; }

public ShaderFlares.lensFlare: { vertexShader: string; fragmentShader: string; }

public ShaderFlares.lensFlareVertexTexture: { vertexShader: string; fragmentShader: string; }

public lensFlare.fragmentShader: string

public lensFlare.vertexShader: string

public lensFlareVertexTexture.fragmentShader: string

public lensFlareVertexTexture.vertexShader: string

ShaderLib: { basic: THREE.Shader; lambert: THREE.Shader; phong: THREE.Shader; particle_basic: THREE.Shader; depth: THREE.Shader; dashed: THREE.Shader; normal: THREE.Shader; normalmap: THREE.Shader; cube: THREE.Shader; depthRGBA: THREE.Shader; [name: string]: THREE.Shader; }

(): Shader

Returns

Shader

public ShaderLib.basic: Shader

public ShaderLib.cube: Shader

public ShaderLib.dashed: Shader

public ShaderLib.depth: Shader

public ShaderLib.depthRGBA: Shader

public ShaderLib.lambert: Shader

public ShaderLib.normal: Shader

public ShaderLib.normalmap: Shader

public ShaderLib.particle_basic: Shader

public ShaderLib.phong: Shader

ShortType: TextureDataType

SmoothShading: Shading

SphericalReflectionMapping: MappingConstructor

SphericalRefractionMapping: MappingConstructor

SrcAlphaFactor: BlendingDstFactor

SrcAlphaSaturateFactor: BlendingSrcFactor

SrcColorFactor: BlendingDstFactor

SubtractEquation: BlendingEquation

SubtractiveBlending: Blending

UVMapping: MappingConstructor

UniformsLib: { common: any; bump: any; normalmap: any; fog: any; lights: any; particle: any; shadowmap: any; }

public UniformsLib.bump: any

public UniformsLib.common: any

public UniformsLib.fog: any

public UniformsLib.lights: any

public UniformsLib.normalmap: any

public UniformsLib.particle: any

public UniformsLib.shadowmap: any

UniformsUtils: { merge(uniforms: any[]): any; clone(uniforms_src: any): any; }

public clone(): any

Returns

any

.uniforms_src.uniforms_src: any

public merge(): any

Returns

any

.uniforms.uniforms: Array<any>

UnsignedByteType: TextureDataType

UnsignedIntType: TextureDataType

UnsignedShort4444Type: PixelType

UnsignedShort5551Type: PixelType

UnsignedShort565Type: PixelType

UnsignedShortType: TextureDataType

VertexColors: Colors

ZeroFactor: BlendingDstFactor