I'll look at it asap.
Fabrice
On Aug 27, 2009, at 6:03 PM, MP wrote:
Hi!
I'm trying to utilize the Mirror class with the duplicate option set
to false, but i'm constantly getting a runtime error (null object).
Looking at the code i belive that Mirror class has a bug ...
In Mirror.as there is a code block:
------------------------------------------------------------
if (!duplicate) {
uva = face.uv0;
uvb = face.uv1;
uvc = face.uv2;
uv0 = new UV(uva.u, uva.v);
uv1 = new UV(uvb.u, uvb.v);
uv2 = new UV(uvc.u, uvc.v);
face.v0 = face.v1 = face.v2 = null;
face.uv0 = face.uv1 = face.uv2 = null;
}
------------------------------------------------------------
Setting face.v2 = null leads to the method addVertexAt() in Face.as
in which we set _v2 = faceVO.v2 = vertex (vertex being null !)
and in the next step we get to:
------------------------------------------------------------
if(index == 2)
{
if(-0.5*(_v0.x*(_v2.y - _v1.y) + _v1.x*(_v0.y - _v2.y) + _v2.x*(_v1.y
- _v0.y)) < 0)
faceVO.reverseArea = true;
}
------------------------------------------------------------
Since _v2 was set to null in the previous step, _v2.y always generates
an error for accessing properties of a null object.
Has anybody successfully applied Mirror with duplicate set to false??
If i use the Mirror class with duplicate = true, everything works
fine, but the result is not what i wanted.