CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
3D scene management, camera controls, rendering primitives, and visual effects for creating interactive 3D applications.
import { Scene, Camera, Globe, Primitive, Model, PointCloud, Billboard, Label } from "cesium";Core scene management and rendering controls.
/**
* The main 3D scene containing all rendered objects
*/
class Scene {
constructor(options?: SceneOptions);
readonly canvas: HTMLCanvasElement;
readonly drawingBufferWidth: number;
readonly drawingBufferHeight: number;
readonly camera: Camera;
readonly primitives: PrimitiveCollection;
readonly groundPrimitives: PrimitiveCollection;
readonly globe: Globe;
readonly skyBox: SkyBox;
readonly skyAtmosphere: SkyAtmosphere;
readonly sun: Sun;
readonly moon: Moon;
readonly backgroundColor: Color;
readonly fog: Fog;
readonly shadowMap: ShadowMap;
readonly postProcessStages: PostProcessStageCollection;
mode: SceneMode;
morphTime: number;
farToNearRatio: number;
logarithmicDepthBuffer: boolean;
gamma: number;
highDynamicRange: boolean;
cameraEventWaitTime: number;
render(time?: JulianDate): void;
requestRender(): void;
pick(windowPosition: Cartesian2, width?: number, height?: number): object;
pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
drillPick(windowPosition: Cartesian2, limit?: number): object[];
cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
completeMorph(): void;
morphTo2D(duration?: number): void;
morphTo3D(duration?: number): void;
morphToColumbusView(duration?: number): void;
isDestroyed(): boolean;
destroy(): void;
}
interface SceneOptions {
canvas: HTMLCanvasElement;
contextOptions?: WebGLContextAttributes;
creditContainer?: Element;
creditViewport?: Element;
ellipsoid?: Ellipsoid;
terrainProvider?: TerrainProvider;
skyBox?: SkyBox;
skyAtmosphere?: SkyAtmosphere;
sceneMode?: SceneMode;
mapProjection?: MapProjection;
globe?: Globe;
orderIndependentTranslucency?: boolean;
shadows?: boolean;
terrainShadows?: ShadowMode;
mapMode2D?: MapMode2D;
requestRenderMode?: boolean;
maximumRenderTimeChange?: number;
}Camera positioning, movement, and view transformations.
/**
* 3D camera for controlling the view of the scene
*/
class Camera {
position: Cartesian3;
direction: Cartesian3;
up: Cartesian3;
right: Cartesian3;
transform: Matrix4;
inverse: Matrix4;
viewMatrix: Matrix4;
inverseViewMatrix: Matrix4;
projectionMatrix: Matrix4;
infiniteProjectionMatrix: Matrix4;
frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
defaultMoveAmount: number;
defaultLookAmount: number;
defaultRotateAmount: number;
defaultZoomAmount: number;
constrainedAxis?: Cartesian3;
maximumZoomFactor: number;
setView(options: CameraSetViewOptions): void;
worldToCameraCoordinates(cartesian: Cartesian3, result?: Cartesian4): Cartesian4;
worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
move(direction: Cartesian3, amount?: number): void;
moveForward(amount?: number): void;
moveBackward(amount?: number): void;
moveUp(amount?: number): void;
moveDown(amount?: number): void;
moveRight(amount?: number): void;
moveLeft(amount?: number): void;
lookLeft(amount?: number): void;
lookRight(amount?: number): void;
lookUp(amount?: number): void;
lookDown(amount?: number): void;
look(axis: Cartesian3, angle?: number): void;
twistLeft(amount?: number): void;
twistRight(amount?: number): void;
rotate(axis: Cartesian3, angle?: number): void;
rotateDown(angle?: number): void;
rotateUp(angle?: number): void;
rotateRight(angle?: number): void;
rotateLeft(angle?: number): void;
zoomIn(amount?: number): void;
zoomOut(amount?: number): void;
getMagnitude(): number;
lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
getPickRay(windowPosition: Cartesian2, result?: Ray): Ray;
flyTo(options: CameraFlightOptions): void;
flyHome(duration?: number): void;
computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
cancelFlight(): void;
setRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): void;
getRectangleFromEvent(startPosition: Cartesian2, endPosition: Cartesian2, result?: Rectangle): Rectangle;
}
interface CameraSetViewOptions {
destination?: Cartesian3 | Rectangle;
orientation?: CameraOrientation;
endTransform?: Matrix4;
convert?: boolean;
}
interface CameraOrientation {
heading?: number;
pitch?: number;
roll?: number;
direction?: Cartesian3;
up?: Cartesian3;
}
interface CameraFlightOptions {
destination: Cartesian3 | Rectangle;
orientation?: CameraOrientation;
duration?: number;
complete?: () => void;
cancel?: () => void;
endTransform?: Matrix4;
maximumHeight?: number;
pitchAdjustHeight?: number;
flyOverLongitude?: number;
flyOverLongitudeWeight?: number;
convert?: boolean;
easingFunction?: EasingFunction;
}Low-level rendering primitives for custom graphics.
/**
* A renderable primitive containing geometry and appearance
*/
class Primitive {
constructor(options?: PrimitiveOptions);
geometryInstances?: GeometryInstance | GeometryInstance[];
appearance?: Appearance;
modelMatrix: Matrix4;
show: boolean;
vertexCacheOptimize: boolean;
interleave: boolean;
compressVertices: boolean;
releaseGeometryInstances: boolean;
allowPicking: boolean;
cull: boolean;
asynchronous: boolean;
debugShowBoundingVolume: boolean;
shadows: ShadowMode;
readonly ready: boolean;
readonly readyPromise: Promise<Primitive>;
update(frameState: FrameState): void;
getGeometryInstanceAttributes(id: any): any;
isDestroyed(): boolean;
destroy(): void;
}
interface PrimitiveOptions {
geometryInstances?: GeometryInstance | GeometryInstance[];
appearance?: Appearance;
show?: boolean;
modelMatrix?: Matrix4;
vertexCacheOptimize?: boolean;
interleave?: boolean;
compressVertices?: boolean;
releaseGeometryInstances?: boolean;
allowPicking?: boolean;
cull?: boolean;
asynchronous?: boolean;
debugShowBoundingVolume?: boolean;
shadows?: ShadowMode;
}
/**
* Collection of primitives for rendering
*/
class PrimitiveCollection {
readonly length: number;
show: boolean;
destroyPrimitives: boolean;
add(primitive: any): any;
remove(primitive?: any): boolean;
removeAll(): void;
contains(primitive?: any): boolean;
raise(primitive?: any): void;
raiseToTop(primitive?: any): void;
lower(primitive?: any): void;
lowerToBottom(primitive?: any): void;
get(index: number): any;
isDestroyed(): boolean;
destroy(): void;
}
/**
* A primitive clamped to the ground
*/
class GroundPrimitive {
constructor(options?: GroundPrimitiveOptions);
geometryInstances?: GeometryInstance | GeometryInstance[];
show: boolean;
interleave: boolean;
vertexCacheOptimize: boolean;
compressVertices: boolean;
releaseGeometryInstances: boolean;
allowPicking: boolean;
asynchronous: boolean;
classificationType: ClassificationType;
debugShowBoundingVolume: boolean;
debugShowShadowVolume: boolean;
readonly ready: boolean;
readonly readyPromise: Promise<GroundPrimitive>;
update(frameState: FrameState): void;
getGeometryInstanceAttributes(id: any): any;
isDestroyed(): boolean;
destroy(): void;
}
interface GroundPrimitiveOptions {
geometryInstances?: GeometryInstance | GeometryInstance[];
show?: boolean;
interleave?: boolean;
vertexCacheOptimize?: boolean;
compressVertices?: boolean;
releaseGeometryInstances?: boolean;
allowPicking?: boolean;
asynchronous?: boolean;
classificationType?: ClassificationType;
debugShowBoundingVolume?: boolean;
debugShowShadowVolume?: boolean;
}Earth globe representation and terrain rendering.
/**
* The rendered globe including terrain and imagery
*/
class Globe {
constructor(ellipsoid?: Ellipsoid);
readonly ellipsoid: Ellipsoid;
readonly imageryLayers: ImageryLayerCollection;
terrainProvider: TerrainProvider;
tileLoadProgressEvent: Event;
material?: Material;
depthTestAgainstTerrain: boolean;
preloadAncestors: boolean;
preloadSiblings: boolean;
enableLighting: boolean;
dynamicAtmosphereLighting: boolean;
dynamicAtmosphereLightingFromSun: boolean;
showGroundAtmosphere: boolean;
lightingFadeOutDistance: number;
lightingFadeInDistance: number;
nightFadeOutDistance: number;
nightFadeInDistance: number;
show: boolean;
maximumScreenSpaceError: number;
tileCacheSize: number;
loadingDescendantLimit: number;
backFaceCulling: boolean;
showWaterEffect: boolean;
showSkirts: boolean;
shadows: ShadowMode;
atmosphereLightIntensity: number;
atmosphereRayleighCoefficient: Cartesian3;
atmosphereMieCoefficient: Cartesian3;
atmosphereRayleighScaleHeight: number;
atmosphereMieScaleHeight: number;
atmosphereMieAnisotropy: number;
pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3;
getHeight(cartographic: Cartographic): number;
isDestroyed(): boolean;
destroy(): void;
}High-performance collections for rendering 2D graphics in 3D space.
/**
* Collection of billboards for efficient rendering
*/
class BillboardCollection {
constructor(options?: BillboardCollectionOptions);
readonly length: number;
modelMatrix: Matrix4;
debugShowBoundingVolume: boolean;
blendOption: BlendOption;
show: boolean;
add(billboard?: BillboardOptions): Billboard;
remove(billboard: Billboard): boolean;
removeAll(): void;
contains(billboard?: Billboard): boolean;
get(index: number): Billboard;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
}
/**
* A billboard - a 2D image positioned in 3D space
*/
class Billboard {
show: boolean;
position: Cartesian3;
pixelOffset: Cartesian2;
scaleByDistance?: NearFarScalar;
translucencyByDistance?: NearFarScalar;
pixelOffsetScaleByDistance?: NearFarScalar;
eyeOffset: Cartesian3;
horizontalOrigin: HorizontalOrigin;
verticalOrigin: VerticalOrigin;
scale: number;
color: Color;
rotation: number;
alignedAxis: Cartesian3;
width?: number;
height?: number;
id?: any;
image: string;
ready: boolean;
computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
equals(other: Billboard): boolean;
setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string): void;
setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
}
/**
* Collection of labels for efficient text rendering
*/
class LabelCollection {
constructor(options?: LabelCollectionOptions);
readonly length: number;
modelMatrix: Matrix4;
debugShowBoundingVolume: boolean;
blendOption: BlendOption;
show: boolean;
add(label?: LabelOptions): Label;
remove(label: Label): boolean;
removeAll(): void;
contains(label?: Label): boolean;
get(index: number): Label;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
}
/**
* A label - text positioned in 3D space
*/
class Label {
show: boolean;
position: Cartesian3;
text: string;
font: string;
fillColor: Color;
outlineColor: Color;
outlineWidth: number;
style: LabelStyle;
pixelOffset: Cartesian2;
eyeOffset: Cartesian3;
horizontalOrigin: HorizontalOrigin;
verticalOrigin: VerticalOrigin;
scale: number;
translucencyByDistance?: NearFarScalar;
pixelOffsetScaleByDistance?: NearFarScalar;
scaleByDistance?: NearFarScalar;
distanceDisplayCondition?: DistanceDisplayCondition;
disableDepthTestDistance?: number;
id?: any;
computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
equals(other: Label): boolean;
}Collections for rendering points and lines efficiently.
/**
* Collection of point primitives
*/
class PointPrimitiveCollection {
constructor(options?: PointPrimitiveCollectionOptions);
readonly length: number;
modelMatrix: Matrix4;
debugShowBoundingVolume: boolean;
blendOption: BlendOption;
show: boolean;
add(pointPrimitive?: PointPrimitiveOptions): PointPrimitive;
remove(pointPrimitive: PointPrimitive): boolean;
removeAll(): void;
contains(pointPrimitive?: PointPrimitive): boolean;
get(index: number): PointPrimitive;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
}
/**
* A point primitive - a colored point in 3D space
*/
class PointPrimitive {
show: boolean;
position: Cartesian3;
scaleByDistance?: NearFarScalar;
translucencyByDistance?: NearFarScalar;
color: Color;
outlineColor: Color;
outlineWidth: number;
pixelSize: number;
id?: any;
computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
equals(other: PointPrimitive): boolean;
}
/**
* Collection of polylines for efficient line rendering
*/
class PolylineCollection {
constructor(options?: PolylineCollectionOptions);
readonly length: number;
modelMatrix: Matrix4;
debugShowBoundingVolume: boolean;
show: boolean;
add(polyline?: PolylineOptions): Polyline;
remove(polyline: Polyline): boolean;
removeAll(): void;
contains(polyline?: Polyline): boolean;
get(index: number): Polyline;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
}
/**
* A polyline - a series of connected line segments
*/
class Polyline {
show: boolean;
positions: Cartesian3[];
material?: Material;
width: number;
loop: boolean;
clampToGround: boolean;
id?: any;
distanceDisplayCondition?: DistanceDisplayCondition;
update(): void;
}Atmospheric effects, fog, and post-processing.
/**
* Sky atmosphere rendering with scattering effects
*/
class SkyAtmosphere {
constructor(ellipsoid?: Ellipsoid);
show: boolean;
atmosphereFromSpace: boolean;
intensityFromSpace: number;
rayleighCoefficient: Cartesian3;
mieCoefficient: Cartesian3;
rayleighScaleHeight: number;
mieScaleHeight: number;
mieAnisotropy: number;
brightness: number;
isDestroyed(): boolean;
destroy(): void;
}
/**
* Atmospheric fog effects
*/
class Fog {
enabled: boolean;
density: number;
screenSpaceErrorFactor: number;
minimumBrightness: number;
}
/**
* Sun positioning and rendering
*/
class Sun {
show: boolean;
glowFactor: number;
}
/**
* Moon positioning and rendering
*/
class Moon {
show: boolean;
textureUrl: string;
onlySunLighting: boolean;
}
/**
* Sky box for background rendering
*/
class SkyBox {
constructor(options: SkyBoxOptions);
sources?: any;
show: boolean;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
}
interface SkyBoxOptions {
sources?: any;
show?: boolean;
}Visual appearance and material properties for rendering primitives.
/**
* Base appearance interface for primitive rendering
*/
interface Appearance {
readonly material?: Material;
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
closed: boolean;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
/**
* Material-based appearance for general-purpose rendering
*/
class MaterialAppearance {
constructor(options?: MaterialAppearanceOptions);
readonly material: Material;
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
closed: boolean;
flat: boolean;
faceForward: boolean;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
interface MaterialAppearanceOptions {
flat?: boolean;
faceForward?: boolean;
translucent?: boolean;
closed?: boolean;
material?: Material;
vertexShaderSource?: string;
fragmentShaderSource?: string;
renderState?: any;
}
/**
* Ellipsoid surface appearance for globe rendering
*/
class EllipsoidSurfaceAppearance {
constructor(options?: EllipsoidSurfaceAppearanceOptions);
readonly material: Material;
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
flat: boolean;
faceForward: boolean;
aboveGround: boolean;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
interface EllipsoidSurfaceAppearanceOptions {
flat?: boolean;
faceForward?: boolean;
translucent?: boolean;
aboveGround?: boolean;
material?: Material;
vertexShaderSource?: string;
fragmentShaderSource?: string;
renderState?: any;
}
/**
* Per-instance color appearance
*/
class PerInstanceColorAppearance {
constructor(options?: PerInstanceColorAppearanceOptions);
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
closed: boolean;
flat: boolean;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
interface PerInstanceColorAppearanceOptions {
flat?: boolean;
translucent?: boolean;
closed?: boolean;
vertexShaderSource?: string;
fragmentShaderSource?: string;
renderState?: any;
}
/**
* Polyline color appearance
*/
class PolylineColorAppearance {
constructor(options?: PolylineColorAppearanceOptions);
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
interface PolylineColorAppearanceOptions {
translucent?: boolean;
vertexShaderSource?: string;
fragmentShaderSource?: string;
renderState?: any;
}
/**
* Polyline material appearance
*/
class PolylineMaterialAppearance {
constructor(options?: PolylineMaterialAppearanceOptions);
readonly material: Material;
readonly translucent: boolean;
readonly vertexShaderSource: string;
readonly fragmentShaderSource: string;
readonly renderState: any;
getFragmentShaderSource(): string;
isTranslucent(): boolean;
getRenderState(): any;
}
interface PolylineMaterialAppearanceOptions {
material?: Material;
translucent?: boolean;
vertexShaderSource?: string;
fragmentShaderSource?: string;
renderState?: any;
}
/**
* Material for defining surface properties
*/
class Material {
constructor(options?: MaterialOptions);
readonly type: string;
readonly shaderSource: string;
readonly materials: { [name: string]: Material };
uniforms: { [name: string]: any };
static fromType(type: string, uniforms?: any): Material;
isTranslucent(): boolean;
update(context: Context): void;
destroy(): void;
}
interface MaterialOptions {
strict?: boolean;
translucent?: boolean | Function;
minificationFilter?: TextureMinificationFilter;
magnificationFilter?: TextureMagnificationFilter;
fabric?: any;
}3D model loading and rendering with animations.
/**
* 3D model renderer with support for glTF and animations
*/
class Model {
constructor(options?: ModelOptions);
readonly gltf?: any;
readonly basePath?: string;
readonly boundingSphere: BoundingSphere;
readonly ready: boolean;
readonly readyPromise: Promise<Model>;
readonly activeAnimations: ModelAnimationCollection;
show: boolean;
modelMatrix: Matrix4;
scale: number;
minimumPixelSize: number;
maximumScale?: number;
id?: any;
allowPicking: boolean;
incrementallyLoadTextures: boolean;
asynchronous: boolean;
clampAnimations: boolean;
shadows: ShadowMode;
debugShowBoundingVolume: boolean;
debugWireframe: boolean;
heightReference: HeightReference;
scene?: Scene;
distanceDisplayCondition?: DistanceDisplayCondition;
color?: Color;
colorBlendMode: ColorBlendMode;
colorBlendAmount: number;
silhouetteColor?: Color;
silhouetteSize: number;
clippingPlanes?: ClippingPlaneCollection;
dequantizeInShader: boolean;
imageBasedLightingFactor: Cartesian2;
lightColor?: Cartesian3;
luminanceAtZenith: number;
sphericalHarmonicCoefficients?: Cartesian3[];
specularEnvironmentMaps?: string;
credit?: Credit;
showCreditsOnScreen: boolean;
splitDirection: SplitDirection;
projectTo2D: boolean;
enablePick: boolean;
static fromGltf(options: ModelFromGltfOptions): Model;
static silhouetteSupported(scene: Scene): boolean;
update(frameState: FrameState): void;
isDestroyed(): boolean;
destroy(): void;
getMesh(name: string): ModelMesh;
getMaterial(name: string): ModelMaterial;
getNode(name: string): ModelNode;
setArticulationStage(articulationStageKey: string, value: number): void;
getArticulationStage(articulationStageKey: string): number;
}
interface ModelOptions {
gltf?: any;
basePath?: string;
show?: boolean;
modelMatrix?: Matrix4;
scale?: number;
minimumPixelSize?: number;
maximumScale?: number;
id?: any;
allowPicking?: boolean;
incrementallyLoadTextures?: boolean;
asynchronous?: boolean;
clampAnimations?: boolean;
shadows?: ShadowMode;
debugShowBoundingVolume?: boolean;
debugWireframe?: boolean;
heightReference?: HeightReference;
scene?: Scene;
distanceDisplayCondition?: DistanceDisplayCondition;
color?: Color;
colorBlendMode?: ColorBlendMode;
colorBlendAmount?: number;
silhouetteColor?: Color;
silhouetteSize?: number;
clippingPlanes?: ClippingPlaneCollection;
dequantizeInShader?: boolean;
imageBasedLightingFactor?: Cartesian2;
lightColor?: Cartesian3;
luminanceAtZenith?: number;
sphericalHarmonicCoefficients?: Cartesian3[];
specularEnvironmentMaps?: string;
credit?: Credit | string;
showCreditsOnScreen?: boolean;
splitDirection?: SplitDirection;
projectTo2D?: boolean;
enablePick?: boolean;
}
interface ModelFromGltfOptions extends ModelOptions {
url?: string;
headers?: any;
requestType?: RequestType;
}
/**
* Model animation collection
*/
class ModelAnimationCollection {
readonly length: number;
add(options: ModelAnimationOptions): ModelAnimation;
addAll(options?: ModelAnimationCollectionOptions): ModelAnimation[];
remove(animation: ModelAnimation): boolean;
removeAll(): void;
contains(animation: ModelAnimation): boolean;
get(index: number): ModelAnimation;
update(frameState: FrameState): void;
}
/**
* Individual model animation
*/
class ModelAnimation {
readonly name: string;
readonly startTime: JulianDate;
readonly delay: number;
readonly stopTime: JulianDate;
readonly removeOnStop: boolean;
multiplier: number;
reverse: boolean;
start(options?: ModelAnimationStartOptions): void;
stop(): void;
}
interface ModelAnimationOptions {
name?: string;
startTime?: JulianDate;
delay?: number;
stopTime?: JulianDate;
removeOnStop?: boolean;
multiplier?: number;
reverse?: boolean;
}
interface ModelAnimationCollectionOptions {
multiplier?: number;
reverse?: boolean;
loop?: ModelAnimationLoop;
}
interface ModelAnimationStartOptions {
speedup?: number;
slowdown?: number;
}
enum ModelAnimationLoop {
NONE = 0,
REPEAT = 1,
MIRRORED_REPEAT = 2
}
/**
* Model mesh component
*/
interface ModelMesh {
readonly name: string;
readonly id: number;
readonly materials: ModelMaterial[];
}
/**
* Model material component
*/
interface ModelMaterial {
readonly name: string;
readonly id: number;
}
/**
* Model node component
*/
interface ModelNode {
readonly name: string;
readonly id: number;
readonly show: boolean;
readonly matrix: Matrix4;
readonly originalMatrix: Matrix4;
setTransform(transform: Matrix4): void;
getTransform(): Matrix4;
}enum SceneMode {
MORPHING = 0,
COLUMBUS_VIEW = 1,
SCENE2D = 2,
SCENE3D = 3
}
enum ShadowMode {
DISABLED = 0,
ENABLED = 1,
CAST_ONLY = 2,
RECEIVE_ONLY = 3
}
enum BlendOption {
OPAQUE = 0,
TRANSLUCENT = 1,
OPAQUE_AND_TRANSLUCENT = 2
}
enum HorizontalOrigin {
CENTER = 0,
LEFT = 1,
RIGHT = 2
}
enum VerticalOrigin {
CENTER = 0,
BOTTOM = 1,
BASELINE = 2,
TOP = 3
}
enum LabelStyle {
FILL = 0,
OUTLINE = 1,
FILL_AND_OUTLINE = 2
}
enum ClassificationType {
TERRAIN = 0,
CESIUM_3D_TILE = 1,
BOTH = 2
}
interface NearFarScalar {
near: number;
nearValue: number;
far: number;
farValue: number;
}
interface DistanceDisplayCondition {
near: number;
far: number;
}
interface GeometryInstance {
geometry: Geometry;
modelMatrix?: Matrix4;
id?: any;
attributes?: any;
}
interface FrameState {
mode: SceneMode;
morphTime: number;
mapProjection: MapProjection;
frameNumber: number;
time: JulianDate;
camera: Camera;
cullingVolume: CullingVolume;
occluder?: Occluder;
maximumScreenSpaceError: number;
}
type EasingFunction = (time: number) => number;
enum ColorBlendMode {
HIGHLIGHT = 0,
REPLACE = 1,
MIX = 2
}
enum HeightReference {
NONE = 0,
CLAMP_TO_GROUND = 1,
RELATIVE_TO_GROUND = 2
}
enum RequestType {
TERRAIN = 0,
IMAGERY = 1,
TILES3D = 2,
OTHER = 3
}
interface Context {
readonly canvas: HTMLCanvasElement;
readonly shaderCache: ShaderCache;
readonly uniformState: UniformState;
}
interface ShaderCache {
numberOfShaders: number;
getShaderProgram(options: any): ShaderProgram;
}
interface UniformState {
update(frameState: FrameState): void;
}
interface ShaderProgram {
readonly fragmentShaderSource: string;
readonly vertexShaderSource: string;
readonly attributeLocations: { [name: string]: number };
readonly uniforms: { [name: string]: any };
isDestroyed(): boolean;
destroy(): void;
}
interface CullingVolume {
readonly planes: Cartesian4[];
computeVisibility(boundingVolume: any): Intersect;
}
interface Occluder {
readonly cameraPosition: Cartesian3;
readonly position: Cartesian3;
readonly radius: number;
isPointVisible(occludee: Cartesian3): boolean;
isBoundingSphereVisible(occludee: BoundingSphere): boolean;
computeVisibility(occludeeBS: BoundingSphere): Intersect;
}
interface ClippingPlaneCollection {
readonly length: number;
modelMatrix: Matrix4;
unionClippingRegions: boolean;
enabled: boolean;
edgeColor: Color;
edgeWidth: number;
add(plane: ClippingPlane): ClippingPlane;
get(index: number): ClippingPlane;
contains(plane: ClippingPlane): boolean;
remove(plane: ClippingPlane): boolean;
removeAll(): void;
}
interface ClippingPlane {
normal: Cartesian3;
distance: number;
}Install with Tessl CLI
npx tessl i tessl/npm-cesium