Fix geometry type check

#21
This commit is contained in:
casperlamboo 2017-07-17 15:22:13 +02:00
parent 16d2468ced
commit 87f7f2f906

View File

@ -11,9 +11,9 @@ export default class {
return this;
}
setGeometry(geometry, matrix) {
if (geometry.type === 'BufferGeometry') {
if (geometry.isBufferGeometry) {
geometry = new THREE.Geometry().fromBufferGeometry(geometry);
} else if (geometry.type === 'Geometry') {
} else if (geometry.isGeometry) {
geometry = geometry.clone();
} else {
throw new Error('Geometry is not an instance of BufferGeometry or Geometry');