@itwin/core-common
Version:
iTwin.js components common to frontend and backend
36 lines • 1.59 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Rendering
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RenderMaterial = void 0;
const core_bentley_1 = require("@itwin/core-bentley");
/** Represents a material which can be applied to a surface to control aspects of its appearance such as color, reflectivity, texture, and so on.
* @public
*/
class RenderMaterial {
/** If the material originated from a Material element in the [[IModelDb]], the Id of that element. */
key;
/** Describes how to map an image to a surface to which this material is applied. */
textureMapping;
/** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */
_guid;
constructor(params) {
this.key = params.key;
this.textureMapping = params.textureMapping;
this._guid = core_bentley_1.Guid.createValue();
}
get hasTexture() {
return undefined !== this.textureMapping?.texture;
}
/** An [OrderedComparator]($bentley) that compares this material against `other`. */
compare(other) {
return (0, core_bentley_1.compareStrings)(this._guid, other._guid);
}
}
exports.RenderMaterial = RenderMaterial;
//# sourceMappingURL=RenderMaterial.js.map