added swapMeshes method to swap textures of 2 meshes

This commit is contained in:
logsol 2015-05-06 20:13:13 +02:00
parent 7115292384
commit f1197b3045
3 changed files with 25 additions and 2 deletions

View file

@ -21,7 +21,8 @@ function (Nc, Exception, Layer) {
Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this),
Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this),
Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this)
Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
];
}
@ -163,6 +164,11 @@ function (Nc, Exception, Layer) {
this.delegate.apply(this, arguments);
};
LayerManager.prototype.swapMeshes = function() {
Array.prototype.splice.call(arguments, 0, 0, 'swapMeshes')
this.delegate.apply(this, arguments);
};
LayerManager.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);