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

gbo-reader

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gbo-reader - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

test/flag.gbo

35

lib/convert-obj-to-gbo.js

@@ -23,2 +23,3 @@ var fs = require('fs');

//size = 28

@@ -41,2 +42,3 @@

{
var buffer = stream.buffer;

@@ -83,15 +85,26 @@ var index = stream.index;

for(var i = 0; i < data.length; i+=2){
for(var i = 0; i < data.length; i++){
//write the float in Little-Endian and move the offset
var u = data[i];
u *= 65535;
buffer.writeUInt16LE(u|0 , index);
index+=2
var val = data[i];
// val %= 1;
var v = data[i+1];
v *= 65535;
buffer.writeUInt16LE(v|0 , index);
if(val < 0)
{
console.log('hang on uvs are smaller than 0')
val = 0;
}
else if(val > 1)
{
console.log('hang on uvs are bigger than 1')
val = 1;
}
val *= 65535;
buffer.writeUInt16LE(val|0 , index);
index+=2
}
stream.index = index;

@@ -144,2 +157,8 @@ }

wstream.end();
var inputFile = fs.statSync(objSource, 'utf8')
var percent = ((buffer.length/inputFile.size) * 100) | 0;
console.log('conversion of ' + objSource + ' complete! \ngbo is ' + percent + '% smaller! Highfive!')
}

@@ -146,0 +165,0 @@

@@ -24,11 +24,10 @@ // ObjLoader.js

var z = verts[i+2];
if(x < minX)minX = x;
else if(x > maxX)maxX = x;
if(x > maxX)maxX = x;
if(y < minY)minY = y;
else if(y > maxY)maxY = y;
if(y > maxY)maxY = y;
if(z < minZ)minZ = z;
else if(z > maxZ)maxZ = z;
if(z > maxZ)maxZ = z;

@@ -35,0 +34,0 @@ };

@@ -330,4 +330,4 @@ // ObjLoader.js

console.log(indices.length);
console.log("FOUND ONE!" + line)
// console.log(indices.length);
//console.log("FOUND ONE!" + line)
}

@@ -334,0 +334,0 @@ }

{
"name": "gbo-reader",
"version": "1.0.4",
"version": "1.0.5",
"description": "A reader for goodboys gbo file format.",

@@ -19,3 +19,6 @@ "main": "index.js",

"qunit-assert-close": "^2.1.2"
},
"dependencies": {
"chai": "^4.1.2"
}
}

@@ -44,2 +44,15 @@ var fs = require('fs');

it('should measure bounds correctly if first bounds is the highest', function()
{
var positions = [0.025969, -0.5, 0.000000,
-2.803509, -1.427681, 0.000000,
0.025969, -1.427681, 0.000000,
0.025969, -2.373654, 0.000000]
var bounds = getBounds(positions);
assert.equal(bounds.minY, -2.373654);
assert.equal(bounds.maxY, -0.5);
}),
it('pack format correctly', function()

@@ -78,7 +91,2 @@ {

it('from obj to gbo', function()
{
});
it('from obj to gbo', function()
{

@@ -85,0 +93,0 @@ convertObjToGBO(objFile, gboFile);

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