UNPKG

@antv/g-webgpu-raytracer

Version:

A simple ray tracer implemented with WebGPU

37 lines (29 loc) 1.74 kB
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } import { Buffer } from './Buffer'; export var VertexBuffer = /*#__PURE__*/function (_Buffer) { _inherits(VertexBuffer, _Buffer); var _super = _createSuper(VertexBuffer); function VertexBuffer(length) { _classCallCheck(this, VertexBuffer); return _super.call(this, 1, length); } _createClass(VertexBuffer, [{ key: "append", value: function append(v) { // copy vertices data to the buffer this.appendF(v[0]); this.appendF(v[1]); this.appendF(v[2]); this.pad(1); } }]); return VertexBuffer; }(Buffer); VertexBuffer.bytes = 4; //# sourceMappingURL=VertexBuffer.js.map