1 line
56 KiB
Plaintext
1 line
56 KiB
Plaintext
|
{"version":3,"file":"PrimitivePipeline-ffc4dd1c.js","sources":["../../../../Source/Core/OffsetGeometryInstanceAttribute.js","../../../../Source/Scene/PrimitivePipeline.js"],"sourcesContent":["import Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines the geometry instance offset\n *\n * @alias OffsetGeometryInstanceAttribute\n * @constructor\n *\n * @param {Number} [x=0] The x translation\n * @param {Number} [y=0] The y translation\n * @param {Number} [z=0] The z translation\n *\n * @private\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction OffsetGeometryInstanceAttribute(x, y, z) {\n x = defaultValue(x, 0);\n y = defaultValue(y, 0);\n z = defaultValue(z, 0);\n\n /**\n * The values for the attributes stored in a typed array.\n *\n * @type Float32Array\n */\n this.value = new Float32Array([x, y, z]);\n}\n\nObject.defineProperties(OffsetGeometryInstanceAttribute.prototype, {\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link OffsetGeometryInstanceAttribute#value}.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {ComponentDatatype}\n * @readonly\n *\n * @default {@link ComponentDatatype.FLOAT}\n */\n componentDatatype: {\n get: function () {\n return ComponentDatatype.FLOAT;\n },\n },\n\n /**\n * The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 3\n */\n componentsPerAttribute: {\n get: function () {\n return 3;\n },\n },\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n normalize: {\n get: function () {\n return false;\n },\n },\n});\n\n/**\n * Creates a new {@link OffsetGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @returns {OffsetGeometryInstanceAttribute} The new {@link OffsetGeometryInstanceAttribute} instance.\n */\nOffsetGeometryInstanceAttribute.fromCartesian3 = function (offset) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"offset\", offset);\n //>>includeEnd('debug');\n\n return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);\n};\n\n/**\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.modelMatrix = Cesium.OffsetGeometryInstanceAttribute.toValue(modelMatrix, attributes.modelMatrix);\n */\nOffsetGeometryInstanceAttribute.toValue = function (offset, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"offset\", offset);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Float32Array([offset.x, offset.y, offset.z]);\n }\n\n result[0] = offset.x;\n result[1] = offset.y;\n result[2] = offset.z;\n return result;\n};\nexport default OffsetGeometryInstanceAttribute;\n","import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport ComponentDatatype from \"../
|