| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 * itself will be released from the client. See documentation on | 66 * itself will be released from the client. See documentation on |
| 67 * pack.removeObject for why this is important. | 67 * pack.removeObject for why this is important. |
| 68 * | 68 * |
| 69 * It's important to note that many objects are only referenced by the pack. | 69 * It's important to note that many objects are only referenced by the pack. |
| 70 * Textures, Effects, Materials, for example. That means the moment you call | 70 * Textures, Effects, Materials, for example. That means the moment you call |
| 71 * pack.destroy() those objects will be freed. If the client then tries to | 71 * pack.destroy() those objects will be freed. If the client then tries to |
| 72 * render and some objects are missing you'll immediately get an error. | 72 * render and some objects are missing you'll immediately get an error. |
| 73 */ | 73 */ |
| 74 o3d.Pack.prototype.destroy = function() { | 74 o3d.Pack.prototype.destroy = function() { |
| 75 this.objects_ = []; | 75 this.objects_ = []; |
| 76 this.client.removePack(this); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 | 79 |
| 79 | 80 |
| 80 /** | 81 /** |
| 81 * Removes a pack's reference to an object. Any object created from | 82 * Removes a pack's reference to an object. Any object created from |
| 82 * pack.create___ function can be removed. This releases the pack's reference | 83 * pack.create___ function can be removed. This releases the pack's reference |
| 83 * to that object so if nothing else is referencing that object it will be | 84 * to that object so if nothing else is referencing that object it will be |
| 84 * deleted. | 85 * deleted. |
| 85 * | 86 * |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 /** | 424 /** |
| 424 * Create RawData given a data URL. | 425 * Create RawData given a data URL. |
| 425 * @param {string} data_url The data URL from which to create the RawData. | 426 * @param {string} data_url The data URL from which to create the RawData. |
| 426 * @return {!o3d.RawData} The RawData. | 427 * @return {!o3d.RawData} The RawData. |
| 427 */ | 428 */ |
| 428 o3d.Pack.prototype.createRawDataFromDataURL = | 429 o3d.Pack.prototype.createRawDataFromDataURL = |
| 429 function(data_url) { | 430 function(data_url) { |
| 430 o3d.notImplemented(); | 431 o3d.notImplemented(); |
| 431 }; | 432 }; |
| 432 | 433 |
| OLD | NEW |