VedanshG / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

CompositeMaterial removeMaterial removes other materials #198

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
If you use the code

material = new CompositeMaterial();
material.addMaterial(bitmap1);
material.addMaterial(bitmap2);
material.addMaterial(bitmap3);
...
private function mouseClickHandler(e:InteractiveScene3DEvent):void 
{
material.removeMaterial(bitmap3);
}

What is the expected output? What do you see instead?

bitmap3 is removed, click agian bitmap2, again bitmap1.

If you change removeMaterial function to

public function removeMaterial(material:MaterialObject3D):void
{
  if ( materials.indexOf(material) > -1 )
  {
    materials.splice(materials.indexOf(material), 1);
  }
}

works as expected only bitmap3 is removed other clicks are ignored.

What version of the product are you using? On what operating system?
r915 XP

Please provide any additional information below.

Original issue reported on code.google.com by jbp...@googlemail.com on 11 Jun 2009 at 11:14