Skip to content

Instantly share code, notes, and snippets.

@nickjanssen
Created August 1, 2015 20:46
Show Gist options
  • Save nickjanssen/50b7c7ef0d069bc72b3f to your computer and use it in GitHub Desktop.
Save nickjanssen/50b7c7ef0d069bc72b3f to your computer and use it in GitHub Desktop.
switch (data.userData.type) {
case 'BoxCollider':
entity.parent.addComponent($components.get('rigidBody', {
shape: {
type: 'box',
width: data.userData.size[0],
height: data.userData.size[1],
depth: data.userData.size[2]
},
offset: (new THREE.Vector3()).fromArray(data.userData.center),
mass: 0,
group: 'level',
collidesWith: ['all']
}));
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment