@forbespro/lead-agent
Version:
Lead Chat Agent React Component
89 lines (88 loc) • 2.36 kB
JavaScript
import { Mesh as r, OrthographicCamera as i, BufferGeometry as a, Float32BufferAttribute as t } from "three";
class l {
/**
* Constructs a new pass.
*/
constructor() {
this.isPass = !0, this.enabled = !0, this.needsSwap = !0, this.clear = !1, this.renderToScreen = !1;
}
/**
* Sets the size of the pass.
*
* @abstract
* @param {number} width - The width to set.
* @param {number} height - The width to set.
*/
setSize() {
}
/**
* This method holds the render logic of a pass. It must be implemented in all derived classes.
*
* @abstract
* @param {WebGLRenderer} renderer - The renderer.
* @param {WebGLRenderTarget} writeBuffer - The write buffer. This buffer is intended as the rendering
* destination for the pass.
* @param {WebGLRenderTarget} readBuffer - The read buffer. The pass can access the result from the
* previous pass from this buffer.
* @param {number} deltaTime - The delta time in seconds.
* @param {boolean} maskActive - Whether masking is active or not.
*/
render() {
console.error("THREE.Pass: .render() must be implemented in derived pass.");
}
/**
* Frees the GPU-related resources allocated by this instance. Call this
* method whenever the pass is no longer used in your app.
*
* @abstract
*/
dispose() {
}
}
const n = new i(-1, 1, 1, -1, 0, 1);
class o extends a {
constructor() {
super(), this.setAttribute("position", new t([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new t([0, 2, 0, 0, 2, 0], 2));
}
}
const h = new o();
class c {
/**
* Constructs a new full screen quad.
*
* @param {?Material} material - The material to render te full screen quad with.
*/
constructor(e) {
this._mesh = new r(h, e);
}
/**
* Frees the GPU-related resources allocated by this instance. Call this
* method whenever the instance is no longer used in your app.
*/
dispose() {
this._mesh.geometry.dispose();
}
/**
* Renders the full screen quad.
*
* @param {WebGLRenderer} renderer - The renderer.
*/
render(e) {
e.render(this._mesh, n);
}
/**
* The quad's material.
*
* @type {?Material}
*/
get material() {
return this._mesh.material;
}
set material(e) {
this._mesh.material = e;
}
}
export {
c as FullScreenQuad,
l as Pass
};