add x-axis mirror capability to sculpted prim mesh - addresses Mantis #3342
parent
152b02c832
commit
ad012d4b46
|
@ -202,7 +202,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PrimMesher.SculptMesh.SculptType sculptType;
|
PrimMesher.SculptMesh.SculptType sculptType;
|
||||||
switch ((OpenMetaverse.SculptType)primShape.SculptType)
|
switch ((OpenMetaverse.SculptType)primShape.SculptType)
|
||||||
{
|
{
|
||||||
|
@ -220,7 +219,11 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
sculptType = PrimMesher.SculptMesh.SculptType.sphere;
|
sculptType = PrimMesher.SculptMesh.SculptType.sphere;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false);
|
|
||||||
|
bool mirror = ((primShape.SculptType & 128) != 0);
|
||||||
|
bool invert = ((primShape.SculptType & 64) != 0);
|
||||||
|
|
||||||
|
sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false, mirror, invert);
|
||||||
|
|
||||||
idata.Dispose();
|
idata.Dispose();
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,16 @@ namespace PrimMesher
|
||||||
}
|
}
|
||||||
|
|
||||||
public SculptMesh(Bitmap sculptBitmap, SculptType sculptType, int lod, bool viewerMode)
|
public SculptMesh(Bitmap sculptBitmap, SculptType sculptType, int lod, bool viewerMode)
|
||||||
|
{
|
||||||
|
_SculptMesh(sculptBitmap, sculptType, lod, viewerMode, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SculptMesh(Bitmap sculptBitmap, SculptType sculptType, int lod, bool viewerMode, bool mirror, bool invert)
|
||||||
|
{
|
||||||
|
_SculptMesh(sculptBitmap, sculptType, lod, viewerMode, mirror, invert);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _SculptMesh(Bitmap sculptBitmap, SculptType sculptType, int lod, bool viewerMode, bool mirror, bool invert)
|
||||||
{
|
{
|
||||||
coords = new List<Coord>();
|
coords = new List<Coord>();
|
||||||
faces = new List<Face>();
|
faces = new List<Face>();
|
||||||
|
@ -310,6 +320,7 @@ namespace PrimMesher
|
||||||
color = bitmap.GetPixel(imageX == width ? 0 : imageX, imageY == height ? height - 1 : imageY);
|
color = bitmap.GetPixel(imageX == width ? 0 : imageX, imageY == height ? height - 1 : imageY);
|
||||||
|
|
||||||
x = (color.R - 128) * pixScale;
|
x = (color.R - 128) * pixScale;
|
||||||
|
if (mirror) x = -x;
|
||||||
y = (color.G - 128) * pixScale;
|
y = (color.G - 128) * pixScale;
|
||||||
z = (color.B - 128) * pixScale;
|
z = (color.B - 128) * pixScale;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue