declare module "cesium" {
/**
* Private interfaces to support PropertyBag being a dictionary-like object.
*/
interface DictionaryLike {
[index: string]: any;
}
/**
* Enum containing WebGL Constant values by name.
* for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
* (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
*
* These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
* and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
* specifications.
*/
export enum WebGLConstants {
DEPTH_BUFFER_BIT = 256,
STENCIL_BUFFER_BIT = 1024,
COLOR_BUFFER_BIT = 16384,
POINTS = 0,
LINES = 1,
LINE_LOOP = 2,
LINE_STRIP = 3,
TRIANGLES = 4,
TRIANGLE_STRIP = 5,
TRIANGLE_FAN = 6,
ZERO = 0,
ONE = 1,
SRC_COLOR = 768,
ONE_MINUS_SRC_COLOR = 769,
SRC_ALPHA = 770,
ONE_MINUS_SRC_ALPHA = 771,
DST_ALPHA = 772,
ONE_MINUS_DST_ALPHA = 773,
DST_COLOR = 774,
ONE_MINUS_DST_COLOR = 775,
SRC_ALPHA_SATURATE = 776,
FUNC_ADD = 32774,
BLEND_EQUATION = 32777,
BLEND_EQUATION_RGB = 32777,
BLEND_EQUATION_ALPHA = 34877,
FUNC_SUBTRACT = 32778,
FUNC_REVERSE_SUBTRACT = 32779,
BLEND_DST_RGB = 32968,
BLEND_SRC_RGB = 32969,
BLEND_DST_ALPHA = 32970,
BLEND_SRC_ALPHA = 32971,
CONSTANT_COLOR = 32769,
ONE_MINUS_CONSTANT_COLOR = 32770,
CONSTANT_ALPHA = 32771,
ONE_MINUS_CONSTANT_ALPHA = 32772,
BLEND_COLOR = 32773,
ARRAY_BUFFER = 34962,
ELEMENT_ARRAY_BUFFER = 34963,
ARRAY_BUFFER_BINDING = 34964,
ELEMENT_ARRAY_BUFFER_BINDING = 34965,
STREAM_DRAW = 35040,
STATIC_DRAW = 35044,
DYNAMIC_DRAW = 35048,
BUFFER_SIZE = 34660,
BUFFER_USAGE = 34661,
CURRENT_VERTEX_ATTRIB = 34342,
FRONT = 1028,
BACK = 1029,
FRONT_AND_BACK = 1032,
CULL_FACE = 2884,
BLEND = 3042,
DITHER = 3024,
STENCIL_TEST = 2960,
DEPTH_TEST = 2929,
SCISSOR_TEST = 3089,
POLYGON_OFFSET_FILL = 32823,
SAMPLE_ALPHA_TO_COVERAGE = 32926,
SAMPLE_COVERAGE = 32928,
NO_ERROR = 0,
INVALID_ENUM = 1280,
INVALID_VALUE = 1281,
INVALID_OPERATION = 1282,
OUT_OF_MEMORY = 1285,
CW = 2304,
CCW = 2305,
LINE_WIDTH = 2849,
ALIASED_POINT_SIZE_RANGE = 33901,
ALIASED_LINE_WIDTH_RANGE = 33902,
CULL_FACE_MODE = 2885,
FRONT_FACE = 2886,
DEPTH_RANGE = 2928,
DEPTH_WRITEMASK = 2930,
DEPTH_CLEAR_VALUE = 2931,
DEPTH_FUNC = 2932,
STENCIL_CLEAR_VALUE = 2961,
STENCIL_FUNC = 2962,
STENCIL_FAIL = 2964,
STENCIL_PASS_DEPTH_FAIL = 2965,
STENCIL_PASS_DEPTH_PASS = 2966,
STENCIL_REF = 2967,
STENCIL_VALUE_MASK = 2963,
STENCIL_WRITEMASK = 2968,
STENCIL_BACK_FUNC = 34816,
STENCIL_BACK_FAIL = 34817,
STENCIL_BACK_PASS_DEPTH_FAIL = 34818,
STENCIL_BACK_PASS_DEPTH_PASS = 34819,
STENCIL_BACK_REF = 36003,
STENCIL_BACK_VALUE_MASK = 36004,
STENCIL_BACK_WRITEMASK = 36005,
VIEWPORT = 2978,
SCISSOR_BOX = 3088,
COLOR_CLEAR_VALUE = 3106,
COLOR_WRITEMASK = 3107,
UNPACK_ALIGNMENT = 3317,
PACK_ALIGNMENT = 3333,
MAX_TEXTURE_SIZE = 3379,
MAX_VIEWPORT_DIMS = 3386,
SUBPIXEL_BITS = 3408,
RED_BITS = 3410,
GREEN_BITS = 3411,
BLUE_BITS = 3412,
ALPHA_BITS = 3413,
DEPTH_BITS = 3414,
STENCIL_BITS = 3415,
POLYGON_OFFSET_UNITS = 10752,
POLYGON_OFFSET_FACTOR = 32824,
TEXTURE_BINDING_2D = 32873,
SAMPLE_BUFFERS = 32936,
SAMPLES = 32937,
SAMPLE_COVERAGE_VALUE = 32938,
SAMPLE_COVERAGE_INVERT = 32939,
COMPRESSED_TEXTURE_FORMATS = 34467,
DONT_CARE = 4352,
FASTEST = 4353,
NICEST = 4354,
GENERATE_MIPMAP_HINT = 33170,
BYTE = 5120,
UNSIGNED_BYTE = 5121,
SHORT = 5122,
UNSIGNED_SHORT = 5123,
INT = 5124,
UNSIGNED_INT = 5125,
FLOAT = 5126,
DEPTH_COMPONENT = 6402,
ALPHA = 6406,
RGB = 6407,
RGBA = 6408,
LUMINANCE = 6409,
LUMINANCE_ALPHA = 6410,
UNSIGNED_SHORT_4_4_4_4 = 32819,
UNSIGNED_SHORT_5_5_5_1 = 32820,
UNSIGNED_SHORT_5_6_5 = 33635,
FRAGMENT_SHADER = 35632,
VERTEX_SHADER = 35633,
MAX_VERTEX_ATTRIBS = 34921,
MAX_VERTEX_UNIFORM_VECTORS = 36347,
MAX_VARYING_VECTORS = 36348,
MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661,
MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660,
MAX_TEXTURE_IMAGE_UNITS = 34930,
MAX_FRAGMENT_UNIFORM_VECTORS = 36349,
SHADER_TYPE = 35663,
DELETE_STATUS = 35712,
LINK_STATUS = 35714,
VALIDATE_STATUS = 35715,
ATTACHED_SHADERS = 35717,
ACTIVE_UNIFORMS = 35718,
ACTIVE_ATTRIBUTES = 35721,
SHADING_LANGUAGE_VERSION = 35724,
CURRENT_PROGRAM = 35725,
NEVER = 512,
LESS = 513,
EQUAL = 514,
LEQUAL = 515,
GREATER = 516,
NOTEQUAL = 517,
GEQUAL = 518,
ALWAYS = 519,
KEEP = 7680,
REPLACE = 7681,
INCR = 7682,
DECR = 7683,
INVERT = 5386,
INCR_WRAP = 34055,
DECR_WRAP = 34056,
VENDOR = 7936,
RENDERER = 7937,
VERSION = 7938,
NEAREST = 9728,
LINEAR = 9729,
NEAREST_MIPMAP_NEAREST = 9984,
LINEAR_MIPMAP_NEAREST = 9985,
NEAREST_MIPMAP_LINEAR = 9986,
LINEAR_MIPMAP_LINEAR = 9987,
TEXTURE_MAG_FILTER = 10240,
TEXTURE_MIN_FILTER = 10241,
TEXTURE_WRAP_S = 10242,
TEXTURE_WRAP_T = 10243,
TEXTURE_2D = 3553,
TEXTURE = 5890,
TEXTURE_CUBE_MAP = 34067,
TEXTURE_BINDING_CUBE_MAP = 34068,
TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,
MAX_CUBE_MAP_TEXTURE_SIZE = 34076,
TEXTURE0 = 33984,
TEXTURE1 = 33985,
TEXTURE2 = 33986,
TEXTURE3 = 33987,
TEXTURE4 = 33988,
TEXTURE5 = 33989,
TEXTURE6 = 33990,
TEXTURE7 = 33991,
TEXTURE8 = 33992,
TEXTURE9 = 33993,
TEXTURE10 = 33994,
TEXTURE11 = 33995,
TEXTURE12 = 33996,
TEXTURE13 = 33997,
TEXTURE14 = 33998,
TEXTURE15 = 33999,
TEXTURE16 = 34000,
TEXTURE17 = 34001,
TEXTURE18 = 34002,
TEXTURE19 = 34003,
TEXTURE20 = 34004,
TEXTURE21 = 34005,
TEXTURE22 = 34006,
TEXTURE23 = 34007,
TEXTURE24 = 34008,
TEXTURE25 = 34009,
TEXTURE26 = 34010,
TEXTURE27 = 34011,
TEXTURE28 = 34012,
TEXTURE29 = 34013,
TEXTURE30 = 34014,
TEXTURE31 = 34015,
ACTIVE_TEXTURE = 34016,
REPEAT = 10497,
CLAMP_TO_EDGE = 33071,
MIRRORED_REPEAT = 33648,
FLOAT_VEC2 = 35664,
FLOAT_VEC3 = 35665,
FLOAT_VEC4 = 35666,
INT_VEC2 = 35667,
INT_VEC3 = 35668,
INT_VEC4 = 35669,
BOOL = 35670,
BOOL_VEC2 = 35671,
BOOL_VEC3 = 35672,
BOOL_VEC4 = 35673,
FLOAT_MAT2 = 35674,
FLOAT_MAT3 = 35675,
FLOAT_MAT4 = 35676,
SAMPLER_2D = 35678,
SAMPLER_CUBE = 35680,
VERTEX_ATTRIB_ARRAY_ENABLED = 34338,
VERTEX_ATTRIB_ARRAY_SIZE = 34339,
VERTEX_ATTRIB_ARRAY_STRIDE = 34340,
VERTEX_ATTRIB_ARRAY_TYPE = 34341,
VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922,
VERTEX_ATTRIB_ARRAY_POINTER = 34373,
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975,
IMPLEMENTATION_COLOR_READ_TYPE = 35738,
IMPLEMENTATION_COLOR_READ_FORMAT = 35739,
COMPILE_STATUS = 35713,
LOW_FLOAT = 36336,
MEDIUM_FLOAT = 36337,
HIGH_FLOAT = 36338,
LOW_INT = 36339,
MEDIUM_INT = 36340,
HIGH_INT = 36341,
FRAMEBUFFER = 36160,
RENDERBUFFER = 36161,
RGBA4 = 32854,
RGB5_A1 = 32855,
RGB565 = 36194,
DEPTH_COMPONENT16 = 33189,
STENCIL_INDEX = 6401,
STENCIL_INDEX8 = 36168,
DEPTH_STENCIL = 34041,
RENDERBUFFER_WIDTH = 36162,
RENDERBUFFER_HEIGHT = 36163,
RENDERBUFFER_INTERNAL_FORMAT = 36164,
RENDERBUFFER_RED_SIZE = 36176,
RENDERBUFFER_GREEN_SIZE = 36177,
RENDERBUFFER_BLUE_SIZE = 36178,
RENDERBUFFER_ALPHA_SIZE = 36179,
RENDERBUFFER_DEPTH_SIZE = 36180,
RENDERBUFFER_STENCIL_SIZE = 36181,
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048,
FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049,
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050,
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051,
COLOR_ATTACHMENT0 = 36064,
DEPTH_ATTACHMENT = 36096,
STENCIL_ATTACHMENT = 36128,
DEPTH_STENCIL_ATTACHMENT = 33306,
NONE = 0,
FRAMEBUFFER_COMPLETE = 36053,
FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054,
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055,
FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057,
FRAMEBUFFER_UNSUPPORTED = 36061,
FRAMEBUFFER_BINDING = 36006,
RENDERBUFFER_BINDING = 36007,
MAX_RENDERBUFFER_SIZE = 34024,
INVALID_FRAMEBUFFER_OPERATION = 1286,
UNPACK_FLIP_Y_WEBGL = 37440,
UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441,
CONTEXT_LOST_WEBGL = 37442,
UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443,
BROWSER_DEFAULT_WEBGL = 37444,
COMPRESSED_RGB_S3TC_DXT1_EXT = 33776,
COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777,
COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778,
COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779,
COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840,
COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841,
COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842,
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843,
COMPRESSED_RGBA_ASTC_4x4_WEBGL = 37808,
COMPRESSED_RGB_ETC1_WEBGL = 36196,
COMPRESSED_RGBA_BPTC_UNORM = 36492,
HALF_FLOAT_OES = 36193,
DOUBLE = 5130,
READ_BUFFER = 3074,
UNPACK_ROW_LENGTH = 3314,
UNPACK_SKIP_ROWS = 3315,
UNPACK_SKIP_PIXELS = 3316,
PACK_ROW_LENGTH = 3330,
PACK_SKIP_ROWS = 3331,
PACK_SKIP_PIXELS = 3332,
COLOR = 6144,
DEPTH = 6145,
STENCIL = 6146,
RED = 6403,
RGB8 = 32849,
RGBA8 = 32856,
RGB10_A2 = 32857,
TEXTURE_BINDING_3D = 32874,
UNPACK_SKIP_IMAGES = 32877,
UNPACK_IMAGE_HEIGHT = 32878,
TEXTURE_3D = 32879,
TEXTURE_WRAP_R = 32882,
MAX_3D_TEXTURE_SIZE = 32883,
UNSIGNED_INT_2_10_10_10_REV = 33640,
MAX_ELEMENTS_VERTICES = 33000,
MAX_ELEMENTS_INDICES = 33001,
TEXTURE_MIN_LOD = 33082,
TEXTURE_MAX_LOD = 33083,
TEXTURE_BASE_LEVEL = 33084,
TEXTURE_MAX_LEVEL = 33085,
MIN = 32775,
MAX = 32776,
DEPTH_COMPONENT24 = 33190,
MAX_TEXTURE_LOD_BIAS = 34045,
TEXTURE_COMPARE_MODE = 34892,
TEXTURE_COMPARE_FUNC = 34893,
CURRENT_QUERY = 34917,
QUERY_RESULT = 34918,
QUERY_RESULT_AVAILABLE = 34919,
STREAM_READ = 35041,
STREAM_COPY = 35042,
STATIC_READ = 35045,
STATIC_COPY = 35046,
DYNAMIC_READ = 35049,
DYNAMIC_COPY = 35050,
MAX_DRAW_BUFFERS = 34852,
DRAW_BUFFER0 = 34853,
DRAW_BUFFER1 = 34854,
DRAW_BUFFER2 = 34855,
DRAW_BUFFER3 = 34856,
DRAW_BUFFER4 = 34857,
DRAW_BUFFER5 = 34858,
DRAW_BUFFER6 = 34859,
DRAW_BUFFER7 = 34860,
DRAW_BUFFER8 = 34861,
DRAW_BUFFER9 = 34862,
DRAW_BUFFER10 = 34863,
DRAW_BUFFER11 = 34864,
DRAW_BUFFER12 = 34865,
DRAW_BUFFER13 = 34866,
DRAW_BUFFER14 = 34867,
DRAW_BUFFER15 = 34868,
MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657,
MAX_VERTEX_UNIFORM_COMPONENTS = 35658,
SAMPLER_3D = 35679,
SAMPLER_2D_SHADOW = 35682,
FRAGMENT_SHADER_DERIVATIVE_HINT = 35723,
PIXEL_PACK_BUFFER = 35051,
PIXEL_UNPACK_BUFFER = 35052,
PIXEL_PACK_BUFFER_BINDING = 35053,
PIXEL_UNPACK_BUFFER_BINDING = 35055,
FLOAT_MAT2x3 = 35685,
FLOAT_MAT2x4 = 35686,
FLOAT_MAT3x2 = 35687,
FLOAT_MAT3x4 = 35688,
FLOAT_MAT4x2 = 35689,
FLOAT_MAT4x3 = 35690,
SRGB = 35904,
SRGB8 = 35905,
SRGB8_ALPHA8 = 35907,
COMPARE_REF_TO_TEXTURE = 34894,
RGBA32F = 34836,
RGB32F = 34837,
RGBA16F = 34842,
RGB16F = 34843,
VERTEX_ATTRIB_ARRAY_INTEGER = 35069,
MAX_ARRAY_TEXTURE_LAYERS = 35071,
MIN_PROGRAM_TEXEL_OFFSET = 35076,
MAX_PROGRAM_TEXEL_OFFSET = 35077,
MAX_VARYING_COMPONENTS = 35659,
TEXTURE_2D_ARRAY = 35866,
TEXTURE_BINDING_2D_ARRAY = 35869,
R11F_G11F_B10F = 35898,
UNSIGNED_INT_10F_11F_11F_REV = 35899,
RGB9_E5 = 35901,
UNSIGNED_INT_5_9_9_9_REV = 35902,
TRANSFORM_FEEDBACK_BUFFER_MODE = 35967,
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968,
TRANSFORM_FEEDBACK_VARYINGS = 35971,
TRANSFORM_FEEDBACK_BUFFER_START = 35972,
TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973,
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976,
RASTERIZER_DISCARD = 35977,
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978,
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979,
INTERLEAVED_ATTRIBS = 35980,
SEPARATE_ATTRIBS = 35981,
TRANSFORM_FEEDBACK_BUFFER = 35982,
TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983,
RGBA32UI = 36208,
RGB32UI = 36209,
RGBA16UI = 36214,
RGB16UI = 36215,
RGBA8UI = 36220,
RGB8UI = 36221,
RGBA32I = 36226,
RGB32I = 36227,
RGBA16I = 36232,
RGB16I = 36233,
RGBA8I = 36238,
RGB8I = 36239,
RED_INTEGER = 36244,
RGB_INTEGER = 36248,
RGBA_INTEGER = 36249,
SAMPLER_2D_ARRAY = 36289,
SAMPLER_2D_ARRAY_SHADOW = 36292,
SAMPLER_CUBE_SHADOW = 36293,
UNSIGNED_INT_VEC2 = 36294,
UNSIGNED_INT_VEC3 = 36295,
UNSIGNED_INT_VEC4 = 36296,
INT_SAMPLER_2D = 36298,
INT_SAMPLER_3D = 36299,
INT_SAMPLER_CUBE = 36300,
INT_SAMPLER_2D_ARRAY = 36303,
UNSIGNED_INT_SAMPLER_2D = 36306,
UNSIGNED_INT_SAMPLER_3D = 36307,
UNSIGNED_INT_SAMPLER_CUBE = 36308,
UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311,
DEPTH_COMPONENT32F = 36012,
DEPTH32F_STENCIL8 = 36013,
FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296,
FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297,
FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298,
FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299,
FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300,
FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301,
FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302,
FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303,
FRAMEBUFFER_DEFAULT = 33304,
UNSIGNED_INT_24_8 = 34042,
DEPTH24_STENCIL8 = 35056,
UNSIGNED_NORMALIZED = 35863,
DRAW_FRAMEBUFFER_BINDING = 36006,
READ_FRAMEBUFFER = 36008,
DRAW_FRAMEBUFFER = 36009,
READ_FRAMEBUFFER_BINDING = 36010,
RENDERBUFFER_SAMPLES = 36011,
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052,
MAX_COLOR_ATTACHMENTS = 36063,
COLOR_ATTACHMENT1 = 36065,
COLOR_ATTACHMENT2 = 36066,
COLOR_ATTACHMENT3 = 36067,
COLOR_ATTACHMENT4 = 36068,
COLOR_ATTACHMENT5 = 36069,
COLOR_ATTACHMENT6 = 36070,
COLOR_ATTACHMENT7 = 36071,
COLOR_ATTACHMENT8 = 36072,
COLOR_ATTACHMENT9 = 36073,
COLOR_ATTACHMENT10 = 36074,
COLOR_ATTACHMENT11 = 36075,
COLOR_ATTACHMENT12 = 36076,
COLOR_ATTACHMENT13 = 36077,
COLOR_ATTACHMENT14 = 36078,
COLOR_ATTACHMENT15 = 36079,
FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182,
MAX_SAMPLES = 36183,
HALF_FLOAT = 5131,
RG = 33319,
RG_INTEGER = 33320,
R8 = 33321,
RG8 = 33323,
R16F = 33325,
R32F = 33326,
RG16F = 33327,
RG32F = 33328,
R8I = 33329,
R8UI = 33330,
R16I = 33331,
R16UI = 33332,
R32I = 33333,
R32UI = 33334,
RG8I = 33335,
RG8UI = 33336,
RG16I = 33337,
RG16UI = 33338,
RG32I = 33339,
RG32UI = 33340,
VERTEX_ARRAY_BINDING = 34229,
R8_SNORM = 36756,
RG8_SNORM = 36757,
RGB8_SNORM = 36758,
RGBA8_SNORM = 36759,
SIGNED_NORMALIZED = 36764,
COPY_READ_BUFFER = 36662,
COPY_WRITE_BUFFER = 36663,
COPY_READ_BUFFER_BINDING = 36662,
COPY_WRITE_BUFFER_BINDING = 36663,
UNIFORM_BUFFER = 35345,
UNIFORM_BUFFER_BINDING = 35368,
UNIFORM_BUFFER_START = 35369,
UNIFORM_BUFFER_SIZE = 35370,
MAX_VERTEX_UNIFORM_BLOCKS = 35371,
MAX_FRAGMENT_UNIFORM_BLOCKS = 35373,
MAX_COMBINED_UNIFORM_BLOCKS = 35374,
MAX_UNIFORM_BUFFER_BINDINGS = 35375,
MAX_UNIFORM_BLOCK_SIZE = 35376,
MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377,
MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379,
UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380,
ACTIVE_UNIFORM_BLOCKS = 35382,
UNIFORM_TYPE = 35383,
UNIFORM_SIZE = 35384,
UNIFORM_BLOCK_INDEX = 35386,
UNIFORM_OFFSET = 35387,
UNIFORM_ARRAY_STRIDE = 35388,
UNIFORM_MATRIX_STRIDE = 35389,
UNIFORM_IS_ROW_MAJOR = 35390,
UNIFORM_BLOCK_BINDING = 35391,
UNIFORM_BLOCK_DATA_SIZE = 35392,
UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394,
UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395,
UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396,
UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398,
INVALID_INDEX = 4294967295,
MAX_VERTEX_OUTPUT_COMPONENTS = 37154,
MAX_FRAGMENT_INPUT_COMPONENTS = 37157,
MAX_SERVER_WAIT_TIMEOUT = 37137,
OBJECT_TYPE = 37138,
SYNC_CONDITION = 37139,
SYNC_STATUS = 37140,
SYNC_FLAGS = 37141,
SYNC_FENCE = 37142,
SYNC_GPU_COMMANDS_COMPLETE = 37143,
UNSIGNALED = 37144,
SIGNALED = 37145,
ALREADY_SIGNALED = 37146,
TIMEOUT_EXPIRED = 37147,
CONDITION_SATISFIED = 37148,
WAIT_FAILED = 37149,
SYNC_FLUSH_COMMANDS_BIT = 1,
VERTEX_ATTRIB_ARRAY_DIVISOR = 35070,
ANY_SAMPLES_PASSED = 35887,
ANY_SAMPLES_PASSED_CONSERVATIVE = 36202,
SAMPLER_BINDING = 35097,
RGB10_A2UI = 36975,
INT_2_10_10_10_REV = 36255,
TRANSFORM_FEEDBACK = 36386,
TRANSFORM_FEEDBACK_PAUSED = 36387,
TRANSFORM_FEEDBACK_ACTIVE = 36388,
TRANSFORM_FEEDBACK_BINDING = 36389,
COMPRESSED_R11_EAC = 37488,
COMPRESSED_SIGNED_R11_EAC = 37489,
COMPRESSED_RG11_EAC = 37490,
COMPRESSED_SIGNED_RG11_EAC = 37491,
COMPRESSED_RGB8_ETC2 = 37492,
COMPRESSED_SRGB8_ETC2 = 37493,
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
COMPRESSED_RGBA8_ETC2_EAC = 37496,
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497,
TEXTURE_IMMUTABLE_FORMAT = 37167,
MAX_ELEMENT_INDEX = 36203,
TEXTURE_IMMUTABLE_LEVELS = 33503,
MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047
}
/**
* A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
* retrieved from Elevation Tiles of an an ArcGIS ImageService.
* @example
* const terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
* url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
* token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
* });
* viewer.terrainProvider = terrainProvider;
*
*
* @param options - Object with the following properties:
* @param options.url - The URL of the ArcGIS ImageServer service.
* @param [options.token] - The authorization token to use to connect to the service.
* @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead.
* If neither parameter is specified, the WGS84 ellipsoid is used.
*/
export class ArcGISTiledElevationTerrainProvider {
constructor(options: {
url: Resource | string | Promise | Promise;
token?: string;
ellipsoid?: Ellipsoid;
});
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
* are passed an instance of {@link TileProviderError}.
*/
readonly errorEvent: Event;
/**
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
* the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
*/
readonly credit: Credit;
/**
* Gets the tiling scheme used by this provider. This function should
* not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
*/
readonly tilingScheme: GeographicTilingScheme;
/**
* Gets a value indicating whether or not the provider is ready for use.
*/
readonly ready: boolean;
/**
* Gets a promise that resolves to true when the provider is ready for use.
*/
readonly readyPromise: Promise;
/**
* Gets a value indicating whether or not the provider includes a water mask. The water mask
* indicates which areas of the globe are water rather than land, so they can be rendered
* as a reflective surface with animated waves. This function should not be
* called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
*/
readonly hasWaterMask: boolean;
/**
* Gets a value indicating whether or not the requested tiles include vertex normals.
* This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
*/
readonly hasVertexNormals: boolean;
/**
* Gets an object that can be used to determine availability of terrain from this provider, such as
* at points and in rectangles. This function should not be called before
* {@link TerrainProvider#ready} returns true. This property may be undefined if availability
* information is not available.
*/
readonly availability: TileAvailability;
/**
* Requests the geometry for a given tile. This function should not be called before
* {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain
* data and indicates that all child tiles are available.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @param [request] - The request object. Intended for internal use only.
* @returns A promise for the requested geometry. If this method
* returns undefined instead of a promise, it is an indication that too many requests are already
* pending and the request will be retried later.
*/
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined;
/**
* Gets the maximum geometric error allowed in a tile at a given level.
* @param level - The tile level for which to get the maximum geometric error.
* @returns The maximum geometric error.
*/
getLevelMaximumGeometricError(level: number): number;
/**
* Determines whether data for a tile is available to be loaded.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if not supported, otherwise true or false.
*/
getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
/**
* Makes sure we load availability data for a tile
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
*/
loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise;
}
/**
* ArcType defines the path that should be taken connecting vertices.
*/
export enum ArcType {
/**
* Straight line that does not conform to the surface of the ellipsoid.
*/
NONE = 0,
/**
* Follow geodesic path.
*/
GEODESIC = 1,
/**
* Follow rhumb or loxodrome path.
*/
RHUMB = 2
}
/**
* A collection of key-value pairs that is stored as a hash for easy
* lookup but also provides an array for fast iteration.
*/
export class AssociativeArray {
constructor();
/**
* Gets the number of items in the collection.
*/
length: number;
/**
* Gets an unordered array of all values in the collection.
* This is a live array that will automatically reflect the values in the collection,
* it should not be modified directly.
*/
values: any[];
/**
* Determines if the provided key is in the array.
* @param key - The key to check.
* @returns true if the key is in the array, false otherwise.
*/
contains(key: string | number): boolean;
/**
* Associates the provided key with the provided value. If the key already
* exists, it is overwritten with the new value.
* @param key - A unique identifier.
* @param value - The value to associate with the provided key.
*/
set(key: string | number, value: any): void;
/**
* Retrieves the value associated with the provided key.
* @param key - The key whose value is to be retrieved.
* @returns The associated value, or undefined if the key does not exist in the collection.
*/
get(key: string | number): any;
/**
* Removes a key-value pair from the collection.
* @param key - The key to be removed.
* @returns True if it was removed, false if the key was not in the collection.
*/
remove(key: string | number): boolean;
/**
* Clears the collection.
*/
removeAll(): void;
}
/**
* Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
* @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes.
* @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes.
* @param [center] - The center of the box; automatically computed if not supplied.
*/
export class AxisAlignedBoundingBox {
constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3);
/**
* The minimum point defining the bounding box.
*/
minimum: Cartesian3;
/**
* The maximum point defining the bounding box.
*/
maximum: Cartesian3;
/**
* The center point of the bounding box.
*/
center: Cartesian3;
/**
* Creates an instance of an AxisAlignedBoundingBox from its corners.
* @example
* // Compute an axis aligned bounding box from the two corners.
* const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));
* @param minimum - The minimum point along the x, y, and z axes.
* @param maximum - The maximum point along the x, y, and z axes.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
*/
static fromCorners(minimum: Cartesian3, maximum: Cartesian3, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
/**
* Computes an instance of an AxisAlignedBoundingBox. The box is determined by
* finding the points spaced the farthest apart on the x, y, and z axes.
* @example
* // Compute an axis aligned bounding box enclosing two points.
* const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
* @param positions - List of points that the bounding box will enclose. Each point must have a x, y, and z properties.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
*/
static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
/**
* Duplicates a AxisAlignedBoundingBox instance.
* @param box - The bounding box to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
*/
static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
/**
* Compares the provided AxisAlignedBoundingBox componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first AxisAlignedBoundingBox.
* @param [right] - The second AxisAlignedBoundingBox.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean;
/**
* Determines which side of a plane a box is located.
* @param box - The bounding box to test.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
* intersects the plane.
*/
static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect;
/**
* Duplicates this AxisAlignedBoundingBox instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
*/
clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
/**
* Determines which side of a plane this box is located.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
* intersects the plane.
*/
intersectPlane(plane: Plane): Intersect;
/**
* Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side AxisAlignedBoundingBox.
* @returns true if they are equal, false otherwise.
*/
equals(right?: AxisAlignedBoundingBox): boolean;
}
/**
* Provides geocoding through Bing Maps.
* @param options - Object with the following properties:
* @param options.key - A key to use with the Bing Maps geocoding service
* @param [options.culture] - A Bing Maps {@link https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes|Culture Code} to return results in a specific culture and language.
*/
export class BingMapsGeocoderService {
constructor(options: {
key: string;
culture?: string;
});
/**
* The URL endpoint for the Bing geocoder service
*/
readonly url: string;
/**
* The key for the Bing geocoder service
*/
readonly key: string;
/**
* @param query - The query to be sent to the geocoder service
*/
geocode(query: string): Promise;
}
/**
* A bounding rectangle given by a corner, width and height.
* @param [x = 0.0] - The x coordinate of the rectangle.
* @param [y = 0.0] - The y coordinate of the rectangle.
* @param [width = 0.0] - The width of the rectangle.
* @param [height = 0.0] - The height of the rectangle.
*/
export class BoundingRectangle {
constructor(x?: number, y?: number, width?: number, height?: number);
/**
* The x coordinate of the rectangle.
*/
x: number;
/**
* The y coordinate of the rectangle.
*/
y: number;
/**
* The width of the rectangle.
*/
width: number;
/**
* The height of the rectangle.
*/
height: number;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle;
/**
* Computes a bounding rectangle enclosing the list of 2D points.
* The rectangle is oriented with the corner at the bottom left.
* @param positions - List of points that the bounding rectangle will enclose. Each point must have x and y properties.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle;
/**
* Computes a bounding rectangle from a rectangle.
* @param rectangle - The valid rectangle used to create a bounding rectangle.
* @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle;
/**
* Duplicates a BoundingRectangle instance.
* @param rectangle - The bounding rectangle to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
*/
static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
/**
* Computes a bounding rectangle that is the union of the left and right bounding rectangles.
* @param left - A rectangle to enclose in bounding rectangle.
* @param right - A rectangle to enclose in a bounding rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
/**
* Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
* @param rectangle - A rectangle to expand.
* @param point - A point to enclose in a bounding rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle;
/**
* Determines if two rectangles intersect.
* @param left - A rectangle to check for intersection.
* @param right - The other rectangle to check for intersection.
* @returns Intersect.INTERSECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.
*/
static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect;
/**
* Compares the provided BoundingRectangles componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first BoundingRectangle.
* @param [right] - The second BoundingRectangle.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean;
/**
* Duplicates this BoundingRectangle instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
*/
clone(result?: BoundingRectangle): BoundingRectangle;
/**
* Determines if this rectangle intersects with another.
* @param right - A rectangle to check for intersection.
* @returns Intersect.INTERSECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.
*/
intersect(right: BoundingRectangle): Intersect;
/**
* Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side BoundingRectangle.
* @returns true if they are equal, false otherwise.
*/
equals(right?: BoundingRectangle): boolean;
}
/**
* A bounding sphere with a center and a radius.
* @param [center = Cartesian3.ZERO] - The center of the bounding sphere.
* @param [radius = 0.0] - The radius of the bounding sphere.
*/
export class BoundingSphere {
constructor(center?: Cartesian3, radius?: number);
/**
* The center point of the sphere.
*/
center: Cartesian3;
/**
* The radius of the sphere.
*/
radius: number;
/**
* Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
* The bounding sphere is computed by running two algorithms, a naive algorithm and
* Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
* @param [positions] - An array of points that the bounding sphere will enclose. Each point must have x, y, and z properties.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
*/
static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere from a rectangle projected in 2D.
* @param [rectangle] - The rectangle around which to create a bounding sphere.
* @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
* object's minimum and maximum heights over the rectangle.
* @param [rectangle] - The rectangle around which to create a bounding sphere.
* @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
* @param [minimumHeight = 0.0] - The minimum height over the rectangle.
* @param [maximumHeight = 0.0] - The maximum height over the rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
* on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
* @param [rectangle] - The valid rectangle used to create a bounding sphere.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
* @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere;
/**
* Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
* stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
* algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
* ensure a tight fit.
* @example
* // Compute the bounding sphere from 3 positions, each specified relative to a center.
* // In addition to the X, Y, and Z coordinates, the points array contains two additional
* // elements per point which are ignored for the purpose of computing the bounding sphere.
* const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
* const points = [1.0, 2.0, 3.0, 0.1, 0.2,
* 4.0, 5.0, 6.0, 0.1, 0.2,
* 7.0, 8.0, 9.0, 0.1, 0.2];
* const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
* @param [positions] - An array of points that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the
* origin of the coordinate system. This is useful when the positions are to be used for
* relative-to-center (RTC) rendering.
* @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may
* be higher. Regardless of the value of this parameter, the X coordinate of the first position
* is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
* 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
* the stride is 5, however, two array elements are skipped and the next position begins at array
* index 5.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
*/
static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere;
/**
* Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
* stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
* algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
* ensure a tight fit.
* @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
*/
static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
* tighly and fully encompases the box.
* @example
* // Create a bounding sphere around the unit cube
* const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
* @param [corner] - The minimum height over the rectangle.
* @param [oppositeCorner] - The maximum height over the rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere;
/**
* Creates a bounding sphere encompassing an ellipsoid.
* @example
* const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
* @param ellipsoid - The ellipsoid around which to create a bounding sphere.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere;
/**
* Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
* @param [boundingSpheres] - The array of bounding spheres.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere;
/**
* Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
* @param orientedBoundingBox - The oriented bounding box.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere;
/**
* Computes a tight-fitting bounding sphere enclosing the provided affine transformation.
* @param transformation - The affine transformation.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static fromTransformation(transformation: Matrix4, result?: BoundingSphere): BoundingSphere;
/**
* Duplicates a BoundingSphere instance.
* @param sphere - The bounding sphere to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
*/
static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere that contains both the left and right bounding spheres.
* @param left - A sphere to enclose in a bounding sphere.
* @param right - A sphere to enclose in a bounding sphere.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere;
/**
* Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
* @param sphere - A sphere to expand.
* @param point - A point to enclose in a bounding sphere.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere;
/**
* Determines which side of a plane a sphere is located.
* @param sphere - The bounding sphere to test.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
* intersects the plane.
*/
static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect;
/**
* Applies a 4x4 affine transformation matrix to a bounding sphere.
* @param sphere - The bounding sphere to apply the transformation to.
* @param transform - The transformation matrix to apply to the bounding sphere.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
/**
* Computes the estimated distance squared from the closest point on a bounding sphere to a point.
* @example
* // Sort bounding spheres from back to front
* spheres.sort(function(a, b) {
* return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
* });
* @param sphere - The sphere.
* @param cartesian - The point
* @returns The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.
*/
static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number;
/**
* Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
* The transformation matrix is not verified to have a uniform scale of 1.
* This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
* @example
* const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
* const boundingSphere = new Cesium.BoundingSphere();
* const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
* @param sphere - The bounding sphere to apply the transformation to.
* @param transform - The transformation matrix to apply to the bounding sphere.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
/**
* The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
* plus/minus the radius of the bounding sphere.
*
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding sphere.
* @param sphere - The bounding sphere to calculate the distance to.
* @param position - The position to calculate the distance from.
* @param direction - The direction from position.
* @param [result] - A Interval to store the nearest and farthest distances.
* @returns The nearest and farthest distances on the bounding sphere from position in direction.
*/
static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
/**
* Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
* @param sphere - The bounding sphere to transform to 2D.
* @param [projection = GeographicProjection] - The projection to 2D.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere;
/**
* Determines whether or not a sphere is hidden from view by the occluder.
* @param sphere - The bounding sphere surrounding the occludee object.
* @param occluder - The occluder.
* @returns true if the sphere is not visible; otherwise false.
*/
static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean;
/**
* Compares the provided BoundingSphere componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first BoundingSphere.
* @param [right] - The second BoundingSphere.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: BoundingSphere, right?: BoundingSphere): boolean;
/**
* Determines which side of a plane the sphere is located.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
* intersects the plane.
*/
intersectPlane(plane: Plane): Intersect;
/**
* Computes the estimated distance squared from the closest point on a bounding sphere to a point.
* @example
* // Sort bounding spheres from back to front
* spheres.sort(function(a, b) {
* return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
* });
* @param cartesian - The point
* @returns The estimated distance squared from the bounding sphere to the point.
*/
distanceSquaredTo(cartesian: Cartesian3): number;
/**
* The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
* plus/minus the radius of the bounding sphere.
*
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding sphere.
* @param position - The position to calculate the distance from.
* @param direction - The direction from position.
* @param [result] - A Interval to store the nearest and farthest distances.
* @returns The nearest and farthest distances on the bounding sphere from position in direction.
*/
computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
/**
* Determines whether or not a sphere is hidden from view by the occluder.
* @param occluder - The occluder.
* @returns true if the sphere is not visible; otherwise false.
*/
isOccluded(occluder: Occluder): boolean;
/**
* Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side BoundingSphere.
* @returns true if they are equal, false otherwise.
*/
equals(right?: BoundingSphere): boolean;
/**
* Duplicates this BoundingSphere instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new BoundingSphere instance if none was provided.
*/
clone(result?: BoundingSphere): BoundingSphere;
/**
* Computes the radius of the BoundingSphere.
* @returns The radius of the BoundingSphere.
*/
volume(): number;
}
/**
* Describes a cube centered at the origin.
* @example
* const box = new Cesium.BoxGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
* maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
* minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
* });
* const geometry = Cesium.BoxGeometry.createGeometry(box);
* @param options - Object with the following properties:
* @param options.minimum - The minimum x, y, and z coordinates of the box.
* @param options.maximum - The maximum x, y, and z coordinates of the box.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class BoxGeometry {
constructor(options: {
minimum: Cartesian3;
maximum: Cartesian3;
vertexFormat?: VertexFormat;
});
/**
* Creates a cube centered at the origin given its dimensions.
* @example
* const box = Cesium.BoxGeometry.fromDimensions({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
* dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
* });
* const geometry = Cesium.BoxGeometry.createGeometry(box);
* @param options - Object with the following properties:
* @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
static fromDimensions(options: {
dimensions: Cartesian3;
vertexFormat?: VertexFormat;
}): BoxGeometry;
/**
* Creates a cube from the dimensions of an AxisAlignedBoundingBox.
* @example
* const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ]));
* const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
* @param boundingBox - A description of the AxisAlignedBoundingBox.
*/
static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new BoxGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry;
/**
* Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
* @param boxGeometry - A description of the box.
* @returns The computed vertices and indices.
*/
static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined;
}
/**
* A description of the outline of a cube centered at the origin.
* @example
* const box = new Cesium.BoxOutlineGeometry({
* maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
* minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
* });
* const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
* @param options - Object with the following properties:
* @param options.minimum - The minimum x, y, and z coordinates of the box.
* @param options.maximum - The maximum x, y, and z coordinates of the box.
*/
export class BoxOutlineGeometry {
constructor(options: {
minimum: Cartesian3;
maximum: Cartesian3;
});
/**
* Creates an outline of a cube centered at the origin given its dimensions.
* @example
* const box = Cesium.BoxOutlineGeometry.fromDimensions({
* dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
* });
* const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
* @param options - Object with the following properties:
* @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively.
*/
static fromDimensions(options: {
dimensions: Cartesian3;
}): BoxOutlineGeometry;
/**
* Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
* @example
* const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ]));
* const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
*
*
* @param boundingBox - A description of the AxisAlignedBoundingBox.
*/
static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry;
/**
* Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
* @param boxGeometry - A description of the box outline.
* @returns The computed vertices and indices.
*/
static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined;
}
/**
* A 2D Cartesian point.
* @param [x = 0.0] - The X component.
* @param [y = 0.0] - The Y component.
*/
export class Cartesian2 {
constructor(x?: number, y?: number);
/**
* The X component.
*/
x: number;
/**
* The Y component.
*/
y: number;
/**
* Creates a Cartesian2 instance from x and y coordinates.
* @param x - The x coordinate.
* @param y - The y coordinate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
/**
* Duplicates a Cartesian2 instance.
* @param cartesian - The Cartesian to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
*/
static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
/**
* Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
* x and y properties of the Cartesian3 and drops z.
* @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
/**
* Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
* x and y properties of the Cartesian4 and drops z and w.
* @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
/**
* Flattens an array of Cartesian2s into an array of components.
* @param array - The array of cartesians to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.
* @returns The packed array.
*/
static packArray(array: Cartesian2[], result?: number[]): number[];
/**
* Unpacks an array of cartesian components into an array of Cartesian2s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
/**
* Creates a Cartesian2 from two consecutive elements in an array.
* @example
* // Create a Cartesian2 with (1.0, 2.0)
* const v = [1.0, 2.0];
* const p = Cesium.Cartesian2.fromArray(v);
*
* // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 2.0];
* const p2 = Cesium.Cartesian2.fromArray(v2, 2);
* @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
* @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
/**
* Computes the value of the maximum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the maximum component.
*/
static maximumComponent(cartesian: Cartesian2): number;
/**
* Computes the value of the minimum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the minimum component.
*/
static minimumComponent(cartesian: Cartesian2): number;
/**
* Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the minimum components.
*/
static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the maximum components.
*/
static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the provided Cartesian's squared magnitude.
* @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
* @returns The squared magnitude.
*/
static magnitudeSquared(cartesian: Cartesian2): number;
/**
* Computes the Cartesian's magnitude (length).
* @param cartesian - The Cartesian instance whose magnitude is to be computed.
* @returns The magnitude.
*/
static magnitude(cartesian: Cartesian2): number;
/**
* Computes the distance between two points.
* @example
* // Returns 1.0
* const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distance(left: Cartesian2, right: Cartesian2): number;
/**
* Computes the squared distance between two points. Comparing squared distances
* using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
* @example
* // Returns 4.0, not 2.0
* const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distanceSquared(left: Cartesian2, right: Cartesian2): number;
/**
* Computes the normalized form of the supplied Cartesian.
* @param cartesian - The Cartesian to be normalized.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the dot (scalar) product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The dot product.
*/
static dot(left: Cartesian2, right: Cartesian2): number;
/**
* Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The cross product.
*/
static cross(left: Cartesian2, right: Cartesian2): number;
/**
* Computes the componentwise product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the componentwise quotient of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the componentwise sum of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the componentwise difference of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Multiplies the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be scaled.
* @param scalar - The scalar to multiply with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
/**
* Divides the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be divided.
* @param scalar - The scalar to divide by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
/**
* Negates the provided Cartesian.
* @param cartesian - The Cartesian to be negated.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the absolute value of the provided Cartesian.
* @param cartesian - The Cartesian whose absolute value is to be computed.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the linear interpolation or extrapolation at t using the provided cartesians.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
/**
* Returns the angle, in radians, between the provided Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The angle between the Cartesians.
*/
static angleBetween(left: Cartesian2, right: Cartesian2): number;
/**
* Returns the axis that is most orthogonal to the provided Cartesian.
* @param cartesian - The Cartesian on which to find the most orthogonal axis.
* @param result - The object onto which to store the result.
* @returns The most orthogonal axis.
*/
static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Compares the provided Cartesians componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Cartesian2, right?: Cartesian2): boolean;
/**
* Compares the provided Cartesians componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* An immutable Cartesian2 instance initialized to (0.0, 0.0).
*/
static readonly ZERO: Cartesian2;
/**
* An immutable Cartesian2 instance initialized to (1.0, 1.0).
*/
static readonly ONE: Cartesian2;
/**
* An immutable Cartesian2 instance initialized to (1.0, 0.0).
*/
static readonly UNIT_X: Cartesian2;
/**
* An immutable Cartesian2 instance initialized to (0.0, 1.0).
*/
static readonly UNIT_Y: Cartesian2;
/**
* Duplicates this Cartesian2 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
*/
clone(result?: Cartesian2): Cartesian2;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side Cartesian.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Cartesian2): boolean;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [right] - The right hand side Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Creates a string representing this Cartesian in the format '(x, y)'.
* @returns A string representing the provided Cartesian in the format '(x, y)'.
*/
toString(): string;
}
/**
* A 3D Cartesian point.
* @param [x = 0.0] - The X component.
* @param [y = 0.0] - The Y component.
* @param [z = 0.0] - The Z component.
*/
export class Cartesian3 {
constructor(x?: number, y?: number, z?: number);
/**
* The X component.
*/
x: number;
/**
* The Y component.
*/
y: number;
/**
* The Z component.
*/
z: number;
/**
* Converts the provided Spherical into Cartesian3 coordinates.
* @param spherical - The Spherical to be converted to Cartesian3.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
/**
* Creates a Cartesian3 instance from x, y and z coordinates.
* @param x - The x coordinate.
* @param y - The y coordinate.
* @param z - The z coordinate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
/**
* Duplicates a Cartesian3 instance.
* @param cartesian - The Cartesian to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
*/
static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
* x, y, and z properties of the Cartesian4 and drops w.
* @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
/**
* Flattens an array of Cartesian3s into an array of components.
* @param array - The array of cartesians to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.
* @returns The packed array.
*/
static packArray(array: Cartesian3[], result?: number[]): number[];
/**
* Unpacks an array of cartesian components into an array of Cartesian3s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
/**
* Creates a Cartesian3 from three consecutive elements in an array.
* @example
* // Create a Cartesian3 with (1.0, 2.0, 3.0)
* const v = [1.0, 2.0, 3.0];
* const p = Cesium.Cartesian3.fromArray(v);
*
* // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
* const p2 = Cesium.Cartesian3.fromArray(v2, 2);
* @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
* @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
/**
* Computes the value of the maximum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the maximum component.
*/
static maximumComponent(cartesian: Cartesian3): number;
/**
* Computes the value of the minimum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the minimum component.
*/
static minimumComponent(cartesian: Cartesian3): number;
/**
* Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the minimum components.
*/
static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the maximum components.
*/
static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the provided Cartesian's squared magnitude.
* @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
* @returns The squared magnitude.
*/
static magnitudeSquared(cartesian: Cartesian3): number;
/**
* Computes the Cartesian's magnitude (length).
* @param cartesian - The Cartesian instance whose magnitude is to be computed.
* @returns The magnitude.
*/
static magnitude(cartesian: Cartesian3): number;
/**
* Computes the distance between two points.
* @example
* // Returns 1.0
* const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distance(left: Cartesian3, right: Cartesian3): number;
/**
* Computes the squared distance between two points. Comparing squared distances
* using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
* @example
* // Returns 4.0, not 2.0
* const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distanceSquared(left: Cartesian3, right: Cartesian3): number;
/**
* Computes the normalized form of the supplied Cartesian.
* @param cartesian - The Cartesian to be normalized.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the dot (scalar) product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The dot product.
*/
static dot(left: Cartesian3, right: Cartesian3): number;
/**
* Computes the componentwise product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the componentwise quotient of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the componentwise sum of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the componentwise difference of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Multiplies the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be scaled.
* @param scalar - The scalar to multiply with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
/**
* Divides the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be divided.
* @param scalar - The scalar to divide by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
/**
* Negates the provided Cartesian.
* @param cartesian - The Cartesian to be negated.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the absolute value of the provided Cartesian.
* @param cartesian - The Cartesian whose absolute value is to be computed.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the linear interpolation or extrapolation at t using the provided cartesians.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
/**
* Returns the angle, in radians, between the provided Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The angle between the Cartesians.
*/
static angleBetween(left: Cartesian3, right: Cartesian3): number;
/**
* Returns the axis that is most orthogonal to the provided Cartesian.
* @param cartesian - The Cartesian on which to find the most orthogonal axis.
* @param result - The object onto which to store the result.
* @returns The most orthogonal axis.
*/
static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Projects vector a onto vector b
* @param a - The vector that needs projecting
* @param b - The vector to project onto
* @param result - The result cartesian
* @returns The modified result parameter
*/
static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Compares the provided Cartesians componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Cartesian3, right?: Cartesian3): boolean;
/**
* Compares the provided Cartesians componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Computes the cross (outer) product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The cross product.
*/
static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the midpoint between the right and left Cartesian.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The midpoint.
*/
static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Returns a Cartesian3 position from longitude and latitude values given in degrees.
* @example
* const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
* @param longitude - The longitude, in degrees
* @param latitude - The latitude, in degrees
* @param [height = 0.0] - The height, in meters, above the ellipsoid.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - The object onto which to store the result.
* @returns The position
*/
static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
/**
* Returns a Cartesian3 position from longitude and latitude values given in radians.
* @example
* const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
* @param longitude - The longitude, in radians
* @param latitude - The latitude, in radians
* @param [height = 0.0] - The height, in meters, above the ellipsoid.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - The object onto which to store the result.
* @returns The position
*/
static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
/**
* Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
* @example
* const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
* @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
* @param [result] - An array of Cartesian3 objects to store the result.
* @returns The array of positions.
*/
static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
/**
* Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
* @example
* const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
* @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
* @param [result] - An array of Cartesian3 objects to store the result.
* @returns The array of positions.
*/
static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
/**
* Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
* @example
* const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
* @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - An array of Cartesian3 objects to store the result.
* @returns The array of positions.
*/
static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
/**
* Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
* @example
* const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
* @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - An array of Cartesian3 objects to store the result.
* @returns The array of positions.
*/
static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
/**
* An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
*/
static readonly ZERO: Cartesian3;
/**
* An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).
*/
static readonly ONE: Cartesian3;
/**
* An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
*/
static readonly UNIT_X: Cartesian3;
/**
* An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
*/
static readonly UNIT_Y: Cartesian3;
/**
* An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
*/
static readonly UNIT_Z: Cartesian3;
/**
* Duplicates this Cartesian3 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
clone(result?: Cartesian3): Cartesian3;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side Cartesian.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Cartesian3): boolean;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [right] - The right hand side Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Creates a string representing this Cartesian in the format '(x, y, z)'.
* @returns A string representing this Cartesian in the format '(x, y, z)'.
*/
toString(): string;
}
/**
* A 4D Cartesian point.
* @param [x = 0.0] - The X component.
* @param [y = 0.0] - The Y component.
* @param [z = 0.0] - The Z component.
* @param [w = 0.0] - The W component.
*/
export class Cartesian4 {
constructor(x?: number, y?: number, z?: number, w?: number);
/**
* The X component.
*/
x: number;
/**
* The Y component.
*/
y: number;
/**
* The Z component.
*/
z: number;
/**
* The W component.
*/
w: number;
/**
* Creates a Cartesian4 instance from x, y, z and w coordinates.
* @param x - The x coordinate.
* @param y - The y coordinate.
* @param z - The z coordinate.
* @param w - The w coordinate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
*/
static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
/**
* Creates a Cartesian4 instance from a {@link Color}. red, green, blue,
* and alpha map to x, y, z, and w, respectively.
* @param color - The source color.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
*/
static fromColor(color: Color, result?: Cartesian4): Cartesian4;
/**
* Duplicates a Cartesian4 instance.
* @param cartesian - The Cartesian to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
*/
static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
/**
* Flattens an array of Cartesian4s into an array of components.
* @param array - The array of cartesians to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
* @returns The packed array.
*/
static packArray(array: Cartesian4[], result?: number[]): number[];
/**
* Unpacks an array of cartesian components into an array of Cartesian4s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
/**
* Creates a Cartesian4 from four consecutive elements in an array.
* @example
* // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
* const v = [1.0, 2.0, 3.0, 4.0];
* const p = Cesium.Cartesian4.fromArray(v);
*
* // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
* const p2 = Cesium.Cartesian4.fromArray(v2, 2);
* @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
* @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
*/
static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
/**
* Computes the value of the maximum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the maximum component.
*/
static maximumComponent(cartesian: Cartesian4): number;
/**
* Computes the value of the minimum component for the supplied Cartesian.
* @param cartesian - The cartesian to use.
* @returns The value of the minimum component.
*/
static minimumComponent(cartesian: Cartesian4): number;
/**
* Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the minimum components.
*/
static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
* @param first - A cartesian to compare.
* @param second - A cartesian to compare.
* @param result - The object into which to store the result.
* @returns A cartesian with the maximum components.
*/
static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the provided Cartesian's squared magnitude.
* @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
* @returns The squared magnitude.
*/
static magnitudeSquared(cartesian: Cartesian4): number;
/**
* Computes the Cartesian's magnitude (length).
* @param cartesian - The Cartesian instance whose magnitude is to be computed.
* @returns The magnitude.
*/
static magnitude(cartesian: Cartesian4): number;
/**
* Computes the 4-space distance between two points.
* @example
* // Returns 1.0
* const d = Cesium.Cartesian4.distance(
* new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
* new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distance(left: Cartesian4, right: Cartesian4): number;
/**
* Computes the squared distance between two points. Comparing squared distances
* using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
* @example
* // Returns 4.0, not 2.0
* const d = Cesium.Cartesian4.distance(
* new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
* new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
* @param left - The first point to compute the distance from.
* @param right - The second point to compute the distance to.
* @returns The distance between two points.
*/
static distanceSquared(left: Cartesian4, right: Cartesian4): number;
/**
* Computes the normalized form of the supplied Cartesian.
* @param cartesian - The Cartesian to be normalized.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the dot (scalar) product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @returns The dot product.
*/
static dot(left: Cartesian4, right: Cartesian4): number;
/**
* Computes the componentwise product of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the componentwise quotient of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the componentwise sum of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the componentwise difference of two Cartesians.
* @param left - The first Cartesian.
* @param right - The second Cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Multiplies the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be scaled.
* @param scalar - The scalar to multiply with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
/**
* Divides the provided Cartesian componentwise by the provided scalar.
* @param cartesian - The Cartesian to be divided.
* @param scalar - The scalar to divide by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
/**
* Negates the provided Cartesian.
* @param cartesian - The Cartesian to be negated.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the absolute value of the provided Cartesian.
* @param cartesian - The Cartesian whose absolute value is to be computed.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the linear interpolation or extrapolation at t using the provided cartesians.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
/**
* Returns the axis that is most orthogonal to the provided Cartesian.
* @param cartesian - The Cartesian on which to find the most orthogonal axis.
* @param result - The object onto which to store the result.
* @returns The most orthogonal axis.
*/
static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Compares the provided Cartesians componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Cartesian4, right?: Cartesian4): boolean;
/**
* Compares the provided Cartesians componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [left] - The first Cartesian.
* @param [right] - The second Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
*/
static readonly ZERO: Cartesian4;
/**
* An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).
*/
static readonly ONE: Cartesian4;
/**
* An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
*/
static readonly UNIT_X: Cartesian4;
/**
* An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
*/
static readonly UNIT_Y: Cartesian4;
/**
* An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
*/
static readonly UNIT_Z: Cartesian4;
/**
* An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
*/
static readonly UNIT_W: Cartesian4;
/**
* Duplicates this Cartesian4 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
*/
clone(result?: Cartesian4): Cartesian4;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side Cartesian.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Cartesian4): boolean;
/**
* Compares this Cartesian against the provided Cartesian componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [right] - The right hand side Cartesian.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Creates a string representing this Cartesian in the format '(x, y, z, w)'.
* @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
*/
toString(): string;
/**
* Packs an arbitrary floating point value to 4 values representable using uint8.
* @param value - A floating point number.
* @param [result] - The Cartesian4 that will contain the packed float.
* @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
*/
static packFloat(value: number, result?: Cartesian4): Cartesian4;
}
/**
* A position defined by longitude, latitude, and height.
* @param [longitude = 0.0] - The longitude, in radians.
* @param [latitude = 0.0] - The latitude, in radians.
* @param [height = 0.0] - The height, in meters, above the ellipsoid.
*/
export class Cartographic {
constructor(longitude?: number, latitude?: number, height?: number);
/**
* The longitude, in radians.
*/
longitude: number;
/**
* The latitude, in radians.
*/
latitude: number;
/**
* The height, in meters, above the ellipsoid.
*/
height: number;
/**
* Creates a new Cartographic instance from longitude and latitude
* specified in radians.
* @param longitude - The longitude, in radians.
* @param latitude - The latitude, in radians.
* @param [height = 0.0] - The height, in meters, above the ellipsoid.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if one was not provided.
*/
static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
/**
* Creates a new Cartographic instance from longitude and latitude
* specified in degrees. The values in the resulting object will
* be in radians.
* @param longitude - The longitude, in degrees.
* @param latitude - The latitude, in degrees.
* @param [height = 0.0] - The height, in meters, above the ellipsoid.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if one was not provided.
*/
static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
/**
* Creates a new Cartographic instance from a Cartesian position. The values in the
* resulting object will be in radians.
* @param cartesian - The Cartesian position to convert to cartographic representation.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
*/
static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
/**
* Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
* object should be in radians.
* @param cartographic - Input to be converted into a Cartesian3 output.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
* @param [result] - The object onto which to store the result.
* @returns The position
*/
static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
/**
* Duplicates a Cartographic instance.
* @param cartographic - The cartographic to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
*/
static clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
/**
* Compares the provided cartographics componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first cartographic.
* @param [right] - The second cartographic.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Cartographic, right?: Cartographic): boolean;
/**
* Compares the provided cartographics componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [left] - The first cartographic.
* @param [right] - The second cartographic.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
/**
* An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
*/
static readonly ZERO: Cartographic;
/**
* Duplicates this instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if one was not provided.
*/
clone(result?: Cartographic): Cartographic;
/**
* Compares the provided against this cartographic componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The second cartographic.
* @returns true if left and right are equal, false otherwise.
*/
equals(right?: Cartographic): boolean;
/**
* Compares the provided against this cartographic componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [right] - The second cartographic.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
/**
* Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
* @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
*/
toString(): string;
}
/**
* Geocodes queries containing longitude and latitude coordinates and an optional height.
* Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
*/
export class CartographicGeocoderService {
constructor();
/**
* @param query - The query to be sent to the geocoder service
*/
geocode(query: string): Promise;
}
/**
* A Catmull-Rom spline is a cubic spline where the tangent at control points,
* except the first and last, are computed using the previous and next control points.
* Catmull-Rom splines are in the class C1.
* @example
* // spline above the earth from Philadelphia to Los Angeles
* const spline = new Cesium.CatmullRomSpline({
* times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
* points : [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ]
* });
*
* const p0 = spline.evaluate(times[i]); // equal to positions[i]
* const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
* @param options - Object with the following properties:
* @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
* The values are in no way connected to the clock time. They are the parameterization for the curve.
* @param options.points - The array of {@link Cartesian3} control points.
* @param [options.firstTangent] - The tangent of the curve at the first control point.
* If the tangent is not given, it will be estimated.
* @param [options.lastTangent] - The tangent of the curve at the last control point.
* If the tangent is not given, it will be estimated.
*/
export class CatmullRomSpline {
constructor(options: {
times: number[];
points: Cartesian3[];
firstTangent?: Cartesian3;
lastTangent?: Cartesian3;
});
/**
* An array of times for the control points.
*/
readonly times: number[];
/**
* An array of {@link Cartesian3} control points.
*/
readonly points: Cartesian3[];
/**
* The tangent at the first control point.
*/
readonly firstTangent: Cartesian3;
/**
* The tangent at the last control point.
*/
readonly lastTangent: Cartesian3;
/**
* Finds an index i in times such that the parameter
* time is in the interval [times[i], times[i + 1]].
* @param time - The time.
* @returns The index for the element at the start of the interval.
*/
findTimeInterval(time: number): number;
/**
* Wraps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, wrapped around to the updated animation.
*/
wrapTime(time: number): number;
/**
* Clamps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, clamped to the animation period.
*/
clampTime(time: number): number;
/**
* Evaluates the curve at a given time.
* @param time - The time at which to evaluate the curve.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new instance of the point on the curve at the given time.
*/
evaluate(time: number, result?: Cartesian3): Cartesian3;
}
/**
* A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.
* @example
* // Create Arctic DEM terrain with normals.
* const viewer = new Cesium.Viewer('cesiumContainer', {
* terrainProvider : new Cesium.CesiumTerrainProvider({
* url : Cesium.IonResource.fromAssetId(3956),
* requestVertexNormals : true
* })
* });
* @param options - Object with the following properties:
* @param options.url - The URL of the Cesium terrain server.
* @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available.
* @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available.
* @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available.
* @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
* @param [options.credit] - A credit for the data source, which is displayed on the canvas.
*/
export class CesiumTerrainProvider {
constructor(options: {
url: Resource | string | Promise | Promise;
requestVertexNormals?: boolean;
requestWaterMask?: boolean;
requestMetadata?: boolean;
ellipsoid?: Ellipsoid;
credit?: Credit | string;
});
/**
* Requests the geometry for a given tile. This function should not be called before
* {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and
* may optionally include a water mask and an indication of which child tiles are available.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @param [request] - The request object. Intended for internal use only.
* @returns A promise for the requested geometry. If this method
* returns undefined instead of a promise, it is an indication that too many requests are already
* pending and the request will be retried later.
*/
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined;
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
* are passed an instance of {@link TileProviderError}.
*/
readonly errorEvent: Event;
/**
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
* the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
*/
readonly credit: Credit;
/**
* Gets the tiling scheme used by this provider. This function should
* not be called before {@link CesiumTerrainProvider#ready} returns true.
*/
readonly tilingScheme: GeographicTilingScheme;
/**
* Gets a value indicating whether or not the provider is ready for use.
*/
readonly ready: boolean;
/**
* Gets a promise that resolves to true when the provider is ready for use.
*/
readonly readyPromise: Promise;
/**
* Gets a value indicating whether or not the provider includes a water mask. The water mask
* indicates which areas of the globe are water rather than land, so they can be rendered
* as a reflective surface with animated waves. This function should not be
* called before {@link CesiumTerrainProvider#ready} returns true.
*/
readonly hasWaterMask: boolean;
/**
* Gets a value indicating whether or not the requested tiles include vertex normals.
* This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
*/
readonly hasVertexNormals: boolean;
/**
* Gets a value indicating whether or not the requested tiles include metadata.
* This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
*/
readonly hasMetadata: boolean;
/**
* Boolean flag that indicates if the client should request vertex normals from the server.
* Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
* if the server provides vertex normals.
*/
readonly requestVertexNormals: boolean;
/**
* Boolean flag that indicates if the client should request a watermask from the server.
* Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
* if the server provides a watermask.
*/
readonly requestWaterMask: boolean;
/**
* Boolean flag that indicates if the client should request metadata from the server.
* Metadata is appended to the standard tile mesh data only if the client requests the metadata and
* if the server provides a metadata.
*/
readonly requestMetadata: boolean;
/**
* Gets an object that can be used to determine availability of terrain from this provider, such as
* at points and in rectangles. This function should not be called before
* {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
* information is not available. Note that this reflects tiles that are known to be available currently.
* Additional tiles may be discovered to be available in the future, e.g. if availability information
* exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
* is available now will not become unavailable in the future.
*/
readonly availability: TileAvailability;
/**
* Gets the maximum geometric error allowed in a tile at a given level.
* @param level - The tile level for which to get the maximum geometric error.
* @returns The maximum geometric error.
*/
getLevelMaximumGeometricError(level: number): number;
/**
* Determines whether data for a tile is available to be loaded.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if not supported or availability is unknown, otherwise true or false.
*/
getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
/**
* Makes sure we load availability data for a tile
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
*/
loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise;
}
/**
* A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* // Create a circle.
* const circle = new Cesium.CircleGeometry({
* center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
* radius : 100000.0
* });
* const geometry = Cesium.CircleGeometry.createGeometry(circle);
* @param options - Object with the following properties:
* @param options.center - The circle's center point in the fixed frame.
* @param options.radius - The radius in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
* @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
* @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
*/
export class CircleGeometry {
constructor(options: {
center: Cartesian3;
radius: number;
ellipsoid?: Ellipsoid;
height?: number;
granularity?: number;
vertexFormat?: VertexFormat;
extrudedHeight?: number;
stRotation?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
/**
* Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param circleGeometry - A description of the circle.
* @returns The computed vertices and indices.
*/
static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
}
/**
* A description of the outline of a circle on the ellipsoid.
* @example
* // Create a circle.
* const circle = new Cesium.CircleOutlineGeometry({
* center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
* radius : 100000.0
* });
* const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
* @param options - Object with the following properties:
* @param options.center - The circle's center point in the fixed frame.
* @param options.radius - The radius in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
* @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
* @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
* @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
* @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
*/
export class CircleOutlineGeometry {
constructor(options: {
center: Cartesian3;
radius: number;
ellipsoid?: Ellipsoid;
height?: number;
granularity?: number;
extrudedHeight?: number;
numberOfVerticalLines?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
/**
* Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param circleGeometry - A description of the circle.
* @returns The computed vertices and indices.
*/
static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
}
/**
* A simple clock for keeping track of simulated time.
* @example
* // Create a clock that loops on Christmas day 2013 and runs in real-time.
* const clock = new Cesium.Clock({
* startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
* currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
* stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
* clockRange : Cesium.ClockRange.LOOP_STOP,
* clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
* });
* @param [options] - Object with the following properties:
* @param [options.startTime] - The start time of the clock.
* @param [options.stopTime] - The stop time of the clock.
* @param [options.currentTime] - The current time.
* @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
* @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
* @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
* @param [options.canAnimate = true] - Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, for example. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
* @param [options.shouldAnimate = false] - Indicates whether {@link Clock#tick} should attempt to advance time. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
*/
export class Clock {
constructor(options?: {
startTime?: JulianDate;
stopTime?: JulianDate;
currentTime?: JulianDate;
multiplier?: number;
clockStep?: ClockStep;
clockRange?: ClockRange;
canAnimate?: boolean;
shouldAnimate?: boolean;
});
/**
* The start time of the clock.
*/
startTime: JulianDate;
/**
* The stop time of the clock.
*/
stopTime: JulianDate;
/**
* Determines how the clock should behave when
* {@link Clock#startTime} or {@link Clock#stopTime}
* is reached.
*/
clockRange: ClockRange;
/**
* Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
* for example. The clock will only advance time when both
* {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
*/
canAnimate: boolean;
/**
* An {@link Event} that is fired whenever {@link Clock#tick} is called.
*/
onTick: Event;
/**
* An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
*/
onStop: Event;
/**
* The current time.
* Changing this property will change
* {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
* {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
*/
currentTime: JulianDate;
/**
* Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
* If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
* If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
* elapsed system time since the last call to {@link Clock#tick}.
* Changing this property will change
* {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
* {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
*/
multiplier: number;
/**
* Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
* Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
* {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
* {@link Clock#currentTime} to the current system clock time.
*/
clockStep: ClockStep;
/**
* Indicates whether {@link Clock#tick} should attempt to advance time.
* The clock will only advance time when both
* {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
* Changing this property will change
* {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
* {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
*/
shouldAnimate: boolean;
/**
* Advances the clock from the current time based on the current configuration options.
* tick should be called every frame, regardless of whether animation is taking place
* or not. To control animation, use the {@link Clock#shouldAnimate} property.
* @returns The new value of the {@link Clock#currentTime} property.
*/
tick(): JulianDate;
}
/**
* Constants used by {@link Clock#tick} to determine behavior
* when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
*/
export enum ClockRange {
/**
* {@link Clock#tick} will always advances the clock in its current direction.
*/
UNBOUNDED = 0,
/**
* When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
* {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
*/
CLAMPED = 1,
/**
* When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
* {@link Clock#currentTime} to the opposite end of the interval. When
* time is moving backwards, {@link Clock#tick} will not advance past
* {@link Clock#startTime}
*/
LOOP_STOP = 2
}
/**
* Constants to determine how much time advances with each call
* to {@link Clock#tick}.
*/
export enum ClockStep {
/**
* {@link Clock#tick} advances the current time by a fixed step,
* which is the number of seconds specified by {@link Clock#multiplier}.
*/
TICK_DEPENDENT = 0,
/**
* {@link Clock#tick} advances the current time by the amount of system
* time elapsed since the previous call multiplied by {@link Clock#multiplier}.
*/
SYSTEM_CLOCK_MULTIPLIER = 1,
/**
* {@link Clock#tick} sets the clock to the current system time;
* ignoring all other settings.
*/
SYSTEM_CLOCK = 2
}
/**
* A color, specified using red, green, blue, and alpha values,
* which range from 0 (no intensity) to 1.0 (full intensity).
* @param [red = 1.0] - The red component.
* @param [green = 1.0] - The green component.
* @param [blue = 1.0] - The blue component.
* @param [alpha = 1.0] - The alpha component.
*/
export class Color {
constructor(red?: number, green?: number, blue?: number, alpha?: number);
/**
* The red component.
*/
red: number;
/**
* The green component.
*/
green: number;
/**
* The blue component.
*/
blue: number;
/**
* The alpha component.
*/
alpha: number;
/**
* Creates a Color instance from a {@link Cartesian4}. x, y, z,
* and w map to red, green, blue, and alpha, respectively.
* @param cartesian - The source cartesian.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Color instance if one was not provided.
*/
static fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
/**
* Creates a new Color specified using red, green, blue, and alpha values
* that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
* @param [red = 255] - The red component.
* @param [green = 255] - The green component.
* @param [blue = 255] - The blue component.
* @param [alpha = 255] - The alpha component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Color instance if one was not provided.
*/
static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
/**
* Creates a new Color that has the same red, green, and blue components
* of the specified color, but with the specified alpha value.
* @example
* const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
* @param color - The base color
* @param alpha - The new alpha component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Color instance if one was not provided.
*/
static fromAlpha(color: Color, alpha: number, result?: Color): Color;
/**
* Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
* of the system.
* @example
* const color = Cesium.Color.fromRgba(0x67ADDFFF);
* @param rgba - A single numeric unsigned 32-bit RGBA value.
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The color object.
*/
static fromRgba(rgba: number, result?: Color): Color;
/**
* Creates a Color instance from hue, saturation, and lightness.
* @param [hue = 0] - The hue angle 0...1
* @param [saturation = 0] - The saturation value 0...1
* @param [lightness = 0] - The lightness value 0...1
* @param [alpha = 1.0] - The alpha component 0...1
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The color object.
*/
static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
/**
* Creates a random color using the provided options. For reproducible random colors, you should
* call {@link Math#setRandomNumberSeed} once at the beginning of your application.
* @example
* //Create a completely random color
* const color = Cesium.Color.fromRandom();
*
* //Create a random shade of yellow.
* const color1 = Cesium.Color.fromRandom({
* red : 1.0,
* green : 1.0,
* alpha : 1.0
* });
*
* //Create a random bright color.
* const color2 = Cesium.Color.fromRandom({
* minimumRed : 0.75,
* minimumGreen : 0.75,
* minimumBlue : 0.75,
* alpha : 1.0
* });
* @param [options] - Object with the following properties:
* @param [options.red] - If specified, the red component to use instead of a randomized value.
* @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
* @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
* @param [options.green] - If specified, the green component to use instead of a randomized value.
* @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
* @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
* @param [options.blue] - If specified, the blue component to use instead of a randomized value.
* @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
* @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
* @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
* @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
* @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
static fromRandom(options?: {
red?: number;
minimumRed?: number;
maximumRed?: number;
green?: number;
minimumGreen?: number;
maximumGreen?: number;
blue?: number;
minimumBlue?: number;
maximumBlue?: number;
alpha?: number;
minimumAlpha?: number;
maximumAlpha?: number;
}, result?: Color): Color;
/**
* Creates a Color instance from a CSS color value.
* @example
* const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
* const green = Cesium.Color.fromCssColorString('green');
* @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The color object, or undefined if the string was not a valid CSS color.
*/
static fromCssColorString(color: string, result?: Color): Color;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Color, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Color instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Color): Color;
/**
* Converts a 'byte' color component in the range of 0 to 255 into
* a 'float' color component in the range of 0 to 1.0.
* @param number - The number to be converted.
* @returns The converted number.
*/
static byteToFloat(number: number): number;
/**
* Converts a 'float' color component in the range of 0 to 1.0 into
* a 'byte' color component in the range of 0 to 255.
* @param number - The number to be converted.
* @returns The converted number.
*/
static floatToByte(number: number): number;
/**
* Duplicates a Color.
* @param color - The Color to duplicate.
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
*/
static clone(color: Color, result?: Color): Color;
/**
* Returns true if the first Color equals the second color.
* @param left - The first Color to compare for equality.
* @param right - The second Color to compare for equality.
* @returns true if the Colors are equal; otherwise, false.
*/
static equals(left: Color, right: Color): boolean;
/**
* Returns a duplicate of a Color instance.
* @param [result] - The object to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
clone(result?: Color): Color;
/**
* Returns true if this Color equals other.
* @param other - The Color to compare for equality.
* @returns true if the Colors are equal; otherwise, false.
*/
equals(other: Color): boolean;
/**
* Returns true if this Color equals other componentwise within the specified epsilon.
* @param other - The Color to compare for equality.
* @param [epsilon = 0.0] - The epsilon to use for equality testing.
* @returns true if the Colors are equal within the specified epsilon; otherwise, false.
*/
equalsEpsilon(other: Color, epsilon?: number): boolean;
/**
* Creates a string representing this Color in the format '(red, green, blue, alpha)'.
* @returns A string representing this Color in the format '(red, green, blue, alpha)'.
*/
toString(): string;
/**
* Creates a string containing the CSS color value for this color.
* @returns The CSS equivalent of this color.
*/
toCssColorString(): string;
/**
* Creates a string containing CSS hex string color value for this color.
* @returns The CSS hex string equivalent of this color.
*/
toCssHexString(): string;
/**
* Converts this color to an array of red, green, blue, and alpha values
* that are in the range of 0 to 255.
* @param [result] - The array to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
toBytes(result?: number[]): number[];
/**
* Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
* of the system.
* @example
* const rgba = Cesium.Color.BLUE.toRgba();
* @returns A single numeric unsigned 32-bit RGBA value.
*/
toRgba(): number;
/**
* Brightens this color by the provided magnitude.
* @example
* const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
* @param magnitude - A positive number indicating the amount to brighten.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
brighten(magnitude: number, result: Color): Color;
/**
* Darkens this color by the provided magnitude.
* @example
* const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
* @param magnitude - A positive number indicating the amount to darken.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
darken(magnitude: number, result: Color): Color;
/**
* Creates a new Color that has the same red, green, and blue components
* as this Color, but with the specified alpha value.
* @example
* const translucentRed = Cesium.Color.RED.withAlpha(0.9);
* @param alpha - The new alpha component.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Color instance if one was not provided.
*/
withAlpha(alpha: number, result?: Color): Color;
/**
* Computes the componentwise sum of two Colors.
* @param left - The first Color.
* @param right - The second Color.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Color, right: Color, result: Color): Color;
/**
* Computes the componentwise difference of two Colors.
* @param left - The first Color.
* @param right - The second Color.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Color, right: Color, result: Color): Color;
/**
* Computes the componentwise product of two Colors.
* @param left - The first Color.
* @param right - The second Color.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiply(left: Color, right: Color, result: Color): Color;
/**
* Computes the componentwise quotient of two Colors.
* @param left - The first Color.
* @param right - The second Color.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divide(left: Color, right: Color, result: Color): Color;
/**
* Computes the componentwise modulus of two Colors.
* @param left - The first Color.
* @param right - The second Color.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static mod(left: Color, right: Color, result: Color): Color;
/**
* Computes the linear interpolation or extrapolation at t between the provided colors.
* @param start - The color corresponding to t at 0.0.
* @param end - The color corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static lerp(start: Color, end: Color, t: number, result: Color): Color;
/**
* Multiplies the provided Color componentwise by the provided scalar.
* @param color - The Color to be scaled.
* @param scalar - The scalar to multiply with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(color: Color, scalar: number, result: Color): Color;
/**
* Divides the provided Color componentwise by the provided scalar.
* @param color - The Color to be divided.
* @param scalar - The scalar to divide with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideByScalar(color: Color, scalar: number, result: Color): Color;
/**
* An immutable Color instance initialized to CSS color #F0F8FF
*
*/
static readonly ALICEBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #FAEBD7
*
*/
static readonly ANTIQUEWHITE: Color;
/**
* An immutable Color instance initialized to CSS color #00FFFF
*
*/
static readonly AQUA: Color;
/**
* An immutable Color instance initialized to CSS color #7FFFD4
*
*/
static readonly AQUAMARINE: Color;
/**
* An immutable Color instance initialized to CSS color #F0FFFF
*
*/
static readonly AZURE: Color;
/**
* An immutable Color instance initialized to CSS color #F5F5DC
*
*/
static readonly BEIGE: Color;
/**
* An immutable Color instance initialized to CSS color #FFE4C4
*
*/
static readonly BISQUE: Color;
/**
* An immutable Color instance initialized to CSS color #000000
*
*/
static readonly BLACK: Color;
/**
* An immutable Color instance initialized to CSS color #FFEBCD
*
*/
static readonly BLANCHEDALMOND: Color;
/**
* An immutable Color instance initialized to CSS color #0000FF
*
*/
static readonly BLUE: Color;
/**
* An immutable Color instance initialized to CSS color #8A2BE2
*
*/
static readonly BLUEVIOLET: Color;
/**
* An immutable Color instance initialized to CSS color #A52A2A
*
*/
static readonly BROWN: Color;
/**
* An immutable Color instance initialized to CSS color #DEB887
*
*/
static readonly BURLYWOOD: Color;
/**
* An immutable Color instance initialized to CSS color #5F9EA0
*
*/
static readonly CADETBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #7FFF00
*
*/
static readonly CHARTREUSE: Color;
/**
* An immutable Color instance initialized to CSS color #D2691E
*
*/
static readonly CHOCOLATE: Color;
/**
* An immutable Color instance initialized to CSS color #FF7F50
*
*/
static readonly CORAL: Color;
/**
* An immutable Color instance initialized to CSS color #6495ED
*
*/
static readonly CORNFLOWERBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #FFF8DC
*
*/
static readonly CORNSILK: Color;
/**
* An immutable Color instance initialized to CSS color #DC143C
*
*/
static readonly CRIMSON: Color;
/**
* An immutable Color instance initialized to CSS color #00FFFF
*
*/
static readonly CYAN: Color;
/**
* An immutable Color instance initialized to CSS color #00008B
*
*/
static readonly DARKBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #008B8B
*
*/
static readonly DARKCYAN: Color;
/**
* An immutable Color instance initialized to CSS color #B8860B
*
*/
static readonly DARKGOLDENROD: Color;
/**
* An immutable Color instance initialized to CSS color #A9A9A9
*
*/
static readonly DARKGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #006400
*
*/
static readonly DARKGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #A9A9A9
*
*/
static readonly DARKGREY: Color;
/**
* An immutable Color instance initialized to CSS color #BDB76B
*
*/
static readonly DARKKHAKI: Color;
/**
* An immutable Color instance initialized to CSS color #8B008B
*
*/
static readonly DARKMAGENTA: Color;
/**
* An immutable Color instance initialized to CSS color #556B2F
*
*/
static readonly DARKOLIVEGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #FF8C00
*
*/
static readonly DARKORANGE: Color;
/**
* An immutable Color instance initialized to CSS color #9932CC
*
*/
static readonly DARKORCHID: Color;
/**
* An immutable Color instance initialized to CSS color #8B0000
*
*/
static readonly DARKRED: Color;
/**
* An immutable Color instance initialized to CSS color #E9967A
*
*/
static readonly DARKSALMON: Color;
/**
* An immutable Color instance initialized to CSS color #8FBC8F
*
*/
static readonly DARKSEAGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #483D8B
*
*/
static readonly DARKSLATEBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #2F4F4F
*
*/
static readonly DARKSLATEGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #2F4F4F
*
*/
static readonly DARKSLATEGREY: Color;
/**
* An immutable Color instance initialized to CSS color #00CED1
*
*/
static readonly DARKTURQUOISE: Color;
/**
* An immutable Color instance initialized to CSS color #9400D3
*
*/
static readonly DARKVIOLET: Color;
/**
* An immutable Color instance initialized to CSS color #FF1493
*
*/
static readonly DEEPPINK: Color;
/**
* An immutable Color instance initialized to CSS color #00BFFF
*
*/
static readonly DEEPSKYBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #696969
*
*/
static readonly DIMGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #696969
*
*/
static readonly DIMGREY: Color;
/**
* An immutable Color instance initialized to CSS color #1E90FF
*
*/
static readonly DODGERBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #B22222
*
*/
static readonly FIREBRICK: Color;
/**
* An immutable Color instance initialized to CSS color #FFFAF0
*
*/
static readonly FLORALWHITE: Color;
/**
* An immutable Color instance initialized to CSS color #228B22
*
*/
static readonly FORESTGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #FF00FF
*
*/
static readonly FUCHSIA: Color;
/**
* An immutable Color instance initialized to CSS color #DCDCDC
*
*/
static readonly GAINSBORO: Color;
/**
* An immutable Color instance initialized to CSS color #F8F8FF
*
*/
static readonly GHOSTWHITE: Color;
/**
* An immutable Color instance initialized to CSS color #FFD700
*
*/
static readonly GOLD: Color;
/**
* An immutable Color instance initialized to CSS color #DAA520
*
*/
static readonly GOLDENROD: Color;
/**
* An immutable Color instance initialized to CSS color #808080
*
*/
static readonly GRAY: Color;
/**
* An immutable Color instance initialized to CSS color #008000
*
*/
static readonly GREEN: Color;
/**
* An immutable Color instance initialized to CSS color #ADFF2F
*
*/
static readonly GREENYELLOW: Color;
/**
* An immutable Color instance initialized to CSS color #808080
*
*/
static readonly GREY: Color;
/**
* An immutable Color instance initialized to CSS color #F0FFF0
*
*/
static readonly HONEYDEW: Color;
/**
* An immutable Color instance initialized to CSS color #FF69B4
*
*/
static readonly HOTPINK: Color;
/**
* An immutable Color instance initialized to CSS color #CD5C5C
*
*/
static readonly INDIANRED: Color;
/**
* An immutable Color instance initialized to CSS color #4B0082
*
*/
static readonly INDIGO: Color;
/**
* An immutable Color instance initialized to CSS color #FFFFF0
*
*/
static readonly IVORY: Color;
/**
* An immutable Color instance initialized to CSS color #F0E68C
*
*/
static readonly KHAKI: Color;
/**
* An immutable Color instance initialized to CSS color #E6E6FA
*
*/
static readonly LAVENDER: Color;
/**
* An immutable Color instance initialized to CSS color #FFF0F5
*
*/
static readonly LAVENDAR_BLUSH: Color;
/**
* An immutable Color instance initialized to CSS color #7CFC00
*
*/
static readonly LAWNGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #FFFACD
*
*/
static readonly LEMONCHIFFON: Color;
/**
* An immutable Color instance initialized to CSS color #ADD8E6
*
*/
static readonly LIGHTBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #F08080
*
*/
static readonly LIGHTCORAL: Color;
/**
* An immutable Color instance initialized to CSS color #E0FFFF
*
*/
static readonly LIGHTCYAN: Color;
/**
* An immutable Color instance initialized to CSS color #FAFAD2
*
*/
static readonly LIGHTGOLDENRODYELLOW: Color;
/**
* An immutable Color instance initialized to CSS color #D3D3D3
*
*/
static readonly LIGHTGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #90EE90
*
*/
static readonly LIGHTGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #D3D3D3
*
*/
static readonly LIGHTGREY: Color;
/**
* An immutable Color instance initialized to CSS color #FFB6C1
*
*/
static readonly LIGHTPINK: Color;
/**
* An immutable Color instance initialized to CSS color #20B2AA
*
*/
static readonly LIGHTSEAGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #87CEFA
*
*/
static readonly LIGHTSKYBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #778899
*
*/
static readonly LIGHTSLATEGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #778899
*
*/
static readonly LIGHTSLATEGREY: Color;
/**
* An immutable Color instance initialized to CSS color #B0C4DE
*
*/
static readonly LIGHTSTEELBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #FFFFE0
*
*/
static readonly LIGHTYELLOW: Color;
/**
* An immutable Color instance initialized to CSS color #00FF00
*
*/
static readonly LIME: Color;
/**
* An immutable Color instance initialized to CSS color #32CD32
*
*/
static readonly LIMEGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #FAF0E6
*
*/
static readonly LINEN: Color;
/**
* An immutable Color instance initialized to CSS color #FF00FF
*
*/
static readonly MAGENTA: Color;
/**
* An immutable Color instance initialized to CSS color #800000
*
*/
static readonly MAROON: Color;
/**
* An immutable Color instance initialized to CSS color #66CDAA
*
*/
static readonly MEDIUMAQUAMARINE: Color;
/**
* An immutable Color instance initialized to CSS color #0000CD
*
*/
static readonly MEDIUMBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #BA55D3
*
*/
static readonly MEDIUMORCHID: Color;
/**
* An immutable Color instance initialized to CSS color #9370DB
*
*/
static readonly MEDIUMPURPLE: Color;
/**
* An immutable Color instance initialized to CSS color #3CB371
*
*/
static readonly MEDIUMSEAGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #7B68EE
*
*/
static readonly MEDIUMSLATEBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #00FA9A
*
*/
static readonly MEDIUMSPRINGGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #48D1CC
*
*/
static readonly MEDIUMTURQUOISE: Color;
/**
* An immutable Color instance initialized to CSS color #C71585
*
*/
static readonly MEDIUMVIOLETRED: Color;
/**
* An immutable Color instance initialized to CSS color #191970
*
*/
static readonly MIDNIGHTBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #F5FFFA
*
*/
static readonly MINTCREAM: Color;
/**
* An immutable Color instance initialized to CSS color #FFE4E1
*
*/
static readonly MISTYROSE: Color;
/**
* An immutable Color instance initialized to CSS color #FFE4B5
*
*/
static readonly MOCCASIN: Color;
/**
* An immutable Color instance initialized to CSS color #FFDEAD
*
*/
static readonly NAVAJOWHITE: Color;
/**
* An immutable Color instance initialized to CSS color #000080
*
*/
static readonly NAVY: Color;
/**
* An immutable Color instance initialized to CSS color #FDF5E6
*
*/
static readonly OLDLACE: Color;
/**
* An immutable Color instance initialized to CSS color #808000
*
*/
static readonly OLIVE: Color;
/**
* An immutable Color instance initialized to CSS color #6B8E23
*
*/
static readonly OLIVEDRAB: Color;
/**
* An immutable Color instance initialized to CSS color #FFA500
*
*/
static readonly ORANGE: Color;
/**
* An immutable Color instance initialized to CSS color #FF4500
*
*/
static readonly ORANGERED: Color;
/**
* An immutable Color instance initialized to CSS color #DA70D6
*
*/
static readonly ORCHID: Color;
/**
* An immutable Color instance initialized to CSS color #EEE8AA
*
*/
static readonly PALEGOLDENROD: Color;
/**
* An immutable Color instance initialized to CSS color #98FB98
*
*/
static readonly PALEGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #AFEEEE
*
*/
static readonly PALETURQUOISE: Color;
/**
* An immutable Color instance initialized to CSS color #DB7093
*
*/
static readonly PALEVIOLETRED: Color;
/**
* An immutable Color instance initialized to CSS color #FFEFD5
*
*/
static readonly PAPAYAWHIP: Color;
/**
* An immutable Color instance initialized to CSS color #FFDAB9
*
*/
static readonly PEACHPUFF: Color;
/**
* An immutable Color instance initialized to CSS color #CD853F
*
*/
static readonly PERU: Color;
/**
* An immutable Color instance initialized to CSS color #FFC0CB
*
*/
static readonly PINK: Color;
/**
* An immutable Color instance initialized to CSS color #DDA0DD
*
*/
static readonly PLUM: Color;
/**
* An immutable Color instance initialized to CSS color #B0E0E6
*
*/
static readonly POWDERBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #800080
*
*/
static readonly PURPLE: Color;
/**
* An immutable Color instance initialized to CSS color #FF0000
*
*/
static readonly RED: Color;
/**
* An immutable Color instance initialized to CSS color #BC8F8F
*
*/
static readonly ROSYBROWN: Color;
/**
* An immutable Color instance initialized to CSS color #4169E1
*
*/
static readonly ROYALBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #8B4513
*
*/
static readonly SADDLEBROWN: Color;
/**
* An immutable Color instance initialized to CSS color #FA8072
*
*/
static readonly SALMON: Color;
/**
* An immutable Color instance initialized to CSS color #F4A460
*
*/
static readonly SANDYBROWN: Color;
/**
* An immutable Color instance initialized to CSS color #2E8B57
*
*/
static readonly SEAGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #FFF5EE
*
*/
static readonly SEASHELL: Color;
/**
* An immutable Color instance initialized to CSS color #A0522D
*
*/
static readonly SIENNA: Color;
/**
* An immutable Color instance initialized to CSS color #C0C0C0
*
*/
static readonly SILVER: Color;
/**
* An immutable Color instance initialized to CSS color #87CEEB
*
*/
static readonly SKYBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #6A5ACD
*
*/
static readonly SLATEBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #708090
*
*/
static readonly SLATEGRAY: Color;
/**
* An immutable Color instance initialized to CSS color #708090
*
*/
static readonly SLATEGREY: Color;
/**
* An immutable Color instance initialized to CSS color #FFFAFA
*
*/
static readonly SNOW: Color;
/**
* An immutable Color instance initialized to CSS color #00FF7F
*
*/
static readonly SPRINGGREEN: Color;
/**
* An immutable Color instance initialized to CSS color #4682B4
*
*/
static readonly STEELBLUE: Color;
/**
* An immutable Color instance initialized to CSS color #D2B48C
*
*/
static readonly TAN: Color;
/**
* An immutable Color instance initialized to CSS color #008080
*
*/
static readonly TEAL: Color;
/**
* An immutable Color instance initialized to CSS color #D8BFD8
*
*/
static readonly THISTLE: Color;
/**
* An immutable Color instance initialized to CSS color #FF6347
*
*/
static readonly TOMATO: Color;
/**
* An immutable Color instance initialized to CSS color #40E0D0
*
*/
static readonly TURQUOISE: Color;
/**
* An immutable Color instance initialized to CSS color #EE82EE
*
*/
static readonly VIOLET: Color;
/**
* An immutable Color instance initialized to CSS color #F5DEB3
*
*/
static readonly WHEAT: Color;
/**
* An immutable Color instance initialized to CSS color #FFFFFF
*
*/
static readonly WHITE: Color;
/**
* An immutable Color instance initialized to CSS color #F5F5F5
*
*/
static readonly WHITESMOKE: Color;
/**
* An immutable Color instance initialized to CSS color #FFFF00
*
*/
static readonly YELLOW: Color;
/**
* An immutable Color instance initialized to CSS color #9ACD32
*
*/
static readonly YELLOWGREEN: Color;
/**
* An immutable Color instance initialized to CSS transparent.
*
*/
static readonly TRANSPARENT: Color;
}
/**
* Value and type information for per-instance geometry color.
* @example
* const instance = new Cesium.GeometryInstance({
* geometry : Cesium.BoxGeometry.fromDimensions({
* dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
* }),
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
* id : 'box',
* attributes : {
* color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
* }
* });
* @param [red = 1.0] - The red component.
* @param [green = 1.0] - The green component.
* @param [blue = 1.0] - The blue component.
* @param [alpha = 1.0] - The alpha component.
*/
export class ColorGeometryInstanceAttribute {
constructor(red?: number, green?: number, blue?: number, alpha?: number);
/**
* The values for the attributes stored in a typed array.
*/
value: Uint8Array;
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link ColorGeometryInstanceAttribute#value}.
*/
readonly componentDatatype: ComponentDatatype;
/**
* The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
*/
readonly componentsPerAttribute: number;
/**
* When true and componentDatatype is an integer format,
* indicate that the components should be mapped to the range [0, 1] (unsigned)
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
*/
readonly normalize: boolean;
/**
* Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
* @example
* const instance = new Cesium.GeometryInstance({
* geometry : geometry,
* attributes : {
* color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
* }
* });
* @param color - The color.
* @returns The new {@link ColorGeometryInstanceAttribute} instance.
*/
static fromColor(color: Color): ColorGeometryInstanceAttribute;
/**
* Converts a color to a typed array that can be used to assign a color attribute.
* @example
* const attributes = primitive.getGeometryInstanceAttributes('an id');
* attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
* @param color - The color.
* @param [result] - The array to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
static toValue(color: Color, result?: Uint8Array): Uint8Array;
/**
* Compares the provided ColorGeometryInstanceAttributes and returns
* true if they are equal, false otherwise.
* @param [left] - The first ColorGeometryInstanceAttribute.
* @param [right] - The second ColorGeometryInstanceAttribute.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
}
/**
* WebGL component datatypes. Components are intrinsics,
* which form attributes, which form vertices.
*/
export enum ComponentDatatype {
/**
* 8-bit signed byte corresponding to gl.BYTE and the type
* of an element in Int8Array.
*/
BYTE = WebGLConstants.BYTE,
/**
* 8-bit unsigned byte corresponding to UNSIGNED_BYTE and the type
* of an element in Uint8Array.
*/
UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
/**
* 16-bit signed short corresponding to SHORT and the type
* of an element in Int16Array.
*/
SHORT = WebGLConstants.SHORT,
/**
* 16-bit unsigned short corresponding to UNSIGNED_SHORT and the type
* of an element in Uint16Array.
*/
UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
/**
* 32-bit signed int corresponding to INT and the type
* of an element in Int32Array.
*/
INT = WebGLConstants.INT,
/**
* 32-bit unsigned int corresponding to UNSIGNED_INT and the type
* of an element in Uint32Array.
*/
UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
/**
* 32-bit floating-point corresponding to FLOAT and the type
* of an element in Float32Array.
*/
FLOAT = WebGLConstants.FLOAT,
/**
* 64-bit floating-point corresponding to gl.DOUBLE (in Desktop OpenGL;
* this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
* and the type of an element in Float64Array.
*/
DOUBLE = WebGLConstants.DOUBLE
}
/**
* Describes a compressed texture and contains a compressed texture buffer.
* @param internalFormat - The pixel format of the compressed texture.
* @param pixelDatatype - The pixel datatype of the compressed texture.
* @param width - The width of the texture.
* @param height - The height of the texture.
* @param buffer - The compressed texture buffer.
*/
export class CompressedTextureBuffer {
constructor(internalFormat: PixelFormat, pixelDatatype: PixelDatatype, width: number, height: number, buffer: Uint8Array);
/**
* The format of the compressed texture.
*/
readonly internalFormat: PixelFormat;
/**
* The datatype of the compressed texture.
*/
readonly pixelDatatype: PixelDatatype;
/**
* The width of the texture.
*/
readonly width: number;
/**
* The height of the texture.
*/
readonly height: number;
/**
* The compressed texture buffer.
*/
readonly bufferView: Uint8Array;
/**
* Creates a shallow clone of a compressed texture buffer.
* @param object - The compressed texture buffer to be cloned.
* @returns A shallow clone of the compressed texture buffer.
*/
static clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
/**
* Creates a shallow clone of this compressed texture buffer.
* @returns A shallow clone of the compressed texture buffer.
*/
clone(): CompressedTextureBuffer;
}
/**
* A description of a polygon composed of arbitrary coplanar positions.
* @example
* const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
* polygonHierarchy: new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArrayHeights([
* -90.0, 30.0, 0.0,
* -90.0, 30.0, 300000.0,
* -80.0, 30.0, 300000.0,
* -80.0, 30.0, 0.0
* ]))
* });
* @param options - Object with the following properties:
* @param options.polygonHierarchy - A polygon hierarchy that can include holes.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
*/
export class CoplanarPolygonGeometry {
constructor(options: {
polygonHierarchy: PolygonHierarchy;
stRotation?: number;
vertexFormat?: VertexFormat;
ellipsoid?: Ellipsoid;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* A description of a coplanar polygon from an array of positions.
* @example
* // create a polygon from points
* const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
* positions : Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* });
* const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
* @param options - Object with the following properties:
* @param options.positions - An array of positions that defined the corner points of the polygon.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
*/
static fromPositions(options: {
positions: Cartesian3[];
vertexFormat?: VertexFormat;
stRotation?: number;
ellipsoid?: Ellipsoid;
}): CoplanarPolygonGeometry;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
/**
* Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
* @param polygonGeometry - A description of the polygon.
* @returns The computed vertices and indices.
*/
static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
}
/**
* A description of the outline of a polygon composed of arbitrary coplanar positions.
* @example
* const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
* positions : Cesium.Cartesian3.fromDegreesArrayHeights([
* -90.0, 30.0, 0.0,
* -90.0, 30.0, 1000.0,
* -80.0, 30.0, 1000.0,
* -80.0, 30.0, 0.0
* ])
* });
* const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
* @param options - Object with the following properties:
* @param options.polygonHierarchy - A polygon hierarchy that can include holes.
*/
export class CoplanarPolygonOutlineGeometry {
constructor(options: {
polygonHierarchy: PolygonHierarchy;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* A description of a coplanar polygon outline from an array of positions.
* @param options - Object with the following properties:
* @param options.positions - An array of positions that defined the corner points of the polygon.
*/
static fromPositions(options: {
positions: Cartesian3[];
}): CoplanarPolygonOutlineGeometry;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
/**
* Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
* @param polygonGeometry - A description of the polygon.
* @returns The computed vertices and indices.
*/
static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
}
/**
* Style options for corners.
*/
export enum CornerType {
/**
*
*
* Corner has a smooth edge.
*/
ROUNDED = 0,
/**
*
*
* Corner point is the intersection of adjacent edges.
*/
MITERED = 1,
/**
*
*
* Corner is clipped.
*/
BEVELED = 2
}
/**
* A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* const corridor = new Cesium.CorridorGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
* positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
* width : 100000
* });
* @param options - Object with the following properties:
* @param options.positions - An array of positions that define the center of the corridor.
* @param options.width - The distance between the edges of the corridor in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
* @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
*/
export class CorridorGeometry {
constructor(options: {
positions: Cartesian3[];
width: number;
ellipsoid?: Ellipsoid;
granularity?: number;
height?: number;
extrudedHeight?: number;
vertexFormat?: VertexFormat;
cornerType?: CornerType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
/**
* Computes the bounding rectangle given the provided options
* @param options - Object with the following properties:
* @param options.positions - An array of positions that define the center of the corridor.
* @param options.width - The distance between the edges of the corridor in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
* @param [result] - An object in which to store the result.
* @returns The result rectangle.
*/
static computeRectangle(options: {
positions: Cartesian3[];
width: number;
ellipsoid?: Ellipsoid;
cornerType?: CornerType;
}, result?: Rectangle): Rectangle;
/**
* Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
* @param corridorGeometry - A description of the corridor.
* @returns The computed vertices and indices.
*/
static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
}
/**
* A description of a corridor outline.
* @example
* const corridor = new Cesium.CorridorOutlineGeometry({
* positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
* width : 100000
* });
* @param options - Object with the following properties:
* @param options.positions - An array of positions that define the center of the corridor outline.
* @param options.width - The distance between the edges of the corridor outline.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
* @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
* @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
*/
export class CorridorOutlineGeometry {
constructor(options: {
positions: Cartesian3[];
width: number;
ellipsoid?: Ellipsoid;
granularity?: number;
height?: number;
extrudedHeight?: number;
cornerType?: CornerType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
/**
* Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
* @param corridorOutlineGeometry - A description of the corridor.
* @returns The computed vertices and indices.
*/
static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
}
/**
* A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
* @example
* //Create a credit with a tooltip, image and link
* const credit = new Cesium.Credit('');
* @param html - An string representing an html code snippet
* @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
*/
export class Credit {
constructor(html: string, showOnScreen?: boolean);
/**
* The credit content
*/
readonly html: string;
/**
* Whether the credit should be displayed on screen or in a lightbox
*/
showOnScreen: boolean;
/**
* Gets the credit element
*/
readonly element: HTMLElement;
/**
* Returns true if the credits are equal
* @param left - The first credit
* @param right - The second credit
* @returns true if left and right are equal, false otherwise.
*/
static equals(left: Credit, right: Credit): boolean;
/**
* Returns true if the credits are equal
* @param credit - The credit to compare to.
* @returns true if left and right are equal, false otherwise.
*/
equals(credit: Credit): boolean;
/**
* Duplicates a Credit instance.
* @param [credit] - The Credit to duplicate.
* @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
*/
static clone(credit?: Credit): Credit;
}
/**
* Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
*/
export namespace CubicRealPolynomial {
/**
* Provides the discriminant of the cubic equation from the supplied coefficients.
* @param a - The coefficient of the 3rd order monomial.
* @param b - The coefficient of the 2nd order monomial.
* @param c - The coefficient of the 1st order monomial.
* @param d - The coefficient of the 0th order monomial.
* @returns The value of the discriminant.
*/
function computeDiscriminant(a: number, b: number, c: number, d: number): number;
/**
* Provides the real valued roots of the cubic polynomial with the provided coefficients.
* @param a - The coefficient of the 3rd order monomial.
* @param b - The coefficient of the 2nd order monomial.
* @param c - The coefficient of the 1st order monomial.
* @param d - The coefficient of the 0th order monomial.
* @returns The real valued roots.
*/
function computeRealRoots(a: number, b: number, c: number, d: number): number[];
}
/**
* The culling volume defined by planes.
* @param [planes] - An array of clipping planes.
*/
export class CullingVolume {
constructor(planes?: Cartesian4[]);
/**
* Each plane is represented by a Cartesian4 object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin.
*/
planes: Cartesian4[];
/**
* Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
* The planes are aligned to the x, y, and z axes in world coordinates.
* @param boundingSphere - The bounding sphere used to create the culling volume.
* @param [result] - The object onto which to store the result.
* @returns The culling volume created from the bounding sphere.
*/
static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
/**
* Determines whether a bounding volume intersects the culling volume.
* @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
* @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
*/
computeVisibility(boundingVolume: any): Intersect;
}
export namespace CustomHeightmapTerrainProvider {
/**
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
*/
type GeometryCallback = (x: number, y: number, level: number) => Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | number[] | Promise | undefined;
}
/**
* A simple {@link TerrainProvider} that gets height values from a callback function.
* It can be used for procedurally generated terrain or as a way to load custom
* heightmap data without creating a subclass of {@link TerrainProvider}.
*
* There are some limitations such as no water mask, no vertex normals, and no
* availability, so a full-fledged {@link TerrainProvider} subclass is better suited
* for these more sophisticated use cases.
* @example
* const viewer = new Cesium.Viewer("cesiumContainer", {
* terrainProvider: new Cesium.CustomHeightmapTerrainProvider({
* width: 32,
* height: 32,
* callback: function (x, y, level) {
* return new Float32Array(32 * 32); // all zeros
* },
* }),
* });
* @param options - Object with the following properties:
* @param options.callback - The callback function for requesting tile geometry.
* @param options.width - The number of columns per heightmap tile.
* @param options.height - The number of rows per heightmap tile.
* @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
* surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
* is used.
* @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
* parameter is specified, the WGS84 ellipsoid is used.
* @param [options.credit] - A credit for the data source, which is displayed on the canvas.
*/
export class CustomHeightmapTerrainProvider {
constructor(options: {
callback: CustomHeightmapTerrainProvider.GeometryCallback;
width: number;
height: number;
tilingScheme?: TilingScheme;
ellipsoid?: Ellipsoid;
credit?: Credit | string;
});
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
* are passed an instance of {@link TileProviderError}.
*/
readonly errorEvent: Event;
/**
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
* the source of the terrain.
*/
readonly credit: Credit;
/**
* Gets the tiling scheme used by this provider.
*/
readonly tilingScheme: TilingScheme;
/**
* Gets a value indicating whether or not the provider is ready for use.
*/
readonly ready: boolean;
/**
* Gets a promise that resolves to true when the provider is ready for use.
*/
readonly readyPromise: Promise;
/**
* Gets a value indicating whether or not the provider includes a water mask. The water mask
* indicates which areas of the globe are water rather than land, so they can be rendered
* as a reflective surface with animated waves.
* Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return
* value will always be false.
*/
readonly hasWaterMask: boolean;
/**
* Gets a value indicating whether or not the requested tiles include vertex normals.
* Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return
* value will always be false.
*/
readonly hasVertexNormals: boolean;
/**
* Gets the number of columns per heightmap tile.
*/
readonly width: boolean;
/**
* Gets the number of rows per heightmap tile.
*/
readonly height: boolean;
/**
* Requests the geometry for a given tile. The result includes terrain
* data and indicates that all child tiles are available.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @param [request] - The request object. Intended for internal use only.
* @returns A promise for the requested geometry. If this method
* returns undefined instead of a promise, it is an indication that too many requests are already
* pending and the request will be retried later.
*/
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined;
/**
* Gets the maximum geometric error allowed in a tile at a given level.
* @param level - The tile level for which to get the maximum geometric error.
* @returns The maximum geometric error.
*/
getLevelMaximumGeometricError(level: number): number;
/**
* Determines whether data for a tile is available to be loaded.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if not supported, otherwise true or false.
*/
getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
/**
* Makes sure we load availability data for a tile
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
*/
loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise;
}
/**
* A description of a cylinder.
* @example
* // create cylinder geometry
* const cylinder = new Cesium.CylinderGeometry({
* length: 200000,
* topRadius: 80000,
* bottomRadius: 200000,
* });
* const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
* @param options - Object with the following properties:
* @param options.length - The length of the cylinder.
* @param options.topRadius - The radius of the top of the cylinder.
* @param options.bottomRadius - The radius of the bottom of the cylinder.
* @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class CylinderGeometry {
constructor(options: {
length: number;
topRadius: number;
bottomRadius: number;
slices?: number;
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
/**
* Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
* @param cylinderGeometry - A description of the cylinder.
* @returns The computed vertices and indices.
*/
static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
}
/**
* A description of the outline of a cylinder.
* @example
* // create cylinder geometry
* const cylinder = new Cesium.CylinderOutlineGeometry({
* length: 200000,
* topRadius: 80000,
* bottomRadius: 200000,
* });
* const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
* @param options - Object with the following properties:
* @param options.length - The length of the cylinder.
* @param options.topRadius - The radius of the top of the cylinder.
* @param options.bottomRadius - The radius of the bottom of the cylinder.
* @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
* @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
*/
export class CylinderOutlineGeometry {
constructor(options: {
length: number;
topRadius: number;
bottomRadius: number;
slices?: number;
numberOfVerticalLines?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
/**
* Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
* @param cylinderGeometry - A description of the cylinder outline.
* @returns The computed vertices and indices.
*/
static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
}
/**
* A simple proxy that appends the desired resource as the sole query parameter
* to the given proxy URL.
* @param proxy - The proxy URL that will be used to requests all resources.
*/
export class DefaultProxy extends Proxy {
constructor(proxy: string);
/**
* Get the final URL to use to request a given resource.
* @param resource - The resource to request.
* @returns proxied resource
*/
getURL(resource: string): string;
}
/**
* Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
* argument out of range, etc. This exception should only be thrown during development;
* it usually indicates a bug in the calling code. This exception should never be
* caught; instead the calling code should strive not to generate it.
*
* On the other hand, a {@link RuntimeError} indicates an exception that may
* be thrown at runtime, e.g., out of memory, that the calling code should be prepared
* to catch.
* @param [message] - The error message for this exception.
*/
export class DeveloperError extends Error {
constructor(message?: string);
/**
* 'DeveloperError' indicating that this exception was thrown due to a developer error.
*/
readonly name: string;
/**
* The explanation for why this exception was thrown.
*/
readonly message: string;
/**
* The stack trace of this exception, if available.
*/
readonly stack: string;
}
/**
* Determines visibility based on the distance to the camera.
* @example
* // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
* billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
* @param [near = 0.0] - The smallest distance in the interval where the object is visible.
* @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
*/
export class DistanceDisplayCondition {
constructor(near?: number, far?: number);
/**
* The smallest distance in the interval where the object is visible.
*/
near: number;
/**
* The largest distance in the interval where the object is visible.
*/
far: number;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
/**
* Determines if two distance display conditions are equal.
* @param left - A distance display condition.
* @param right - Another distance display condition.
* @returns Whether the two distance display conditions are equal.
*/
static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
/**
* Duplicates a distance display condition instance.
* @param [value] - The distance display condition to duplicate.
* @param [result] - The result onto which to store the result.
* @returns The duplicated instance.
*/
static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
/**
* Duplicates this instance.
* @param [result] - The result onto which to store the result.
* @returns The duplicated instance.
*/
clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
/**
* Determines if this distance display condition is equal to another.
* @param other - Another distance display condition.
* @returns Whether this distance display condition is equal to the other.
*/
equals(other: DistanceDisplayCondition): boolean;
}
/**
* Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
* @example
* const instance = new Cesium.GeometryInstance({
* geometry : new Cesium.BoxGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
* minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
* maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
* }),
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
* id : 'box',
* attributes : {
* distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
* }
* });
* @param [near = 0.0] - The near distance.
* @param [far = Number.MAX_VALUE] - The far distance.
*/
export class DistanceDisplayConditionGeometryInstanceAttribute {
constructor(near?: number, far?: number);
/**
* The values for the attributes stored in a typed array.
*/
value: Float32Array;
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
*/
readonly componentDatatype: ComponentDatatype;
/**
* The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
*/
readonly componentsPerAttribute: number;
/**
* When true and componentDatatype is an integer format,
* indicate that the components should be mapped to the range [0, 1] (unsigned)
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
*/
readonly normalize: boolean;
/**
* Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
* @example
* const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
* const instance = new Cesium.GeometryInstance({
* geometry : geometry,
* attributes : {
* distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
* }
* });
* @param distanceDisplayCondition - The distance display condition.
* @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
*/
static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
/**
* Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
* @example
* const attributes = primitive.getGeometryInstanceAttributes('an id');
* attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
* @param distanceDisplayCondition - The distance display condition value.
* @param [result] - The array to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
}
/**
* Easing functions for use with TweenCollection. These function are from
* {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
* {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
*/
export namespace EasingFunction {
/**
* Linear easing.
*/
const LINEAR_NONE: EasingFunction.Callback;
/**
* Quadratic in.
*/
const QUADRATIC_IN: EasingFunction.Callback;
/**
* Quadratic out.
*/
const QUADRATIC_OUT: EasingFunction.Callback;
/**
* Quadratic in then out.
*/
const QUADRATIC_IN_OUT: EasingFunction.Callback;
/**
* Cubic in.
*/
const CUBIC_IN: EasingFunction.Callback;
/**
* Cubic out.
*/
const CUBIC_OUT: EasingFunction.Callback;
/**
* Cubic in then out.
*/
const CUBIC_IN_OUT: EasingFunction.Callback;
/**
* Quartic in.
*/
const QUARTIC_IN: EasingFunction.Callback;
/**
* Quartic out.
*/
const QUARTIC_OUT: EasingFunction.Callback;
/**
* Quartic in then out.
*/
const QUARTIC_IN_OUT: EasingFunction.Callback;
/**
* Quintic in.
*/
const QUINTIC_IN: EasingFunction.Callback;
/**
* Quintic out.
*/
const QUINTIC_OUT: EasingFunction.Callback;
/**
* Quintic in then out.
*/
const QUINTIC_IN_OUT: EasingFunction.Callback;
/**
* Sinusoidal in.
*/
const SINUSOIDAL_IN: EasingFunction.Callback;
/**
* Sinusoidal out.
*/
const SINUSOIDAL_OUT: EasingFunction.Callback;
/**
* Sinusoidal in then out.
*/
const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
/**
* Exponential in.
*/
const EXPONENTIAL_IN: EasingFunction.Callback;
/**
* Exponential out.
*/
const EXPONENTIAL_OUT: EasingFunction.Callback;
/**
* Exponential in then out.
*/
const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
/**
* Circular in.
*/
const CIRCULAR_IN: EasingFunction.Callback;
/**
* Circular out.
*/
const CIRCULAR_OUT: EasingFunction.Callback;
/**
* Circular in then out.
*/
const CIRCULAR_IN_OUT: EasingFunction.Callback;
/**
* Elastic in.
*/
const ELASTIC_IN: EasingFunction.Callback;
/**
* Elastic out.
*/
const ELASTIC_OUT: EasingFunction.Callback;
/**
* Elastic in then out.
*/
const ELASTIC_IN_OUT: EasingFunction.Callback;
/**
* Back in.
*/
const BACK_IN: EasingFunction.Callback;
/**
* Back out.
*/
const BACK_OUT: EasingFunction.Callback;
/**
* Back in then out.
*/
const BACK_IN_OUT: EasingFunction.Callback;
/**
* Bounce in.
*/
const BOUNCE_IN: EasingFunction.Callback;
/**
* Bounce out.
*/
const BOUNCE_OUT: EasingFunction.Callback;
/**
* Bounce in then out.
*/
const BOUNCE_IN_OUT: EasingFunction.Callback;
/**
* Function interface for implementing a custom easing function.
* @example
* function quadraticIn(time) {
* return time * time;
* }
* @example
* function quadraticOut(time) {
* return time * (2.0 - time);
* }
* @param time - The time in the range [0, 1].
*/
type Callback = (time: number) => number;
}
/**
* A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* // Create an ellipse.
* const ellipse = new Cesium.EllipseGeometry({
* center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
* semiMajorAxis : 500000.0,
* semiMinorAxis : 300000.0,
* rotation : Cesium.Math.toRadians(60.0)
* });
* const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
* @param options - Object with the following properties:
* @param options.center - The ellipse's center point in the fixed frame.
* @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
* @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
* @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
* @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
* @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class EllipseGeometry {
constructor(options: {
center: Cartesian3;
semiMajorAxis: number;
semiMinorAxis: number;
ellipsoid?: Ellipsoid;
height?: number;
extrudedHeight?: number;
rotation?: number;
stRotation?: number;
granularity?: number;
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
/**
* Computes the bounding rectangle based on the provided options
* @param options - Object with the following properties:
* @param options.center - The ellipse's center point in the fixed frame.
* @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
* @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
* @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
* @param [result] - An object in which to store the result
* @returns The result rectangle
*/
static computeRectangle(options: {
center: Cartesian3;
semiMajorAxis: number;
semiMinorAxis: number;
ellipsoid?: Ellipsoid;
rotation?: number;
granularity?: number;
}, result?: Rectangle): Rectangle;
/**
* Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param ellipseGeometry - A description of the ellipse.
* @returns The computed vertices and indices.
*/
static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
}
/**
* A description of the outline of an ellipse on an ellipsoid.
* @example
* const ellipse = new Cesium.EllipseOutlineGeometry({
* center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
* semiMajorAxis : 500000.0,
* semiMinorAxis : 300000.0,
* rotation : Cesium.Math.toRadians(60.0)
* });
* const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
* @param options - Object with the following properties:
* @param options.center - The ellipse's center point in the fixed frame.
* @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
* @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
* @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
* @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
* @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
* @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
* @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
*/
export class EllipseOutlineGeometry {
constructor(options: {
center: Cartesian3;
semiMajorAxis: number;
semiMinorAxis: number;
ellipsoid?: Ellipsoid;
height?: number;
extrudedHeight?: number;
rotation?: number;
granularity?: number;
numberOfVerticalLines?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
/**
* Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param ellipseGeometry - A description of the ellipse.
* @returns The computed vertices and indices.
*/
static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
}
/**
* A quadratic surface defined in Cartesian coordinates by the equation
* (x / a)^2 + (y / b)^2 + (z / c)^2 = 1. Primarily used
* by Cesium to represent the shape of planetary bodies.
*
* Rather than constructing this object directly, one of the provided
* constants is normally used.
* @param [x = 0] - The radius in the x direction.
* @param [y = 0] - The radius in the y direction.
* @param [z = 0] - The radius in the z direction.
*/
export class Ellipsoid {
constructor(x?: number, y?: number, z?: number);
/**
* Gets the radii of the ellipsoid.
*/
readonly radii: Cartesian3;
/**
* Gets the squared radii of the ellipsoid.
*/
readonly radiiSquared: Cartesian3;
/**
* Gets the radii of the ellipsoid raise to the fourth power.
*/
readonly radiiToTheFourth: Cartesian3;
/**
* Gets one over the radii of the ellipsoid.
*/
readonly oneOverRadii: Cartesian3;
/**
* Gets one over the squared radii of the ellipsoid.
*/
readonly oneOverRadiiSquared: Cartesian3;
/**
* Gets the minimum radius of the ellipsoid.
*/
readonly minimumRadius: number;
/**
* Gets the maximum radius of the ellipsoid.
*/
readonly maximumRadius: number;
/**
* Duplicates an Ellipsoid instance.
* @param ellipsoid - The ellipsoid to duplicate.
* @param [result] - The object onto which to store the result, or undefined if a new
* instance should be created.
* @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
*/
static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
/**
* Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
* @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
* @param [result] - The object onto which to store the result, or undefined if a new
* instance should be created.
* @returns A new Ellipsoid instance.
*/
static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
/**
* An Ellipsoid instance initialized to the WGS84 standard.
*/
static readonly WGS84: Ellipsoid;
/**
* An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
*/
static readonly UNIT_SPHERE: Ellipsoid;
/**
* An Ellipsoid instance initialized to a sphere with the lunar radius.
*/
static readonly MOON: Ellipsoid;
/**
* Duplicates an Ellipsoid instance.
* @param [result] - The object onto which to store the result, or undefined if a new
* instance should be created.
* @returns The cloned Ellipsoid.
*/
clone(result?: Ellipsoid): Ellipsoid;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
/**
* Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
* @param cartesian - The Cartesian for which to to determine the geocentric normal.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided.
*/
geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
* @param cartographic - The cartographic position for which to to determine the geodetic normal.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided.
*/
geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
/**
* Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
* @param cartesian - The Cartesian position for which to to determine the surface normal.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
*/
geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Converts the provided cartographic to Cartesian representation.
* @example
* //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
* const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
* const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
* @param cartographic - The cartographic position.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided.
*/
cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
/**
* Converts the provided array of cartographics to an array of Cartesians.
* @example
* //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
* const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
* new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
* new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
* const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
* @param cartographics - An array of cartographic positions.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Array instance if none was provided.
*/
cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
/**
* Converts the provided cartesian to cartographic representation.
* The cartesian is undefined at the center of the ellipsoid.
* @example
* //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
* const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
* const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
* @param cartesian - The Cartesian position to convert to cartographic representation.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
*/
cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
/**
* Converts the provided array of cartesians to an array of cartographics.
* @example
* //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
* const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
* new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
* new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
* const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
* @param cartesians - An array of Cartesian positions.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Array instance if none was provided.
*/
cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
/**
* Scales the provided Cartesian position along the geodetic surface normal
* so that it is on the surface of this ellipsoid. If the position is
* at the center of the ellipsoid, this function returns undefined.
* @param cartesian - The Cartesian position to scale.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
*/
scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Scales the provided Cartesian position along the geocentric surface normal
* so that it is on the surface of this ellipsoid.
* @param cartesian - The Cartesian position to scale.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided.
*/
scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
* its components by the result of {@link Ellipsoid#oneOverRadii}.
* @param position - The position to transform.
* @param [result] - The position to which to copy the result, or undefined to create and
* return a new instance.
* @returns The position expressed in the scaled space. The returned instance is the
* one passed as the result parameter if it is not undefined, or a new instance of it is.
*/
transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
* its components by the result of {@link Ellipsoid#radii}.
* @param position - The position to transform.
* @param [result] - The position to which to copy the result, or undefined to create and
* return a new instance.
* @returns The position expressed in the unscaled space. The returned instance is the
* one passed as the result parameter if it is not undefined, or a new instance of it is.
*/
transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The other Ellipsoid.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Ellipsoid): boolean;
/**
* Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
* @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
*/
toString(): string;
/**
* Computes a point which is the intersection of the surface normal with the z-axis.
* @param position - the position. must be on the surface of the ellipsoid.
* @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
* In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.
* In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
* Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
* @param [result] - The cartesian to which to copy the result, or undefined to create and
* return a new instance.
* @returns the intersection point if it's inside the ellipsoid, undefined otherwise
*/
getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
/**
* Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
* Gauss-Legendre 10th order quadrature.
* @param rectangle - The rectangle used for computing the surface area.
* @returns The approximate area of the rectangle on the surface of this ellipsoid.
*/
surfaceArea(rectangle: Rectangle): number;
}
/**
* Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
* @param [start] - The initial planetodetic point on the path.
* @param [end] - The final planetodetic point on the path.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
*/
export class EllipsoidGeodesic {
constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
/**
* Gets the ellipsoid.
*/
readonly ellipsoid: Ellipsoid;
/**
* Gets the surface distance between the start and end point
*/
readonly surfaceDistance: number;
/**
* Gets the initial planetodetic point on the path.
*/
readonly start: Cartographic;
/**
* Gets the final planetodetic point on the path.
*/
readonly end: Cartographic;
/**
* Gets the heading at the initial point.
*/
readonly startHeading: number;
/**
* Gets the heading at the final point.
*/
readonly endHeading: number;
/**
* Sets the start and end points of the geodesic
* @param start - The initial planetodetic point on the path.
* @param end - The final planetodetic point on the path.
*/
setEndPoints(start: Cartographic, end: Cartographic): void;
/**
* Provides the location of a point at the indicated portion along the geodesic.
* @param fraction - The portion of the distance between the initial and final points.
* @param [result] - The object in which to store the result.
* @returns The location of the point along the geodesic.
*/
interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
/**
* Provides the location of a point at the indicated distance along the geodesic.
* @param distance - The distance from the inital point to the point of interest along the geodesic
* @param [result] - The object in which to store the result.
* @returns The location of the point along the geodesic.
*/
interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
}
/**
* A description of an ellipsoid centered at the origin.
* @example
* const ellipsoid = new Cesium.EllipsoidGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
* radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
* });
* const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
* @param [options] - Object with the following properties:
* @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
* @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
* @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
* @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
* @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
* @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
* @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
* @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class EllipsoidGeometry {
constructor(options?: {
radii?: Cartesian3;
innerRadii?: Cartesian3;
minimumClock?: number;
maximumClock?: number;
minimumCone?: number;
maximumCone?: number;
stackPartitions?: number;
slicePartitions?: number;
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
/**
* Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param ellipsoidGeometry - A description of the ellipsoid.
* @returns The computed vertices and indices.
*/
static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
}
/**
* A description of the outline of an ellipsoid centered at the origin.
* @example
* const ellipsoid = new Cesium.EllipsoidOutlineGeometry({
* radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
* stackPartitions: 6,
* slicePartitions: 5
* });
* const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
* @param [options] - Object with the following properties:
* @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
* @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
* @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
* @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
* @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
* @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
* @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
* @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
* @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
*/
export class EllipsoidOutlineGeometry {
constructor(options?: {
radii?: Cartesian3;
innerRadii?: Cartesian3;
minimumClock?: number;
maximumClock?: number;
minimumCone?: number;
maximumCone?: number;
stackPartitions?: number;
slicePartitions?: number;
subdivisions?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
/**
* Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
* @param ellipsoidGeometry - A description of the ellipsoid outline.
* @returns The computed vertices and indices.
*/
static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
}
/**
* Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
* @param [start] - The initial planetodetic point on the path.
* @param [end] - The final planetodetic point on the path.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
*/
export class EllipsoidRhumbLine {
constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
/**
* Gets the ellipsoid.
*/
readonly ellipsoid: Ellipsoid;
/**
* Gets the surface distance between the start and end point
*/
readonly surfaceDistance: number;
/**
* Gets the initial planetodetic point on the path.
*/
readonly start: Cartographic;
/**
* Gets the final planetodetic point on the path.
*/
readonly end: Cartographic;
/**
* Gets the heading from the start point to the end point.
*/
readonly heading: number;
/**
* Create a rhumb line using an initial position with a heading and distance.
* @param start - The initial planetodetic point on the path.
* @param heading - The heading in radians.
* @param distance - The rhumb line distance between the start and end point.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
* @param [result] - The object in which to store the result.
* @returns The EllipsoidRhumbLine object.
*/
static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
/**
* Sets the start and end points of the rhumb line.
* @param start - The initial planetodetic point on the path.
* @param end - The final planetodetic point on the path.
*/
setEndPoints(start: Cartographic, end: Cartographic): void;
/**
* Provides the location of a point at the indicated portion along the rhumb line.
* @param fraction - The portion of the distance between the initial and final points.
* @param [result] - The object in which to store the result.
* @returns The location of the point along the rhumb line.
*/
interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
/**
* Provides the location of a point at the indicated distance along the rhumb line.
* @param distance - The distance from the inital point to the point of interest along the rhumbLine.
* @param [result] - The object in which to store the result.
* @returns The location of the point along the rhumb line.
*/
interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
/**
* Provides the location of a point at the indicated longitude along the rhumb line.
* If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
* @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
* @param [result] - The object in which to store the result.
* @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
*/
findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
/**
* Provides the location of a point at the indicated latitude along the rhumb line.
* If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
* @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
* @param [result] - The object in which to store the result.
* @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
*/
findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
}
/**
* A plane tangent to the provided ellipsoid at the provided origin.
* If origin is not on the surface of the ellipsoid, it's surface projection will be used.
* If origin is at the center of the ellipsoid, an exception will be thrown.
* @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
*/
export class EllipsoidTangentPlane {
constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
/**
* Gets the ellipsoid.
*/
ellipsoid: Ellipsoid;
/**
* Gets the origin.
*/
origin: Cartesian3;
/**
* Gets the plane which is tangent to the ellipsoid.
*/
readonly plane: Plane;
/**
* Gets the local X-axis (east) of the tangent plane.
*/
readonly xAxis: Cartesian3;
/**
* Gets the local Y-axis (north) of the tangent plane.
*/
readonly yAxis: Cartesian3;
/**
* Gets the local Z-axis (up) of the tangent plane.
*/
readonly zAxis: Cartesian3;
/**
* Creates a new instance from the provided ellipsoid and the center
* point of the provided Cartesians.
* @param cartesians - The list of positions surrounding the center point.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
* @returns The new instance of EllipsoidTangentPlane.
*/
static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane;
/**
* Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
* @param cartesian - The point to project.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
*/
projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
/**
* Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
* The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
* @param cartesians - The array of points to project.
* @param [result] - The array of Cartesian2 instances onto which to store results.
* @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
*/
projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
/**
* Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
* @param cartesian - The point to project.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartesian2 instance if none was provided.
*/
projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
/**
* Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
* @param cartesians - The array of points to project.
* @param [result] - The array of Cartesian2 instances onto which to store results.
* @returns The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as cartesians.
*/
projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
/**
* Computes the projection of the provided 2D position onto the 3D ellipsoid.
* @param cartesian - The points to project.
* @param [result] - The Cartesian3 instance to store result.
* @returns The modified result parameter or a new Cartesian3 instance if none was provided.
*/
projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
/**
* Computes the projection of the provided 2D positions onto the 3D ellipsoid.
* @param cartesians - The array of points to project.
* @param [result] - The array of Cartesian3 instances onto which to store results.
* @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
*/
projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
}
/**
* A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
* surface.
* @param [options] - Object with the following properties:
* @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
* surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
* is used.
* @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
* parameter is specified, the WGS84 ellipsoid is used.
*/
export class EllipsoidTerrainProvider {
constructor(options?: {
tilingScheme?: TilingScheme;
ellipsoid?: Ellipsoid;
});
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
* are passed an instance of {@link TileProviderError}.
*/
readonly errorEvent: Event;
/**
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
* the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
*/
readonly credit: Credit;
/**
* Gets the tiling scheme used by this provider. This function should
* not be called before {@link EllipsoidTerrainProvider#ready} returns true.
*/
readonly tilingScheme: GeographicTilingScheme;
/**
* Gets a value indicating whether or not the provider is ready for use.
*/
readonly ready: boolean;
/**
* Gets a promise that resolves to true when the provider is ready for use.
*/
readonly readyPromise: Promise;
/**
* Gets a value indicating whether or not the provider includes a water mask. The water mask
* indicates which areas of the globe are water rather than land, so they can be rendered
* as a reflective surface with animated waves. This function should not be
* called before {@link EllipsoidTerrainProvider#ready} returns true.
*/
readonly hasWaterMask: boolean;
/**
* Gets a value indicating whether or not the requested tiles include vertex normals.
* This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
*/
readonly hasVertexNormals: boolean;
/**
* Gets an object that can be used to determine availability of terrain from this provider, such as
* at points and in rectangles. This function should not be called before
* {@link TerrainProvider#ready} returns true. This property may be undefined if availability
* information is not available.
*/
readonly availability: TileAvailability;
/**
* Requests the geometry for a given tile. This function should not be called before
* {@link TerrainProvider#ready} returns true. The result includes terrain
* data and indicates that all child tiles are available.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @param [request] - The request object. Intended for internal use only.
* @returns A promise for the requested geometry. If this method
* returns undefined instead of a promise, it is an indication that too many requests are already
* pending and the request will be retried later.
*/
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined;
/**
* Gets the maximum geometric error allowed in a tile at a given level.
* @param level - The tile level for which to get the maximum geometric error.
* @returns The maximum geometric error.
*/
getLevelMaximumGeometricError(level: number): number;
/**
* Determines whether data for a tile is available to be loaded.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if not supported, otherwise true or false.
*/
getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
/**
* Makes sure we load availability data for a tile
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
*/
loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise;
}
/**
* A generic utility class for managing subscribers for a particular event.
* This class is usually instantiated inside of a container class and
* exposed as a property for others to subscribe to.
* @example
* MyObject.prototype.myListener = function(arg1, arg2) {
* this.myArg1Copy = arg1;
* this.myArg2Copy = arg2;
* }
*
* const myObjectInstance = new MyObject();
* const evt = new Cesium.Event();
* evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
* evt.raiseEvent('1', '2');
* evt.removeEventListener(MyObject.prototype.myListener);
*/
export class Event {
constructor();
/**
* The number of listeners currently subscribed to the event.
*/
readonly numberOfListeners: number;
/**
* Registers a callback function to be executed whenever the event is raised.
* An optional scope can be provided to serve as the this pointer
* in which the function will execute.
* @param listener - The function to be executed when the event is raised.
* @param [scope] - An optional object scope to serve as the this
* pointer in which the listener function will execute.
* @returns A function that will remove this event listener when invoked.
*/
addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback;
/**
* Unregisters a previously registered callback.
* @param listener - The function to be unregistered.
* @param [scope] - The scope that was originally passed to addEventListener.
* @returns true if the listener was removed; false if the listener and scope are not registered with the event.
*/
removeEventListener(listener: (...params: any[]) => any, scope?: any): boolean;
/**
* Raises the event by calling each registered listener with all supplied arguments.
* @param arguments - This method takes any number of parameters and passes them through to the listener functions.
*/
raiseEvent(...arguments: any[]): void;
}
export namespace Event {
/**
* A function that removes a listener.
*/
type RemoveCallback = () => void;
}
/**
* A convenience object that simplifies the common pattern of attaching event listeners
* to several events, then removing all those listeners at once later, for example, in
* a destroy method.
* @example
* const helper = new Cesium.EventHelper();
*
* helper.add(someObject.event, listener1, this);
* helper.add(otherObject.event, listener2, this);
*
* // later...
* helper.removeAll();
*/
export class EventHelper {
constructor();
/**
* Adds a listener to an event, and records the registration to be cleaned up later.
* @param event - The event to attach to.
* @param listener - The function to be executed when the event is raised.
* @param [scope] - An optional object scope to serve as the this
* pointer in which the listener function will execute.
* @returns A function that will remove this event listener when invoked.
*/
add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
/**
* Unregisters all previously added listeners.
*/
removeAll(): void;
}
export namespace EventHelper {
/**
* A function that removes a listener.
*/
type RemoveCallback = () => void;
}
/**
* Flags to enable experimental features in CesiumJS. Stability and performance
* may not be optimal when these are enabled. Experimental features are subject
* to change without Cesium's standard deprecation policy.
*
* Experimental features must still uphold Cesium's quality standards. Here
* are some guidelines:
*
*
*
Experimental features must have high unit test coverage like any other feature.
*
Experimental features are intended for large features where there is benefit of merging some of the code sooner (e.g. to avoid long-running staging branches)
*
Experimental flags should be short-lived. Make it clear in the PR what it would take to promote the feature to a regular feature.
*
To avoid cluttering the code, check the flag in as few places as possible. Ideally this would be a single place.
*
*/
export const ExperimentalFeatures: any;
/**
* Constants to determine how an interpolated value is extrapolated
* when querying outside the bounds of available data.
*/
export enum ExtrapolationType {
/**
* No extrapolation occurs.
*/
NONE = 0,
/**
* The first or last value is used when outside the range of sample data.
*/
HOLD = 1,
/**
* The value is extrapolated.
*/
EXTRAPOLATE = 2
}
/**
* A set of functions to detect whether the current browser supports
* various features.
*/
export namespace FeatureDetection {
/**
* Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
* @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
*/
function supportsBasis(scene: Scene): boolean;
/**
* Detects whether the current browser supports the full screen standard.
* @returns true if the browser supports the full screen standard, false if not.
*/
function supportsFullscreen(): boolean;
/**
* Detects whether the current browser supports typed arrays.
* @returns true if the browser supports typed arrays, false if not.
*/
function supportsTypedArrays(): boolean;
/**
* Detects whether the current browser supports BigInt64Array typed arrays.
* @returns true if the browser supports BigInt64Array typed arrays, false if not.
*/
function supportsBigInt64Array(): boolean;
/**
* Detects whether the current browser supports BigUint64Array typed arrays.
* @returns true if the browser supports BigUint64Array typed arrays, false if not.
*/
function supportsBigUint64Array(): boolean;
/**
* Detects whether the current browser supports BigInt.
* @returns true if the browser supports BigInt, false if not.
*/
function supportsBigInt(): boolean;
/**
* Detects whether the current browser supports Web Workers.
* @returns true if the browsers supports Web Workers, false if not.
*/
function supportsWebWorkers(): boolean;
/**
* Detects whether the current browser supports Web Assembly.
* @returns true if the browsers supports Web Assembly, false if not.
*/
function supportsWebAssembly(): boolean;
}
/**
* Describes a frustum at the given the origin and orientation.
* @param options - Object with the following properties:
* @param options.frustum - The frustum.
* @param options.origin - The origin of the frustum.
* @param options.orientation - The orientation of the frustum.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class FrustumGeometry {
constructor(options: {
frustum: PerspectiveFrustum | OrthographicFrustum;
origin: Cartesian3;
orientation: Quaternion;
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
*/
static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
/**
* Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
* @param frustumGeometry - A description of the frustum.
* @returns The computed vertices and indices.
*/
static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
}
/**
* A description of the outline of a frustum with the given the origin and orientation.
* @param options - Object with the following properties:
* @param options.frustum - The frustum.
* @param options.origin - The origin of the frustum.
* @param options.orientation - The orientation of the frustum.
*/
export class FrustumOutlineGeometry {
constructor(options: {
frustum: PerspectiveFrustum | OrthographicFrustum;
origin: Cartesian3;
orientation: Quaternion;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
*/
static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
/**
* Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
* @param frustumGeometry - A description of the frustum.
* @returns The computed vertices and indices.
*/
static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
}
/**
* Browser-independent functions for working with the standard fullscreen API.
*/
export namespace Fullscreen {
/**
* The element that is currently fullscreen, if any. To simply check if the
* browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
*/
const element: any;
/**
* The name of the event on the document that is fired when fullscreen is
* entered or exited. This event name is intended for use with addEventListener.
* In your event handler, to determine if the browser is in fullscreen mode or not,
* use {@link Fullscreen#fullscreen}.
*/
const changeEventName: string;
/**
* The name of the event that is fired when a fullscreen error
* occurs. This event name is intended for use with addEventListener.
*/
const errorEventName: string;
/**
* Determine whether the browser will allow an element to be made fullscreen, or not.
* For example, by default, iframes cannot go fullscreen unless the containing page
* adds an "allowfullscreen" attribute (or prefixed equivalent).
*/
const enabled: boolean;
/**
* Determines if the browser is currently in fullscreen mode.
*/
const fullscreen: boolean;
/**
* Detects whether the browser supports the standard fullscreen API.
* @returns true if the browser supports the standard fullscreen API,
* false otherwise.
*/
function supportsFullscreen(): boolean;
/**
* Asynchronously requests the browser to enter fullscreen mode on the given element.
* If fullscreen mode is not supported by the browser, does nothing.
* @example
* // Put the entire page into fullscreen.
* Cesium.Fullscreen.requestFullscreen(document.body)
*
* // Place only the Cesium canvas into fullscreen.
* Cesium.Fullscreen.requestFullscreen(scene.canvas)
* @param element - The HTML element which will be placed into fullscreen mode.
* @param [vrDevice] - The HMDVRDevice device.
*/
function requestFullscreen(element: any, vrDevice?: any): void;
/**
* Asynchronously exits fullscreen mode. If the browser is not currently
* in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
*/
function exitFullscreen(): void;
}
/**
* The type of geocoding to be performed by a {@link GeocoderService}.
*/
export enum GeocodeType {
/**
* Perform a search where the input is considered complete.
*/
SEARCH = 0,
/**
* Perform an auto-complete using partial input, typically
* reserved for providing possible results as a user is typing.
*/
AUTOCOMPLETE = 1
}
export namespace GeocoderService {
/**
* @property displayName - The display name for a location
* @property destination - The bounding box for a location
*/
type Result = {
displayName: string;
destination: Rectangle | Cartesian3;
};
}
/**
* Provides geocoding through an external service. This type describes an interface and
* is not intended to be used.
*/
export class GeocoderService {
constructor();
/**
* @param query - The query to be sent to the geocoder service
* @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
*/
geocode(query: string, type?: GeocodeType): Promise;
}
/**
* A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
* them by the {@link Ellipsoid#maximumRadius}. This projection
* is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
* is also known as EPSG:4326.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
*/
export class GeographicProjection {
constructor(ellipsoid?: Ellipsoid);
/**
* Gets the {@link Ellipsoid}.
*/
readonly ellipsoid: Ellipsoid;
/**
* Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
* X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
* ellipsoid. Z is the unmodified height.
* @param cartographic - The coordinates to project.
* @param [result] - An instance into which to copy the result. If this parameter is
* undefined, a new instance is created and returned.
* @returns The projected coordinates. If the result parameter is not undefined, the
* coordinates are copied there and that instance is returned. Otherwise, a new instance is
* created and returned.
*/
project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
/**
* Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
* coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
* divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
* @param cartesian - The Cartesian position to unproject with height (z) in meters.
* @param [result] - An instance into which to copy the result. If this parameter is
* undefined, a new instance is created and returned.
* @returns The unprojected coordinates. If the result parameter is not undefined, the
* coordinates are copied there and that instance is returned. Otherwise, a new instance is
* created and returned.
*/
unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
}
/**
* A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
* longitude and latitude are directly mapped to X and Y. This projection is commonly
* known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
* @param [options] - Object with the following properties:
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
* the WGS84 ellipsoid.
* @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
* @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
* the tile tree.
* @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
* the tile tree.
*/
export class GeographicTilingScheme {
constructor(options?: {
ellipsoid?: Ellipsoid;
rectangle?: Rectangle;
numberOfLevelZeroTilesX?: number;
numberOfLevelZeroTilesY?: number;
});
/**
* Gets the ellipsoid that is tiled by this tiling scheme.
*/
ellipsoid: Ellipsoid;
/**
* Gets the rectangle, in radians, covered by this tiling scheme.
*/
rectangle: Rectangle;
/**
* Gets the map projection used by this tiling scheme.
*/
projection: MapProjection;
/**
* Gets the total number of tiles in the X direction at a specified level-of-detail.
* @param level - The level-of-detail.
* @returns The number of tiles in the X direction at the given level.
*/
getNumberOfXTilesAtLevel(level: number): number;
/**
* Gets the total number of tiles in the Y direction at a specified level-of-detail.
* @param level - The level-of-detail.
* @returns The number of tiles in the Y direction at the given level.
*/
getNumberOfYTilesAtLevel(level: number): number;
/**
* Transforms a rectangle specified in geodetic radians to the native coordinate system
* of this tiling scheme.
* @param rectangle - The rectangle to transform.
* @param [result] - The instance to which to copy the result, or undefined if a new instance
* should be created.
* @returns The specified 'result', or a new object containing the native rectangle if 'result'
* is undefined.
*/
rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
/**
* Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
* of the tiling scheme.
* @param x - The integer x coordinate of the tile.
* @param y - The integer y coordinate of the tile.
* @param level - The tile level-of-detail. Zero is the least detailed.
* @param [result] - The instance to which to copy the result, or undefined if a new instance
* should be created.
* @returns The specified 'result', or a new object containing the rectangle
* if 'result' is undefined.
*/
tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
/**
* Converts tile x, y coordinates and level to a cartographic rectangle in radians.
* @param x - The integer x coordinate of the tile.
* @param y - The integer y coordinate of the tile.
* @param level - The tile level-of-detail. Zero is the least detailed.
* @param [result] - The instance to which to copy the result, or undefined if a new instance
* should be created.
* @returns The specified 'result', or a new object containing the rectangle
* if 'result' is undefined.
*/
tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
/**
* Calculates the tile x, y coordinates of the tile containing
* a given cartographic position.
* @param position - The position.
* @param level - The tile level-of-detail. Zero is the least detailed.
* @param [result] - The instance to which to copy the result, or undefined if a new instance
* should be created.
* @returns The specified 'result', or a new object containing the tile x, y coordinates
* if 'result' is undefined.
*/
positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
}
/**
* A geometry representation with attributes forming vertices and optional index data
* defining primitives. Geometries and an {@link Appearance}, which describes the shading,
* can be assigned to a {@link Primitive} for visualization. A Primitive can
* be created from many heterogeneous - in many cases - geometries for performance.
*
* Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
*
* @example
* // Create geometry with a position attribute and indexed lines.
* const positions = new Float64Array([
* 0.0, 0.0, 0.0,
* 7500000.0, 0.0, 0.0,
* 0.0, 7500000.0, 0.0
* ]);
*
* const geometry = new Cesium.Geometry({
* attributes : {
* position : new Cesium.GeometryAttribute({
* componentDatatype : Cesium.ComponentDatatype.DOUBLE,
* componentsPerAttribute : 3,
* values : positions
* })
* },
* indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
* primitiveType : Cesium.PrimitiveType.LINES,
* boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
* });
* @param options - Object with the following properties:
* @param options.attributes - Attributes, which make up the geometry's vertices.
* @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
* @param [options.indices] - Optional index data that determines the primitives in the geometry.
* @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
*/
export class Geometry {
constructor(options: {
attributes: GeometryAttributes;
primitiveType?: PrimitiveType;
indices?: Uint16Array | Uint32Array;
boundingSphere?: BoundingSphere;
});
/**
* Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
* {@link GeometryAttribute} containing the attribute's data.
*
* Attributes are always stored non-interleaved in a Geometry.
*
*
* There are reserved attribute names with well-known semantics. The following attributes
* are created by a Geometry (depending on the provided {@link VertexFormat}.
*
*
position - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.
*
normal - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.
*
st - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.
*
bitangent - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.
*
tangent - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.
*
*
*
* The following attribute names are generally not created by a Geometry, but are added
* to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
* the geometry for rendering.
*
*
position3DHigh - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
*
position3DLow - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
*
position3DHigh - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
*
position2DLow - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
*
color - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.
*
pickColor - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.
*
*
* @example
* geometry.attributes.position = new Cesium.GeometryAttribute({
* componentDatatype : Cesium.ComponentDatatype.FLOAT,
* componentsPerAttribute : 3,
* values : new Float32Array(0)
* });
*/
attributes: GeometryAttributes;
/**
* Optional index data that - along with {@link Geometry#primitiveType} -
* determines the primitives in the geometry.
*/
indices: any[];
/**
* The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
* but can varying based on the specific geometry.
*/
primitiveType: PrimitiveType;
/**
* An optional bounding sphere that fully encloses the geometry. This is
* commonly used for culling.
*/
boundingSphere: BoundingSphere;
/**
* Computes the number of vertices in a geometry. The runtime is linear with
* respect to the number of attributes in a vertex, not the number of vertices.
* @example
* const numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
* @param geometry - The geometry.
* @returns The number of vertices in the geometry.
*/
static computeNumberOfVertices(geometry: Geometry): number;
}
/**
* Values and type information for geometry attributes. A {@link Geometry}
* generally contains one or more attributes. All attributes together form
* the geometry's vertices.
* @example
* const geometry = new Cesium.Geometry({
* attributes : {
* position : new Cesium.GeometryAttribute({
* componentDatatype : Cesium.ComponentDatatype.FLOAT,
* componentsPerAttribute : 3,
* values : new Float32Array([
* 0.0, 0.0, 0.0,
* 7500000.0, 0.0, 0.0,
* 0.0, 7500000.0, 0.0
* ])
* })
* },
* primitiveType : Cesium.PrimitiveType.LINE_LOOP
* });
* @param [options] - Object with the following properties:
* @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
* @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
* @param [options.normalize = false] - When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
* @param [options.values] - The values for the attributes stored in a typed array.
*/
export class GeometryAttribute {
constructor(options?: {
componentDatatype?: ComponentDatatype;
componentsPerAttribute?: number;
normalize?: boolean;
values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
});
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link GeometryAttribute#values}.
*/
componentDatatype: ComponentDatatype;
/**
* A number between 1 and 4 that defines the number of components in an attributes.
* For example, a position attribute with x, y, and z components would have 3 as
* shown in the code example.
* @example
* attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
* attribute.componentsPerAttribute = 3;
* attribute.values = new Float32Array([
* 0.0, 0.0, 0.0,
* 7500000.0, 0.0, 0.0,
* 0.0, 7500000.0, 0.0
* ]);
*/
componentsPerAttribute: number;
/**
* When true and componentDatatype is an integer format,
* indicate that the components should be mapped to the range [0, 1] (unsigned)
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
*
* This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
*
* @example
* attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
* attribute.componentsPerAttribute = 4;
* attribute.normalize = true;
* attribute.values = new Uint8Array([
* Cesium.Color.floatToByte(color.red),
* Cesium.Color.floatToByte(color.green),
* Cesium.Color.floatToByte(color.blue),
* Cesium.Color.floatToByte(color.alpha)
* ]);
*/
normalize: boolean;
/**
* The values for the attributes stored in a typed array. In the code example,
* every three elements in values defines one attributes since
* componentsPerAttribute is 3.
* @example
* attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
* attribute.componentsPerAttribute = 3;
* attribute.values = new Float32Array([
* 0.0, 0.0, 0.0,
* 7500000.0, 0.0, 0.0,
* 0.0, 7500000.0, 0.0
* ]);
*/
values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
}
/**
* Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
* {@link GeometryAttribute} containing the attribute's data.
*
* Attributes are always stored non-interleaved in a Geometry.
*
*/
export class GeometryAttributes {
constructor();
/**
* The 3D position attribute.
*
* 64-bit floating-point (for precision). 3 components per attribute.
*
*/
position: GeometryAttribute;
/**
* The normal attribute (normalized), which is commonly used for lighting.
*
* 32-bit floating-point. 3 components per attribute.
*
* 32-bit floating-point. 2 components per attribute
*
*/
st: GeometryAttribute;
/**
* The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
*
* 32-bit floating-point. 3 components per attribute.
*
*/
bitangent: GeometryAttribute;
/**
* The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
*
* 32-bit floating-point. 3 components per attribute.
*
*/
tangent: GeometryAttribute;
/**
* The color attribute.
*
* 8-bit unsigned integer. 4 components per attribute.
*
*/
color: GeometryAttribute;
}
/**
* Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
* for asynchronous geometry creation.
*/
export class GeometryFactory {
constructor();
/**
* Returns a geometry.
* @param geometryFactory - A description of the circle.
* @returns The computed vertices and indices.
*/
static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
}
/**
* Geometry instancing allows one {@link Geometry} object to be positions in several
* different locations and colored uniquely. For example, one {@link BoxGeometry} can
* be instanced several times, each with a different modelMatrix to change
* its position, rotation, and scale.
* @example
* // Create geometry for a box, and two instances that refer to it.
* // One instance positions the box on the bottom and colored aqua.
* // The other instance positions the box on the top and color white.
* const geometry = Cesium.BoxGeometry.fromDimensions({
* vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
* dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
* });
* const instanceBottom = new Cesium.GeometryInstance({
* geometry : geometry,
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
* attributes : {
* color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
* },
* id : 'bottom'
* });
* const instanceTop = new Cesium.GeometryInstance({
* geometry : geometry,
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
* attributes : {
* color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
* },
* id : 'top'
* });
* @param options - Object with the following properties:
* @param options.geometry - The geometry to instance.
* @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
* @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.
* @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
*/
export class GeometryInstance {
constructor(options: {
geometry: Geometry | GeometryFactory;
modelMatrix?: Matrix4;
id?: any;
attributes?: any;
});
/**
* The geometry being instanced.
*/
geometry: Geometry;
/**
* The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
* When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
* Local reference frames can be used by providing a different transformation matrix, like that returned
* by {@link Transforms.eastNorthUpToFixedFrame}.
*/
modelMatrix: Matrix4;
/**
* User-defined object returned when the instance is picked or used to get/set per-instance attributes.
*/
id: any;
/**
* Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
* {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
*/
attributes: any;
}
/**
* Values and type information for per-instance geometry attributes.
* @example
* const instance = new Cesium.GeometryInstance({
* geometry : Cesium.BoxGeometry.fromDimensions({
* dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
* }),
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
* id : 'box',
* attributes : {
* color : new Cesium.GeometryInstanceAttribute({
* componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
* componentsPerAttribute : 4,
* normalize : true,
* value : [255, 255, 0, 255]
* })
* }
* });
* @param options - Object with the following properties:
* @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
* @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
* @param [options.normalize = false] - When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
* @param options.value - The value for the attribute.
*/
export class GeometryInstanceAttribute {
constructor(options: {
componentDatatype: ComponentDatatype;
componentsPerAttribute: number;
normalize?: boolean;
value: number[];
});
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link GeometryInstanceAttribute#value}.
*/
componentDatatype: ComponentDatatype;
/**
* A number between 1 and 4 that defines the number of components in an attributes.
* For example, a position attribute with x, y, and z components would have 3 as
* shown in the code example.
* @example
* show : new Cesium.GeometryInstanceAttribute({
* componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
* componentsPerAttribute : 1,
* normalize : true,
* value : [1.0]
* })
*/
componentsPerAttribute: number;
/**
* When true and componentDatatype is an integer format,
* indicate that the components should be mapped to the range [0, 1] (unsigned)
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
*
* This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
*
* @example
* attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
* attribute.componentsPerAttribute = 4;
* attribute.normalize = true;
* attribute.value = [
* Cesium.Color.floatToByte(color.red),
* Cesium.Color.floatToByte(color.green),
* Cesium.Color.floatToByte(color.blue),
* Cesium.Color.floatToByte(color.alpha)
* ];
*/
normalize: boolean;
/**
* The values for the attributes stored in a typed array. In the code example,
* every three elements in values defines one attributes since
* componentsPerAttribute is 3.
* @example
* show : new Cesium.GeometryInstanceAttribute({
* componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
* componentsPerAttribute : 1,
* normalize : true,
* value : [1.0]
* })
*/
value: number[];
}
/**
* Content pipeline functions for geometries.
*/
export namespace GeometryPipeline {
/**
* Converts a geometry's triangle indices to line indices. If the geometry has an indices
* and its primitiveType is TRIANGLES, TRIANGLE_STRIP,
* TRIANGLE_FAN, it is converted to LINES; otherwise, the geometry is not changed.
*
* This is commonly used to create a wireframe geometry for visual debugging.
*
* @example
* geometry = Cesium.GeometryPipeline.toWireframe(geometry);
* @param geometry - The geometry to modify.
* @returns The modified geometry argument, with its triangle indices converted to lines.
*/
function toWireframe(geometry: Geometry): Geometry;
/**
* Creates a new {@link Geometry} with LINES representing the provided
* attribute (attributeName) for the provided geometry. This is used to
* visualize vector attributes like normals, tangents, and bitangents.
* @example
* const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
* @param geometry - The Geometry instance with the attribute.
* @param [attributeName = 'normal'] - The name of the attribute.
* @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
* @returns A new Geometry instance with line segments for the vector.
*/
function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
/**
* Creates an object that maps attribute names to unique locations (indices)
* for matching vertex attributes and shader programs.
* @example
* const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
* // Example output
* // {
* // 'position' : 0,
* // 'normal' : 1
* // }
* @param geometry - The geometry, which is not modified, to create the object for.
* @returns An object with attribute name / index pairs.
*/
function createAttributeLocations(geometry: Geometry): any;
/**
* Reorders a geometry's attributes and indices to achieve better performance from the GPU's pre-vertex-shader cache.
* @example
* geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
* @param geometry - The geometry to modify.
* @returns The modified geometry argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
*/
function reorderForPreVertexCache(geometry: Geometry): Geometry;
/**
* Reorders a geometry's indices to achieve better performance from the GPU's
* post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType
* is not TRIANGLES or the geometry does not have an indices, this function has no effect.
* @example
* geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
* @param geometry - The geometry to modify.
* @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
* @returns The modified geometry argument, with its indices reordered for the post-vertex-shader cache.
*/
function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
/**
* Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
* indices fit into unsigned shorts. This is used to meet the WebGL requirements
* when unsigned int indices are not supported.
*
* If the geometry does not have any indices, this function has no effect.
*
* @example
* const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
* @param geometry - The geometry to be split into multiple geometries.
* @returns An array of geometries, each with indices that fit into unsigned shorts.
*/
function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
/**
* Projects a geometry's 3D position attribute to 2D, replacing the position
* attribute with separate position3D and position2D attributes.
*
* If the geometry does not have a position, this function has no effect.
*
* @example
* geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
* @param geometry - The geometry to modify.
* @param attributeName - The name of the attribute.
* @param attributeName3D - The name of the attribute in 3D.
* @param attributeName2D - The name of the attribute in 2D.
* @param [projection = new GeographicProjection()] - The projection to use.
* @returns The modified geometry argument with position3D and position2D attributes.
*/
function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
/**
* Encodes floating-point geometry attribute values as two separate attributes to improve
* rendering precision.
*
* This is commonly used to create high-precision position vertex attributes.
*
* @example
* geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
* @param geometry - The geometry to modify.
* @param attributeName - The name of the attribute.
* @param attributeHighName - The name of the attribute for the encoded high bits.
* @param attributeLowName - The name of the attribute for the encoded low bits.
* @returns The modified geometry argument, with its encoded attribute.
*/
function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
/**
* Transforms a geometry instance to world coordinates. This changes
* the instance's modelMatrix to {@link Matrix4.IDENTITY} and transforms the
* following attributes if they are present: position, normal,
* tangent, and bitangent.
* @example
* Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
* @param instance - The geometry instance to modify.
* @returns The modified instance argument, with its attributes transforms to world coordinates.
*/
function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
/**
* Computes per-vertex normals for a geometry containing TRIANGLES by averaging the normals of
* all triangles incident to the vertex. The result is a new normal attribute added to the geometry.
* This assumes a counter-clockwise winding order.
* @example
* Cesium.GeometryPipeline.computeNormal(geometry);
* @param geometry - The geometry to modify.
* @returns The modified geometry argument with the computed normal attribute.
*/
function computeNormal(geometry: Geometry): Geometry;
/**
* Computes per-vertex tangents and bitangents for a geometry containing TRIANGLES.
* The result is new tangent and bitangent attributes added to the geometry.
* This assumes a counter-clockwise winding order.
*
* @example
* Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
* @param geometry - The geometry to modify.
* @returns The modified geometry argument with the computed tangent and bitangent attributes.
*/
function computeTangentAndBitangent(geometry: Geometry): Geometry;
/**
* Compresses and packs geometry normal attribute values to save memory.
* @example
* geometry = Cesium.GeometryPipeline.compressVertices(geometry);
* @param geometry - The geometry to modify.
* @returns The modified geometry argument, with its normals compressed and packed.
*/
function compressVertices(geometry: Geometry): Geometry;
}
/**
* Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
* and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
* @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
*/
export class GoogleEarthEnterpriseMetadata {
constructor(resourceOrUrl: Resource | string);
/**
* True if imagery is available.
*/
imageryPresent: boolean;
/**
* True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
*/
protoImagery: boolean;
/**
* True if terrain is available.
*/
terrainPresent: boolean;
/**
* Exponent used to compute constant to calculate negative height values.
*/
negativeAltitudeExponentBias: number;
/**
* Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
*/
negativeAltitudeThreshold: number;
/**
* Dictionary of provider id to copyright strings.
*/
providers: any;
/**
* Key used to decode packets
*/
key: ArrayBuffer;
/**
* Gets the name of the Google Earth Enterprise server.
*/
readonly url: string;
/**
* Gets the proxy used for metadata requests.
*/
readonly proxy: Proxy;
/**
* Gets the resource used for metadata requests.
*/
readonly resource: Resource;
/**
* Gets a promise that resolves to true when the metadata is ready for use.
*/
readonly readyPromise: Promise;
/**
* Converts a tiles (x, y, level) position into a quadkey used to request an image
* from a Google Earth Enterprise server.
* @param x - The tile's x coordinate.
* @param y - The tile's y coordinate.
* @param level - The tile's zoom level.
*/
static tileXYToQuadKey(x: number, y: number, level: number): void;
/**
* Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
* (x, y, level) position.
* @param quadkey - The tile's quad key
*/
static quadKeyToTileXY(quadkey: string): void;
}
/**
* Terrain data for a single tile from a Google Earth Enterprise server.
* @example
* const buffer = ...
* const childTileMask = ...
* const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
* buffer : heightBuffer,
* childTileMask : childTileMask
* });
* @param options - Object with the following properties:
* @param options.buffer - The buffer containing terrain data.
* @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
* @param options.negativeElevationThreshold - Threshold for negative values
* @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
* If a child's bit is set, geometry will be requested for that tile as well when it
* is needed. If the bit is cleared, the child tile is not requested and geometry is
* instead upsampled from the parent. The bit values are as follows:
*
*
Bit Position
Bit Value
Child Tile
*
0
1
Southwest
*
1
2
Southeast
*
2
4
Northeast
*
3
8
Northwest
*
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
* otherwise, false.
* @param [options.credits] - Array of credits for this tile.
*/
export class GoogleEarthEnterpriseTerrainData {
constructor(options: {
buffer: ArrayBuffer;
negativeAltitudeExponentBias: number;
negativeElevationThreshold: number;
childTileMask?: number;
createdByUpsampling?: boolean;
credits?: Credit[];
});
/**
* An array of credits for this tile
*/
credits: Credit[];
/**
* The water mask included in this terrain data, if any. A water mask is a rectangular
* Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
* Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
*/
waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
/**
* Computes the terrain height at a specified longitude and latitude.
* @param rectangle - The rectangle covered by this terrain data.
* @param longitude - The longitude in radians.
* @param latitude - The latitude in radians.
* @returns The terrain height at the specified position. If the position
* is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
* incorrect for positions far outside the rectangle.
*/
interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
/**
* Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
* height samples in this instance, interpolated if necessary.
* @param tilingScheme - The tiling scheme of this terrain data.
* @param thisX - The X coordinate of this tile in the tiling scheme.
* @param thisY - The Y coordinate of this tile in the tiling scheme.
* @param thisLevel - The level of this tile in the tiling scheme.
* @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
* @returns A promise for upsampled heightmap terrain data for the descendant tile,
* or undefined if too many asynchronous upsample operations are in progress and the request has been
* deferred.
*/
upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined;
/**
* Determines if a given child tile is available, based on the
* {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
* to be one of the four children of this tile. If non-child tile coordinates are
* given, the availability of the southeast child tile is returned.
* @param thisX - The tile X coordinate of this (the parent) tile.
* @param thisY - The tile Y coordinate of this (the parent) tile.
* @param childX - The tile X coordinate of the child tile to check for availability.
* @param childY - The tile Y coordinate of the child tile to check for availability.
* @returns True if the child tile is available; otherwise, false.
*/
isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
/**
* Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
* terrain data. If this value is false, the data was obtained from some other source, such
* as by downloading it from a remote server. This method should return true for instances
* returned from a call to {@link HeightmapTerrainData#upsample}.
* @returns True if this instance was created by upsampling; otherwise, false.
*/
wasCreatedByUpsampling(): boolean;
}
/**
* Provides tiled terrain using the Google Earth Enterprise REST API.
* @example
* const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
* const gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
* metadata : geeMetadata
* });
* @param options - Object with the following properties:
* @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
* @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
* @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
* @param [options.credit] - A credit for the data source, which is displayed on the canvas.
*/
export class GoogleEarthEnterpriseTerrainProvider {
constructor(options: {
url: Resource | string;
metadata: GoogleEarthEnterpriseMetadata;
ellipsoid?: Ellipsoid;
credit?: Credit | string;
});
/**
* Gets the name of the Google Earth Enterprise server url hosting the imagery.
*/
readonly url: string;
/**
* Gets the proxy used by this provider.
*/
readonly proxy: Proxy;
/**
* Gets the tiling scheme used by this provider. This function should
* not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
*/
readonly tilingScheme: TilingScheme;
/**
* Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
* are passed an instance of {@link TileProviderError}.
*/
readonly errorEvent: Event;
/**
* Gets a value indicating whether or not the provider is ready for use.
*/
readonly ready: boolean;
/**
* Gets a promise that resolves to true when the provider is ready for use.
*/
readonly readyPromise: Promise;
/**
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
* the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
*/
readonly credit: Credit;
/**
* Gets a value indicating whether or not the provider includes a water mask. The water mask
* indicates which areas of the globe are water rather than land, so they can be rendered
* as a reflective surface with animated waves. This function should not be
* called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
*/
readonly hasWaterMask: boolean;
/**
* Gets a value indicating whether or not the requested tiles include vertex normals.
* This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
*/
readonly hasVertexNormals: boolean;
/**
* Gets an object that can be used to determine availability of terrain from this provider, such as
* at points and in rectangles. This function should not be called before
* {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
* information is not available.
*/
readonly availability: TileAvailability;
/**
* Requests the geometry for a given tile. This function should not be called before
* {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
* may optionally include a water mask and an indication of which child tiles are available.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @param [request] - The request object. Intended for internal use only.
* @returns A promise for the requested geometry. If this method
* returns undefined instead of a promise, it is an indication that too many requests are already
* pending and the request will be retried later.
*/
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined;
/**
* Gets the maximum geometric error allowed in a tile at a given level.
* @param level - The tile level for which to get the maximum geometric error.
* @returns The maximum geometric error.
*/
getLevelMaximumGeometricError(level: number): number;
/**
* Determines whether data for a tile is available to be loaded.
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if not supported, otherwise true or false.
*/
getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
/**
* Makes sure we load availability data for a tile
* @param x - The X coordinate of the tile for which to request geometry.
* @param y - The Y coordinate of the tile for which to request geometry.
* @param level - The level of the tile for which to request geometry.
* @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
*/
loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise;
}
/**
* Represents a Gregorian date in a more precise format than the JavaScript Date object.
* In addition to submillisecond precision, this object can also represent leap seconds.
* @param [year] - The year as a whole number.
* @param [month] - The month as a whole number with range [1, 12].
* @param [day] - The day of the month as a whole number starting at 1.
* @param [hour] - The hour as a whole number with range [0, 23].
* @param [minute] - The minute of the hour as a whole number with range [0, 59].
* @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
* @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
* @param [isLeapSecond] - Whether this time is during a leap second.
*/
export class GregorianDate {
constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
/**
* Gets or sets the year as a whole number.
*/
year: number;
/**
* Gets or sets the month as a whole number with range [1, 12].
*/
month: number;
/**
* Gets or sets the day of the month as a whole number starting at 1.
*/
day: number;
/**
* Gets or sets the hour as a whole number with range [0, 23].
*/
hour: number;
/**
* Gets or sets the minute of the hour as a whole number with range [0, 59].
*/
minute: number;
/**
* Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
*/
second: number;
/**
* Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
*/
millisecond: number;
/**
* Gets or sets whether this time is during a leap second.
*/
isLeapSecond: boolean;
}
/**
* A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
* @example
* const positions = Cesium.Cartesian3.fromDegreesArray([
* -112.1340164450331, 36.05494287836128,
* -112.08821010582645, 36.097804071380715,
* -112.13296079730024, 36.168769146801104
* ]);
*
* const geometry = new Cesium.GroundPolylineGeometry({
* positions : positions
* });
* @param options - Options with the following properties:
* @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
* @param [options.width = 1.0] - The screen space width in pixels.
* @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
* @param [options.loop = false] - Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
*/
export class GroundPolylineGeometry {
constructor(options: {
positions: Cartesian3[];
width?: number;
granularity?: number;
loop?: boolean;
arcType?: ArcType;
});
/**
* The screen space width in pixels.
*/
width: number;
/**
* The distance interval used for interpolating options.points. Zero indicates no interpolation.
* Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
*/
granularity: boolean;
/**
* Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
* If the geometry has two positions this parameter will be ignored.
*/
loop: boolean;
/**
* The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
*/
arcType: ArcType;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
*/
static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
}
/**
* Defines a heading angle, pitch angle, and range in a local frame.
* Heading is the rotation from the local north direction where a positive angle is increasing eastward.
* Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
* angles are below the plane. Range is the distance from the center of the frame.
* @param [heading = 0.0] - The heading angle in radians.
* @param [pitch = 0.0] - The pitch angle in radians.
* @param [range = 0.0] - The distance from the center in meters.
*/
export class HeadingPitchRange {
constructor(heading?: number, pitch?: number, range?: number);
/**
* Heading is the rotation from the local north direction where a positive angle is increasing eastward.
*/
heading: number;
/**
* Pitch is the rotation from the local xy-plane. Positive pitch angles
* are above the plane. Negative pitch angles are below the plane.
*/
pitch: number;
/**
* Range is the distance from the center of the local frame.
*/
range: number;
/**
* Duplicates a HeadingPitchRange instance.
* @param hpr - The HeadingPitchRange to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
*/
static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
}
/**
* A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
* negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
* the positive x axis.
* @param [heading = 0.0] - The heading component in radians.
* @param [pitch = 0.0] - The pitch component in radians.
* @param [roll = 0.0] - The roll component in radians.
*/
export class HeadingPitchRoll {
constructor(heading?: number, pitch?: number, roll?: number);
/**
* Gets or sets the heading.
*/
heading: number;
/**
* Gets or sets the pitch.
*/
pitch: number;
/**
* Gets or sets the roll.
*/
roll: number;
/**
* Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
* @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
* @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
* @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
*/
static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
/**
* Returns a new HeadingPitchRoll instance from angles given in degrees.
* @param heading - the heading in degrees
* @param pitch - the pitch in degrees
* @param roll - the heading in degrees
* @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
* @returns A new HeadingPitchRoll instance
*/
static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
/**
* Duplicates a HeadingPitchRoll instance.
* @param headingPitchRoll - The HeadingPitchRoll to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
*/
static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
/**
* Compares the provided HeadingPitchRolls componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first HeadingPitchRoll.
* @param [right] - The second HeadingPitchRoll.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
/**
* Compares the provided HeadingPitchRolls componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [left] - The first HeadingPitchRoll.
* @param [right] - The second HeadingPitchRoll.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Duplicates this HeadingPitchRoll instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
*/
clone(result?: HeadingPitchRoll): HeadingPitchRoll;
/**
* Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side HeadingPitchRoll.
* @returns true if they are equal, false otherwise.
*/
equals(right?: HeadingPitchRoll): boolean;
/**
* Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [right] - The right hand side HeadingPitchRoll.
* @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
* @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
*/
toString(): string;
}
/**
* The encoding that is used for a heightmap
*/
export enum HeightmapEncoding {
/**
* No encoding
*/
NONE = 0,
/**
* LERC encoding
*/
LERC = 1
}
/**
* Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
* is a rectangular array of heights in row-major order from north to south and west to east.
* @example
* const buffer = ...
* const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
* const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
* const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
* const terrainData = new Cesium.HeightmapTerrainData({
* buffer : heightBuffer,
* width : 65,
* height : 65,
* childTileMask : childTileMask,
* waterMask : waterMask
* });
* @param options - Object with the following properties:
* @param options.buffer - The buffer containing height data.
* @param options.width - The width (longitude direction) of the heightmap, in samples.
* @param options.height - The height (latitude direction) of the heightmap, in samples.
* @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
* If a child's bit is set, geometry will be requested for that tile as well when it
* is needed. If the bit is cleared, the child tile is not requested and geometry is
* instead upsampled from the parent. The bit values are as follows:
*
*
Bit Position
Bit Value
Child Tile
*
0
1
Southwest
*
1
2
Southeast
*
2
4
Northwest
*
3
8
Northeast
*
* @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
* Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
* Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
* @param [options.structure] - An object describing the structure of the height data.
* @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
* the height above the heightOffset, in meters. The heightOffset is added to the resulting
* height after multiplying by the scale.
* @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
* height in meters. The offset is added after the height sample is multiplied by the
* heightScale.
* @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
* sample. This is usually 1, indicating that each element is a separate height sample. If
* it is greater than 1, that number of elements together form the height sample, which is
* computed according to the structure.elementMultiplier and structure.isBigEndian properties.
* @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
* one height to the first element of the next height.
* @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
* stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
* is 256, the height is computed as follows:
* `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
* This is assuming that the isBigEndian property is false. If it is true, the order of the
* elements is reversed.
* @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
* stride property is greater than 1. If this property is false, the first element is the
* low-order element. If it is true, the first element is the high-order element.
* @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
* than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
* buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
* not specified, no minimum value is enforced.
* @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
* than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
* buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
* than 65535. If this parameter is not specified, no maximum value is enforced.
* @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
* otherwise, false.
*/
export class HeightmapTerrainData {
constructor(options: {
buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
width: number;
height: number;
childTileMask?: number;
waterMask?: Uint8Array;
structure?: {
heightScale?: number;
heightOffset?: number;
elementsPerHeight?: number;
stride?: number;
elementMultiplier?: number;
isBigEndian?: boolean;
lowestEncodedHeight?: number;
highestEncodedHeight?: number;
};
encoding?: HeightmapEncoding;
createdByUpsampling?: boolean;
});
/**
* An array of credits for this tile.
*/
credits: Credit[];
/**
* The water mask included in this terrain data, if any. A water mask is a square
* Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
* Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
*/
waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
/**
* Computes the terrain height at a specified longitude and latitude.
* @param rectangle - The rectangle covered by this terrain data.
* @param longitude - The longitude in radians.
* @param latitude - The latitude in radians.
* @returns The terrain height at the specified position. If the position
* is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
* incorrect for positions far outside the rectangle.
*/
interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
/**
* Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
* height samples in this instance, interpolated if necessary.
* @param tilingScheme - The tiling scheme of this terrain data.
* @param thisX - The X coordinate of this tile in the tiling scheme.
* @param thisY - The Y coordinate of this tile in the tiling scheme.
* @param thisLevel - The level of this tile in the tiling scheme.
* @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
* @returns A promise for upsampled heightmap terrain data for the descendant tile,
* or undefined if too many asynchronous upsample operations are in progress and the request has been
* deferred.
*/
upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined;
/**
* Determines if a given child tile is available, based on the
* {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
* to be one of the four children of this tile. If non-child tile coordinates are
* given, the availability of the southeast child tile is returned.
* @param thisX - The tile X coordinate of this (the parent) tile.
* @param thisY - The tile Y coordinate of this (the parent) tile.
* @param childX - The tile X coordinate of the child tile to check for availability.
* @param childY - The tile Y coordinate of the child tile to check for availability.
* @returns True if the child tile is available; otherwise, false.
*/
isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
/**
* Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
* terrain data. If this value is false, the data was obtained from some other source, such
* as by downloading it from a remote server. This method should return true for instances
* returned from a call to {@link HeightmapTerrainData#upsample}.
* @returns True if this instance was created by upsampling; otherwise, false.
*/
wasCreatedByUpsampling(): boolean;
}
/**
* An {@link InterpolationAlgorithm} for performing Hermite interpolation.
*/
export namespace HermitePolynomialApproximation {
/**
* Given the desired degree, returns the number of data points required for interpolation.
* @param degree - The desired degree of interpolation.
* @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
* @returns The number of required data points needed for the desired degree of interpolation.
*/
function getRequiredDataPoints(degree: number, inputOrder?: number): number;
/**
* Interpolates values using Hermite Polynomial Approximation.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
/**
* Interpolates values using Hermite Polynomial Approximation.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param inputOrder - The number of derivatives supplied for input.
* @param outputOrder - The number of derivatives desired for output.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
}
/**
* A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
* must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
* tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between points[i] and
* points[i + 1], the tangents at the points will be outTangents[i] and inTangents[i],
* respectively.
* @example
* // Create a G1 continuous Hermite spline
* const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
* const spline = new Cesium.HermiteSpline({
* times : times,
* points : [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ],
* outTangents : [
* new Cesium.Cartesian3(1125196, -161816, 270551),
* new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
* new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
* new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
* ],
* inTangents : [
* new Cesium.Cartesian3(-1993381, -731813, 368057),
* new Cesium.Cartesian3(-4193834, 96759, -585367),
* new Cesium.Cartesian3(-1781805, 817999, -894230),
* new Cesium.Cartesian3(1165345, 112641, 47281)
* ]
* });
*
* const p0 = spline.evaluate(times[0]);
* @param options - Object with the following properties:
* @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
* The values are in no way connected to the clock time. They are the parameterization for the curve.
* @param options.points - The array of {@link Cartesian3} control points.
* @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point.
* @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point.
*/
export class HermiteSpline {
constructor(options: {
times: number[];
points: Cartesian3[];
inTangents: Cartesian3[];
outTangents: Cartesian3[];
});
/**
* An array of times for the control points.
*/
readonly times: number[];
/**
* An array of {@link Cartesian3} control points.
*/
readonly points: Cartesian3[];
/**
* An array of {@link Cartesian3} incoming tangents at each control point.
*/
readonly inTangents: Cartesian3[];
/**
* An array of {@link Cartesian3} outgoing tangents at each control point.
*/
readonly outTangents: Cartesian3[];
/**
* Creates a spline where the tangents at each control point are the same.
* The curves are guaranteed to be at least in the class C1.
* @example
* const points = [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ];
*
* // Add tangents
* const tangents = new Array(points.length);
* tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
* const temp = new Cesium.Cartesian3();
* for (let i = 1; i < tangents.length - 1; ++i) {
* tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
* }
* tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
*
* const spline = Cesium.HermiteSpline.createC1({
* times : times,
* points : points,
* tangents : tangents
* });
* @param options - Object with the following properties:
* @param options.times - The array of control point times.
* @param options.points - The array of control points.
* @param options.tangents - The array of tangents at the control points.
* @returns A hermite spline.
*/
static createC1(options: {
times: number[];
points: Cartesian3[];
tangents: Cartesian3[];
}): HermiteSpline;
/**
* Creates a natural cubic spline. The tangents at the control points are generated
* to create a curve in the class C2.
* @example
* // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
* const spline = Cesium.HermiteSpline.createNaturalCubic({
* times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
* points : [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ]
* });
* @param options - Object with the following properties:
* @param options.times - The array of control point times.
* @param options.points - The array of control points.
* @returns A hermite spline or a linear spline if less than 3 control points were given.
*/
static createNaturalCubic(options: {
times: number[];
points: Cartesian3[];
}): HermiteSpline | LinearSpline;
/**
* Creates a clamped cubic spline. The tangents at the interior control points are generated
* to create a curve in the class C2.
* @example
* // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
* const spline = Cesium.HermiteSpline.createClampedCubic({
* times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
* points : [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ],
* firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
* lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
* });
* @param options - Object with the following properties:
* @param options.times - The array of control point times.
* @param options.points - The array of control points.
* @param options.firstTangent - The outgoing tangent of the first control point.
* @param options.lastTangent - The incoming tangent of the last control point.
* @returns A hermite spline or a linear spline if less than 3 control points were given.
*/
static createClampedCubic(options: {
times: number[];
points: Cartesian3[];
firstTangent: Cartesian3;
lastTangent: Cartesian3;
}): HermiteSpline | LinearSpline;
/**
* Finds an index i in times such that the parameter
* time is in the interval [times[i], times[i + 1]].
* @param time - The time.
* @returns The index for the element at the start of the interval.
*/
findTimeInterval(time: number): number;
/**
* Wraps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, wrapped around to the updated animation.
*/
wrapTime(time: number): number;
/**
* Clamps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, clamped to the animation period.
*/
clampTime(time: number): number;
/**
* Evaluates the curve at a given time.
* @param time - The time at which to evaluate the curve.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new instance of the point on the curve at the given time.
*/
evaluate(time: number, result?: Cartesian3): Cartesian3;
}
/**
* Hilbert Order helper functions.
*/
export namespace HilbertOrder { }
/**
* Constants for WebGL index datatypes. These corresponds to the
* type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
*/
export enum IndexDatatype {
/**
* 8-bit unsigned byte corresponding to UNSIGNED_BYTE and the type
* of an element in Uint8Array.
*/
UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
/**
* 16-bit unsigned short corresponding to UNSIGNED_SHORT and the type
* of an element in Uint16Array.
*/
UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
/**
* 32-bit unsigned int corresponding to UNSIGNED_INT and the type
* of an element in Uint32Array.
*/
UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
}
export namespace InterpolationAlgorithm {
/**
* Gets the name of this interpolation algorithm.
*/
var type: string;
/**
* Given the desired degree, returns the number of data points required for interpolation.
* @param degree - The desired degree of interpolation.
* @returns The number of required data points needed for the desired degree of interpolation.
*/
function getRequiredDataPoints(degree: number): number;
/**
* Performs zero order interpolation.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
/**
* Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
* if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param inputOrder - The number of derivatives supplied for input.
* @param outputOrder - The number of derivatives desired for output.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
}
/**
* The interface for interpolation algorithms.
*/
export interface InterpolationAlgorithm {
}
/**
* This enumerated type is used in determining where, relative to the frustum, an
* object is located. The object can either be fully contained within the frustum (INSIDE),
* partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
* outside of the frustum's 6 planes (OUTSIDE).
*/
export enum Intersect {
/**
* Represents that an object is not contained within the frustum.
*/
OUTSIDE = -1,
/**
* Represents that an object intersects one of the frustum's planes.
*/
INTERSECTING = 0,
/**
* Represents that an object is fully within the frustum.
*/
INSIDE = 1
}
/**
* Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
*/
export namespace IntersectionTests {
/**
* Computes the intersection of a ray and a plane.
* @param ray - The ray.
* @param plane - The plane.
* @param [result] - The object onto which to store the result.
* @returns The intersection point or undefined if there is no intersections.
*/
function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
/**
* Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.
*
* Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
* Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
* @param ray - The ray.
* @param p0 - The first vertex of the triangle.
* @param p1 - The second vertex of the triangle.
* @param p2 - The third vertex of the triangle.
* @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle
* and return undefined for intersections with the back face.
* @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
*/
function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
/**
* Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
*
* Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
* Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
* @param ray - The ray.
* @param p0 - The first vertex of the triangle.
* @param p1 - The second vertex of the triangle.
* @param p2 - The third vertex of the triangle.
* @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle
* and return undefined for intersections with the back face.
* @param [result] - The Cartesian3 onto which to store the result.
* @returns The intersection point or undefined if there is no intersections.
*/
function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
/**
* Computes the intersection of a line segment and a triangle.
* @param v0 - The an end point of the line segment.
* @param v1 - The other end point of the line segment.
* @param p0 - The first vertex of the triangle.
* @param p1 - The second vertex of the triangle.
* @param p2 - The third vertex of the triangle.
* @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle
* and return undefined for intersections with the back face.
* @param [result] - The Cartesian3 onto which to store the result.
* @returns The intersection point or undefined if there is no intersections.
*/
function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
/**
* Computes the intersection points of a ray with a sphere.
* @param ray - The ray.
* @param sphere - The sphere.
* @param [result] - The result onto which to store the result.
* @returns The interval containing scalar points along the ray or undefined if there are no intersections.
*/
function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
/**
* Computes the intersection points of a line segment with a sphere.
* @param p0 - An end point of the line segment.
* @param p1 - The other end point of the line segment.
* @param sphere - The sphere.
* @param [result] - The result onto which to store the result.
* @returns The interval containing scalar points along the ray or undefined if there are no intersections.
*/
function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
/**
* Computes the intersection points of a ray with an ellipsoid.
* @param ray - The ray.
* @param ellipsoid - The ellipsoid.
* @returns The interval containing scalar points along the ray or undefined if there are no intersections.
*/
function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
/**
* Provides the point along the ray which is nearest to the ellipsoid.
* @param ray - The ray.
* @param ellipsoid - The ellipsoid.
* @returns The nearest planetodetic point on the ray.
*/
function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
/**
* Computes the intersection of a line segment and a plane.
* @example
* const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
* const normal = ellipsoid.geodeticSurfaceNormal(origin);
* const plane = Cesium.Plane.fromPointNormal(origin, normal);
*
* const p0 = new Cesium.Cartesian3(...);
* const p1 = new Cesium.Cartesian3(...);
*
* // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
* const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
* @param endPoint0 - An end point of the line segment.
* @param endPoint1 - The other end point of the line segment.
* @param plane - The plane.
* @param [result] - The object onto which to store the result.
* @returns The intersection point or undefined if there is no intersection.
*/
function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
/**
* Computes the intersection of a triangle and a plane
* @example
* const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
* const normal = ellipsoid.geodeticSurfaceNormal(origin);
* const plane = Cesium.Plane.fromPointNormal(origin, normal);
*
* const p0 = new Cesium.Cartesian3(...);
* const p1 = new Cesium.Cartesian3(...);
* const p2 = new Cesium.Cartesian3(...);
*
* // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
* const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
* @param p0 - First point of the triangle
* @param p1 - Second point of the triangle
* @param p2 - Third point of the triangle
* @param plane - Intersection plane
* @returns An object with properties positions and indices, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)
*/
function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
}
/**
* Contains functions for operating on 2D triangles.
*/
export namespace Intersections2D {
/**
* Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
* polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
* 3, or 4 vertices.
* @example
* const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
* // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
* @param threshold - The threshold coordinate value at which to clip the triangle.
* @param keepAbove - true to keep the portion of the triangle above the threshold, or false
* to keep the portion below.
* @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
* @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
* @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
* @param [result] - The array into which to copy the result. If this parameter is not supplied,
* a new array is constructed and returned.
* @returns The polygon that results after the clip, specified as a list of
* vertices. The vertices are specified in counter-clockwise order.
* Each vertex is either an index from the existing list (identified as
* a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
* For new vertices, the -1 is followed by three additional numbers: the
* index of each of the two original vertices forming the line segment that
* the new vertex lies on, and the fraction of the distance from the first
* vertex to the second one.
*/
function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
/**
* Compute the barycentric coordinates of a 2D position within a 2D triangle.
* @example
* const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
* // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
* @param x - The x coordinate of the position for which to find the barycentric coordinates.
* @param y - The y coordinate of the position for which to find the barycentric coordinates.
* @param x1 - The x coordinate of the triangle's first vertex.
* @param y1 - The y coordinate of the triangle's first vertex.
* @param x2 - The x coordinate of the triangle's second vertex.
* @param y2 - The y coordinate of the triangle's second vertex.
* @param x3 - The x coordinate of the triangle's third vertex.
* @param y3 - The y coordinate of the triangle's third vertex.
* @param [result] - The instance into to which to copy the result. If this parameter
* is undefined, a new instance is created and returned.
* @returns The barycentric coordinates of the position within the triangle.
*/
function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
/**
* Compute the intersection between 2 line segments
* @example
* const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
* // result === new Cesium.Cartesian2(0.0, 1.0);
* @param x00 - The x coordinate of the first line's first vertex.
* @param y00 - The y coordinate of the first line's first vertex.
* @param x01 - The x coordinate of the first line's second vertex.
* @param y01 - The y coordinate of the first line's second vertex.
* @param x10 - The x coordinate of the second line's first vertex.
* @param y10 - The y coordinate of the second line's first vertex.
* @param x11 - The x coordinate of the second line's second vertex.
* @param y11 - The y coordinate of the second line's second vertex.
* @param [result] - The instance into to which to copy the result. If this parameter
* is undefined, a new instance is created and returned.
* @returns The intersection point, undefined if there is no intersection point or lines are coincident.
*/
function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
}
/**
* Represents the closed interval [start, stop].
* @param [start = 0.0] - The beginning of the interval.
* @param [stop = 0.0] - The end of the interval.
*/
export class Interval {
constructor(start?: number, stop?: number);
/**
* The beginning of the interval.
*/
start: number;
/**
* The end of the interval.
*/
stop: number;
}
/**
* Default settings for accessing the Cesium ion API.
*
* An ion access token is only required if you are using any ion related APIs.
* A default access token is provided for evaluation purposes only.
* Sign up for a free ion account and get your own access token at {@link https://cesium.com}
*/
export namespace Ion {
/**
* Gets or sets the default Cesium ion access token.
*/
var defaultAccessToken: string;
/**
* Gets or sets the default Cesium ion server.
*/
var defaultServer: string | Resource;
}
/**
* Provides geocoding through Cesium ion.
* @param options - Object with the following properties:
* @param options.scene - The scene
* @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
* @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
*/
export class IonGeocoderService {
constructor(options: {
scene: Scene;
accessToken?: string;
server?: string | Resource;
});
/**
* @param query - The query to be sent to the geocoder service
* @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
*/
geocode(query: string, type?: GeocodeType): Promise;
}
/**
* A {@link Resource} instance that encapsulates Cesium ion asset access.
* This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
* @param endpoint - The result of the Cesium ion asset endpoint service.
* @param endpointResource - The resource used to retreive the endpoint.
*/
export class IonResource extends Resource {
constructor(endpoint: any, endpointResource: Resource);
/**
* Asynchronously creates an instance.
* @example
* //Load a Cesium3DTileset with asset ID of 124624234
* viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
* @example
* //Load a CZML file with asset ID of 10890
* Cesium.IonResource.fromAssetId(10890)
* .then(function (resource) {
* viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
* });
* @param assetId - The Cesium ion asset id.
* @param [options] - An object with the following properties:
* @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
* @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
* @returns A Promise to am instance representing the Cesium ion Asset.
*/
static fromAssetId(assetId: number, options?: {
accessToken?: string;
server?: string | Resource;
}): Promise;
/**
* Gets the credits required for attribution of the asset.
*/
readonly credits: Credit[];
/**
* Duplicates a Resource instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Resource instance if one was not provided.
*/
clone(result?: Resource): Resource;
/**
* Asynchronously loads the given image resource. Returns a promise that will resolve to
* an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
* @example
* // load a single image asynchronously
* resource.fetchImage().then(function(image) {
* // use the loaded image
* }).otherwise(function(error) {
* // an error occurred
* });
*
* // load several images in parallel
* when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
* // images is an array containing all the loaded images
* });
* @param [options] - An object with the following properties.
* @param [options.preferBlob = false] - If true, we will load the image via a blob.
* @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned.
* @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap.
* @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchImage(options?: {
preferBlob?: boolean;
preferImageBitmap?: boolean;
flipY?: boolean;
skipColorSpaceConversion?: boolean;
}): Promise | Promise | undefined;
}
/**
* Constants related to ISO8601 support.
*/
export namespace Iso8601 {
/**
* A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
* This is equivalent to the date string '0000-01-01T00:00:00Z'
*/
const MINIMUM_VALUE: JulianDate;
/**
* A {@link JulianDate} representing the latest time representable by an ISO8601 date.
* This is equivalent to the date string '9999-12-31T24:00:00Z'
*/
const MAXIMUM_VALUE: JulianDate;
/**
* A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
* This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
*/
const MAXIMUM_INTERVAL: JulianDate;
}
/**
* Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
* For increased precision, this class stores the whole number part of the date and the seconds
* part of the date in separate components. In order to be safe for arithmetic and represent
* leap seconds, the date is always stored in the International Atomic Time standard
* {@link TimeStandard.TAI}.
* @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
* @param [secondsOfDay = 0.0] - The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.
* @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
*/
export class JulianDate {
constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
/**
* Gets or sets the number of whole days.
*/
dayNumber: number;
/**
* Gets or sets the number of seconds into the current day.
*/
secondsOfDay: number;
/**
* Creates a new instance from a GregorianDate.
* @param date - A GregorianDate.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
/**
* Creates a new instance from a JavaScript Date.
* @param date - A JavaScript Date.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static fromDate(date: Date, result?: JulianDate): JulianDate;
/**
* Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
* This method is superior to Date.parse because it will handle all valid formats defined by the ISO 8601
* specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
* @param iso8601String - An ISO 8601 date.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
/**
* Creates a new instance that represents the current system time.
* This is equivalent to calling JulianDate.fromDate(new Date());.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static now(result?: JulianDate): JulianDate;
/**
* Creates a {@link GregorianDate} from the provided instance.
* @param julianDate - The date to be converted.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
/**
* Creates a JavaScript Date from the provided instance.
* Since JavaScript dates are only accurate to the nearest millisecond and
* cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
* If the provided JulianDate is during a leap second, the previous second is used.
* @param julianDate - The date to be converted.
* @returns A new instance representing the provided date.
*/
static toDate(julianDate: JulianDate): Date;
/**
* Creates an ISO8601 representation of the provided date.
* @param julianDate - The date to be converted.
* @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
* @returns The ISO8601 representation of the provided date.
*/
static toIso8601(julianDate: JulianDate, precision?: number): string;
/**
* Duplicates a JulianDate instance.
* @param julianDate - The date to duplicate.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
*/
static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
/**
* Compares two instances.
* @param left - The first instance.
* @param right - The second instance.
* @returns A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.
*/
static compare(left: JulianDate, right: JulianDate): number;
/**
* Compares two instances and returns true if they are equal, false otherwise.
* @param [left] - The first instance.
* @param [right] - The second instance.
* @returns true if the dates are equal; otherwise, false.
*/
static equals(left?: JulianDate, right?: JulianDate): boolean;
/**
* Compares two instances and returns true if they are within epsilon seconds of
* each other. That is, in order for the dates to be considered equal (and for
* this function to return true), the absolute value of the difference between them, in
* seconds, must be less than epsilon.
* @param [left] - The first instance.
* @param [right] - The second instance.
* @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
* @returns true if the two dates are within epsilon seconds of each other; otherwise false.
*/
static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
/**
* Computes the total number of whole and fractional days represented by the provided instance.
* @param julianDate - The date.
* @returns The Julian date as single floating point number.
*/
static totalDays(julianDate: JulianDate): number;
/**
* Computes the difference in seconds between the provided instance.
* @param left - The first instance.
* @param right - The second instance.
* @returns The difference, in seconds, when subtracting right from left.
*/
static secondsDifference(left: JulianDate, right: JulianDate): number;
/**
* Computes the difference in days between the provided instance.
* @param left - The first instance.
* @param right - The second instance.
* @returns The difference, in days, when subtracting right from left.
*/
static daysDifference(left: JulianDate, right: JulianDate): number;
/**
* Computes the number of seconds the provided instance is ahead of UTC.
* @param julianDate - The date.
* @returns The number of seconds the provided instance is ahead of UTC
*/
static computeTaiMinusUtc(julianDate: JulianDate): number;
/**
* Adds the provided number of seconds to the provided date instance.
* @param julianDate - The date.
* @param seconds - The number of seconds to add or subtract.
* @param result - An existing instance to use for the result.
* @returns The modified result parameter.
*/
static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
/**
* Adds the provided number of minutes to the provided date instance.
* @param julianDate - The date.
* @param minutes - The number of minutes to add or subtract.
* @param result - An existing instance to use for the result.
* @returns The modified result parameter.
*/
static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
/**
* Adds the provided number of hours to the provided date instance.
* @param julianDate - The date.
* @param hours - The number of hours to add or subtract.
* @param result - An existing instance to use for the result.
* @returns The modified result parameter.
*/
static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
/**
* Adds the provided number of days to the provided date instance.
* @param julianDate - The date.
* @param days - The number of days to add or subtract.
* @param result - An existing instance to use for the result.
* @returns The modified result parameter.
*/
static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
/**
* Compares the provided instances and returns true if left is earlier than right, false otherwise.
* @param left - The first instance.
* @param right - The second instance.
* @returns true if left is earlier than right, false otherwise.
*/
static lessThan(left: JulianDate, right: JulianDate): boolean;
/**
* Compares the provided instances and returns true if left is earlier than or equal to right, false otherwise.
* @param left - The first instance.
* @param right - The second instance.
* @returns true if left is earlier than or equal to right, false otherwise.
*/
static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
/**
* Compares the provided instances and returns true if left is later than right, false otherwise.
* @param left - The first instance.
* @param right - The second instance.
* @returns true if left is later than right, false otherwise.
*/
static greaterThan(left: JulianDate, right: JulianDate): boolean;
/**
* Compares the provided instances and returns true if left is later than or equal to right, false otherwise.
* @param left - The first instance.
* @param right - The second instance.
* @returns true if left is later than or equal to right, false otherwise.
*/
static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
/**
* Duplicates this instance.
* @param [result] - An existing instance to use for the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
clone(result?: JulianDate): JulianDate;
/**
* Compares this and the provided instance and returns true if they are equal, false otherwise.
* @param [right] - The second instance.
* @returns true if the dates are equal; otherwise, false.
*/
equals(right?: JulianDate): boolean;
/**
* Compares this and the provided instance and returns true if they are within epsilon seconds of
* each other. That is, in order for the dates to be considered equal (and for
* this function to return true), the absolute value of the difference between them, in
* seconds, must be less than epsilon.
* @param [right] - The second instance.
* @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
* @returns true if the two dates are within epsilon seconds of each other; otherwise false.
*/
equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
/**
* Creates a string representing this date in ISO8601 format.
* @returns A string representing this date in ISO8601 format.
*/
toString(): string;
/**
* Gets or sets the list of leap seconds used throughout Cesium.
*/
static leapSeconds: LeapSecond[];
}
/**
* This enumerated type is for representing keyboard modifiers. These are keys
* that are held down in addition to other event types.
*/
export enum KeyboardEventModifier {
/**
* Represents the shift key being held down.
*/
SHIFT = 0,
/**
* Represents the control key being held down.
*/
CTRL = 1,
/**
* Represents the alt key being held down.
*/
ALT = 2
}
/**
* An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
*/
export namespace LagrangePolynomialApproximation {
/**
* Given the desired degree, returns the number of data points required for interpolation.
* @param degree - The desired degree of interpolation.
* @returns The number of required data points needed for the desired degree of interpolation.
*/
function getRequiredDataPoints(degree: number): number;
/**
* Interpolates values using Lagrange Polynomial Approximation.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
}
/**
* Describes a single leap second, which is constructed from a {@link JulianDate} and a
* numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
* @param [date] - A Julian date representing the time of the leap second.
* @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
*/
export class LeapSecond {
constructor(date?: JulianDate, offset?: number);
/**
* Gets or sets the date at which this leap second occurs.
*/
julianDate: JulianDate;
/**
* Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
* of this leap second.
*/
offset: number;
}
/**
* An {@link InterpolationAlgorithm} for performing linear interpolation.
*/
export namespace LinearApproximation {
/**
* Given the desired degree, returns the number of data points required for interpolation.
* Since linear interpolation can only generate a first degree polynomial, this function
* always returns 2.
* @param degree - The desired degree of interpolation.
* @returns This function always returns 2.
*/
function getRequiredDataPoints(degree: number): number;
/**
* Interpolates values using linear approximation.
* @param x - The independent variable for which the dependent variables will be interpolated.
* @param xTable - The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
* @param yTable - The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
* @param yStride - The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
* @param [result] - An existing array into which to store the result.
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
}
/**
* A spline that uses piecewise linear interpolation to create a curve.
* @example
* const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
* const spline = new Cesium.LinearSpline({
* times : times,
* points : [
* new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
* new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
* new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
* new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
* new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
* ]
* });
*
* const p0 = spline.evaluate(times[0]);
* @param options - Object with the following properties:
* @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
* The values are in no way connected to the clock time. They are the parameterization for the curve.
* @param options.points - The array of {@link Cartesian3} control points.
*/
export class LinearSpline {
constructor(options: {
times: number[];
points: Cartesian3[];
});
/**
* An array of times for the control points.
*/
readonly times: number[];
/**
* An array of {@link Cartesian3} control points.
*/
readonly points: Cartesian3[];
/**
* Finds an index i in times such that the parameter
* time is in the interval [times[i], times[i + 1]].
* @param time - The time.
* @returns The index for the element at the start of the interval.
*/
findTimeInterval(time: number): number;
/**
* Wraps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, wrapped around to the updated animation.
*/
wrapTime(time: number): number;
/**
* Clamps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, clamped to the animation period.
*/
clampTime(time: number): number;
/**
* Evaluates the curve at a given time.
* @param time - The time at which to evaluate the curve.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new instance of the point on the curve at the given time.
*/
evaluate(time: number, result?: Cartesian3): Cartesian3;
}
/**
* Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
* flat map like Cesium's 2D and Columbus View modes.
*/
export class MapProjection {
constructor();
/**
* Gets the {@link Ellipsoid}.
*/
readonly ellipsoid: Ellipsoid;
/**
* Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
* @param cartographic - The coordinates to project.
* @param [result] - An instance into which to copy the result. If this parameter is
* undefined, a new instance is created and returned.
* @returns The projected coordinates. If the result parameter is not undefined, the
* coordinates are copied there and that instance is returned. Otherwise, a new instance is
* created and returned.
*/
project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
/**
* Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
* coordinates, in radians.
* @param cartesian - The Cartesian position to unproject with height (z) in meters.
* @param [result] - An instance into which to copy the result. If this parameter is
* undefined, a new instance is created and returned.
* @returns The unprojected coordinates. If the result parameter is not undefined, the
* coordinates are copied there and that instance is returned. Otherwise, a new instance is
* created and returned.
*/
unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
}
/**
* Math functions.
*/
export namespace Math {
/**
* 0.1
*/
const EPSILON1 = 0.1;
/**
* 0.01
*/
const EPSILON2 = 0.01;
/**
* 0.001
*/
const EPSILON3 = 0.001;
/**
* 0.0001
*/
const EPSILON4 = 0.0001;
/**
* 0.00001
*/
const EPSILON5 = 0.00001;
/**
* 0.000001
*/
const EPSILON6 = 0.000001;
/**
* 0.0000001
*/
const EPSILON7 = 1e-7;
/**
* 0.00000001
*/
const EPSILON8 = 1e-8;
/**
* 0.000000001
*/
const EPSILON9 = 1e-9;
/**
* 0.0000000001
*/
const EPSILON10 = 1e-10;
/**
* 0.00000000001
*/
const EPSILON11 = 1e-11;
/**
* 0.000000000001
*/
const EPSILON12 = 1e-12;
/**
* 0.0000000000001
*/
const EPSILON13 = 1e-13;
/**
* 0.00000000000001
*/
const EPSILON14 = 1e-14;
/**
* 0.000000000000001
*/
const EPSILON15 = 1e-15;
/**
* 0.0000000000000001
*/
const EPSILON16 = 1e-16;
/**
* 0.00000000000000001
*/
const EPSILON17 = 1e-17;
/**
* 0.000000000000000001
*/
const EPSILON18 = 1e-18;
/**
* 0.0000000000000000001
*/
const EPSILON19 = 1e-19;
/**
* 0.00000000000000000001
*/
const EPSILON20 = 1e-20;
/**
* 0.000000000000000000001
*/
const EPSILON21 = 1e-21;
/**
* The gravitational parameter of the Earth in meters cubed
* per second squared as defined by the WGS84 model: 3.986004418e14
*/
const GRAVITATIONALPARAMETER = 398600441800000;
/**
* Radius of the sun in meters: 6.955e8
*/
const SOLAR_RADIUS = 695500000;
/**
* The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
* Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
* Celestial Mechanics 82: 83-110, 2002.
*/
const LUNAR_RADIUS = 1737400;
/**
* 64 * 1024
*/
const SIXTY_FOUR_KILOBYTES: number;
/**
* 4 * 1024 * 1024 * 1024
*/
const FOUR_GIGABYTES: number;
/**
* Returns the sign of the value; 1 if the value is positive, -1 if the value is
* negative, or 0 if the value is 0.
* @param value - The value to return the sign of.
* @returns The sign of value.
*/
function sign(value: number): number;
/**
* Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
* This is similar to {@link Math#sign} except that returns 1.0 instead of
* 0.0 when the input value is 0.0.
* @param value - The value to return the sign of.
* @returns The sign of value.
*/
function signNotZero(value: number): number;
/**
* Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
* @param value - The scalar value in the range [-1.0, 1.0]
* @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
* @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
*/
function toSNorm(value: number, rangeMaximum?: number): number;
/**
* Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
* @param value - SNORM value in the range [0, rangeMaximum]
* @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
* @returns Scalar in the range [-1.0, 1.0].
*/
function fromSNorm(value: number, rangeMaximum?: number): number;
/**
* Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
* @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
* @param rangeMinimum - The minimum value in the mapped range.
* @param rangeMaximum - The maximum value in the mapped range.
* @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
*/
function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
/**
* Returns the hyperbolic sine of a number.
* The hyperbolic sine of value is defined to be
* (ex - e-x)/2.0
* where e is Euler's number, approximately 2.71828183.
*
*
Special cases:
*
*
If the argument is NaN, then the result is NaN.
*
*
If the argument is infinite, then the result is an infinity
* with the same sign as the argument.
*
*
If the argument is zero, then the result is a zero with the
* same sign as the argument.
*
*
* @param value - The number whose hyperbolic sine is to be returned.
* @returns The hyperbolic sine of value.
*/
function sinh(value: number): number;
/**
* Returns the hyperbolic cosine of a number.
* The hyperbolic cosine of value is defined to be
* (ex + e-x)/2.0
* where e is Euler's number, approximately 2.71828183.
*
*
Special cases:
*
*
If the argument is NaN, then the result is NaN.
*
*
If the argument is infinite, then the result is positive infinity.
*
*
If the argument is zero, then the result is 1.0.
*
*
* @param value - The number whose hyperbolic cosine is to be returned.
* @returns The hyperbolic cosine of value.
*/
function cosh(value: number): number;
/**
* Computes the linear interpolation of two values.
* @example
* const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
* @param p - The start value to interpolate.
* @param q - The end value to interpolate.
* @param time - The time of interpolation generally in the range [0.0, 1.0].
* @returns The linearly interpolated value.
*/
function lerp(p: number, q: number, time: number): number;
/**
* pi
*/
const PI: number;
/**
* 1/pi
*/
const ONE_OVER_PI: number;
/**
* pi/2
*/
const PI_OVER_TWO: number;
/**
* pi/3
*/
const PI_OVER_THREE: number;
/**
* pi/4
*/
const PI_OVER_FOUR: number;
/**
* pi/6
*/
const PI_OVER_SIX: number;
/**
* 3pi/2
*/
const THREE_PI_OVER_TWO: number;
/**
* 2pi
*/
const TWO_PI: number;
/**
* 1/2pi
*/
const ONE_OVER_TWO_PI: number;
/**
* The number of radians in a degree.
*/
const RADIANS_PER_DEGREE: number;
/**
* The number of degrees in a radian.
*/
const DEGREES_PER_RADIAN: number;
/**
* The number of radians in an arc second.
*/
const RADIANS_PER_ARCSECOND: number;
/**
* Converts degrees to radians.
* @param degrees - The angle to convert in degrees.
* @returns The corresponding angle in radians.
*/
function toRadians(degrees: number): number;
/**
* Converts radians to degrees.
* @param radians - The angle to convert in radians.
* @returns The corresponding angle in degrees.
*/
function toDegrees(radians: number): number;
/**
* Converts a longitude value, in radians, to the range [-Math.PI, Math.PI).
* @example
* // Convert 270 degrees to -90 degrees longitude
* const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
* @param angle - The longitude value, in radians, to convert to the range [-Math.PI, Math.PI).
* @returns The equivalent longitude value in the range [-Math.PI, Math.PI).
*/
function convertLongitudeRange(angle: number): number;
/**
* Convenience function that clamps a latitude value, in radians, to the range [-Math.PI/2, Math.PI/2).
* Useful for sanitizing data before use in objects requiring correct range.
* @example
* // Clamp 108 degrees latitude to 90 degrees latitude
* const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
* @param angle - The latitude value, in radians, to clamp to the range [-Math.PI/2, Math.PI/2).
* @returns The latitude value clamped to the range [-Math.PI/2, Math.PI/2).
*/
function clampToLatitudeRange(angle: number): number;
/**
* Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
* @param angle - in radians
* @returns The angle in the range [-Math.PI, Math.PI].
*/
function negativePiToPi(angle: number): number;
/**
* Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
* @param angle - in radians
* @returns The angle in the range [0, Math.TWO_PI].
*/
function zeroToTwoPi(angle: number): number;
/**
* The modulo operation that also works for negative dividends.
* @param m - The dividend.
* @param n - The divisor.
* @returns The remainder.
*/
function mod(m: number, n: number): number;
/**
* Determines if two values are equal using an absolute or relative tolerance test. This is useful
* to avoid problems due to roundoff error when comparing floating-point values directly. The values are
* first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
* Use this test if you are unsure of the magnitudes of left and right.
* @example
* const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
* const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
* const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
* const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
* @param left - The first value to compare.
* @param right - The other value to compare.
* @param [relativeEpsilon = 0] - The maximum inclusive delta between left and right for the relative tolerance test.
* @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between left and right for the absolute tolerance test.
* @returns true if the values are equal within the epsilon; otherwise, false.
*/
function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
/**
* Determines if the left value is less than the right value. If the two values are within
* absoluteEpsilon of each other, they are considered equal and this function returns false.
* @param left - The first number to compare.
* @param right - The second number to compare.
* @param absoluteEpsilon - The absolute epsilon to use in comparison.
* @returns true if left is less than right by more than
* absoluteEpsilon. false if left is greater or if the two
* values are nearly equal.
*/
function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
/**
* Determines if the left value is less than or equal to the right value. If the two values are within
* absoluteEpsilon of each other, they are considered equal and this function returns true.
* @param left - The first number to compare.
* @param right - The second number to compare.
* @param absoluteEpsilon - The absolute epsilon to use in comparison.
* @returns true if left is less than right or if the
* the values are nearly equal.
*/
function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
/**
* Determines if the left value is greater the right value. If the two values are within
* absoluteEpsilon of each other, they are considered equal and this function returns false.
* @param left - The first number to compare.
* @param right - The second number to compare.
* @param absoluteEpsilon - The absolute epsilon to use in comparison.
* @returns true if left is greater than right by more than
* absoluteEpsilon. false if left is less or if the two
* values are nearly equal.
*/
function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
/**
* Determines if the left value is greater than or equal to the right value. If the two values are within
* absoluteEpsilon of each other, they are considered equal and this function returns true.
* @param left - The first number to compare.
* @param right - The second number to compare.
* @param absoluteEpsilon - The absolute epsilon to use in comparison.
* @returns true if left is greater than right or if the
* the values are nearly equal.
*/
function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
/**
* Computes the factorial of the provided number.
* @example
* //Compute 7!, which is equal to 5040
* const computedFactorial = Cesium.Math.factorial(7);
* @param n - The number whose factorial is to be computed.
* @returns The factorial of the provided number or undefined if the number is less than 0.
*/
function factorial(n: number): number;
/**
* Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
* @example
* const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
* const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
* @param [n] - The number to be incremented.
* @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
* @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
* @returns The incremented number.
*/
function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
/**
* Determines if a non-negative integer is a power of two.
* The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
* @example
* const t = Cesium.Math.isPowerOfTwo(16); // true
* const f = Cesium.Math.isPowerOfTwo(20); // false
* @param n - The integer to test in the range [0, (2^32)-1].
* @returns true if the number if a power of two; otherwise, false.
*/
function isPowerOfTwo(n: number): boolean;
/**
* Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
* The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
* @example
* const n = Cesium.Math.nextPowerOfTwo(29); // 32
* const m = Cesium.Math.nextPowerOfTwo(32); // 32
* @param n - The integer to test in the range [0, 2^31].
* @returns The next power-of-two integer.
*/
function nextPowerOfTwo(n: number): number;
/**
* Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
* The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
* @example
* const n = Cesium.Math.previousPowerOfTwo(29); // 16
* const m = Cesium.Math.previousPowerOfTwo(32); // 32
* @param n - The integer to test in the range [0, (2^32)-1].
* @returns The previous power-of-two integer.
*/
function previousPowerOfTwo(n: number): number;
/**
* Constraint a value to lie between two values.
* @param value - The value to constrain.
* @param min - The minimum value.
* @param max - The maximum value.
* @returns The value clamped so that min <= value <= max.
*/
function clamp(value: number, min: number, max: number): number;
/**
* Sets the seed used by the random number generator
* in {@link Math#nextRandomNumber}.
* @param seed - An integer used as the seed.
*/
function setRandomNumberSeed(seed: number): void;
/**
* Generates a random floating point number in the range of [0.0, 1.0)
* using a Mersenne twister.
* @returns A random number in the range of [0.0, 1.0).
*/
function nextRandomNumber(): number;
/**
* Generates a random number between two numbers.
* @param min - The minimum value.
* @param max - The maximum value.
* @returns A random number between the min and max.
*/
function randomBetween(min: number, max: number): number;
/**
* Computes Math.acos(value), but first clamps value to the range [-1.0, 1.0]
* so that the function will never return NaN.
* @param value - The value for which to compute acos.
* @returns The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,
* whichever is closer, if the value is outside the range.
*/
function acosClamped(value: number): number;
/**
* Computes Math.asin(value), but first clamps value to the range [-1.0, 1.0]
* so that the function will never return NaN.
* @param value - The value for which to compute asin.
* @returns The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,
* whichever is closer, if the value is outside the range.
*/
function asinClamped(value: number): number;
/**
* Finds the chord length between two points given the circle's radius and the angle between the points.
* @param angle - The angle between the two points.
* @param radius - The radius of the circle.
* @returns The chord length.
*/
function chordLength(angle: number, radius: number): number;
/**
* Finds the logarithm of a number to a base.
* @param number - The number.
* @param base - The base.
* @returns The result.
*/
function logBase(number: number, base: number): number;
/**
* Finds the cube root of a number.
* Returns NaN if number is not provided.
* @param [number] - The number.
* @returns The result.
*/
function cbrt(number?: number): number;
/**
* Finds the base 2 logarithm of a number.
* @param number - The number.
* @returns The result.
*/
function log2(number: number): number;
/**
* Computes a fast approximation of Atan for input in the range [-1, 1].
*
* Based on Michal Drobot's approximation from ShaderFastLibs,
* which in turn is based on "Efficient approximations for the arctangent function,"
* Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
* Adapted from ShaderFastLibs under MIT License.
* @param x - An input number in the range [-1, 1]
* @returns An approximation of atan(x)
*/
function fastApproximateAtan(x: number): number;
/**
* Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
*
* Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
* @param x - An input number that isn't zero if y is zero.
* @param y - An input number that isn't zero if x is zero.
* @returns An approximation of atan2(x, y)
*/
function fastApproximateAtan2(x: number, y: number): number;
}
export interface Matrix2 extends ArrayLike {
}
/**
* A 2x2 matrix, indexable as a column-major order array.
* Constructor parameters are in row-major order for code readability.
* @param [column0Row0 = 0.0] - The value for column 0, row 0.
* @param [column1Row0 = 0.0] - The value for column 1, row 0.
* @param [column0Row1 = 0.0] - The value for column 0, row 1.
* @param [column1Row1 = 0.0] - The value for column 1, row 1.
*/
export class Matrix2 implements ArrayLike {
constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Matrix2 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
/**
* Flattens an array of Matrix2s into an array of components. The components
* are stored in column-major order.
* @param array - The array of matrices to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
* @returns The packed array.
*/
static packArray(array: Matrix2[], result?: number[]): number[];
/**
* Unpacks an array of column-major matrix components into an array of Matrix2s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Matrix2[]): Matrix2[];
/**
* Duplicates a Matrix2 instance.
* @param matrix - The matrix to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
*/
static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
/**
* Creates a Matrix2 from 4 consecutive elements in an array.
* @example
* // Create the Matrix2:
* // [1.0, 2.0]
* // [1.0, 2.0]
*
* const v = [1.0, 1.0, 2.0, 2.0];
* const m = Cesium.Matrix2.fromArray(v);
*
* // Create same Matrix2 with using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
* const m2 = Cesium.Matrix2.fromArray(v2, 2);
*/
static fromArray: any;
/**
* Creates a Matrix2 instance from a column-major order array.
* @param values - The column-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
/**
* Creates a Matrix2 instance from a row-major order array.
* The resulting matrix will be in column-major order.
* @param values - The row-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
/**
* Computes a Matrix2 instance representing a non-uniform scale.
* @example
* // Creates
* // [7.0, 0.0]
* // [0.0, 8.0]
* const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
* @param scale - The x and y scale factors.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
/**
* Computes a Matrix2 instance representing a uniform scale.
* @example
* // Creates
* // [2.0, 0.0]
* // [0.0, 2.0]
* const m = Cesium.Matrix2.fromUniformScale(2.0);
* @param scale - The uniform scale factor.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
/**
* Creates a rotation matrix.
* @example
* // Rotate a point 45 degrees counterclockwise.
* const p = new Cesium.Cartesian2(5, 6);
* const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
* const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
* @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
static fromRotation(angle: number, result?: Matrix2): Matrix2;
/**
* Creates an Array from the provided Matrix2 instance.
* The array will be in column-major order.
* @param matrix - The matrix to use..
* @param [result] - The Array onto which to store the result.
* @returns The modified Array parameter or a new Array instance if one was not provided.
*/
static toArray(matrix: Matrix2, result?: number[]): number[];
/**
* Computes the array index of the element at the provided row and column.
* @example
* const myMatrix = new Cesium.Matrix2();
* const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
* const column1Row0 = myMatrix[column1Row0Index]
* myMatrix[column1Row0Index] = 10.0;
* @param row - The zero-based index of the row.
* @param column - The zero-based index of the column.
* @returns The index of the element at the provided row and column.
*/
static getElementIndex(row: number, column: number): number;
/**
* Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
/**
* Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified column.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
/**
* Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
/**
* Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified row.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
/**
* Computes a new matrix that replaces the scale with the provided scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
/**
* Computes a new matrix that replaces the scale with the provided uniform scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The uniform scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
/**
* Extracts the non-uniform scale assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
/**
* Computes the maximum scale assuming the matrix is an affine transformation.
* The maximum scale is the maximum length of the column vectors.
* @param matrix - The matrix.
* @returns The maximum scale.
*/
static getMaximumScale(matrix: Matrix2): number;
/**
* Sets the rotation assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param rotation - The rotation matrix.
* @returns The modified result parameter.
*/
static setRotation(matrix: Matrix2, rotation: Matrix2): Matrix2;
/**
* Extracts the rotation matrix assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRotation(matrix: Matrix2, result: Matrix2): Matrix2;
/**
* Computes the product of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
/**
* Computes the sum of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
/**
* Computes the difference of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
/**
* Computes the product of a matrix and a column vector.
* @param matrix - The matrix.
* @param cartesian - The column.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
/**
* Computes the product of a matrix and a scalar.
* @param matrix - The matrix.
* @param scalar - The number to multiply by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
/**
* Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
* @example
* // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
* Cesium.Matrix2.multiplyByScale(m, scale, m);
* @param matrix - The matrix on the left-hand side.
* @param scale - The non-uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
/**
* Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
* @example
* // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);
* Cesium.Matrix2.multiplyByUniformScale(m, scale, m);
* @param matrix - The matrix on the left-hand side.
* @param scale - The uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
/**
* Creates a negated copy of the provided matrix.
* @param matrix - The matrix to negate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(matrix: Matrix2, result: Matrix2): Matrix2;
/**
* Computes the transpose of the provided matrix.
* @param matrix - The matrix to transpose.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
/**
* Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
* @param matrix - The matrix with signed elements.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(matrix: Matrix2, result: Matrix2): Matrix2;
/**
* Compares the provided matrices componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Matrix2, right?: Matrix2): boolean;
/**
* Compares the provided matrices componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
/**
* An immutable Matrix2 instance initialized to the identity matrix.
*/
static readonly IDENTITY: Matrix2;
/**
* An immutable Matrix2 instance initialized to the zero matrix.
*/
static readonly ZERO: Matrix2;
/**
* The index into Matrix2 for column 0, row 0.
* @example
* const matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
*/
static readonly COLUMN0ROW0: number;
/**
* The index into Matrix2 for column 0, row 1.
* @example
* const matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
*/
static readonly COLUMN0ROW1: number;
/**
* The index into Matrix2 for column 1, row 0.
* @example
* const matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
*/
static readonly COLUMN1ROW0: number;
/**
* The index into Matrix2 for column 1, row 1.
* @example
* const matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
*/
static readonly COLUMN1ROW1: number;
/**
* Gets the number of items in the collection.
*/
length: number;
/**
* Duplicates the provided Matrix2 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix2 instance if one was not provided.
*/
clone(result?: Matrix2): Matrix2;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side matrix.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Matrix2): boolean;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [right] - The right hand side matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
/**
* Creates a string representing this Matrix with each row being
* on a separate line and in the format '(column0, column1)'.
* @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
*/
toString(): string;
}
export interface Matrix3 extends ArrayLike {
}
/**
* A 3x3 matrix, indexable as a column-major order array.
* Constructor parameters are in row-major order for code readability.
* @param [column0Row0 = 0.0] - The value for column 0, row 0.
* @param [column1Row0 = 0.0] - The value for column 1, row 0.
* @param [column2Row0 = 0.0] - The value for column 2, row 0.
* @param [column0Row1 = 0.0] - The value for column 0, row 1.
* @param [column1Row1 = 0.0] - The value for column 1, row 1.
* @param [column2Row1 = 0.0] - The value for column 2, row 1.
* @param [column0Row2 = 0.0] - The value for column 0, row 2.
* @param [column1Row2 = 0.0] - The value for column 1, row 2.
* @param [column2Row2 = 0.0] - The value for column 2, row 2.
*/
export class Matrix3 implements ArrayLike {
constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Matrix3 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
/**
* Flattens an array of Matrix3s into an array of components. The components
* are stored in column-major order.
* @param array - The array of matrices to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.
* @returns The packed array.
*/
static packArray(array: Matrix3[], result?: number[]): number[];
/**
* Unpacks an array of column-major matrix components into an array of Matrix3s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Matrix3[]): Matrix3[];
/**
* Duplicates a Matrix3 instance.
* @param matrix - The matrix to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
*/
static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
/**
* Creates a Matrix3 from 9 consecutive elements in an array.
* @example
* // Create the Matrix3:
* // [1.0, 2.0, 3.0]
* // [1.0, 2.0, 3.0]
* // [1.0, 2.0, 3.0]
*
* const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
* const m = Cesium.Matrix3.fromArray(v);
*
* // Create same Matrix3 with using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
* const m2 = Cesium.Matrix3.fromArray(v2, 2);
*/
static fromArray: any;
/**
* Creates a Matrix3 instance from a column-major order array.
* @param values - The column-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
/**
* Creates a Matrix3 instance from a row-major order array.
* The resulting matrix will be in column-major order.
* @param values - The row-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
/**
* Computes a 3x3 rotation matrix from the provided quaternion.
* @param quaternion - the quaternion to use.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The 3x3 rotation matrix from this quaternion.
*/
static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
/**
* Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
* @param headingPitchRoll - the headingPitchRoll to use.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The 3x3 rotation matrix from this headingPitchRoll.
*/
static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
/**
* Computes a Matrix3 instance representing a non-uniform scale.
* @example
* // Creates
* // [7.0, 0.0, 0.0]
* // [0.0, 8.0, 0.0]
* // [0.0, 0.0, 9.0]
* const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
* @param scale - The x, y, and z scale factors.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
/**
* Computes a Matrix3 instance representing a uniform scale.
* @example
* // Creates
* // [2.0, 0.0, 0.0]
* // [0.0, 2.0, 0.0]
* // [0.0, 0.0, 2.0]
* const m = Cesium.Matrix3.fromUniformScale(2.0);
* @param scale - The uniform scale factor.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
/**
* Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
* @example
* // Creates
* // [0.0, -9.0, 8.0]
* // [9.0, 0.0, -7.0]
* // [-8.0, 7.0, 0.0]
* const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
* @param vector - the vector on the left hand side of the cross product operation.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
/**
* Creates a rotation matrix around the x-axis.
* @example
* // Rotate a point 45 degrees counterclockwise around the x-axis.
* const p = new Cesium.Cartesian3(5, 6, 7);
* const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
* const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
* @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromRotationX(angle: number, result?: Matrix3): Matrix3;
/**
* Creates a rotation matrix around the y-axis.
* @example
* // Rotate a point 45 degrees counterclockwise around the y-axis.
* const p = new Cesium.Cartesian3(5, 6, 7);
* const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
* const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
* @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromRotationY(angle: number, result?: Matrix3): Matrix3;
/**
* Creates a rotation matrix around the z-axis.
* @example
* // Rotate a point 45 degrees counterclockwise around the z-axis.
* const p = new Cesium.Cartesian3(5, 6, 7);
* const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
* const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
* @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
*/
static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
/**
* Creates an Array from the provided Matrix3 instance.
* The array will be in column-major order.
* @param matrix - The matrix to use..
* @param [result] - The Array onto which to store the result.
* @returns The modified Array parameter or a new Array instance if one was not provided.
*/
static toArray(matrix: Matrix3, result?: number[]): number[];
/**
* Computes the array index of the element at the provided row and column.
* @example
* const myMatrix = new Cesium.Matrix3();
* const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
* const column1Row0 = myMatrix[column1Row0Index]
* myMatrix[column1Row0Index] = 10.0;
* @param column - The zero-based index of the column.
* @param row - The zero-based index of the row.
* @returns The index of the element at the provided row and column.
*/
static getElementIndex(column: number, row: number): number;
/**
* Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
/**
* Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified column.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
/**
* Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
/**
* Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified row.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
/**
* Computes a new matrix that replaces the scale with the provided scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
/**
* Computes a new matrix that replaces the scale with the provided uniform scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The uniform scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
/**
* Extracts the non-uniform scale assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
/**
* Computes the maximum scale assuming the matrix is an affine transformation.
* The maximum scale is the maximum length of the column vectors.
* @param matrix - The matrix.
* @returns The maximum scale.
*/
static getMaximumScale(matrix: Matrix3): number;
/**
* Sets the rotation assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param rotation - The rotation matrix.
* @returns The modified result parameter.
*/
static setRotation(matrix: Matrix3, rotation: Matrix3): Matrix3;
/**
* Extracts the rotation matrix assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the product of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the sum of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the difference of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the product of a matrix and a column vector.
* @param matrix - The matrix.
* @param cartesian - The column.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the product of a matrix and a scalar.
* @param matrix - The matrix.
* @param scalar - The number to multiply by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
/**
* Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
* @example
* // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
* Cesium.Matrix3.multiplyByScale(m, scale, m);
* @param matrix - The matrix on the left-hand side.
* @param scale - The non-uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
/**
* Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
* @example
* // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);
* Cesium.Matrix3.multiplyByUniformScale(m, scale, m);
* @param matrix - The matrix on the left-hand side.
* @param scale - The uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
/**
* Creates a negated copy of the provided matrix.
* @param matrix - The matrix to negate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the transpose of the provided matrix.
* @param matrix - The matrix to transpose.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the eigenvectors and eigenvalues of a symmetric matrix.
*
* Returns a diagonal matrix and unitary matrix such that:
* matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
*
*
* The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
* of the unitary matrix are the corresponding eigenvectors.
*
* @example
* const a = //... symetric matrix
* const result = {
* unitary : new Cesium.Matrix3(),
* diagonal : new Cesium.Matrix3()
* };
* Cesium.Matrix3.computeEigenDecomposition(a, result);
*
* const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
* const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
* Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
*
* const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
* const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
* const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
* @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
* @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
* @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
*/
static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
/**
* Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
* @param matrix - The matrix with signed elements.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the determinant of the provided matrix.
* @param matrix - The matrix to use.
* @returns The value of the determinant of the matrix.
*/
static determinant(matrix: Matrix3): number;
/**
* Computes the inverse of the provided matrix.
* @param matrix - The matrix to invert.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Computes the inverse transpose of a matrix.
* @param matrix - The matrix to transpose and invert.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
/**
* Compares the provided matrices componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Matrix3, right?: Matrix3): boolean;
/**
* Compares the provided matrices componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
/**
* An immutable Matrix3 instance initialized to the identity matrix.
*/
static readonly IDENTITY: Matrix3;
/**
* An immutable Matrix3 instance initialized to the zero matrix.
*/
static readonly ZERO: Matrix3;
/**
* The index into Matrix3 for column 0, row 0.
*/
static readonly COLUMN0ROW0: number;
/**
* The index into Matrix3 for column 0, row 1.
*/
static readonly COLUMN0ROW1: number;
/**
* The index into Matrix3 for column 0, row 2.
*/
static readonly COLUMN0ROW2: number;
/**
* The index into Matrix3 for column 1, row 0.
*/
static readonly COLUMN1ROW0: number;
/**
* The index into Matrix3 for column 1, row 1.
*/
static readonly COLUMN1ROW1: number;
/**
* The index into Matrix3 for column 1, row 2.
*/
static readonly COLUMN1ROW2: number;
/**
* The index into Matrix3 for column 2, row 0.
*/
static readonly COLUMN2ROW0: number;
/**
* The index into Matrix3 for column 2, row 1.
*/
static readonly COLUMN2ROW1: number;
/**
* The index into Matrix3 for column 2, row 2.
*/
static readonly COLUMN2ROW2: number;
/**
* Gets the number of items in the collection.
*/
length: number;
/**
* Duplicates the provided Matrix3 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix3 instance if one was not provided.
*/
clone(result?: Matrix3): Matrix3;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side matrix.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Matrix3): boolean;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [right] - The right hand side matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
/**
* Creates a string representing this Matrix with each row being
* on a separate line and in the format '(column0, column1, column2)'.
* @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
*/
toString(): string;
}
export interface Matrix4 extends ArrayLike {
}
/**
* A 4x4 matrix, indexable as a column-major order array.
* Constructor parameters are in row-major order for code readability.
* @param [column0Row0 = 0.0] - The value for column 0, row 0.
* @param [column1Row0 = 0.0] - The value for column 1, row 0.
* @param [column2Row0 = 0.0] - The value for column 2, row 0.
* @param [column3Row0 = 0.0] - The value for column 3, row 0.
* @param [column0Row1 = 0.0] - The value for column 0, row 1.
* @param [column1Row1 = 0.0] - The value for column 1, row 1.
* @param [column2Row1 = 0.0] - The value for column 2, row 1.
* @param [column3Row1 = 0.0] - The value for column 3, row 1.
* @param [column0Row2 = 0.0] - The value for column 0, row 2.
* @param [column1Row2 = 0.0] - The value for column 1, row 2.
* @param [column2Row2 = 0.0] - The value for column 2, row 2.
* @param [column3Row2 = 0.0] - The value for column 3, row 2.
* @param [column0Row3 = 0.0] - The value for column 0, row 3.
* @param [column1Row3 = 0.0] - The value for column 1, row 3.
* @param [column2Row3 = 0.0] - The value for column 2, row 3.
* @param [column3Row3 = 0.0] - The value for column 3, row 3.
*/
export class Matrix4 implements ArrayLike {
constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column3Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column3Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number, column3Row2?: number, column0Row3?: number, column1Row3?: number, column2Row3?: number, column3Row3?: number);
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Matrix4 instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
/**
* Flattens an array of Matrix4s into an array of components. The components
* are stored in column-major order.
* @param array - The array of matrices to pack.
* @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.
* @returns The packed array.
*/
static packArray(array: Matrix4[], result?: number[]): number[];
/**
* Unpacks an array of column-major matrix components into an array of Matrix4s.
* @param array - The array of components to unpack.
* @param [result] - The array onto which to store the result.
* @returns The unpacked array.
*/
static unpackArray(array: number[], result?: Matrix4[]): Matrix4[];
/**
* Duplicates a Matrix4 instance.
* @param matrix - The matrix to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
*/
static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
/**
* Creates a Matrix4 from 16 consecutive elements in an array.
* @example
* // Create the Matrix4:
* // [1.0, 2.0, 3.0, 4.0]
* // [1.0, 2.0, 3.0, 4.0]
* // [1.0, 2.0, 3.0, 4.0]
* // [1.0, 2.0, 3.0, 4.0]
*
* const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
* const m = Cesium.Matrix4.fromArray(v);
*
* // Create same Matrix4 with using an offset into an array
* const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
* const m2 = Cesium.Matrix4.fromArray(v2, 2);
* @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
* @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix4 instance if one was not provided.
*/
static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance from a column-major order array.
* @param values - The column-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance from a row-major order array.
* The resulting matrix will be in column-major order.
* @param values - The row-major order array.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance from a Matrix3 representing the rotation
* and a Cartesian3 representing the translation.
* @param rotation - The upper left portion of the matrix representing the rotation.
* @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
* representation with the rotation represented as a quaternion.
* @example
* const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
* new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
* Cesium.Quaternion.IDENTITY, // rotation
* new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
* result);
* @param translation - The translation transformation.
* @param rotation - The rotation transformation.
* @param scale - The non-uniform scale transformation.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
/**
* Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
* @param translationRotationScale - The instance.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
/**
* Creates a Matrix4 instance from a Cartesian3 representing the translation.
* @param translation - The upper right portion of the matrix representing the translation.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing a non-uniform scale.
* @example
* // Creates
* // [7.0, 0.0, 0.0, 0.0]
* // [0.0, 8.0, 0.0, 0.0]
* // [0.0, 0.0, 9.0, 0.0]
* // [0.0, 0.0, 0.0, 1.0]
* const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
* @param scale - The x, y, and z scale factors.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing a uniform scale.
* @example
* // Creates
* // [2.0, 0.0, 0.0, 0.0]
* // [0.0, 2.0, 0.0, 0.0]
* // [0.0, 0.0, 2.0, 0.0]
* // [0.0, 0.0, 0.0, 1.0]
* const m = Cesium.Matrix4.fromUniformScale(2.0);
* @param scale - The uniform scale factor.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
/**
* Creates a rotation matrix.
* @param rotation - The rotation matrix.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromRotation(rotation: Matrix3, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance from a Camera.
* @param camera - The camera to use.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
*/
static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing a perspective transformation matrix.
* @param fovY - The field of view along the Y axis in radians.
* @param aspectRatio - The aspect ratio.
* @param near - The distance to the near plane in meters.
* @param far - The distance to the far plane in meters.
* @param result - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing an orthographic transformation matrix.
* @param left - The number of meters to the left of the camera that will be in view.
* @param right - The number of meters to the right of the camera that will be in view.
* @param bottom - The number of meters below of the camera that will be in view.
* @param top - The number of meters above of the camera that will be in view.
* @param near - The distance to the near plane in meters.
* @param far - The distance to the far plane in meters.
* @param result - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing an off center perspective transformation.
* @param left - The number of meters to the left of the camera that will be in view.
* @param right - The number of meters to the right of the camera that will be in view.
* @param bottom - The number of meters below of the camera that will be in view.
* @param top - The number of meters above of the camera that will be in view.
* @param near - The distance to the near plane in meters.
* @param far - The distance to the far plane in meters.
* @param result - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance representing an infinite off center perspective transformation.
* @param left - The number of meters to the left of the camera that will be in view.
* @param right - The number of meters to the right of the camera that will be in view.
* @param bottom - The number of meters below of the camera that will be in view.
* @param top - The number of meters above of the camera that will be in view.
* @param near - The distance to the near plane in meters.
* @param result - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
* @example
* // Create viewport transformation using an explicit viewport and depth range.
* const m = Cesium.Matrix4.computeViewportTransformation({
* x : 0.0,
* y : 0.0,
* width : 1024.0,
* height : 768.0
* }, 0.0, 1.0, new Cesium.Matrix4());
* @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
* @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
* @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
* @param [result] - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
/**
* Computes a Matrix4 instance that transforms from world space to view space.
* @param position - The position of the camera.
* @param direction - The forward direction.
* @param up - The up direction.
* @param right - The right direction.
* @param result - The object in which the result will be stored.
* @returns The modified result parameter.
*/
static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
/**
* Computes an Array from the provided Matrix4 instance.
* The array will be in column-major order.
* @example
* //create an array from an instance of Matrix4
* // m = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
* const a = Cesium.Matrix4.toArray(m);
*
* // m remains the same
* //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]
* @param matrix - The matrix to use..
* @param [result] - The Array onto which to store the result.
* @returns The modified Array parameter or a new Array instance if one was not provided.
*/
static toArray(matrix: Matrix4, result?: number[]): number[];
/**
* Computes the array index of the element at the provided row and column.
* @example
* const myMatrix = new Cesium.Matrix4();
* const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
* const column1Row0 = myMatrix[column1Row0Index];
* myMatrix[column1Row0Index] = 10.0;
* @param row - The zero-based index of the row.
* @param column - The zero-based index of the column.
* @returns The index of the element at the provided row and column.
*/
static getElementIndex(row: number, column: number): number;
/**
* Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
* @example
* //returns a Cartesian4 instance with values from the specified column
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* //Example 1: Creates an instance of Cartesian
* const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
* @example
* //Example 2: Sets values for Cartesian instance
* const a = new Cesium.Cartesian4();
* Cesium.Matrix4.getColumn(m, 2, a);
*
* // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
/**
* Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
* @example
* //creates a new Matrix4 instance with new column values from the Cartesian4 instance
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
*
* // m remains the same
* // a = [10.0, 11.0, 99.0, 13.0]
* // [14.0, 15.0, 98.0, 17.0]
* // [18.0, 19.0, 97.0, 21.0]
* // [22.0, 23.0, 96.0, 25.0]
* @param matrix - The matrix to use.
* @param index - The zero-based index of the column to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified column.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
/**
* Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
* @example
* //returns a Cartesian4 instance with values from the specified column
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* //Example 1: Returns an instance of Cartesian
* const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
* @example
* //Example 2: Sets values for a Cartesian instance
* const a = new Cesium.Cartesian4();
* Cesium.Matrix4.getRow(m, 2, a);
*
* // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to retrieve.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
/**
* Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
* @example
* //create a new Matrix4 instance with new row values from the Cartesian4 instance
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
*
* // m remains the same
* // a = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [99.0, 98.0, 97.0, 96.0]
* // [22.0, 23.0, 24.0, 25.0]
* @param matrix - The matrix to use.
* @param index - The zero-based index of the row to set.
* @param cartesian - The Cartesian whose values will be assigned to the specified row.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
/**
* Computes a new matrix that replaces the translation in the rightmost column of the provided
* matrix with the provided translation. This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param translation - The translation that replaces the translation of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
/**
* Computes a new matrix that replaces the scale with the provided scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
/**
* Computes a new matrix that replaces the scale with the provided uniform scale.
* This assumes the matrix is an affine transformation.
* @param matrix - The matrix to use.
* @param scale - The uniform scale that replaces the scale of the provided matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static setUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
/**
* Extracts the non-uniform scale assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter
*/
static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
/**
* Computes the maximum scale assuming the matrix is an affine transformation.
* The maximum scale is the maximum length of the column vectors in the upper-left
* 3x3 matrix.
* @param matrix - The matrix.
* @returns The maximum scale.
*/
static getMaximumScale(matrix: Matrix4): number;
/**
* Sets the rotation assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param rotation - The rotation matrix.
* @returns The modified result parameter.
*/
static setRotation(matrix: Matrix4, rotation: Matrix4): Matrix4;
/**
* Extracts the rotation matrix assuming the matrix is an affine transformation.
* @param matrix - The matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getRotation(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the product of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the sum of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the difference of two matrices.
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the product of two matrices assuming the matrices are affine transformation matrices,
* where the upper left 3x3 elements are any matrix, and
* the upper three elements in the fourth column are the translation.
* The bottom row is assumed to be [0, 0, 0, 1].
* The matrix is not verified to be in the proper form.
* This method is faster than computing the product for general 4x4
* matrices using {@link Matrix4.multiply}.
* @example
* const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);
* const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
* const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
* @param left - The first matrix.
* @param right - The second matrix.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
/**
* Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0])
* by a 3x3 rotation matrix. This is an optimization
* for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m); with less allocations and arithmetic operations.
* @example
* // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
* Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
* @param matrix - The matrix on the left-hand side.
* @param rotation - The 3x3 rotation matrix on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
/**
* Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0])
* by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
* for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations.
* @example
* // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
* Cesium.Matrix4.multiplyByTranslation(m, position, m);
* @param matrix - The matrix on the left-hand side.
* @param translation - The translation on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
/**
* Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0])
* by an implicit non-uniform scale matrix. This is an optimization
* for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where
* m must be an affine matrix.
* This function performs fewer allocations and arithmetic operations.
* @example
* // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
* Cesium.Matrix4.multiplyByScale(m, scale, m);
* @param matrix - The affine matrix on the left-hand side.
* @param scale - The non-uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
/**
* Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
* @example
* // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
* Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
* @param matrix - The matrix on the left-hand side.
* @param scale - The uniform scale on the right-hand side.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
/**
* Computes the product of a matrix and a column vector.
* @param matrix - The matrix.
* @param cartesian - The vector.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
/**
* Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
* with a {@link Cartesian4} with a w component of zero.
* @example
* const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
* const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
* // A shortcut for
* // Cartesian3 p = ...
* // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
* @param matrix - The matrix.
* @param cartesian - The point.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
* with a {@link Cartesian4} with a w component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
* @example
* const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
* const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
* @param matrix - The matrix.
* @param cartesian - The point.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
/**
* Computes the product of a matrix and a scalar.
* @example
* //create a Matrix4 instance which is a scaled version of the supplied Matrix4
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
*
* // m remains the same
* // a = [-20.0, -22.0, -24.0, -26.0]
* // [-28.0, -30.0, -32.0, -34.0]
* // [-36.0, -38.0, -40.0, -42.0]
* // [-44.0, -46.0, -48.0, -50.0]
* @param matrix - The matrix.
* @param scalar - The number to multiply by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
/**
* Computes a negated copy of the provided matrix.
* @example
* //create a new Matrix4 instance which is a negation of a Matrix4
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
*
* // m remains the same
* // a = [-10.0, -11.0, -12.0, -13.0]
* // [-14.0, -15.0, -16.0, -17.0]
* // [-18.0, -19.0, -20.0, -21.0]
* // [-22.0, -23.0, -24.0, -25.0]
* @param matrix - The matrix to negate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the transpose of the provided matrix.
* @example
* //returns transpose of a Matrix4
* // m = [10.0, 11.0, 12.0, 13.0]
* // [14.0, 15.0, 16.0, 17.0]
* // [18.0, 19.0, 20.0, 21.0]
* // [22.0, 23.0, 24.0, 25.0]
*
* const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
*
* // m remains the same
* // a = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
* @param matrix - The matrix to transpose.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
* @param matrix - The matrix with signed elements.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static abs(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Compares the provided matrices componentwise and returns
* true if they are equal, false otherwise.
* @example
* //compares two Matrix4 instances
*
* // a = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
*
* // b = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
*
* if(Cesium.Matrix4.equals(a,b)) {
* console.log("Both matrices are equal");
* } else {
* console.log("They are not equal");
* }
*
* //Prints "Both matrices are equal" on the console
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Matrix4, right?: Matrix4): boolean;
/**
* Compares the provided matrices componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @example
* //compares two Matrix4 instances
*
* // a = [10.5, 14.5, 18.5, 22.5]
* // [11.5, 15.5, 19.5, 23.5]
* // [12.5, 16.5, 20.5, 24.5]
* // [13.5, 17.5, 21.5, 25.5]
*
* // b = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
*
* if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
* console.log("Difference between both the matrices is less than 0.1");
* } else {
* console.log("Difference between both the matrices is not less than 0.1");
* }
*
* //Prints "Difference between both the matrices is not less than 0.1" on the console
* @param [left] - The first matrix.
* @param [right] - The second matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
/**
* Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
* @param matrix - The matrix to use.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
/**
* Gets the upper left 3x3 matrix of the provided matrix.
* @example
* // returns a Matrix3 instance from a Matrix4 instance
*
* // m = [10.0, 14.0, 18.0, 22.0]
* // [11.0, 15.0, 19.0, 23.0]
* // [12.0, 16.0, 20.0, 24.0]
* // [13.0, 17.0, 21.0, 25.0]
*
* const b = new Cesium.Matrix3();
* Cesium.Matrix4.getMatrix3(m,b);
*
* // b = [10.0, 14.0, 18.0]
* // [11.0, 15.0, 19.0]
* // [12.0, 16.0, 20.0]
* @param matrix - The matrix to use.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
/**
* Computes the inverse of the provided matrix using Cramers Rule.
* If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
* If the matrix is a proper rigid transformation, it is more efficient
* to invert it with {@link Matrix4.inverseTransformation}.
* @param matrix - The matrix to invert.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
* where the upper left 3x3 elements are a rotation matrix,
* and the upper three elements in the fourth column are the translation.
* The bottom row is assumed to be [0, 0, 0, 1].
* The matrix is not verified to be in the proper form.
* This method is faster than computing the inverse for a general 4x4
* matrix using {@link Matrix4.inverse}.
* @param matrix - The matrix to invert.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* Computes the inverse transpose of a matrix.
* @param matrix - The matrix to transpose and invert.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
/**
* An immutable Matrix4 instance initialized to the identity matrix.
*/
static readonly IDENTITY: Matrix4;
/**
* An immutable Matrix4 instance initialized to the zero matrix.
*/
static readonly ZERO: Matrix4;
/**
* The index into Matrix4 for column 0, row 0.
*/
static readonly COLUMN0ROW0: number;
/**
* The index into Matrix4 for column 0, row 1.
*/
static readonly COLUMN0ROW1: number;
/**
* The index into Matrix4 for column 0, row 2.
*/
static readonly COLUMN0ROW2: number;
/**
* The index into Matrix4 for column 0, row 3.
*/
static readonly COLUMN0ROW3: number;
/**
* The index into Matrix4 for column 1, row 0.
*/
static readonly COLUMN1ROW0: number;
/**
* The index into Matrix4 for column 1, row 1.
*/
static readonly COLUMN1ROW1: number;
/**
* The index into Matrix4 for column 1, row 2.
*/
static readonly COLUMN1ROW2: number;
/**
* The index into Matrix4 for column 1, row 3.
*/
static readonly COLUMN1ROW3: number;
/**
* The index into Matrix4 for column 2, row 0.
*/
static readonly COLUMN2ROW0: number;
/**
* The index into Matrix4 for column 2, row 1.
*/
static readonly COLUMN2ROW1: number;
/**
* The index into Matrix4 for column 2, row 2.
*/
static readonly COLUMN2ROW2: number;
/**
* The index into Matrix4 for column 2, row 3.
*/
static readonly COLUMN2ROW3: number;
/**
* The index into Matrix4 for column 3, row 0.
*/
static readonly COLUMN3ROW0: number;
/**
* The index into Matrix4 for column 3, row 1.
*/
static readonly COLUMN3ROW1: number;
/**
* The index into Matrix4 for column 3, row 2.
*/
static readonly COLUMN3ROW2: number;
/**
* The index into Matrix4 for column 3, row 3.
*/
static readonly COLUMN3ROW3: number;
/**
* Gets the number of items in the collection.
*/
length: number;
/**
* Duplicates the provided Matrix4 instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Matrix4 instance if one was not provided.
*/
clone(result?: Matrix4): Matrix4;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side matrix.
* @returns true if they are equal, false otherwise.
*/
equals(right?: Matrix4): boolean;
/**
* Compares this matrix to the provided matrix componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [right] - The right hand side matrix.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if they are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
/**
* Computes a string representing this Matrix with each row being
* on a separate line and in the format '(column0, column1, column2, column3)'.
* @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
*/
toString(): string;
}
/**
* Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
* @param [near = 0.0] - The lower bound of the camera range.
* @param [nearValue = 0.0] - The value at the lower bound of the camera range.
* @param [far = 1.0] - The upper bound of the camera range.
* @param [farValue = 0.0] - The value at the upper bound of the camera range.
*/
export class NearFarScalar {
constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
/**
* The lower bound of the camera range.
*/
near: number;
/**
* The value at the lower bound of the camera range.
*/
nearValue: number;
/**
* The upper bound of the camera range.
*/
far: number;
/**
* The value at the upper bound of the camera range.
*/
farValue: number;
/**
* Duplicates a NearFarScalar instance.
* @param nearFarScalar - The NearFarScalar to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
*/
static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
/**
* Compares the provided NearFarScalar and returns true if they are equal,
* false otherwise.
* @param [left] - The first NearFarScalar.
* @param [right] - The second NearFarScalar.
* @returns true if left and right are equal; otherwise false.
*/
static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
/**
* Duplicates this instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
*/
clone(result?: NearFarScalar): NearFarScalar;
/**
* Compares this instance to the provided NearFarScalar and returns true if they are equal,
* false otherwise.
* @param [right] - The right hand side NearFarScalar.
* @returns true if left and right are equal; otherwise false.
*/
equals(right?: NearFarScalar): boolean;
}
/**
* Creates an Occluder derived from an object's position and radius, as well as the camera position.
* The occluder can be used to determine whether or not other objects are visible or hidden behind the
* visible horizon defined by the occluder and camera position.
* @example
* // Construct an occluder one unit away from the origin with a radius of one.
* const cameraPosition = Cesium.Cartesian3.ZERO;
* const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
* const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
* @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
* @param cameraPosition - The coordinate of the viewer/camera.
*/
export class Occluder {
constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
/**
* The position of the occluder.
*/
position: Cartesian3;
/**
* The radius of the occluder.
*/
radius: number;
/**
* The position of the camera.
*/
cameraPosition: Cartesian3;
/**
* Creates an occluder from a bounding sphere and the camera position.
* @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
* @param cameraPosition - The coordinate of the viewer/camera.
* @param [result] - The object onto which to store the result.
* @returns The occluder derived from an object's position and radius, as well as the camera position.
*/
static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
/**
* Determines whether or not a point, the occludee, is hidden from view by the occluder.
* @example
* const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
* const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
* const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
* const point = new Cesium.Cartesian3(0, 0, -3);
* occluder.isPointVisible(point); //returns true
* @param occludee - The point surrounding the occludee object.
* @returns true if the occludee is visible; otherwise false.
*/
isPointVisible(occludee: Cartesian3): boolean;
/**
* Determines whether or not a sphere, the occludee, is hidden from view by the occluder.
* @example
* const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
* const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
* const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
* const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
* occluder.isBoundingSphereVisible(bigSphere); //returns true
* @param occludee - The bounding sphere surrounding the occludee object.
* @returns true if the occludee is visible; otherwise false.
*/
isBoundingSphereVisible(occludee: BoundingSphere): boolean;
/**
* Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
* @example
* const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
* const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
* const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
* const occluder = new Cesium.Occluder(sphere1, cameraPosition);
* occluder.computeVisibility(sphere2); //returns Visibility.NONE
* @param occludeeBS - The bounding sphere of the occludee.
* @returns Visibility.NONE if the occludee is not visible,
* Visibility.PARTIAL if the occludee is partially visible, or
* Visibility.FULL if the occludee is fully visible.
*/
computeVisibility(occludeeBS: BoundingSphere): Visibility;
/**
* Computes a point that can be used as the occludee position to the visibility functions.
* Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
* an object that is used for visibility; however it is also possible to compute a point that if
* seen/not seen would also indicate if an object is visible/not visible. This function is better
* called for objects that do not move relative to the occluder and is large, such as a chunk of
* terrain. You are better off not calling this and using the object's bounding sphere for objects
* such as a satellite or ground vehicle.
* @example
* const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
* const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
* const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
* const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
* const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
* const occludeePosition = tileOccluderSphere.center;
* const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
* @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
* @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
* @param positions - List of altitude points on the horizon near the surface of the occluder.
* @returns An object containing two attributes: occludeePoint and valid
* which is a boolean value.
*/
static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
/**
* Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
* @param rectangle - The rectangle used to create a bounding sphere.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
* @returns An object containing two attributes: occludeePoint and valid
* which is a boolean value.
*/
static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
}
/**
* Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
* @example
* // Configure a Viewer to use the OpenCage Geocoder
* const viewer = new Cesium.Viewer('cesiumContainer', {
* geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '')
* });
* @param url - The endpoint to the OpenCage server.
* @param apiKey - The OpenCage API Key.
* @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
* @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
* @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
* @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
* @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
* @param [options.jsonp] - Wraps the returned JSON with a function name.
* @param [options.language] - An IETF format language code.
* @param [options.limit] - The maximum number of results we should return.
* @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
* @param [options.no_annotations] - When set to 1 results will not contain annotations.
* @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
* @param [options.no_record] - When set to 1 the query contents are not logged.
* @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
* @param [options.proximity] - Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870).
*/
export class OpenCageGeocoderService {
constructor(url: Resource | string, apiKey: string, params?: {
abbrv?: number;
});
/**
* The Resource used to access the OpenCage endpoint.
*/
readonly url: Resource;
/**
* Optional params passed to OpenCage in order to customize geocoding
*/
readonly params: any;
/**
* @param query - The query to be sent to the geocoder service
*/
geocode(query: string): Promise;
}
/**
* Creates an instance of an OrientedBoundingBox.
* An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.
* @example
* // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
* const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
* const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
*
* const obb = new Cesium.OrientedBoundingBox(center, halfAxes);
* @param [center = Cartesian3.ZERO] - The center of the box.
* @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
* Equivalently, the transformation matrix, to rotate and scale a 0x0x0
* cube centered at the origin.
*/
export class OrientedBoundingBox {
constructor(center?: Cartesian3, halfAxes?: Matrix3);
/**
* The center of the box.
*/
center: Cartesian3;
/**
* The transformation matrix, to rotate the box to the right position.
*/
halfAxes: Matrix3;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Computes an instance of an OrientedBoundingBox of the given positions.
* This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
* Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
* @example
* // Compute an object oriented bounding box enclosing two points.
* const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
* @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
*/
static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
* There are no guarantees about the orientation of the bounding box.
* @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
* @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
* @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
*/
static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Computes an OrientedBoundingBox that bounds an affine transformation.
* @param transformation - The affine transformation.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
*/
static fromTransformation(transformation: Matrix4, result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Duplicates a OrientedBoundingBox instance.
* @param box - The bounding box to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
*/
static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Determines which side of a plane the oriented bounding box is located.
* @param box - The oriented bounding box to test.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
* intersects the plane.
*/
static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
/**
* Computes the estimated distance squared from the closest point on a bounding box to a point.
* @example
* // Sort bounding boxes from back to front
* boxes.sort(function(a, b) {
* return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
* });
* @param box - The box.
* @param cartesian - The point
* @returns The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
*/
static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
/**
* The distances calculated by the vector from the center of the bounding box to position projected onto direction.
*
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding box.
* @param box - The bounding box to calculate the distance to.
* @param position - The position to calculate the distance from.
* @param direction - The direction from position.
* @param [result] - A Interval to store the nearest and farthest distances.
* @returns The nearest and farthest distances on the bounding box from position in direction.
*/
static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
/**
* Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
* @param box - The oriented bounding box.
* @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
* @returns The modified result parameter or a new array if none was provided.
*/
static computeCorners(box: OrientedBoundingBox, result?: Cartesian3[]): Cartesian3[];
/**
* Computes a transformation matrix from an oriented bounding box.
* @param box - The oriented bounding box.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
*/
static computeTransformation(box: OrientedBoundingBox, result: Matrix4): Matrix4;
/**
* Determines whether or not a bounding box is hidden from view by the occluder.
* @param box - The bounding box surrounding the occludee object.
* @param occluder - The occluder.
* @returns true if the box is not visible; otherwise false.
*/
static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
/**
* Determines which side of a plane the oriented bounding box is located.
* @param plane - The plane to test against.
* @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
* intersects the plane.
*/
intersectPlane(plane: Plane): Intersect;
/**
* Computes the estimated distance squared from the closest point on a bounding box to a point.
* @example
* // Sort bounding boxes from back to front
* boxes.sort(function(a, b) {
* return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
* });
* @param cartesian - The point
* @returns The estimated distance squared from the bounding sphere to the point.
*/
distanceSquaredTo(cartesian: Cartesian3): number;
/**
* The distances calculated by the vector from the center of the bounding box to position projected onto direction.
*
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding box.
* @param position - The position to calculate the distance from.
* @param direction - The direction from position.
* @param [result] - A Interval to store the nearest and farthest distances.
* @returns The nearest and farthest distances on the bounding box from position in direction.
*/
computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
/**
* Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
* @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
* @returns The modified result parameter or a new array if none was provided.
*/
computeCorners(result?: Cartesian3[]): Cartesian3[];
/**
* Computes a transformation matrix from an oriented bounding box.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
*/
computeTransformation(result: Matrix4): Matrix4;
/**
* Determines whether or not a bounding box is hidden from view by the occluder.
* @param occluder - The occluder.
* @returns true if the sphere is not visible; otherwise false.
*/
isOccluded(occluder: Occluder): boolean;
/**
* Compares the provided OrientedBoundingBox componentwise and returns
* true if they are equal, false otherwise.
* @param left - The first OrientedBoundingBox.
* @param right - The second OrientedBoundingBox.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
/**
* Duplicates this OrientedBoundingBox instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
*/
clone(result?: OrientedBoundingBox): OrientedBoundingBox;
/**
* Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side OrientedBoundingBox.
* @returns true if they are equal, false otherwise.
*/
equals(right?: OrientedBoundingBox): boolean;
}
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
* @example
* const maxRadii = ellipsoid.maximumRadius;
*
* const frustum = new Cesium.OrthographicFrustum();
* frustum.near = 0.01 * maxRadii;
* frustum.far = 50.0 * maxRadii;
* @param [options] - An object with the following properties:
* @param [options.width] - The width of the frustum in meters.
* @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
* @param [options.near = 1.0] - The distance of the near plane.
* @param [options.far = 500000000.0] - The distance of the far plane.
*/
export class OrthographicFrustum {
constructor(options?: {
width?: number;
aspectRatio?: number;
near?: number;
far?: number;
});
/**
* The horizontal width of the frustum in meters.
*/
width: number;
/**
* The aspect ratio of the frustum's width to it's height.
*/
aspectRatio: number;
/**
* The distance of the near plane.
*/
near: number;
/**
* The distance of the far plane.
*/
far: number;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
/**
* Gets the orthographic projection matrix computed from the view frustum.
*/
readonly projectionMatrix: Matrix4;
/**
* Creates a culling volume for this frustum.
* @example
* // Check if a bounding volume intersects the frustum.
* const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* const intersect = cullingVolume.computeVisibility(boundingVolume);
* @param position - The eye position.
* @param direction - The view direction.
* @param up - The up direction.
* @returns A culling volume at the given position and orientation.
*/
computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
/**
* Returns the pixel's width and height in meters.
* @example
* // Example 1
* // Get the width and height of a pixel.
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
* @param drawingBufferWidth - The width of the drawing buffer.
* @param drawingBufferHeight - The height of the drawing buffer.
* @param distance - The distance to the near plane in meters.
* @param pixelRatio - The scaling factor from pixel space to coordinate space.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*/
getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
/**
* Returns a duplicate of a OrthographicFrustum instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
*/
clone(result?: OrthographicFrustum): OrthographicFrustum;
/**
* Compares the provided OrthographicFrustum componentwise and returns
* true if they are equal, false otherwise.
* @param [other] - The right hand side OrthographicFrustum.
* @returns true if they are equal, false otherwise.
*/
equals(other?: OrthographicFrustum): boolean;
/**
* Compares the provided OrthographicFrustum componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param other - The right hand side OrthographicFrustum.
* @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if this and other are within the provided epsilon, false otherwise.
*/
equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
}
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
* @example
* const maxRadii = ellipsoid.maximumRadius;
*
* const frustum = new Cesium.OrthographicOffCenterFrustum();
* frustum.right = maxRadii * Cesium.Math.PI;
* frustum.left = -c.frustum.right;
* frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
* frustum.bottom = -c.frustum.top;
* frustum.near = 0.01 * maxRadii;
* frustum.far = 50.0 * maxRadii;
* @param [options] - An object with the following properties:
* @param [options.left] - The left clipping plane distance.
* @param [options.right] - The right clipping plane distance.
* @param [options.top] - The top clipping plane distance.
* @param [options.bottom] - The bottom clipping plane distance.
* @param [options.near = 1.0] - The near clipping plane distance.
* @param [options.far = 500000000.0] - The far clipping plane distance.
*/
export class OrthographicOffCenterFrustum {
constructor(options?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
near?: number;
far?: number;
});
/**
* The left clipping plane.
*/
left: number;
/**
* The right clipping plane.
*/
right: number;
/**
* The top clipping plane.
*/
top: number;
/**
* The bottom clipping plane.
*/
bottom: number;
/**
* The distance of the near plane.
*/
near: number;
/**
* The distance of the far plane.
*/
far: number;
/**
* Gets the orthographic projection matrix computed from the view frustum.
*/
readonly projectionMatrix: Matrix4;
/**
* Creates a culling volume for this frustum.
* @example
* // Check if a bounding volume intersects the frustum.
* const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* const intersect = cullingVolume.computeVisibility(boundingVolume);
* @param position - The eye position.
* @param direction - The view direction.
* @param up - The up direction.
* @returns A culling volume at the given position and orientation.
*/
computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
/**
* Returns the pixel's width and height in meters.
* @example
* // Example 1
* // Get the width and height of a pixel.
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
* @param drawingBufferWidth - The width of the drawing buffer.
* @param drawingBufferHeight - The height of the drawing buffer.
* @param distance - The distance to the near plane in meters.
* @param pixelRatio - The scaling factor from pixel space to coordinate space.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*/
getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
/**
* Returns a duplicate of a OrthographicOffCenterFrustum instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
*/
clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
/**
* Compares the provided OrthographicOffCenterFrustum componentwise and returns
* true if they are equal, false otherwise.
* @param [other] - The right hand side OrthographicOffCenterFrustum.
* @returns true if they are equal, false otherwise.
*/
equals(other?: OrthographicOffCenterFrustum): boolean;
/**
* Compares the provided OrthographicOffCenterFrustum componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param other - The right hand side OrthographicOffCenterFrustum.
* @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if this and other are within the provided epsilon, false otherwise.
*/
equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
}
export namespace Packable {
/**
* The number of elements used to pack the object into an array.
*/
var packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
*/
function pack(value: any, array: number[], startingIndex?: number): void;
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Object instance if one was not provided.
*/
function unpack(array: number[], startingIndex?: number, result?: any): any;
}
/**
* Static interface for types which can store their values as packed
* elements in an array. These methods and properties are expected to be
* defined on a constructor function.
*/
export interface Packable {
}
/**
* Static interface for {@link Packable} types which are interpolated in a
* different representation than their packed value. These methods and
* properties are expected to be defined on a constructor function.
*/
export namespace PackableForInterpolation {
/**
* The number of elements used to store the object into an array in its interpolatable form.
*/
var packedInterpolationLength: number;
/**
* Converts a packed array into a form suitable for interpolation.
* @param packedArray - The packed array.
* @param [startingIndex = 0] - The index of the first element to be converted.
* @param [lastIndex = packedArray.length] - The index of the last element to be converted.
* @param [result] - The object into which to store the result.
*/
function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
/**
* Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
* @param array - The array previously packed for interpolation.
* @param sourceArray - The original packed array.
* @param [startingIndex = 0] - The startingIndex used to convert the array.
* @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Object instance if one was not provided.
*/
function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
}
/**
* Provides geocoding via a {@link https://pelias.io/|Pelias} server.
* @example
* // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
* const viewer = new Cesium.Viewer('cesiumContainer', {
* geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
* url: 'https://api.geocode.earth/v1/',
* queryParameters: {
* api_key: ''
* }
* }))
* });
* @param url - The endpoint to the Pelias server.
*/
export class PeliasGeocoderService {
constructor(url: Resource | string);
/**
* The Resource used to access the Pelias endpoint.
*/
readonly url: Resource;
/**
* @param query - The query to be sent to the geocoder service
* @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
*/
geocode(query: string, type?: GeocodeType): Promise;
}
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
* @example
* const frustum = new Cesium.PerspectiveFrustum({
* fov : Cesium.Math.PI_OVER_THREE,
* aspectRatio : canvas.clientWidth / canvas.clientHeight
* near : 1.0,
* far : 1000.0
* });
* @param [options] - An object with the following properties:
* @param [options.fov] - The angle of the field of view (FOV), in radians.
* @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
* @param [options.near = 1.0] - The distance of the near plane.
* @param [options.far = 500000000.0] - The distance of the far plane.
* @param [options.xOffset = 0.0] - The offset in the x direction.
* @param [options.yOffset = 0.0] - The offset in the y direction.
*/
export class PerspectiveFrustum {
constructor(options?: {
fov?: number;
aspectRatio?: number;
near?: number;
far?: number;
xOffset?: number;
yOffset?: number;
});
/**
* The angle of the field of view (FOV), in radians. This angle will be used
* as the horizontal FOV if the width is greater than the height, otherwise
* it will be the vertical FOV.
*/
fov: number;
/**
* The aspect ratio of the frustum's width to it's height.
*/
aspectRatio: number;
/**
* The distance of the near plane.
*/
near: number;
/**
* The distance of the far plane.
*/
far: number;
/**
* Offsets the frustum in the x direction.
*/
xOffset: number;
/**
* Offsets the frustum in the y direction.
*/
yOffset: number;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
/**
* Gets the perspective projection matrix computed from the view frustum.
*/
readonly projectionMatrix: Matrix4;
/**
* The perspective projection matrix computed from the view frustum with an infinite far plane.
*/
readonly infiniteProjectionMatrix: Matrix4;
/**
* Gets the angle of the vertical field of view, in radians.
*/
readonly fovy: number;
/**
* Creates a culling volume for this frustum.
* @example
* // Check if a bounding volume intersects the frustum.
* const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* const intersect = cullingVolume.computeVisibility(boundingVolume);
* @param position - The eye position.
* @param direction - The view direction.
* @param up - The up direction.
* @returns A culling volume at the given position and orientation.
*/
computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
/**
* Returns the pixel's width and height in meters.
* @example
* // Example 1
* // Get the width and height of a pixel.
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
* @example
* // Example 2
* // Get the width and height of a pixel if the near plane was set to 'distance'.
* // For example, get the size of a pixel of an image on a billboard.
* const position = camera.position;
* const direction = camera.direction;
* const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
* const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
* const distance = Cesium.Cartesian3.magnitude(toCenterProj);
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
* @param drawingBufferWidth - The width of the drawing buffer.
* @param drawingBufferHeight - The height of the drawing buffer.
* @param distance - The distance to the near plane in meters.
* @param pixelRatio - The scaling factor from pixel space to coordinate space.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*/
getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
/**
* Returns a duplicate of a PerspectiveFrustum instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
clone(result?: PerspectiveFrustum): PerspectiveFrustum;
/**
* Compares the provided PerspectiveFrustum componentwise and returns
* true if they are equal, false otherwise.
* @param [other] - The right hand side PerspectiveFrustum.
* @returns true if they are equal, false otherwise.
*/
equals(other?: PerspectiveFrustum): boolean;
/**
* Compares the provided PerspectiveFrustum componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param other - The right hand side PerspectiveFrustum.
* @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if this and other are within the provided epsilon, false otherwise.
*/
equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
}
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
* @example
* const frustum = new Cesium.PerspectiveOffCenterFrustum({
* left : -1.0,
* right : 1.0,
* top : 1.0,
* bottom : -1.0,
* near : 1.0,
* far : 100.0
* });
* @param [options] - An object with the following properties:
* @param [options.left] - The left clipping plane distance.
* @param [options.right] - The right clipping plane distance.
* @param [options.top] - The top clipping plane distance.
* @param [options.bottom] - The bottom clipping plane distance.
* @param [options.near = 1.0] - The near clipping plane distance.
* @param [options.far = 500000000.0] - The far clipping plane distance.
*/
export class PerspectiveOffCenterFrustum {
constructor(options?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
near?: number;
far?: number;
});
/**
* Defines the left clipping plane.
*/
left: number;
/**
* Defines the right clipping plane.
*/
right: number;
/**
* Defines the top clipping plane.
*/
top: number;
/**
* Defines the bottom clipping plane.
*/
bottom: number;
/**
* The distance of the near plane.
*/
near: number;
/**
* The distance of the far plane.
*/
far: number;
/**
* Gets the perspective projection matrix computed from the view frustum.
*/
readonly projectionMatrix: Matrix4;
/**
* Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
*/
readonly infiniteProjectionMatrix: Matrix4;
/**
* Creates a culling volume for this frustum.
* @example
* // Check if a bounding volume intersects the frustum.
* const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* const intersect = cullingVolume.computeVisibility(boundingVolume);
* @param position - The eye position.
* @param direction - The view direction.
* @param up - The up direction.
* @returns A culling volume at the given position and orientation.
*/
computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
/**
* Returns the pixel's width and height in meters.
* @example
* // Example 1
* // Get the width and height of a pixel.
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
* @example
* // Example 2
* // Get the width and height of a pixel if the near plane was set to 'distance'.
* // For example, get the size of a pixel of an image on a billboard.
* const position = camera.position;
* const direction = camera.direction;
* const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
* const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
* const distance = Cesium.Cartesian3.magnitude(toCenterProj);
* const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
* @param drawingBufferWidth - The width of the drawing buffer.
* @param drawingBufferHeight - The height of the drawing buffer.
* @param distance - The distance to the near plane in meters.
* @param pixelRatio - The scaling factor from pixel space to coordinate space.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*/
getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
/**
* Returns a duplicate of a PerspectiveOffCenterFrustum instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
/**
* Compares the provided PerspectiveOffCenterFrustum componentwise and returns
* true if they are equal, false otherwise.
* @param [other] - The right hand side PerspectiveOffCenterFrustum.
* @returns true if they are equal, false otherwise.
*/
equals(other?: PerspectiveOffCenterFrustum): boolean;
/**
* Compares the provided PerspectiveOffCenterFrustum componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param other - The right hand side PerspectiveOffCenterFrustum.
* @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
* @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
* @returns true if this and other are within the provided epsilon, false otherwise.
*/
equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
}
/**
* A utility class for generating custom map pins as canvas elements.
*
*
*
* Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
*
*/
export class PinBuilder {
constructor();
/**
* Creates an empty pin of the specified color and size.
* @param color - The color of the pin.
* @param size - The size of the pin, in pixels.
* @returns The canvas element that represents the generated pin.
*/
fromColor(color: Color, size: number): HTMLCanvasElement;
/**
* Creates a pin with the specified icon, color, and size.
* @param url - The url of the image to be stamped onto the pin.
* @param color - The color of the pin.
* @param size - The size of the pin, in pixels.
* @returns The canvas element or a Promise to the canvas element that represents the generated pin.
*/
fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise;
/**
* Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
* @param id - The id of the maki icon to be stamped onto the pin.
* @param color - The color of the pin.
* @param size - The size of the pin, in pixels.
* @returns The canvas element or a Promise to the canvas element that represents the generated pin.
*/
fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise;
/**
* Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
* while still being contained completely within the pin.
* @param text - The text to be stamped onto the pin.
* @param color - The color of the pin.
* @param size - The size of the pin, in pixels.
* @returns The canvas element that represents the generated pin.
*/
fromText(text: string, color: Color, size: number): HTMLCanvasElement;
}
/**
* The format of a pixel, i.e., the number of components it has and what they represent.
*/
export enum PixelFormat {
/**
* A pixel format containing a depth value.
*/
DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
/**
* A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
*/
DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
/**
* A pixel format containing an alpha channel.
*/
ALPHA = WebGLConstants.ALPHA,
/**
* A pixel format containing red, green, and blue channels.
*/
RGB = WebGLConstants.RGB,
/**
* A pixel format containing red, green, blue, and alpha channels.
*/
RGBA = WebGLConstants.RGBA,
/**
* A pixel format containing a luminance (intensity) channel.
*/
LUMINANCE = WebGLConstants.LUMINANCE,
/**
* A pixel format containing luminance (intensity) and alpha channels.
*/
LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
/**
* A pixel format containing red, green, and blue channels that is DXT1 compressed.
*/
RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
/**
* A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
*/
RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
/**
* A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
*/
RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
/**
* A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
*/
RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
/**
* A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
*/
RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
/**
* A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
*/
RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
/**
* A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
*/
RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
/**
* A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
*/
RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
/**
* A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
*/
RGBA_ASTC = WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
/**
* A pixel format containing red, green, and blue channels that is ETC1 compressed.
*/
RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
/**
* A pixel format containing red, green, and blue channels that is ETC2 compressed.
*/
RGB8_ETC2 = WebGLConstants.COMPRESSED_RGB8_ETC2,
/**
* A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
*/
RGBA8_ETC2_EAC = WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
/**
* A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
*/
RGBA_BC7 = WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM
}
/**
* A plane in Hessian Normal Form defined by
*
* ax + by + cz + d = 0
*
* where (a, b, c) is the plane's normal, d is the signed
* distance to the plane, and (x, y, z) is any point on
* the plane.
* @example
* // The plane x=0
* const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
* @param normal - The plane's normal (normalized).
* @param distance - The shortest distance from the origin to the plane. The sign of
* distance determines which side of the plane the origin
* is on. If distance is positive, the origin is in the half-space
* in the direction of the normal; if negative, the origin is in the half-space
* opposite to the normal; if zero, the plane passes through the origin.
*/
export class Plane {
constructor(normal: Cartesian3, distance: number);
/**
* The plane's normal.
*/
normal: Cartesian3;
/**
* The shortest distance from the origin to the plane. The sign of
* distance determines which side of the plane the origin
* is on. If distance is positive, the origin is in the half-space
* in the direction of the normal; if negative, the origin is in the half-space
* opposite to the normal; if zero, the plane passes through the origin.
*/
distance: number;
/**
* Creates a plane from a normal and a point on the plane.
* @example
* const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
* const normal = ellipsoid.geodeticSurfaceNormal(point);
* const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
* @param point - The point on the plane.
* @param normal - The plane's normal (normalized).
* @param [result] - The object onto which to store the result.
* @returns A new plane instance or the modified result parameter.
*/
static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
/**
* Creates a plane from the general equation
* @param coefficients - The plane's normal (normalized).
* @param [result] - The object onto which to store the result.
* @returns A new plane instance or the modified result parameter.
*/
static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
/**
* Computes the signed shortest distance of a point to a plane.
* The sign of the distance determines which side of the plane the point
* is on. If the distance is positive, the point is in the half-space
* in the direction of the normal; if negative, the point is in the half-space
* opposite to the normal; if zero, the plane passes through the point.
* @param plane - The plane.
* @param point - The point.
* @returns The signed shortest distance of the point to the plane.
*/
static getPointDistance(plane: Plane, point: Cartesian3): number;
/**
* Projects a point onto the plane.
* @param plane - The plane to project the point onto
* @param point - The point to project onto the plane
* @param [result] - The result point. If undefined, a new Cartesian3 will be created.
* @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
*/
static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
/**
* Transforms the plane by the given transformation matrix.
* @param plane - The plane.
* @param transform - The transformation matrix.
* @param [result] - The object into which to store the result.
* @returns The plane transformed by the given transformation matrix.
*/
static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
/**
* Duplicates a Plane instance.
* @param plane - The plane to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Plane instance if one was not provided.
*/
static clone(plane: Plane, result?: Plane): Plane;
/**
* Compares the provided Planes by normal and distance and returns
* true if they are equal, false otherwise.
* @param left - The first plane.
* @param right - The second plane.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left: Plane, right: Plane): boolean;
/**
* A constant initialized to the XY plane passing through the origin, with normal in positive Z.
*/
static readonly ORIGIN_XY_PLANE: Plane;
/**
* A constant initialized to the YZ plane passing through the origin, with normal in positive X.
*/
static readonly ORIGIN_YZ_PLANE: Plane;
/**
* A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
*/
static readonly ORIGIN_ZX_PLANE: Plane;
}
/**
* Describes geometry representing a plane centered at the origin, with a unit width and length.
* @example
* const planeGeometry = new Cesium.PlaneGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY
* });
* @param [options] - Object with the following properties:
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class PlaneGeometry {
constructor(options?: {
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
/**
* Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
* @param planeGeometry - A description of the plane.
* @returns The computed vertices and indices.
*/
static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
}
/**
* Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
*/
export class PlaneOutlineGeometry {
constructor();
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @returns The array that was packed into
*/
static pack(value: PlaneOutlineGeometry, array: number[]): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
/**
* Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
* @returns The computed vertices and indices.
*/
static createGeometry(): Geometry | undefined;
}
/**
* A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* // 1. create a polygon from points
* const polygon = new Cesium.PolygonGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* )
* });
* const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
*
* // 2. create a nested polygon with holes
* const polygonWithHole = new Cesium.PolygonGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -109.0, 30.0,
* -95.0, 30.0,
* -95.0, 40.0,
* -109.0, 40.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -107.0, 31.0,
* -107.0, 39.0,
* -97.0, 39.0,
* -97.0, 31.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -105.0, 33.0,
* -99.0, 33.0,
* -99.0, 37.0,
* -105.0, 37.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -103.0, 34.0,
* -101.0, 34.0,
* -101.0, 36.0,
* -103.0, 36.0
* ])
* )]
* )]
* )]
* )
* });
* const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
*
* // 3. create extruded polygon
* const extrudedPolygon = new Cesium.PolygonGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* ),
* extrudedHeight: 300000
* });
* const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
* @param options - Object with the following properties:
* @param options.polygonHierarchy - A polygon hierarchy that can include holes.
* @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
* @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
* @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
* @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
*/
export class PolygonGeometry {
constructor(options: {
polygonHierarchy: PolygonHierarchy;
height?: number;
extrudedHeight?: number;
vertexFormat?: VertexFormat;
stRotation?: number;
ellipsoid?: Ellipsoid;
granularity?: number;
perPositionHeight?: boolean;
closeTop?: boolean;
closeBottom?: boolean;
arcType?: ArcType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* // create a polygon from points
* const polygon = Cesium.PolygonGeometry.fromPositions({
* positions : Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* });
* const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
* @param options - Object with the following properties:
* @param options.positions - An array of positions that defined the corner points of the polygon.
* @param [options.height = 0.0] - The height of the polygon.
* @param [options.extrudedHeight] - The height of the polygon extrusion.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
* @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
* @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
*/
static fromPositions(options: {
positions: Cartesian3[];
height?: number;
extrudedHeight?: number;
vertexFormat?: VertexFormat;
stRotation?: number;
ellipsoid?: Ellipsoid;
granularity?: number;
perPositionHeight?: boolean;
closeTop?: boolean;
closeBottom?: boolean;
arcType?: ArcType;
}): PolygonGeometry;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
*/
static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
/**
* Returns the bounding rectangle given the provided options
* @param options - Object with the following properties:
* @param options.polygonHierarchy - A polygon hierarchy that can include holes.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [result] - An object in which to store the result.
* @returns The result rectangle
*/
static computeRectangle(options: {
polygonHierarchy: PolygonHierarchy;
granularity?: number;
arcType?: ArcType;
ellipsoid?: Ellipsoid;
}, result?: Rectangle): Rectangle;
/**
* Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
* @param polygonGeometry - A description of the polygon.
* @returns The computed vertices and indices.
*/
static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
}
/**
* An hierarchy of linear rings which define a polygon and its holes.
* The holes themselves may also have holes which nest inner polygons.
* @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
* @param [holes] - An array of polygon hierarchies defining holes in the polygon.
*/
export class PolygonHierarchy {
constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
/**
* A linear ring defining the outer boundary of the polygon or hole.
*/
positions: Cartesian3[];
/**
* An array of polygon hierarchies defining holes in the polygon.
*/
holes: PolygonHierarchy[];
}
/**
* A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
* @example
* // 1. create a polygon outline from points
* const polygon = new Cesium.PolygonOutlineGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* )
* });
* const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
*
* // 2. create a nested polygon with holes outline
* const polygonWithHole = new Cesium.PolygonOutlineGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -109.0, 30.0,
* -95.0, 30.0,
* -95.0, 40.0,
* -109.0, 40.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -107.0, 31.0,
* -107.0, 39.0,
* -97.0, 39.0,
* -97.0, 31.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -105.0, 33.0,
* -99.0, 33.0,
* -99.0, 37.0,
* -105.0, 37.0
* ]),
* [new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -103.0, 34.0,
* -101.0, 34.0,
* -101.0, 36.0,
* -103.0, 36.0
* ])
* )]
* )]
* )]
* )
* });
* const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
*
* // 3. create extruded polygon outline
* const extrudedPolygon = new Cesium.PolygonOutlineGeometry({
* polygonHierarchy : new Cesium.PolygonHierarchy(
* Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* ),
* extrudedHeight: 300000
* });
* const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
* @param options - Object with the following properties:
* @param options.polygonHierarchy - A polygon hierarchy that can include holes.
* @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
* @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
* @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
*/
export class PolygonOutlineGeometry {
constructor(options: {
polygonHierarchy: PolygonHierarchy;
height?: number;
extrudedHeight?: number;
vertexFormat?: VertexFormat;
ellipsoid?: Ellipsoid;
granularity?: number;
perPositionHeight?: boolean;
arcType?: ArcType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
/**
* A description of a polygon outline from an array of positions.
* @example
* // create a polygon from points
* const polygon = Cesium.PolygonOutlineGeometry.fromPositions({
* positions : Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0,
* -75.0, 30.0,
* -70.0, 30.0,
* -68.0, 40.0
* ])
* });
* const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
* @param options - Object with the following properties:
* @param options.positions - An array of positions that defined the corner points of the polygon.
* @param [options.height = 0.0] - The height of the polygon.
* @param [options.extrudedHeight] - The height of the polygon extrusion.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
* @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
*/
static fromPositions(options: {
positions: Cartesian3[];
height?: number;
extrudedHeight?: number;
ellipsoid?: Ellipsoid;
granularity?: number;
perPositionHeight?: boolean;
arcType?: ArcType;
}): PolygonOutlineGeometry;
/**
* Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
* @param polygonGeometry - A description of the polygon outline.
* @returns The computed vertices and indices.
*/
static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
}
/**
* A description of a polyline modeled as a line strip; the first two positions define a line segment,
* and each additional position defines a line segment from the previous position. The polyline is capable of
* displaying with a material.
* @example
* // A polyline with two connected line segments
* const polyline = new Cesium.PolylineGeometry({
* positions : Cesium.Cartesian3.fromDegreesArray([
* 0.0, 0.0,
* 5.0, 0.0,
* 5.0, 5.0
* ]),
* width : 10.0
* });
* const geometry = Cesium.PolylineGeometry.createGeometry(polyline);
* @param options - Object with the following properties:
* @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
* @param [options.width = 1.0] - The width in pixels.
* @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
* @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
*/
export class PolylineGeometry {
constructor(options: {
positions: Cartesian3[];
width?: number;
colors?: Color[];
colorsPerVertex?: boolean;
arcType?: ArcType;
granularity?: number;
vertexFormat?: VertexFormat;
ellipsoid?: Ellipsoid;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
/**
* Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
* @param polylineGeometry - A description of the polyline.
* @returns The computed vertices and indices.
*/
static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
}
/**
* A description of a polyline with a volume (a 2D shape extruded along a polyline).
* @example
* function computeCircle(radius) {
* const positions = [];
* for (let i = 0; i < 360; i++) {
* const radians = Cesium.Math.toRadians(i);
* positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
* }
* return positions;
* }
*
* const volume = new Cesium.PolylineVolumeGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
* polylinePositions : Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0
* ]),
* shapePositions : computeCircle(100000.0)
* });
* @param options - Object with the following properties:
* @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume.
* @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
*/
export class PolylineVolumeGeometry {
constructor(options: {
polylinePositions: Cartesian3[];
shapePositions: Cartesian2[];
ellipsoid?: Ellipsoid;
granularity?: number;
vertexFormat?: VertexFormat;
cornerType?: CornerType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
/**
* Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
* @param polylineVolumeGeometry - A description of the polyline volume.
* @returns The computed vertices and indices.
*/
static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
}
/**
* A description of a polyline with a volume (a 2D shape extruded along a polyline).
* @example
* function computeCircle(radius) {
* const positions = [];
* for (let i = 0; i < 360; i++) {
* const radians = Cesium.Math.toRadians(i);
* positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
* }
* return positions;
* }
*
* const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
* polylinePositions : Cesium.Cartesian3.fromDegreesArray([
* -72.0, 40.0,
* -70.0, 35.0
* ]),
* shapePositions : computeCircle(100000.0)
* });
* @param options - Object with the following properties:
* @param options.polylinePositions - An array of positions that define the center of the polyline volume.
* @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
*/
export class PolylineVolumeOutlineGeometry {
constructor(options: {
polylinePositions: Cartesian3[];
shapePositions: Cartesian2[];
ellipsoid?: Ellipsoid;
granularity?: number;
cornerType?: CornerType;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
/**
* Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
* @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
* @returns The computed vertices and indices.
*/
static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
}
/**
* The type of a geometric primitive, i.e., points, lines, and triangles.
*/
export enum PrimitiveType {
/**
* Points primitive where each vertex (or index) is a separate point.
*/
POINTS = WebGLConstants.POINTS,
/**
* Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
*/
LINES = WebGLConstants.LINES,
/**
* Line loop primitive where each vertex (or index) after the first connects a line to
* the previous vertex, and the last vertex implicitly connects to the first.
*/
LINE_LOOP = WebGLConstants.LINE_LOOP,
/**
* Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
*/
LINE_STRIP = WebGLConstants.LINE_STRIP,
/**
* Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
*/
TRIANGLES = WebGLConstants.TRIANGLES,
/**
* Triangle strip primitive where each vertex (or index) after the first two connect to
* the previous two vertices forming a triangle. For example, this can be used to model a wall.
*/
TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
/**
* Triangle fan primitive where each vertex (or index) after the first two connect to
* the previous vertex and the first vertex forming a triangle. For example, this can be used
* to model a cone or circle.
*/
TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
}
/**
* Base class for proxying requested made by {@link Resource}.
*/
export class Proxy {
constructor();
/**
* Get the final URL to use to request a given resource.
* @param resource - The resource to request.
* @returns proxied resource
*/
getURL(resource: string): string;
}
/**
* Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
*/
export namespace QuadraticRealPolynomial {
/**
* Provides the discriminant of the quadratic equation from the supplied coefficients.
* @param a - The coefficient of the 2nd order monomial.
* @param b - The coefficient of the 1st order monomial.
* @param c - The coefficient of the 0th order monomial.
* @returns The value of the discriminant.
*/
function computeDiscriminant(a: number, b: number, c: number): number;
/**
* Provides the real valued roots of the quadratic polynomial with the provided coefficients.
* @param a - The coefficient of the 2nd order monomial.
* @param b - The coefficient of the 1st order monomial.
* @param c - The coefficient of the 0th order monomial.
* @returns The real valued roots.
*/
function computeRealRoots(a: number, b: number, c: number): number[];
}
/**
* Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
* mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
* as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
* of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
* and 32767 at the maximum height in the tile.
* @example
* const data = new Cesium.QuantizedMeshTerrainData({
* minimumHeight : -100,
* maximumHeight : 2101,
* quantizedVertices : new Uint16Array([// order is SW NW SE NE
* // longitude
* 0, 0, 32767, 32767,
* // latitude
* 0, 32767, 0, 32767,
* // heights
* 16384, 0, 32767, 16384]),
* indices : new Uint16Array([0, 3, 1,
* 0, 2, 3]),
* boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
* orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
* horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
* westIndices : [0, 1],
* southIndices : [0, 1],
* eastIndices : [2, 3],
* northIndices : [1, 3],
* westSkirtHeight : 1.0,
* southSkirtHeight : 1.0,
* eastSkirtHeight : 1.0,
* northSkirtHeight : 1.0
* });
* @param options - Object with the following properties:
* @param options.quantizedVertices - The buffer containing the quantized mesh.
* @param options.indices - The indices specifying how the quantized vertices are linked
* together into triangles. Each three indices specifies one triangle.
* @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
* @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
* @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
* @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
* @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
* is below the horizon, the entire tile is assumed to be below the horizon as well.
* The point is expressed in ellipsoid-scaled coordinates.
* @param options.westIndices - The indices of the vertices on the western edge of the tile.
* @param options.southIndices - The indices of the vertices on the southern edge of the tile.
* @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
* @param options.northIndices - The indices of the vertices on the northern edge of the tile.
* @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
* @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
* @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
* @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
* @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
* If a child's bit is set, geometry will be requested for that tile as well when it
* is needed. If the bit is cleared, the child tile is not requested and geometry is
* instead upsampled from the parent. The bit values are as follows:
*
*
Bit Position
Bit Value
Child Tile
*
0
1
Southwest
*
1
2
Southeast
*
2
4
Northwest
*
3
8
Northeast
*
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
* otherwise, false.
* @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
* @param [options.waterMask] - The buffer containing the watermask.
* @param [options.credits] - Array of credits for this tile.
*/
export class QuantizedMeshTerrainData {
constructor(options: {
quantizedVertices: Uint16Array;
indices: Uint16Array | Uint32Array;
minimumHeight: number;
maximumHeight: number;
boundingSphere: BoundingSphere;
orientedBoundingBox?: OrientedBoundingBox;
horizonOcclusionPoint: Cartesian3;
westIndices: number[];
southIndices: number[];
eastIndices: number[];
northIndices: number[];
westSkirtHeight: number;
southSkirtHeight: number;
eastSkirtHeight: number;
northSkirtHeight: number;
childTileMask?: number;
createdByUpsampling?: boolean;
encodedNormals?: Uint8Array;
waterMask?: Uint8Array;
credits?: Credit[];
});
/**
* An array of credits for this tile.
*/
credits: Credit[];
/**
* The water mask included in this terrain data, if any. A water mask is a rectangular
* Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
* Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
*/
waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
/**
* Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
* vertices in this instance, interpolated if necessary.
* @param tilingScheme - The tiling scheme of this terrain data.
* @param thisX - The X coordinate of this tile in the tiling scheme.
* @param thisY - The Y coordinate of this tile in the tiling scheme.
* @param thisLevel - The level of this tile in the tiling scheme.
* @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
* @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
* @returns A promise for upsampled heightmap terrain data for the descendant tile,
* or undefined if too many asynchronous upsample operations are in progress and the request has been
* deferred.
*/
upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined;
/**
* Computes the terrain height at a specified longitude and latitude.
* @param rectangle - The rectangle covered by this terrain data.
* @param longitude - The longitude in radians.
* @param latitude - The latitude in radians.
* @returns The terrain height at the specified position. The position is clamped to
* the rectangle, so expect incorrect results for positions far outside the rectangle.
*/
interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
/**
* Determines if a given child tile is available, based on the
* {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
* to be one of the four children of this tile. If non-child tile coordinates are
* given, the availability of the southeast child tile is returned.
* @param thisX - The tile X coordinate of this (the parent) tile.
* @param thisY - The tile Y coordinate of this (the parent) tile.
* @param childX - The tile X coordinate of the child tile to check for availability.
* @param childY - The tile Y coordinate of the child tile to check for availability.
* @returns True if the child tile is available; otherwise, false.
*/
isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
/**
* Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
* terrain data. If this value is false, the data was obtained from some other source, such
* as by downloading it from a remote server. This method should return true for instances
* returned from a call to {@link HeightmapTerrainData#upsample}.
* @returns True if this instance was created by upsampling; otherwise, false.
*/
wasCreatedByUpsampling(): boolean;
}
/**
* Defines functions for 4th order polynomial functions of one variable with only real coefficients.
*/
export namespace QuarticRealPolynomial {
/**
* Provides the discriminant of the quartic equation from the supplied coefficients.
* @param a - The coefficient of the 4th order monomial.
* @param b - The coefficient of the 3rd order monomial.
* @param c - The coefficient of the 2nd order monomial.
* @param d - The coefficient of the 1st order monomial.
* @param e - The coefficient of the 0th order monomial.
* @returns The value of the discriminant.
*/
function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
/**
* Provides the real valued roots of the quartic polynomial with the provided coefficients.
* @param a - The coefficient of the 4th order monomial.
* @param b - The coefficient of the 3rd order monomial.
* @param c - The coefficient of the 2nd order monomial.
* @param d - The coefficient of the 1st order monomial.
* @param e - The coefficient of the 0th order monomial.
* @returns The real valued roots.
*/
function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
}
/**
* A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
* @param [x = 0.0] - The X component.
* @param [y = 0.0] - The Y component.
* @param [z = 0.0] - The Z component.
* @param [w = 0.0] - The W component.
*/
export class Quaternion {
constructor(x?: number, y?: number, z?: number, w?: number);
/**
* The X component.
*/
x: number;
/**
* The Y component.
*/
y: number;
/**
* The Z component.
*/
z: number;
/**
* The W component.
*/
w: number;
/**
* Computes a quaternion representing a rotation around an axis.
* @param axis - The axis of rotation.
* @param angle - The angle in radians to rotate around the axis.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
/**
* Computes a Quaternion from the provided Matrix3 instance.
* @param matrix - The rotation matrix.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
/**
* Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
* negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
* the positive x axis.
* @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Quaternion instance if none was provided.
*/
static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
/**
* The number of elements used to store the object into an array in its interpolatable form.
*/
static packedInterpolationLength: number;
/**
* Converts a packed array into a form suitable for interpolation.
* @param packedArray - The packed array.
* @param [startingIndex = 0] - The index of the first element to be converted.
* @param [lastIndex = packedArray.length] - The index of the last element to be converted.
* @param [result] - The object into which to store the result.
*/
static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
/**
* Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
* @param array - The array previously packed for interpolation.
* @param sourceArray - The original packed array.
* @param [firstIndex = 0] - The firstIndex used to convert the array.
* @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
/**
* Duplicates a Quaternion instance.
* @param quaternion - The quaternion to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
*/
static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
/**
* Computes the conjugate of the provided quaternion.
* @param quaternion - The quaternion to conjugate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
/**
* Computes magnitude squared for the provided quaternion.
* @param quaternion - The quaternion to conjugate.
* @returns The magnitude squared.
*/
static magnitudeSquared(quaternion: Quaternion): number;
/**
* Computes magnitude for the provided quaternion.
* @param quaternion - The quaternion to conjugate.
* @returns The magnitude.
*/
static magnitude(quaternion: Quaternion): number;
/**
* Computes the normalized form of the provided quaternion.
* @param quaternion - The quaternion to normalize.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
/**
* Computes the inverse of the provided quaternion.
* @param quaternion - The quaternion to normalize.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
/**
* Computes the componentwise sum of two quaternions.
* @param left - The first quaternion.
* @param right - The second quaternion.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
/**
* Computes the componentwise difference of two quaternions.
* @param left - The first quaternion.
* @param right - The second quaternion.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
/**
* Negates the provided quaternion.
* @param quaternion - The quaternion to be negated.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
/**
* Computes the dot (scalar) product of two quaternions.
* @param left - The first quaternion.
* @param right - The second quaternion.
* @returns The dot product.
*/
static dot(left: Quaternion, right: Quaternion): number;
/**
* Computes the product of two quaternions.
* @param left - The first quaternion.
* @param right - The second quaternion.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
/**
* Multiplies the provided quaternion componentwise by the provided scalar.
* @param quaternion - The quaternion to be scaled.
* @param scalar - The scalar to multiply with.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
/**
* Divides the provided quaternion componentwise by the provided scalar.
* @param quaternion - The quaternion to be divided.
* @param scalar - The scalar to divide by.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
/**
* Computes the axis of rotation of the provided quaternion.
* @param quaternion - The quaternion to use.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
/**
* Computes the angle of rotation of the provided quaternion.
* @param quaternion - The quaternion to use.
* @returns The angle of rotation.
*/
static computeAngle(quaternion: Quaternion): number;
/**
* Computes the linear interpolation or extrapolation at t using the provided quaternions.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
/**
* Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
/**
* The logarithmic quaternion function.
* @param quaternion - The unit quaternion.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
/**
* The exponential quaternion function.
* @param cartesian - The cartesian.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
/**
* Computes an inner quadrangle point.
*
This will compute quaternions that ensure a squad curve is C1.
* @param q0 - The first quaternion.
* @param q1 - The second quaternion.
* @param q2 - The third quaternion.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
/**
* Computes the spherical quadrangle interpolation between quaternions.
* @example
* // 1. compute the squad interpolation between two quaternions on a curve
* const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
* const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
* const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
*
* // 2. compute the squad interpolation as above but where the first quaternion is a end point.
* const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
* const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
* @param q0 - The first quaternion.
* @param q1 - The second quaternion.
* @param s0 - The first inner quadrangle.
* @param s1 - The second inner quadrangle.
* @param t - The time in [0,1] used to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
/**
* Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
* This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.
* @param start - The value corresponding to t at 0.0.
* @param end - The value corresponding to t at 1.0.
* @param t - The point along t at which to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter.
*/
static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
/**
* Computes the spherical quadrangle interpolation between quaternions.
* An implementation that is faster than {@link Quaternion#squad}, but less accurate.
* @param q0 - The first quaternion.
* @param q1 - The second quaternion.
* @param s0 - The first inner quadrangle.
* @param s1 - The second inner quadrangle.
* @param t - The time in [0,1] used to interpolate.
* @param result - The object onto which to store the result.
* @returns The modified result parameter or a new instance if none was provided.
*/
static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
/**
* Compares the provided quaternions componentwise and returns
* true if they are equal, false otherwise.
* @param [left] - The first quaternion.
* @param [right] - The second quaternion.
* @returns true if left and right are equal, false otherwise.
*/
static equals(left?: Quaternion, right?: Quaternion): boolean;
/**
* Compares the provided quaternions componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [left] - The first quaternion.
* @param [right] - The second quaternion.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
/**
* An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
*/
static readonly ZERO: Quaternion;
/**
* An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
*/
static readonly IDENTITY: Quaternion;
/**
* Duplicates this Quaternion instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
clone(result?: Quaternion): Quaternion;
/**
* Compares this and the provided quaternion componentwise and returns
* true if they are equal, false otherwise.
* @param [right] - The right hand side quaternion.
* @returns true if left and right are equal, false otherwise.
*/
equals(right?: Quaternion): boolean;
/**
* Compares this and the provided quaternion componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [right] - The right hand side quaternion.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
/**
* Returns a string representing this quaternion in the format (x, y, z, w).
* @returns A string representing this Quaternion.
*/
toString(): string;
}
/**
* A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
* The generated curve is in the class C1.
* @param options - Object with the following properties:
* @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
* The values are in no way connected to the clock time. They are the parameterization for the curve.
* @param options.points - The array of {@link Quaternion} control points.
*/
export class QuaternionSpline {
constructor(options: {
times: number[];
points: Quaternion[];
});
/**
* An array of times for the control points.
*/
readonly times: number[];
/**
* An array of {@link Quaternion} control points.
*/
readonly points: Quaternion[];
/**
* Finds an index i in times such that the parameter
* time is in the interval [times[i], times[i + 1]].
* @param time - The time.
* @returns The index for the element at the start of the interval.
*/
findTimeInterval(time: number): number;
/**
* Wraps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, wrapped around to the updated animation.
*/
wrapTime(time: number): number;
/**
* Clamps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, clamped to the animation period.
*/
clampTime(time: number): number;
/**
* Evaluates the curve at a given time.
* @param time - The time at which to evaluate the curve.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new instance of the point on the curve at the given time.
*/
evaluate(time: number, result?: Quaternion): Quaternion;
}
/**
* A queue that can enqueue items at the end, and dequeue items from the front.
*/
export class Queue {
constructor();
/**
* The length of the queue.
*/
readonly length: number;
/**
* Enqueues the specified item.
* @param item - The item to enqueue.
*/
enqueue(item: any): void;
/**
* Dequeues an item. Returns undefined if the queue is empty.
* @returns The the dequeued item.
*/
dequeue(): any;
/**
* Returns the item at the front of the queue. Returns undefined if the queue is empty.
* @returns The item at the front of the queue.
*/
peek(): any;
/**
* Check whether this queue contains the specified item.
* @param item - The item to search for.
*/
contains(item: any): void;
/**
* Remove all items from the queue.
*/
clear(): void;
/**
* Sort the items in the queue in-place.
* @param compareFunction - A function that defines the sort order.
*/
sort(compareFunction: Queue.Comparator): void;
}
export namespace Queue {
/**
* A function used to compare two items while sorting a queue.
* @example
* function compareNumbers(a, b) {
* return a - b;
* }
* @param a - An item in the array.
* @param b - An item in the array.
*/
type Comparator = (a: any, b: any) => number;
}
/**
* Represents a ray that extends infinitely from the provided origin in the provided direction.
* @param [origin = Cartesian3.ZERO] - The origin of the ray.
* @param [direction = Cartesian3.ZERO] - The direction of the ray.
*/
export class Ray {
constructor(origin?: Cartesian3, direction?: Cartesian3);
/**
* The origin of the ray.
*/
origin: Cartesian3;
/**
* The direction of the ray.
*/
direction: Cartesian3;
/**
* Duplicates a Ray instance.
* @param ray - The ray to duplicate.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
*/
static clone(ray: Ray, result?: Ray): Ray;
/**
* Computes the point along the ray given by r(t) = o + t*d,
* where o is the origin of the ray and d is the direction.
* @example
* //Get the first intersection point of a ray and an ellipsoid.
* const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
* const point = Cesium.Ray.getPoint(ray, intersection.start);
* @param ray - The ray.
* @param t - A scalar value.
* @param [result] - The object in which the result will be stored.
* @returns The modified result parameter, or a new instance if none was provided.
*/
static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
}
/**
* A two dimensional region specified as longitude and latitude coordinates.
* @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
* @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
* @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
* @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
*/
export class Rectangle {
constructor(west?: number, south?: number, east?: number, north?: number);
/**
* The westernmost longitude in radians in the range [-Pi, Pi].
*/
west: number;
/**
* The southernmost latitude in radians in the range [-Pi/2, Pi/2].
*/
south: number;
/**
* The easternmost longitude in radians in the range [-Pi, Pi].
*/
east: number;
/**
* The northernmost latitude in radians in the range [-Pi/2, Pi/2].
*/
north: number;
/**
* Gets the width of the rectangle in radians.
*/
readonly width: number;
/**
* Gets the height of the rectangle in radians.
*/
readonly height: number;
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Rectangle instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
/**
* Computes the width of a rectangle in radians.
* @param rectangle - The rectangle to compute the width of.
* @returns The width.
*/
static computeWidth(rectangle: Rectangle): number;
/**
* Computes the height of a rectangle in radians.
* @param rectangle - The rectangle to compute the height of.
* @returns The height.
*/
static computeHeight(rectangle: Rectangle): number;
/**
* Creates a rectangle given the boundary longitude and latitude in degrees.
* @example
* const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
* @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
* @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
* @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
* @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
/**
* Creates a rectangle given the boundary longitude and latitude in radians.
* @example
* const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
* @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
* @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
* @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
* @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
/**
* Creates the smallest possible Rectangle that encloses all positions in the provided array.
* @param cartographics - The list of Cartographic instances.
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
/**
* Creates the smallest possible Rectangle that encloses all positions in the provided array.
* @param cartesians - The list of Cartesian instances.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
/**
* Duplicates a Rectangle.
* @param rectangle - The rectangle to clone.
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
* @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
*/
static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
/**
* Compares the provided Rectangles componentwise and returns
* true if they pass an absolute or relative tolerance test,
* false otherwise.
* @param [left] - The first Rectangle.
* @param [right] - The second Rectangle.
* @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
* @returns true if left and right are within the provided epsilon, false otherwise.
*/
static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
/**
* Duplicates this Rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
clone(result?: Rectangle): Rectangle;
/**
* Compares the provided Rectangle with this Rectangle componentwise and returns
* true if they are equal, false otherwise.
* @param [other] - The Rectangle to compare.
* @returns true if the Rectangles are equal, false otherwise.
*/
equals(other?: Rectangle): boolean;
/**
* Compares the provided rectangles and returns true if they are equal,
* false otherwise.
* @param [left] - The first Rectangle.
* @param [right] - The second Rectangle.
* @returns true if left and right are equal; otherwise false.
*/
static equals(left?: Rectangle, right?: Rectangle): boolean;
/**
* Compares the provided Rectangle with this Rectangle componentwise and returns
* true if they are within the provided epsilon,
* false otherwise.
* @param [other] - The Rectangle to compare.
* @param [epsilon = 0] - The epsilon to use for equality testing.
* @returns true if the Rectangles are within the provided epsilon, false otherwise.
*/
equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
/**
* Checks a Rectangle's properties and throws if they are not in valid ranges.
* @param rectangle - The rectangle to validate
*/
static validate(rectangle: Rectangle): void;
/**
* Computes the southwest corner of a rectangle.
* @param rectangle - The rectangle for which to find the corner
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if none was provided.
*/
static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
/**
* Computes the northwest corner of a rectangle.
* @param rectangle - The rectangle for which to find the corner
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if none was provided.
*/
static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
/**
* Computes the northeast corner of a rectangle.
* @param rectangle - The rectangle for which to find the corner
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if none was provided.
*/
static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
/**
* Computes the southeast corner of a rectangle.
* @param rectangle - The rectangle for which to find the corner
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if none was provided.
*/
static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
/**
* Computes the center of a rectangle.
* @param rectangle - The rectangle for which to find the center
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Cartographic instance if none was provided.
*/
static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
/**
* Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
* latitude and longitude in radians and produces a correct intersection, taking into account the fact that
* the same angle can be represented with multiple values as well as the wrapping of longitude at the
* anti-meridian. For a simple intersection that ignores these factors and can be used with projected
* coordinates, see {@link Rectangle.simpleIntersection}.
* @param rectangle - On rectangle to find an intersection
* @param otherRectangle - Another rectangle to find an intersection
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
*/
static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
/**
* Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
* does not attempt to put the angular coordinates into a consistent range or to account for crossing the
* anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
* and longitude (i.e. projected coordinates).
* @param rectangle - On rectangle to find an intersection
* @param otherRectangle - Another rectangle to find an intersection
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
*/
static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
/**
* Computes a rectangle that is the union of two rectangles.
* @param rectangle - A rectangle to enclose in rectangle.
* @param otherRectangle - A rectangle to enclose in a rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
/**
* Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
* @param rectangle - A rectangle to expand.
* @param cartographic - A cartographic to enclose in a rectangle.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Rectangle instance if one was not provided.
*/
static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
/**
* Returns true if the cartographic is on or inside the rectangle, false otherwise.
* @param rectangle - The rectangle
* @param cartographic - The cartographic to test.
* @returns true if the provided cartographic is inside the rectangle, false otherwise.
*/
static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
/**
* Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
* {@link BoundingSphere#fromPoints}. Sampling is necessary to account
* for rectangles that cover the poles or cross the equator.
* @param rectangle - The rectangle to subsample.
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
* @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
* @param [result] - The array of Cartesians onto which to store the result.
* @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
*/
static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
/**
* Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
* @param rectangle - The rectangle to subsection.
* @param westLerp - The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.
* @param southLerp - The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.
* @param eastLerp - The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.
* @param northLerp - The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Rectangle instance if none was provided.
*/
static subsection(rectangle: Rectangle, westLerp: number, southLerp: number, eastLerp: number, northLerp: number, result?: Rectangle): Rectangle;
/**
* The largest possible rectangle.
*/
static readonly MAX_VALUE: Rectangle;
}
/**
* A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
* @example
* // 1. create a rectangle
* const rectangle = new Cesium.RectangleGeometry({
* ellipsoid : Cesium.Ellipsoid.WGS84,
* rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
* height : 10000.0
* });
* const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
*
* // 2. create an extruded rectangle without a top
* const rectangle = new Cesium.RectangleGeometry({
* ellipsoid : Cesium.Ellipsoid.WGS84,
* rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
* height : 10000.0,
* extrudedHeight: 300000
* });
* const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
* @param options - Object with the following properties:
* @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
* @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
* @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
*/
export class RectangleGeometry {
constructor(options: {
rectangle: Rectangle;
vertexFormat?: VertexFormat;
ellipsoid?: Ellipsoid;
granularity?: number;
height?: number;
rotation?: number;
stRotation?: number;
extrudedHeight?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
/**
* Computes the bounding rectangle based on the provided options
* @param options - Object with the following properties:
* @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
* @param [result] - An object in which to store the result.
* @returns The result rectangle
*/
static computeRectangle(options: {
rectangle: Rectangle;
ellipsoid?: Ellipsoid;
granularity?: number;
rotation?: number;
}, result?: Rectangle): Rectangle;
/**
* Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
* @param rectangleGeometry - A description of the rectangle.
* @returns The computed vertices and indices.
*/
static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
}
/**
* A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
* @example
* const rectangle = new Cesium.RectangleOutlineGeometry({
* ellipsoid : Cesium.Ellipsoid.WGS84,
* rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
* height : 10000.0
* });
* const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
* @param options - Object with the following properties:
* @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
* @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
* @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
* @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
*/
export class RectangleOutlineGeometry {
constructor(options: {
rectangle: Rectangle;
ellipsoid?: Ellipsoid;
granularity?: number;
height?: number;
rotation?: number;
extrudedHeight?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new Quaternion instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
/**
* Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
* @param rectangleGeometry - A description of the rectangle outline.
* @returns The computed vertices and indices.
*/
static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
}
/**
* Constants for identifying well-known reference frames.
*/
export enum ReferenceFrame {
/**
* The fixed frame.
*/
FIXED = 0,
/**
* The inertial frame.
*/
INERTIAL = 1
}
/**
* Stores information for making a request. In general this does not need to be constructed directly.
* @param [options] - An object with the following properties:
* @param [options.url] - The url to request.
* @param [options.requestFunction] - The function that makes the actual data request.
* @param [options.cancelFunction] - The function that is called when the request is cancelled.
* @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
* @param [options.priority = 0.0] - The initial priority of the request.
* @param [options.throttle = false] - Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
* @param [options.throttleByServer = false] - Whether to throttle the request by server.
* @param [options.type = RequestType.OTHER] - The type of request.
*/
export class Request {
constructor(options?: {
url?: string;
requestFunction?: Request.RequestCallback;
cancelFunction?: Request.CancelCallback;
priorityFunction?: Request.PriorityCallback;
priority?: number;
throttle?: boolean;
throttleByServer?: boolean;
type?: RequestType;
});
/**
* The URL to request.
*/
url: string;
/**
* The function that makes the actual data request.
*/
requestFunction: Request.RequestCallback;
/**
* The function that is called when the request is cancelled.
*/
cancelFunction: Request.CancelCallback;
/**
* The function that is called to update the request's priority, which occurs once per frame.
*/
priorityFunction: Request.PriorityCallback;
/**
* Priority is a unit-less value where lower values represent higher priority.
* For world-based objects, this is usually the distance from the camera.
* A request that does not have a priority function defaults to a priority of 0.
*
* If priorityFunction is defined, this value is updated every frame with the result of that call.
*/
priority: number;
/**
* Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
* request will be throttled and sent based on priority.
*/
readonly throttle: boolean;
/**
* Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
* for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
* to true is preferable for requests going through HTTP/1 servers.
*/
readonly throttleByServer: boolean;
/**
* Type of request.
*/
readonly type: RequestType;
/**
* The current state of the request.
*/
readonly state: RequestState;
/**
* Duplicates a Request instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Resource instance if one was not provided.
*/
clone(result?: Request): Request;
}
export namespace Request {
/**
* The function that makes the actual data request.
*/
type RequestCallback = () => Promise;
/**
* The function that is called when the request is cancelled.
*/
type CancelCallback = () => void;
/**
* The function that is called to update the request's priority, which occurs once per frame.
*/
type PriorityCallback = () => number;
}
/**
* An event that is raised when a request encounters an error.
* @param [statusCode] - The HTTP error status code, such as 404.
* @param [response] - The response included along with the error.
* @param [responseHeaders] - The response headers, represented either as an object literal or as a
* string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
*/
export class RequestErrorEvent {
constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
/**
* The HTTP error status code, such as 404. If the error does not have a particular
* HTTP code, this property will be undefined.
*/
statusCode: number;
/**
* The response included along with the error. If the error does not include a response,
* this property will be undefined.
*/
response: any;
/**
* The headers included in the response, represented as an object literal of key/value pairs.
* If the error does not include any headers, this property will be undefined.
*/
responseHeaders: any;
/**
* Creates a string representing this RequestErrorEvent.
* @returns A string representing the provided RequestErrorEvent.
*/
toString(): string;
}
/**
* The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
* to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
* a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
* number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.
*/
export namespace RequestScheduler {
/**
* The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
*/
var maximumRequests: number;
/**
* The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
* listed in {@link requestsByServer} do not observe this limit.
*/
var maximumRequestsPerServer: number;
/**
* A per server key list of overrides to use for throttling instead of maximumRequestsPerServer
* @example
* RequestScheduler.requestsByServer = {
* 'api.cesium.com:443': 18,
* 'assets.cesium.com:443': 18
* };
*/
var requestsByServer: any;
/**
* Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
*/
var throttleRequests: boolean;
}
/**
* State of the request.
*/
export enum RequestState {
/**
* Initial unissued state.
*/
UNISSUED = 0,
/**
* Issued but not yet active. Will become active when open slots are available.
*/
ISSUED = 1,
/**
* Actual http request has been sent.
*/
ACTIVE = 2,
/**
* Request completed successfully.
*/
RECEIVED = 3,
/**
* Request was cancelled, either explicitly or automatically because of low priority.
*/
CANCELLED = 4,
/**
* Request failed.
*/
FAILED = 5
}
/**
* An enum identifying the type of request. Used for finer grained logging and priority sorting.
*/
export enum RequestType {
/**
* Terrain request.
*/
TERRAIN = 0,
/**
* Imagery request.
*/
IMAGERY = 1,
/**
* 3D Tiles request.
*/
TILES3D = 2,
/**
* Other request.
*/
OTHER = 3
}
/**
* A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.
* @example
* function refreshTokenRetryCallback(resource, error) {
* if (error.statusCode === 403) {
* // 403 status code means a new token should be generated
* return getNewAccessToken()
* .then(function(token) {
* resource.queryParameters.access_token = token;
* return true;
* })
* .otherwise(function() {
* return false;
* });
* }
*
* return false;
* }
*
* const resource = new Resource({
* url: 'http://server.com/path/to/resource.json',
* proxy: new DefaultProxy('/proxy/'),
* headers: {
* 'X-My-Header': 'valueOfHeader'
* },
* queryParameters: {
* 'access_token': '123-435-456-000'
* },
* retryCallback: refreshTokenRetryCallback,
* retryAttempts: 1
* });
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
*/
export class Resource {
constructor(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
});
/**
* Additional HTTP headers that will be sent with the request.
*/
headers: any;
/**
* A Request object that will be used. Intended for internal use only.
*/
request: Request;
/**
* A proxy to be used when loading the resource.
*/
proxy: Proxy;
/**
* Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.
*/
retryCallback: (...params: any[]) => any;
/**
* The number of times the retryCallback should be called before giving up.
*/
retryAttempts: number;
/**
* Returns true if blobs are supported.
*/
static readonly isBlobSupported: boolean;
/**
* Query parameters appended to the url.
*/
readonly queryParameters: any;
/**
* The key/value pairs used to replace template parameters in the url.
*/
readonly templateValues: any;
/**
* The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
*/
url: string;
/**
* The file extension of the resource.
*/
readonly extension: string;
/**
* True if the Resource refers to a data URI.
*/
isDataUri: boolean;
/**
* True if the Resource refers to a blob URI.
*/
isBlobUri: boolean;
/**
* True if the Resource refers to a cross origin URL.
*/
isCrossOriginUrl: boolean;
/**
* True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
*/
hasHeaders: boolean;
/**
* Override Object#toString so that implicit string conversion gives the
* complete URL represented by this Resource.
* @returns The URL represented by this Resource
*/
toString(): string;
/**
* Returns the url, optional with the query string and processed by a proxy.
* @param [query = false] - If true, the query string is included.
* @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
* @returns The url with all the requested components.
*/
getUrlComponent(query?: boolean, proxy?: boolean): string;
/**
* Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
* as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.
* @param params - The query parameters
* @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
*/
setQueryParameters(params: any, useAsDefault?: boolean): void;
/**
* Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
* as opposed to adding them one at a time to the queryParameters property.
* @param params - The query parameters
*/
appendQueryParameters(params: any): void;
/**
* Combines the specified object and the existing template values. This allows you to add many values at once,
* as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.
* @param template - The template values
* @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
*/
setTemplateValues(template: any, useAsDefault?: boolean): void;
/**
* Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
* @param options - An object with the following properties
* @param [options.url] - The url that will be resolved relative to the url of the current instance.
* @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The function to call when loading the resource fails.
* @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.preserveQueryParameters = false] - If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.
* @returns The resource derived from the current one.
*/
getDerivedResource(options: {
url?: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
preserveQueryParameters?: boolean;
}): Resource;
/**
* Duplicates a Resource instance.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new Resource instance if one was not provided.
*/
clone(result?: Resource): Resource;
/**
* Returns the base path of the Resource.
* @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
* @returns The base URI of the resource
*/
getBaseUri(includeQuery?: boolean): string;
/**
* Appends a forward slash to the URL.
*/
appendForwardSlash(): void;
/**
* Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
* an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* // load a single URL asynchronously
* resource.fetchArrayBuffer().then(function(arrayBuffer) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchArrayBuffer(): Promise | undefined;
/**
* Creates a Resource and calls fetchArrayBuffer() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchArrayBuffer(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
}): Promise | undefined;
/**
* Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
* a Blob once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* // load a single URL asynchronously
* resource.fetchBlob().then(function(blob) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchBlob(): Promise | undefined;
/**
* Creates a Resource and calls fetchBlob() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchBlob(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
}): Promise | undefined;
/**
* Asynchronously loads the given image resource. Returns a promise that will resolve to
* an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
* @example
* // load a single image asynchronously
* resource.fetchImage().then(function(image) {
* // use the loaded image
* }).otherwise(function(error) {
* // an error occurred
* });
*
* // load several images in parallel
* when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
* // images is an array containing all the loaded images
* });
* @param [options] - An object with the following properties.
* @param [options.preferBlob = false] - If true, we will load the image via a blob.
* @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned.
* @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap.
* @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchImage(options?: {
preferBlob?: boolean;
preferImageBitmap?: boolean;
flipY?: boolean;
skipColorSpaceConversion?: boolean;
}): Promise | Promise | undefined;
/**
* Creates a Resource and calls fetchImage() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.flipY = false] - Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.preferBlob = false] - If true, we will load the image via a blob.
* @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned.
* @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchImage(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
flipY?: boolean;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
preferBlob?: boolean;
preferImageBitmap?: boolean;
skipColorSpaceConversion?: boolean;
}): Promise | Promise | undefined;
/**
* Asynchronously loads the given resource as text. Returns a promise that will resolve to
* a String once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* // load text from a URL, setting a custom header
* const resource = new Resource({
* url: 'http://someUrl.com/someJson.txt',
* headers: {
* 'X-Custom-Header' : 'some value'
* }
* });
* resource.fetchText().then(function(text) {
* // Do something with the text
* }).otherwise(function(error) {
* // an error occurred
* });
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchText(): Promise | undefined;
/**
* Creates a Resource and calls fetchText() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchText(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
}): Promise | undefined;
/**
* Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
* a JSON object once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
* adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not
* already specified.
* @example
* resource.fetchJson().then(function(jsonData) {
* // Do something with the JSON object
* }).otherwise(function(error) {
* // an error occurred
* });
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchJson(): Promise | undefined;
/**
* Creates a Resource and calls fetchJson() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchJson(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
}): Promise | undefined;
/**
* Asynchronously loads the given resource as XML. Returns a promise that will resolve to
* an XML Document once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* // load XML from a URL, setting a custom header
* Cesium.loadXML('http://someUrl.com/someXML.xml', {
* 'X-Custom-Header' : 'some value'
* }).then(function(document) {
* // Do something with the document
* }).otherwise(function(error) {
* // an error occurred
* });
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchXML(): Promise | undefined;
/**
* Creates a Resource and calls fetchXML() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchXML(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
}): Promise | undefined;
/**
* Requests a resource using JSONP.
* @example
* // load a data asynchronously
* resource.fetchJsonp().then(function(data) {
* // use the loaded data
* }).otherwise(function(error) {
* // an error occurred
* });
* @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetchJsonp(callbackParameterName?: string): Promise | undefined;
/**
* Creates a Resource from a URL and calls fetchJsonp() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetchJsonp(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
callbackParameterName?: string;
}): Promise | undefined;
/**
* Asynchronously loads the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
* the more specific functions eg. fetchJson, fetchBlob, etc.
* @example
* resource.fetch()
* .then(function(body) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
fetch(options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls fetch() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static fetch(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously deletes the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.delete()
* .then(function(body) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
delete(options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls delete() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.data] - Data that is posted with the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static delete(options: {
url: string;
data?: any;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously gets headers the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.head()
* .then(function(headers) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
head(options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls head() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static head(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously gets options the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.options()
* .then(function(headers) {
* // use the data
* }).otherwise(function(error) {
* // an error occurred
* });
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
options(options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls options() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static options(options: {
url: string;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously posts data to the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.post(data)
* .then(function(result) {
* // use the result
* }).otherwise(function(error) {
* // an error occurred
* });
* @param data - Data that is posted with the resource.
* @param [options] - Object with the following properties:
* @param [options.data] - Data that is posted with the resource.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
post(data: any, options?: {
data?: any;
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls post() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param options.data - Data that is posted with the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static post(options: {
url: string;
data: any;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously puts data to the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.put(data)
* .then(function(result) {
* // use the result
* }).otherwise(function(error) {
* // an error occurred
* });
* @param data - Data that is posted with the resource.
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
put(data: any, options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls put() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param options.data - Data that is posted with the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static put(options: {
url: string;
data: any;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Asynchronously patches data to the given resource. Returns a promise that will resolve to
* the result once loaded, or reject if the resource failed to load. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* @example
* resource.patch(data)
* .then(function(result) {
* // use the result
* }).otherwise(function(error) {
* // an error occurred
* });
* @param data - Data that is posted with the resource.
* @param [options] - Object with the following properties:
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.headers] - Additional HTTP headers to send with the request, if any.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
patch(data: any, options?: {
responseType?: string;
headers?: any;
overrideMimeType?: string;
}): Promise | undefined;
/**
* Creates a Resource from a URL and calls patch() on it.
* @param options - A url or an object with the following properties
* @param options.url - The url of the resource.
* @param options.data - Data that is posted with the resource.
* @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
* @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
* @param [options.headers = {}] - Additional HTTP headers that will be sent.
* @param [options.proxy] - A proxy to be used when loading the resource.
* @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
* @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
* @param [options.request] - A Request object that will be used. Intended for internal use only.
* @param [options.responseType] - The type of response. This controls the type of item returned.
* @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
* @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority.
*/
static patch(options: {
url: string;
data: any;
queryParameters?: any;
templateValues?: any;
headers?: any;
proxy?: Proxy;
retryCallback?: Resource.RetryCallback;
retryAttempts?: number;
request?: Request;
responseType?: string;
overrideMimeType?: string;
}): Promise | undefined;
/**
* A resource instance initialized to the current browser location
*/
static readonly DEFAULT: Resource;
}
export namespace Resource {
/**
* A function that returns the value of the property.
* @param [resource] - The resource that failed to load.
* @param [error] - The error that occurred during the loading of the resource.
*/
type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise;
}
/**
* Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
* out of memory, could not compile shader, etc. If a function may throw this
* exception, the calling code should be prepared to catch it.
*
* On the other hand, a {@link DeveloperError} indicates an exception due
* to a developer error, e.g., invalid argument, that usually indicates a bug in the
* calling code.
* @param [message] - The error message for this exception.
*/
export class RuntimeError extends Error {
constructor(message?: string);
/**
* 'RuntimeError' indicating that this exception was thrown due to a runtime error.
*/
readonly name: string;
/**
* The explanation for why this exception was thrown.
*/
readonly message: string;
/**
* The stack trace of this exception, if available.
*/
readonly stack: string;
}
/**
* Handles user input events. Custom functions can be added to be executed on
* when the user enters input.
* @param [element = document] - The element to add events to.
*/
export class ScreenSpaceEventHandler {
constructor(element?: HTMLCanvasElement);
/**
* Set a function to be executed on an input event.
* @param action - Function to be executed when the input event occurs.
* @param type - The ScreenSpaceEventType of input event.
* @param [modifier] - A KeyboardEventModifier key that is held when a type
* event occurs.
*/
setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void;
/**
* Returns the function to be executed on an input event.
* @param type - The ScreenSpaceEventType of input event.
* @param [modifier] - A KeyboardEventModifier key that is held when a type
* event occurs.
* @returns The function to be executed on an input event.
*/
getInputAction(type: number, modifier?: number): (...params: any[]) => any;
/**
* Removes the function to be executed on an input event.
* @param type - The ScreenSpaceEventType of input event.
* @param [modifier] - A KeyboardEventModifier key that is held when a type
* event occurs.
*/
removeInputAction(type: number, modifier?: number): void;
/**
* Returns true if this object was destroyed; otherwise, false.
*
* If this object was destroyed, it should not be used; calling any function other than
* isDestroyed will result in a {@link DeveloperError} exception.
* @returns true if this object was destroyed; otherwise, false.
*/
isDestroyed(): boolean;
/**
* Removes listeners held by this object.
*
* Once an object is destroyed, it should not be used; calling any function other than
* isDestroyed will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined) to the object as done in the example.
* @example
* handler = handler && handler.destroy();
*/
destroy(): void;
/**
* The amount of time, in milliseconds, that mouse events will be disabled after
* receiving any touch events, such that any emulated mouse events will be ignored.
*/
static mouseEmulationIgnoreMilliseconds: number;
/**
* The amount of time, in milliseconds, before a touch on the screen becomes a
* touch and hold.
*/
static touchHoldDelayMilliseconds: number;
}
/**
* This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
*/
export enum ScreenSpaceEventType {
/**
* Represents a mouse left button down event.
*/
LEFT_DOWN = 0,
/**
* Represents a mouse left button up event.
*/
LEFT_UP = 1,
/**
* Represents a mouse left click event.
*/
LEFT_CLICK = 2,
/**
* Represents a mouse left double click event.
*/
LEFT_DOUBLE_CLICK = 3,
/**
* Represents a mouse left button down event.
*/
RIGHT_DOWN = 5,
/**
* Represents a mouse right button up event.
*/
RIGHT_UP = 6,
/**
* Represents a mouse right click event.
*/
RIGHT_CLICK = 7,
/**
* Represents a mouse middle button down event.
*/
MIDDLE_DOWN = 10,
/**
* Represents a mouse middle button up event.
*/
MIDDLE_UP = 11,
/**
* Represents a mouse middle click event.
*/
MIDDLE_CLICK = 12,
/**
* Represents a mouse move event.
*/
MOUSE_MOVE = 15,
/**
* Represents a mouse wheel event.
*/
WHEEL = 16,
/**
* Represents the start of a two-finger event on a touch surface.
*/
PINCH_START = 17,
/**
* Represents the end of a two-finger event on a touch surface.
*/
PINCH_END = 18,
/**
* Represents a change of a two-finger event on a touch surface.
*/
PINCH_MOVE = 19
}
/**
* Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
* @example
* const instance = new Cesium.GeometryInstance({
* geometry : new Cesium.BoxGeometry({
* vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
* minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
* maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
* }),
* modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
* Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
* id : 'box',
* attributes : {
* show : new Cesium.ShowGeometryInstanceAttribute(false)
* }
* });
* @param [show = true] - Determines if the geometry instance will be shown.
*/
export class ShowGeometryInstanceAttribute {
constructor(show?: boolean);
/**
* The values for the attributes stored in a typed array.
*/
value: Uint8Array;
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link ColorGeometryInstanceAttribute#value}.
*/
readonly componentDatatype: ComponentDatatype;
/**
* The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
*/
readonly componentsPerAttribute: number;
/**
* When true and componentDatatype is an integer format,
* indicate that the components should be mapped to the range [0, 1] (unsigned)
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
*/
readonly normalize: boolean;
/**
* Converts a boolean show to a typed array that can be used to assign a show attribute.
* @example
* const attributes = primitive.getGeometryInstanceAttributes('an id');
* attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
* @param show - The show value.
* @param [result] - The array to store the result in, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
static toValue(show: boolean, result?: Uint8Array): Uint8Array;
}
/**
* Contains functions for finding the Cartesian coordinates of the sun and the moon in the
* Earth-centered inertial frame.
*/
export namespace Simon1994PlanetaryPositions {
/**
* Computes the position of the Sun in the Earth-centered inertial frame
* @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
* @param [result] - The object onto which to store the result.
* @returns Calculated sun position
*/
function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
/**
* Computes the position of the Moon in the Earth-centered inertial frame
* @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
* @param [result] - The object onto which to store the result.
* @returns Calculated moon position
*/
function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
}
/**
* A description of a polyline modeled as a line strip; the first two positions define a line segment,
* and each additional position defines a line segment from the previous position.
* @example
* // A polyline with two connected line segments
* const polyline = new Cesium.SimplePolylineGeometry({
* positions : Cesium.Cartesian3.fromDegreesArray([
* 0.0, 0.0,
* 5.0, 0.0,
* 5.0, 5.0
* ])
* });
* const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
* @param options - Object with the following properties:
* @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
* @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
* @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
* @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
* @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
* @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
*/
export class SimplePolylineGeometry {
constructor(options: {
positions: Cartesian3[];
colors?: Color[];
colorsPerVertex?: boolean;
arcType?: ArcType;
granularity?: number;
ellipsoid?: Ellipsoid;
});
/**
* The number of elements used to pack the object into an array.
*/
packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
/**
* Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
* @param simplePolylineGeometry - A description of the polyline.
* @returns The computed vertices and indices.
*/
static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
}
/**
* A description of a sphere centered at the origin.
* @example
* const sphere = new Cesium.SphereGeometry({
* radius : 100.0,
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY
* });
* const geometry = Cesium.SphereGeometry.createGeometry(sphere);
* @param [options] - Object with the following properties:
* @param [options.radius = 1.0] - The radius of the sphere.
* @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
* @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
* @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
*/
export class SphereGeometry {
constructor(options?: {
radius?: number;
stackPartitions?: number;
slicePartitions?: number;
vertexFormat?: VertexFormat;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
/**
* Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
* @param sphereGeometry - A description of the sphere.
* @returns The computed vertices and indices.
*/
static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
}
/**
* A description of the outline of a sphere.
* @example
* const sphere = new Cesium.SphereOutlineGeometry({
* radius : 100.0,
* stackPartitions : 6,
* slicePartitions: 5
* });
* const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
* @param [options] - Object with the following properties:
* @param [options.radius = 1.0] - The radius of the sphere.
* @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
* @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
* @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
*/
export class SphereOutlineGeometry {
constructor(options?: {
radius?: number;
stackPartitions?: number;
slicePartitions?: number;
subdivisions?: number;
});
/**
* The number of elements used to pack the object into an array.
*/
static packedLength: number;
/**
* Stores the provided instance into the provided array.
* @param value - The value to pack.
* @param array - The array to pack into.
* @param [startingIndex = 0] - The index into the array at which to start packing the elements.
* @returns The array that was packed into
*/
static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
/**
* Retrieves an instance from a packed array.
* @param array - The packed array.
* @param [startingIndex = 0] - The starting index of the element to be unpacked.
* @param [result] - The object into which to store the result.
* @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
*/
static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
/**
* Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
* @param sphereGeometry - A description of the sphere outline.
* @returns The computed vertices and indices.
*/
static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
}
/**
* A set of curvilinear 3-dimensional coordinates.
* @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
* @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
* @param [magnitude = 1.0] - The linear coordinate measured from the origin.
*/
export class Spherical {
constructor(clock?: number, cone?: number, magnitude?: number);
/**
* The clock component.
*/
clock: number;
/**
* The cone component.
*/
cone: number;
/**
* The magnitude component.
*/
magnitude: number;
/**
* Converts the provided Cartesian3 into Spherical coordinates.
* @param cartesian3 - The Cartesian3 to be converted to Spherical.
* @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
* @returns The modified result parameter, or a new instance if one was not provided.
*/
static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
/**
* Creates a duplicate of a Spherical.
* @param spherical - The spherical to clone.
* @param [result] - The object to store the result into, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
*/
static clone(spherical: Spherical, result?: Spherical): Spherical;
/**
* Computes the normalized version of the provided spherical.
* @param spherical - The spherical to be normalized.
* @param [result] - The object to store the result into, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
static normalize(spherical: Spherical, result?: Spherical): Spherical;
/**
* Returns true if the first spherical is equal to the second spherical, false otherwise.
* @param left - The first Spherical to be compared.
* @param right - The second Spherical to be compared.
* @returns true if the first spherical is equal to the second spherical, false otherwise.
*/
static equals(left: Spherical, right: Spherical): boolean;
/**
* Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
* @param left - The first Spherical to be compared.
* @param right - The second Spherical to be compared.
* @param [epsilon = 0.0] - The epsilon to compare against.
* @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
*/
static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
/**
* Returns true if this spherical is equal to the provided spherical, false otherwise.
* @param other - The Spherical to be compared.
* @returns true if this spherical is equal to the provided spherical, false otherwise.
*/
equals(other: Spherical): boolean;
/**
* Creates a duplicate of this Spherical.
* @param [result] - The object to store the result into, if undefined a new instance will be created.
* @returns The modified result parameter or a new instance if result was undefined.
*/
clone(result?: Spherical): Spherical;
/**
* Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
* @param other - The Spherical to be compared.
* @param epsilon - The epsilon to compare against.
* @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
*/
equalsEpsilon(other: Spherical, epsilon: number): boolean;
/**
* Returns a string representing this instance in the format (clock, cone, magnitude).
* @returns A string representing this instance.
*/
toString(): string;
}
/**
* Creates a curve parameterized and evaluated by time. This type describes an interface
* and is not intended to be instantiated directly.
*/
export class Spline {
constructor();
/**
* An array of times for the control points.
*/
times: number[];
/**
* An array of control points.
*/
points: Cartesian3[] | Quaternion[];
/**
* Evaluates the curve at a given time.
* @param time - The time at which to evaluate the curve.
* @param [result] - The object onto which to store the result.
* @returns The modified result parameter or a new instance of the point on the curve at the given time.
*/
evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
/**
* Finds an index i in times such that the parameter
* time is in the interval [times[i], times[i + 1]].
* @param time - The time.
* @param startIndex - The index from which to start the search.
* @returns The index for the element at the start of the interval.
*/
findTimeInterval(time: number, startIndex: number): number;
/**
* Wraps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, wrapped around the animation period.
*/
wrapTime(time: number): number;
/**
* Clamps the given time to the period covered by the spline.
* @param time - The time.
* @returns The time, clamped to the animation period.
*/
clampTime(time: number): number;
}
/**
* A wrapper around a web worker that allows scheduling tasks for a given worker,
* returning results asynchronously via a promise.
*
* The Worker is not constructed until a task is scheduled.
* @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.
* @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded,
* scheduleTask will not queue any more tasks, allowing
* work to be rescheduled in future frames.
*/
export class TaskProcessor {
constructor(workerPath: string, maximumActiveTasks?: number);
/**
* Schedule a task to be processed by the web worker asynchronously. If there are currently more
* tasks active than the maximum set by the constructor, will immediately return undefined.
* Otherwise, returns a promise that will resolve to the result posted back by the worker when
* finished.
* @example
* const taskProcessor = new Cesium.TaskProcessor('myWorkerPath');
* const promise = taskProcessor.scheduleTask({
* someParameter : true,
* another : 'hello'
* });
* if (!Cesium.defined(promise)) {
* // too many active tasks - try again later
* } else {
* Cesium.when(promise, function(result) {
* // use the result of the task
* });
* }
* @param parameters - Any input data that will be posted to the worker.
* @param [transferableObjects] - An array of objects contained in parameters that should be
* transferred to the worker instead of copied.
* @returns Either a promise that will resolve to the result when available, or undefined
* if there are too many active tasks,
*/
scheduleTask(parameters: any, transferableObjects?: object[]): Promise