Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

webgl-obj-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.5 to 2.0.6

.nyc_output/fe438996-e1f7-40d5-9adc-855542589b0d.json

10

dist/layout.d.ts
export declare enum TYPES {
"BYTE" = 1,
"UNSIGNED_BYTE" = 1,
"SHORT" = 2,
"UNSIGNED_SHORT" = 2,
"FLOAT" = 4
"BYTE" = "BYTE",
"UNSIGNED_BYTE" = "UNSIGNED_BYTE",
"SHORT" = "SHORT",
"UNSIGNED_SHORT" = "UNSIGNED_SHORT",
"FLOAT" = "FLOAT"
}

@@ -8,0 +8,0 @@ export interface AttributeInfo {

@@ -79,3 +79,4 @@ import { Layout } from "./layout";

makeIndexBufferData(): Uint16ArrayWithItemSize;
makeIndexBufferDataForMaterials(...materialIndices: Array<number>): Uint16ArrayWithItemSize;
addMaterialLibrary(mtl: MaterialLibrary): void;
}
{
"name": "webgl-obj-loader",
"version": "2.0.5",
"version": "2.0.6",
"description": "A simple OBJ model loader to help facilitate the learning of WebGL",

@@ -56,4 +56,2 @@ "main": "dist/webgl-obj-loader.min.js",

"chai": "^4.1.2",
"eslint": "^6.6.0",
"eslint-config-google": "^0.14.0",
"mocha": "6.2.2",

@@ -60,0 +58,0 @@ "nyc": "^14.1.1",

export enum TYPES {
"BYTE" = 1,
"UNSIGNED_BYTE" = 1,
"SHORT" = 2,
"UNSIGNED_SHORT" = 2,
"FLOAT" = 4,
"BYTE" = "BYTE",
"UNSIGNED_BYTE" = "UNSIGNED_BYTE",
"SHORT" = "SHORT",
"UNSIGNED_SHORT" = "UNSIGNED_SHORT",
"FLOAT" = "FLOAT",
}

@@ -66,3 +66,17 @@

constructor(public key: string, public size: number, public type: TYPES, public normalized: boolean = false) {
this.sizeOfType = this.type;
switch (type) {
case "BYTE":
case "UNSIGNED_BYTE":
this.sizeOfType = 1;
break;
case "SHORT":
case "UNSIGNED_SHORT":
this.sizeOfType = 2;
break;
case "FLOAT":
this.sizeOfType = 4;
break;
default:
throw new Error(`Unknown gl type: ${type}`);
}
this.sizeInBytes = this.sizeOfType * size;

@@ -69,0 +83,0 @@ }

@@ -270,3 +270,3 @@ import { Layout } from "./layout";

*/
const vertex = elements[j].split("/");
const vertex = triangle[j].split("/");
// it's possible for faces to only specify the vertex

@@ -742,2 +742,11 @@ // and the normal. In this case, vertex will only have

makeIndexBufferDataForMaterials(...materialIndices: Array<number>): Uint16ArrayWithItemSize {
const indices: number[] = new Array<number>().concat(
...materialIndices.map(mtlIdx => this.indicesPerMaterial[mtlIdx]),
);
const buffer: Uint16ArrayWithItemSize = new Uint16Array(indices);
buffer.numItems = indices.length;
return buffer;
}
addMaterialLibrary(mtl: MaterialLibrary) {

@@ -744,0 +753,0 @@ for (const name in mtl.materials) {

@@ -28,6 +28,5 @@ import Mesh from "./mesh";

const mapData = (material as any)[attr] as TextureMapData;
if (!mapData) {
if (!mapData || !mapData.filename) {
continue;
}
const url = root + mapData.filename;

@@ -34,0 +33,0 @@ textures.push(

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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