New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ogl

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ogl - npm Package Compare versions

Comparing version 0.0.106 to 0.0.107

2

package.json
{
"name": "ogl",
"version": "0.0.106",
"version": "0.0.107",
"description": "WebGL Library",

@@ -5,0 +5,0 @@ "exports": "./src/index.mjs",

@@ -216,3 +216,5 @@ // attribute params

const array = attr.data;
const stride = attr.stride ? attr.stride / array.BYTES_PER_ELEMENT : attr.size;
// Data loaded shouldn't haave stride, only buffers
// const stride = attr.stride ? attr.stride / array.BYTES_PER_ELEMENT : attr.size;
const stride = attr.size;

@@ -259,3 +261,5 @@ if (!this.bounds) {

const array = attr.data;
const stride = attr.stride ? attr.stride / array.BYTES_PER_ELEMENT : attr.size;
// Data loaded shouldn't haave stride, only buffers
// const stride = attr.stride ? attr.stride / array.BYTES_PER_ELEMENT : attr.size;
const stride = attr.size;

@@ -262,0 +266,0 @@ if (!this.bounds) this.computeBoundingBox(attr);

@@ -623,13 +623,32 @@ import { Geometry } from '../core/Geometry.js';

const TypeArray = TYPE_ARRAY[componentType];
const elementBytes = data.BYTES_PER_ELEMENT;
const elementBytes = TypeArray.BYTES_PER_ELEMENT;
const componentStride = byteStride / elementBytes;
const isInterleaved = !!byteStride && componentStride !== size;
// TODO: interleaved
// Convert data to typed array for various uses (bounding boxes, animation etc)
const newData = isInterleaved ? new TypeArray(data) : new TypeArray(data, byteOffset, count * size);
let filteredData;
// Convert data to typed array for various uses (bounding boxes, raycasting, animation, merging etc)
if (isInterleaved) {
// First convert entire buffer to type
const typedData = new TypeArray(data, byteOffset);
// TODO: add length to not copy entire buffer if can help it
// const typedData = new TypeArray(data, byteOffset, (count - 1) * componentStride)
// Create output with length
filteredData = new TypeArray(count * size);
// Add element by element
for (let i = 0; i < count; i++) {
const start = componentStride * i;
const end = start + size;
filteredData.set(typedData.slice(start, end), i * size);
}
} else {
// Simply a slice
filteredData = new TypeArray(data, byteOffset, count * size);
}
// Return attribute data
return {
data: newData,
data: filteredData,
size,

@@ -636,0 +655,0 @@ type: componentType,

@@ -172,3 +172,5 @@ // TODO: barycentric code shouldn't be here, but where?

const end = Math.min(index ? index.count : position.count, geometry.drawRange.start + geometry.drawRange.count);
const stride = position.stride ? position.stride / position.data.BYTES_PER_ELEMENT : position.size;
// Data loaded shouldn't haave stride, only buffers
// const stride = position.stride ? position.stride / position.data.BYTES_PER_ELEMENT : position.size;
const stride = position.size;

@@ -175,0 +177,0 @@ for (let j = start; j < end; j += 3) {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc