Comparing version 1.0.7 to 1.1.0
24
mesh.js
'use strict' | ||
var DEFAULT_VERTEX_NORMALS_EPSILON = 1e-6; // may be too large if triangles are very small | ||
var DEFAULT_FACE_NORMALS_EPSILON = 1e-6; | ||
var createShader = require('gl-shader') | ||
@@ -238,2 +241,17 @@ var createBuffer = require('gl-buffer') | ||
} | ||
if('ambient' in params) { | ||
this.ambientLight = params.ambient | ||
} | ||
if('diffuse' in params) { | ||
this.diffuseLight = params.diffuse | ||
} | ||
if('specular' in params) { | ||
this.specularLight = params.specular | ||
} | ||
if('roughness' in params) { | ||
this.roughness = params.roughness | ||
} | ||
if('fresnel' in params) { | ||
this.fresnel = params.fresnel | ||
} | ||
@@ -282,7 +300,9 @@ if(params.texture) { | ||
var cellNormals = params.cellNormals | ||
var vertexNormalsEpsilon = params.vertexNormalsEpsilon === void(0) ? DEFAULT_VERTEX_NORMALS_EPSILON : params.vertexNormalsEpsilon | ||
var faceNormalsEpsilon = params.faceNormalsEpsilon === void(0) ? DEFAULT_FACE_NORMALS_EPSILON : params.faceNormalsEpsilon | ||
if(params.useFacetNormals && !cellNormals) { | ||
cellNormals = normals.faceNormals(cells, positions) | ||
cellNormals = normals.faceNormals(cells, positions, faceNormalsEpsilon) | ||
} | ||
if(!cellNormals && !vertexNormals) { | ||
vertexNormals = normals.vertexNormals(cells, positions) | ||
vertexNormals = normals.vertexNormals(cells, positions, vertexNormalsEpsilon) | ||
} | ||
@@ -289,0 +309,0 @@ |
{ | ||
"name": "gl-mesh3d", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "3D mesh drawing", | ||
@@ -20,3 +20,3 @@ "main": "mesh.js", | ||
"ndarray": "^1.0.15", | ||
"normals": "^1.0.0", | ||
"normals": "^1.0.1", | ||
"polytope-closest-point": "^1.0.0", | ||
@@ -23,0 +23,0 @@ "simplicial-complex-contour": "^1.0.0", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
50584
1414
0
Updatednormals@^1.0.1