Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Test = { isThread: true };
- Test.Checker = function() {
- this.bufferMaterial = undefined;
- };
- Test.Checker.prototype.checkTextures = function( scene ) {
- if ( scene !== undefined && scene !== null) {
- scene.children.filter(function( item ) {
- if ( item instanceof THREE.Mesh ) {
- this.bufferMaterial = item.material;
- }
- });
- }
- };
- Test.Checker.prototype.changeTexture = function() {
- if ( this.bufferMaterial !== undefined ) {
- this.bufferMaterial = new THREE.MeshBasicMaterial({
- map: THREE.ImageUtils.loadTexture( '/images/textures/box2.jpg' )
- });
- }
- else return -1;
- };
- onmessage = function( sender ) {
- var objectTest = new Test.Checker();
- objectTest.checkTextures( sender.data );
- if ( this.bufferMaterial !== undefined ) this.changeTexture();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement