True, I really don't like making modifications to the away3d classes,
especially when I may not be the next developer on the project.

I was wondering if there was a nice simple (direct) way I was missing of
doing it, instead of having to modify the away3d classes or to create a
classes to handle any materials I use because the name and/or the side is
not available.

I would recommend adding "side" or "name" or something that is public string
so we could access it via the mouse event 3D though, saves time and is very
simple. But perhaps it goes against the grain of good policy / framework /
structure of away3d.

D


On 13 June 2010 14:54, elguapoloco <[email protected]>wrote:

> Hi,
>
> Have you looked into extending the BitmapMaterial class? Just create a
> custom class that extends BitmapMaterial and add a public variable to
> it that holds it's assigned side:
>
> ...
> myCustomBitmapMaterial:MyCustomBitmapMaterialClass = new
> MyCustomBitmapMaterialClass(Cast.bitmap(new hal()));
> myCustomBitmapMaterial.cubeSide = CubeFaces.FRONT;
> ...
>
> Then in your event handler:
>
> private function click(e:MouseEvent3D):void
> {
> trace( (e.material as MyCustomBitmapMaterialClass).cubeSide );
> }
>
> It's usually better to extend a Class first and only if necessary
> modify the API's one.
>
> ath,
>
> Jerome.
>

Reply via email to