()
| 6773 | }; |
| 6774 | |
| 6775 | function handle_objects() { |
| 6776 | |
| 6777 | var object; |
| 6778 | |
| 6779 | for( dd in data.objects ) { |
| 6780 | |
| 6781 | if ( !result.objects[ dd ] ) { |
| 6782 | |
| 6783 | o = data.objects[ dd ]; |
| 6784 | |
| 6785 | if ( o.geometry !== undefined ) { |
| 6786 | |
| 6787 | geometry = result.geometries[ o.geometry ]; |
| 6788 | |
| 6789 | // geometry already loaded |
| 6790 | |
| 6791 | if ( geometry ) { |
| 6792 | |
| 6793 | var hasNormals = false; |
| 6794 | |
| 6795 | // not anymore support for multiple materials |
| 6796 | // shouldn't really be array |
| 6797 | |
| 6798 | material = result.materials[ o.materials[ 0 ] ]; |
| 6799 | hasNormals = material instanceof THREE.ShaderMaterial; |
| 6800 | |
| 6801 | if ( hasNormals ) { |
| 6802 | |
| 6803 | geometry.computeTangents(); |
| 6804 | |
| 6805 | } |
| 6806 | |
| 6807 | p = o.position; |
| 6808 | r = o.rotation; |
| 6809 | q = o.quaternion; |
| 6810 | s = o.scale; |
| 6811 | m = o.matrix; |
| 6812 | |
| 6813 | // turn off quaternions, for the moment |
| 6814 | |
| 6815 | q = 0; |
| 6816 | |
| 6817 | if ( o.materials.length == 0 ) { |
| 6818 | |
| 6819 | material = new THREE.MeshFaceMaterial(); |
| 6820 | |
| 6821 | } |
| 6822 | |
| 6823 | // dirty hack to handle meshes with multiple materials |
| 6824 | // just use face materials defined in model |
| 6825 | |
| 6826 | if ( o.materials.length > 1 ) { |
| 6827 | |
| 6828 | material = new THREE.MeshFaceMaterial(); |
| 6829 | |
| 6830 | } |
| 6831 | |
| 6832 | object = new THREE.Mesh( geometry, material ); |
no outgoing calls
no test coverage detected