three-to-cannon
Advanced tools
Comparing version 1.1.2 to 1.2.0
18
index.js
@@ -19,3 +19,3 @@ var CANNON = require('cannon'), | ||
*/ | ||
module.exports = CANNON.mesh2shape = function (object, options) { | ||
var mesh2shape = function (object, options) { | ||
options = options || {}; | ||
@@ -70,4 +70,6 @@ | ||
CANNON.mesh2shape.Type = Type; | ||
mesh2shape.Type = Type; | ||
module.exports = CANNON.mesh2shape = mesh2shape; | ||
/****************************************************************************** | ||
@@ -309,3 +311,4 @@ * Shape construction | ||
if (meshes[0].geometry.isBufferGeometry) { | ||
if (meshes[0].geometry.attributes.position) { | ||
if (meshes[0].geometry.attributes.position | ||
&& meshes[0].geometry.attributes.position.itemSize > 2) { | ||
tmp.fromBufferGeometry(meshes[0].geometry); | ||
@@ -326,4 +329,9 @@ } | ||
if (mesh.geometry.isBufferGeometry) { | ||
tmp.fromBufferGeometry(mesh.geometry); | ||
combined.merge(tmp, mesh.matrixWorld); | ||
if (mesh.geometry.attributes.position | ||
&& mesh.geometry.attributes.position.itemSize > 2) { | ||
var tmpGeom = new THREE.Geometry(); | ||
tmpGeom.fromBufferGeometry(mesh.geometry); | ||
combined.merge(tmpGeom, mesh.matrixWorld); | ||
tmpGeom.dispose(); | ||
} | ||
} else { | ||
@@ -330,0 +338,0 @@ combined.merge(mesh.geometry, mesh.matrixWorld); |
{ | ||
"name": "three-to-cannon", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Convert a THREE.Mesh to a CANNON.Shape.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "node test/index.js", | ||
"preversion": "npm run test", | ||
"postversion": "git push && git push --tags && npm publish" | ||
@@ -30,3 +31,7 @@ }, | ||
"cannon": "github:donmccurdy/cannon.js#v0.6.2-dev1" | ||
}, | ||
"devDependencies": { | ||
"cannon": "github:donmccurdy/cannon.js#v0.6.2-dev1", | ||
"three": "^0.89.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
25466
5
664
0
2