Socket
Socket
Sign inDemoInstall

webgl-framework

Package Overview
Dependencies
1
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.8 to 2.2.0

1

dist/lib/BaseRenderer.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseRenderer = void 0;
const gl_matrix_1 = require("gl-matrix");

@@ -4,0 +5,0 @@ class BaseRenderer {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseShader = void 0;
class BaseShader {

@@ -4,0 +5,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BinaryDataLoader = void 0;
class BinaryDataLoader {

@@ -4,0 +5,0 @@ static async load(url) {

13

dist/lib/CombinedAnimation.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CombinedAnimation = void 0;
class CombinedAnimation {
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
getStart() {

@@ -22,2 +17,8 @@ return this.start;

}
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
clamp(i, low, high) {

@@ -24,0 +25,0 @@ return Math.max(Math.min(i, high), low);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CompressedTextureLoader = void 0;
const BinaryDataLoader_1 = require("./BinaryDataLoader");

@@ -4,0 +5,0 @@ const PKM_HEADER_SIZE = 16; // size of PKM header

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=DrawableShader.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrameBuffer = void 0;
class FrameBuffer {

@@ -4,0 +5,0 @@ /** Constructor. */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullModel = void 0;
const BinaryDataLoader_1 = require("./BinaryDataLoader");

@@ -4,0 +5,0 @@ class FullModel {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=RendererWithExposedMethods.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiffuseShader = void 0;
const BaseShader_1 = require("../BaseShader");
/**
* Simple shader using one texture.
*/
class DiffuseShader extends BaseShader_1.BaseShader {

@@ -32,3 +36,3 @@ /** @inheritdoc */

/** @inheritdoc */
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz) {
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz, attribs) {
if (this.rm_Vertex === undefined || this.rm_TexCoord0 === undefined || this.view_proj_matrix === undefined) {

@@ -41,4 +45,11 @@ return;

gl.enableVertexAttribArray(this.rm_TexCoord0);
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
if (attribs) {
for (const [key, value] of attribs) {
gl.vertexAttribPointer(key, ...value);
}
}
else {
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
}
renderer.calculateMVPMatrix(tx, ty, tz, rx, ry, rz, sx, sy, sz);

@@ -45,0 +56,0 @@ gl.uniformMatrix4fv(this.view_proj_matrix, false, renderer.getMVPMatrix());

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextureUtils = void 0;
/** Utilities to create various textures. */

@@ -4,0 +5,0 @@ class TextureUtils {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UncompressedTextureLoader = void 0;
class UncompressedTextureLoader {

@@ -4,0 +5,0 @@ static load(url, gl, minFilter = gl.LINEAR, magFilter = gl.LINEAR, clamp = false) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullScreenUtils = void 0;
class FullScreenUtils {

@@ -4,0 +5,0 @@ /** Enters fullscreen. */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Point3D.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Spline = void 0;
class Spline {

@@ -4,0 +5,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Spline3D = void 0;
const Spline_1 = require("./Spline");

@@ -4,0 +5,0 @@ class Spline3D {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiffuseShader = exports.CombinedAnimation = exports.TextureUtils = exports.FrameBuffer = exports.BaseRenderer = exports.BaseShader = exports.FullModel = exports.UncompressedTextureLoader = exports.CompressedTextureLoader = exports.BinaryDataLoader = exports.FullScreenUtils = void 0;
var FullScreenUtils_1 = require("./utils/FullScreenUtils");
exports.FullScreenUtils = FullScreenUtils_1.FullScreenUtils;
Object.defineProperty(exports, "FullScreenUtils", { enumerable: true, get: function () { return FullScreenUtils_1.FullScreenUtils; } });
var BinaryDataLoader_1 = require("./BinaryDataLoader");
exports.BinaryDataLoader = BinaryDataLoader_1.BinaryDataLoader;
Object.defineProperty(exports, "BinaryDataLoader", { enumerable: true, get: function () { return BinaryDataLoader_1.BinaryDataLoader; } });
var CompressedTextureLoader_1 = require("./CompressedTextureLoader");
exports.CompressedTextureLoader = CompressedTextureLoader_1.CompressedTextureLoader;
Object.defineProperty(exports, "CompressedTextureLoader", { enumerable: true, get: function () { return CompressedTextureLoader_1.CompressedTextureLoader; } });
var UncompressedTextureLoader_1 = require("./UncompressedTextureLoader");
exports.UncompressedTextureLoader = UncompressedTextureLoader_1.UncompressedTextureLoader;
Object.defineProperty(exports, "UncompressedTextureLoader", { enumerable: true, get: function () { return UncompressedTextureLoader_1.UncompressedTextureLoader; } });
var FullModel_1 = require("./FullModel");
exports.FullModel = FullModel_1.FullModel;
Object.defineProperty(exports, "FullModel", { enumerable: true, get: function () { return FullModel_1.FullModel; } });
var BaseShader_1 = require("./BaseShader");
exports.BaseShader = BaseShader_1.BaseShader;
Object.defineProperty(exports, "BaseShader", { enumerable: true, get: function () { return BaseShader_1.BaseShader; } });
var BaseRenderer_1 = require("./BaseRenderer");
exports.BaseRenderer = BaseRenderer_1.BaseRenderer;
Object.defineProperty(exports, "BaseRenderer", { enumerable: true, get: function () { return BaseRenderer_1.BaseRenderer; } });
var FrameBuffer_1 = require("./FrameBuffer");
exports.FrameBuffer = FrameBuffer_1.FrameBuffer;
Object.defineProperty(exports, "FrameBuffer", { enumerable: true, get: function () { return FrameBuffer_1.FrameBuffer; } });
var TextureUtils_1 = require("./TextureUtils");
exports.TextureUtils = TextureUtils_1.TextureUtils;
Object.defineProperty(exports, "TextureUtils", { enumerable: true, get: function () { return TextureUtils_1.TextureUtils; } });
var CombinedAnimation_1 = require("./CombinedAnimation");
exports.CombinedAnimation = CombinedAnimation_1.CombinedAnimation;
Object.defineProperty(exports, "CombinedAnimation", { enumerable: true, get: function () { return CombinedAnimation_1.CombinedAnimation; } });
var DiffuseShader_1 = require("./shaders/DiffuseShader");
exports.DiffuseShader = DiffuseShader_1.DiffuseShader;
Object.defineProperty(exports, "DiffuseShader", { enumerable: true, get: function () { return DiffuseShader_1.DiffuseShader; } });
//# sourceMappingURL=webgl-framework.js.map

@@ -0,0 +0,0 @@ import { mat4 } from "gl-matrix";

@@ -0,0 +0,0 @@ export declare abstract class BaseShader {

export declare class BinaryDataLoader {
static load(url: string): Promise<ArrayBuffer>;
}

@@ -0,0 +0,0 @@ export declare class CombinedAnimation {

@@ -0,0 +0,0 @@ export declare class CompressedTextureLoader {

import { FullModel } from "./FullModel";
import { RendererWithExposedMethods } from "./RendererWithExposedMethods";
/**
* Descriptor of a vertex attribute.
*/
export type AttributeDescriptor = [size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr];
export interface DrawableShader {

@@ -18,4 +22,5 @@ /**

* @param sz Scale z
* @param attribs Vertex data attribute bindings. Key - attribute id, value - descriptor params.
*/
drawModel(renderer: RendererWithExposedMethods, model: FullModel, tx: number, ty: number, tz: number, rx: number, ry: number, rz: number, sx: number, sy: number, sz: number): void;
drawModel(renderer: RendererWithExposedMethods, model: FullModel, tx: number, ty: number, tz: number, rx: number, ry: number, rz: number, sx: number, sy: number, sz: number, attribs?: Map<number, AttributeDescriptor>): void;
}

@@ -0,0 +0,0 @@ export declare class FrameBuffer {

@@ -0,0 +0,0 @@ export declare class FullModel {

@@ -0,0 +0,0 @@ import { mat4 } from "gl-matrix";

import { BaseShader } from "../BaseShader";
import { DrawableShader } from "../DrawableShader";
import { AttributeDescriptor, DrawableShader } from "../DrawableShader";
import { RendererWithExposedMethods } from "../RendererWithExposedMethods";
import { FullModel } from "../FullModel";
/**
* Simple shader using one texture.
*/
export declare class DiffuseShader extends BaseShader implements DrawableShader {

@@ -15,3 +18,3 @@ view_proj_matrix: WebGLUniformLocation | undefined;

/** @inheritdoc */
drawModel(renderer: RendererWithExposedMethods, model: FullModel, tx: number, ty: number, tz: number, rx: number, ry: number, rz: number, sx: number, sy: number, sz: number): void;
drawModel(renderer: RendererWithExposedMethods, model: FullModel, tx: number, ty: number, tz: number, rx: number, ry: number, rz: number, sx: number, sy: number, sz: number, attribs?: Map<number, AttributeDescriptor>): void;
}

@@ -0,0 +0,0 @@ /** Utilities to create various textures. */

export declare class UncompressedTextureLoader {
static load(url: string, gl: WebGLRenderingContext, minFilter?: number, magFilter?: number, clamp?: boolean): Promise<WebGLTexture>;
static load(url: string, gl: WebGLRenderingContext, minFilter?: 9729, magFilter?: 9729, clamp?: boolean): Promise<WebGLTexture>;
static loadCubemap(url: string, gl: WebGL2RenderingContext, extension?: string): Promise<WebGLTexture>;
}

@@ -0,0 +0,0 @@ export declare class FullScreenUtils {

@@ -0,0 +0,0 @@ export interface Point3D {

@@ -0,0 +0,0 @@ export declare class Spline {

@@ -0,0 +0,0 @@ import { Point3D } from "./Point3D";

@@ -0,0 +0,0 @@ export { FullScreenUtils } from "./utils/FullScreenUtils";

@@ -1708,8 +1708,2 @@ class FullScreenUtils {

class CombinedAnimation {
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
getStart() {

@@ -1727,2 +1721,8 @@ return this.start;

}
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
clamp(i, low, high) {

@@ -1741,2 +1741,5 @@ return Math.max(Math.min(i, high), low);

/**
* Simple shader using one texture.
*/
class DiffuseShader extends BaseShader {

@@ -1770,3 +1773,3 @@ /** @inheritdoc */

/** @inheritdoc */
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz) {
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz, attribs) {
if (this.rm_Vertex === undefined || this.rm_TexCoord0 === undefined || this.view_proj_matrix === undefined) {

@@ -1779,4 +1782,11 @@ return;

gl.enableVertexAttribArray(this.rm_TexCoord0);
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
if (attribs) {
for (const [key, value] of attribs) {
gl.vertexAttribPointer(key, ...value);
}
}
else {
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
}
renderer.calculateMVPMatrix(tx, ty, tz, rx, ry, rz, sx, sy, sz);

@@ -1783,0 +1793,0 @@ gl.uniformMatrix4fv(this.view_proj_matrix, false, renderer.getMVPMatrix());

@@ -1714,8 +1714,2 @@ (function (global, factory) {

class CombinedAnimation {
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
getStart() {

@@ -1733,2 +1727,8 @@ return this.start;

}
constructor(frames) {
this.frames = frames;
this.start = 0;
this.end = 0;
this.currentCoeff = 0;
}
clamp(i, low, high) {

@@ -1747,2 +1747,5 @@ return Math.max(Math.min(i, high), low);

/**
* Simple shader using one texture.
*/
class DiffuseShader extends BaseShader {

@@ -1776,3 +1779,3 @@ /** @inheritdoc */

/** @inheritdoc */
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz) {
drawModel(renderer, model, tx, ty, tz, rx, ry, rz, sx, sy, sz, attribs) {
if (this.rm_Vertex === undefined || this.rm_TexCoord0 === undefined || this.view_proj_matrix === undefined) {

@@ -1785,4 +1788,11 @@ return;

gl.enableVertexAttribArray(this.rm_TexCoord0);
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
if (attribs) {
for (const [key, value] of attribs) {
gl.vertexAttribPointer(key, ...value);
}
}
else {
gl.vertexAttribPointer(this.rm_Vertex, 3, gl.FLOAT, false, 4 * (3 + 2), 0);
gl.vertexAttribPointer(this.rm_TexCoord0, 2, gl.FLOAT, false, 4 * (3 + 2), 4 * 3);
}
renderer.calculateMVPMatrix(tx, ty, tz, rx, ry, rz, sx, sy, sz);

@@ -1789,0 +1799,0 @@ gl.uniformMatrix4fv(this.view_proj_matrix, false, renderer.getMVPMatrix());

{
"name": "webgl-framework",
"version": "2.1.8",
"version": "2.2.0",
"description": "Basic low-level WebGL framework",

@@ -114,4 +114,4 @@ "author": "Oleksandr Popov (github.com/keaukraine/)",

"typedoc": "^0.12.0",
"typescript": "^3.7.5"
"typescript": "^5.1.6"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc