From 29ab39f14f69822bd0df0b263b03bec69c376e39 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Apr 2017 13:05:20 +0100 Subject: [PATCH] cosmetics on mesh upload encoding of number of faces on pbs shape. Use opensim shape enums in place of libovm for coerence, add a few coments. --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 59 +++++++++++-------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 46932b1b6a..4a5a8e77b6 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1011,36 +1011,49 @@ namespace OpenSim.Region.ClientStack.Linden int nfaces = face_list.Count; switch(nfaces) { - case 1: - case 2: - pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle; - pbs.PathCurve = (byte)PathCurve.Circle; - if(nfaces == 2) - pbs.ProfileHollow = 1; + case 0: // low oops case + case 1: // torus + pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Curve1; break; - case 3: - case 4: - pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle; - pbs.PathCurve = (byte)PathCurve.Line; - if(nfaces == 4) - pbs.ProfileHollow = 1; + case 2: // torus with hollow (a sl viewer whould see 4 faces on a hollow sphere) + pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Curve1; + pbs.ProfileHollow = 1; break; - case 5: - pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle | (byte)HollowShape.Triangle; - pbs.PathCurve = (byte)PathCurve.Line; + case 3: // cylinder + pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Straight; break; - default: - // hack to flag that pbs does represent number of faces - //meshs where never uploaded with this + case 4: // cylinder with hollow + pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Straight; + pbs.ProfileHollow = 1; + break; + + case 5: // prism + pbs.ProfileCurve = (byte)ProfileShape.EquilateralTriangle | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Straight; + break; + + case 6: // box + pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Straight; + break; + + case 7: // box with hollow + pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle; + pbs.PathCurve = (byte)Extrusion.Straight; + pbs.ProfileHollow = 1; + break; + + default: // 8 faces box with cut pbs.ProfileCurve = (byte)ProfileCurve.Square | (byte)HollowShape.Triangle; - pbs.PathCurve = (byte)PathCurve.Line; - if(nfaces == 7) - pbs.ProfileHollow = 1; - else if(nfaces == 8) - pbs.ProfileBegin = 1; + pbs.PathCurve = (byte)Extrusion.Straight; + pbs.ProfileBegin = 1; break; }