UNPKG

@openhps/core

Version:

Open Hybrid Positioning System - Core component

51 lines (48 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pointUV = exports.default = void 0; var _Node = _interopRequireDefault(require("../core/Node.js")); var _TSLBase = require("../tsl/TSLBase.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * A node for representing the uv coordinates of points. * * Can only be used with a WebGL backend. In WebGPU, point * primitives always have the size of one pixel and can thus * can't be used as sprite-like objects that display textures. * * @augments Node */ class PointUVNode extends _Node.default { static get type() { return 'PointUVNode'; } /** * Constructs a new point uv node. */ constructor() { super('vec2'); /** * This flag can be used for type testing. * * @type {boolean} * @readonly * @default true */ this.isPointUVNode = true; } generate( /*builder*/ ) { return 'vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )'; } } var _default = exports.default = PointUVNode; /** * TSL object that represents the uv coordinates of points. * * @tsl * @type {PointUVNode} */ const pointUV = exports.pointUV = /*@__PURE__*/(0, _TSLBase.nodeImmutable)(PointUVNode);