1 line
13 KiB
Plaintext
1 line
13 KiB
Plaintext
|
{"version":3,"file":"VertexFormat-07539138.js","sources":["../../../../Source/Core/VertexFormat.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided\n * to a {@link Geometry} to request that certain properties be computed, e.g., just position,\n * position and normal, etc.\n *\n * @param {Object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.\n *\n * @alias VertexFormat\n * @constructor\n *\n * @example\n * // Create a vertex format with position and 2D texture coordinate attributes.\n * const format = new Cesium.VertexFormat({\n * position : true,\n * st : true\n * });\n *\n * @see Geometry#attributes\n * @see Packable\n */\nfunction VertexFormat(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * When <code>true</code>, the vertex has a 3D position attribute.\n * <p>\n * 64-bit floating-point (for precision). 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.position = defaultValue(options.position, false);\n\n /**\n * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.normal = defaultValue(options.normal, false);\n\n /**\n * When <code>true</code>, the vertex has a 2D texture coordinate attribute.\n * <p>\n * 32-bit floating-point. 2 components per attribute\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.st = defaultValue(options.st, false);\n\n /**\n * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.bitangent = defaultValue(options.bitangent, false);\n\n /**\n * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.tangent = defaultValue(options.tangent, false);\n\n /**\n * When <code>true</code>, the vertex has an RGB color attribute.\n * <p>\n * 8-bit unsigned byte. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.color = defaultValue(options.color, false);\n}\n\n/**\n * An immutable vertex format with only a position attribute.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n */\nVertexFormat.POSITION_ONLY = Object.freeze(\n new VertexFormat({\n position: true,\n })\n);\n\n/**\n * An immutable vertex format with position and normal attributes.\n * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n */\nVertexFormat.POSITION_AND_NORMAL = Object.freeze(\n new VertexFormat({\n position: true,\n normal: true,\n })\n);\n\n/**\n * An immutable vertex format with position, normal, and st attributes.\n * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}\n * is <code>TEXTURED/code>.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n * @see VertexFormat#st\n */\nVertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(\n new VertexFormat({\n position: true,\n normal: true,\n st: true,\n })\n);\n\n/**\n * An immutable vertex format with position and st attributes.\n * This is compa
|