UNPKG

@openhps/core

Version:

Open Hybrid Positioning System - Core component

49 lines (45 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _Sampler = _interopRequireDefault(require("../Sampler.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * A special form of sampler binding type. * It's texture value is managed by a node object. * * @private * @augments Sampler */ class NodeSampler extends _Sampler.default { /** * Constructs a new node-based sampler. * * @param {string} name - The samplers's name. * @param {TextureNode} textureNode - The texture node. * @param {UniformGroupNode} groupNode - The uniform group node. */ constructor(name, textureNode, groupNode) { super(name, textureNode ? textureNode.value : null); /** * The texture node. * * @type {TextureNode} */ this.textureNode = textureNode; /** * The uniform group node. * * @type {UniformGroupNode} */ this.groupNode = groupNode; } /** * Updates the texture value of this sampler. */ update() { this.texture = this.textureNode.value; } } var _default = exports.default = NodeSampler;