* Applying Dahlia's Triangular hole in a cube peg patch. Fixes the hollow orientation in a cube in the meshmerizer. Thanks Dahlia!

* See mantis 0001203 for more details!
0.6.0-stable
Teravus Ovares 2008-05-09 02:00:55 +00:00
parent 7e275bfa37
commit 6bb4ab0563
2 changed files with 22 additions and 3 deletions

View File

@ -55,6 +55,7 @@ Patches
* John R Sohn(XenReborn)
* Xantor
* YZh
* Dahlia
LSL Devs

View File

@ -331,11 +331,29 @@ namespace OpenSim.Region.Physics.Meshing
if (hshape == HollowShape.Triangle)
{
float hollowFactorF = (float)fhollowFactor / (float)50000;
Vertex IMM = new Vertex(-0.25f * hollowFactorF, -0.45f * hollowFactorF, 0.0f);
Vertex IPM = new Vertex(+0.5f * hollowFactorF, +0f * hollowFactorF, 0.0f);
Vertex IPP = new Vertex(-0.25f * hollowFactorF, +0.45f * hollowFactorF, 0.0f);
Vertex IMM;
Vertex IPM;
Vertex IPP;
if (pshape == ProfileShape.Square)
{
// corner points are at 345, 105, and 225 degrees for the triangle within a box
//IMM = new Vertex(((float)Math.Cos(345.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, ((float)Math.Sin(345.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, 0.0f);
//IPM = new Vertex(((float)Math.Cos(105.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, ((float)Math.Sin(105.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, 0.0f);
//IPP = new Vertex(((float)Math.Cos(225.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, ((float)Math.Sin(225.0 * DEG_TO_RAD) * 0.5f) * hollowFactorF, 0.0f);
// hard coded here for speed, the equations are in the commented out lines above
IMM = new Vertex(0.48296f * hollowFactorF, -0.12941f * hollowFactorF, 0.0f);
IPM = new Vertex(-0.12941f * hollowFactorF, 0.48296f * hollowFactorF, 0.0f);
IPP = new Vertex(-0.35355f * hollowFactorF, -0.35355f * hollowFactorF, 0.0f);
}
else
{
IMM = new Vertex(-0.25f * hollowFactorF, -0.45f * hollowFactorF, 0.0f);
IPM = new Vertex(+0.5f * hollowFactorF, +0f * hollowFactorF, 0.0f);
IPP = new Vertex(-0.25f * hollowFactorF, +0.45f * hollowFactorF, 0.0f);
}
holeHull = new SimpleHull();