ywywdh / papervision3d

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

ColorMaterial.clone() doesn't work #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a ColorMaterial
2. Create any primitive ( e.g. sphere) using a clone of the material as the
primitive's material.
3. Add the primitive to a scene.

What is the expected output? What do you see instead?
Expect to see the primitive in the scene. Instead see nothing.

What version of the product are you using? On what operating system?
Version 2 beta (latest from SVN on 8 Sept)

Please provide any additional information below.
Because the clone method isn't implemented in the ColorMaterial class, it
uses the clone method implementation in the MaterialObject3D base class.
This creates a MaterialObject3D instance with all the properties of the
original ColorMaterial, but because it's not a ColorMaterial it doesn't
have the correct drawTriangle method.

The solution is to add the following method to the ColorMaterial class

override public function clone():MaterialObject3D
{
    var cloned:MaterialObject3D = new ColorMaterial();
    cloned.copy(this);
    return cloned;
}

Original issue reported on code.google.com by bigroom....@googlemail.com on 8 Sep 2008 at 2:41

GoogleCodeExporter commented 9 years ago
Thank you for reporting. Fixed.

Original comment by r.hauw...@gmail.com on 17 Nov 2008 at 12:25