From c9b5516ca8664786d85a6c3f48bb831476050c6e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 9 Feb 2008 05:18:52 +0000 Subject: * Adds Top Shear support to the Meshmerizer for the Cube prim and the Cylinder prim. --- OpenSim/Region/Physics/Meshing/Extruder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/Physics/Meshing/Extruder.cs') diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index 5886c9e..086261b 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs @@ -40,6 +40,8 @@ namespace OpenSim.Region.Physics.Meshing public float taperTopFactorY = 1f; public float taperBotFactorX = 1f; public float taperBotFactorY = 1f; + public float pushX = 0f; + public float pushY = 0f; public Mesh Extrude(Mesh m) { @@ -54,10 +56,17 @@ namespace OpenSim.Region.Physics.Meshing if (v == null) continue; + // This is the top + // Set the Z + .5 to match the rest of the scale of the mesh + // Scale it by Size, and Taper the scaling v.Z = +.5f; v.X *= (size.X * taperTopFactorX); v.Y *= (size.Y * taperTopFactorY); v.Z *= size.Z; + + //Push the top of the object over by the Top Shear amount + v.X += pushX * size.X; + v.Y += pushY * size.X; } foreach (Vertex v in workingMinus.vertices) @@ -65,6 +74,7 @@ namespace OpenSim.Region.Physics.Meshing if (v == null) continue; + // This is the bottom v.Z = -.5f; v.X *= (size.X * taperBotFactorX); v.Y *= (size.Y * taperBotFactorY); -- cgit v1.1