aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2018-05-27 01:54:05 +0100
committerUbitUmarov2018-05-27 01:54:05 +0100
commit458fe42afda5ac44f1714d9687f114d6d2467f7b (patch)
tree7baad62db99289c1ab079b31885b7b7b4ba79a05
parentfix a bug on warp3d.dll (diff)
downloadopensim-SC-458fe42afda5ac44f1714d9687f114d6d2467f7b.zip
opensim-SC-458fe42afda5ac44f1714d9687f114d6d2467f7b.tar.gz
opensim-SC-458fe42afda5ac44f1714d9687f114d6d2467f7b.tar.bz2
opensim-SC-458fe42afda5ac44f1714d9687f114d6d2467f7b.tar.xz
fix some cases in prim number of sides
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs89
1 files changed, 62 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2177acd..6c035f0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3892,6 +3892,7 @@ namespace OpenSim.Region.Framework.Scenes
3892 public int GetNumberOfSides() 3892 public int GetNumberOfSides()
3893 { 3893 {
3894 int ret = 0; 3894 int ret = 0;
3895 int cut;
3895 3896
3896 if(Shape.SculptEntry) 3897 if(Shape.SculptEntry)
3897 { 3898 {
@@ -3913,24 +3914,42 @@ namespace OpenSim.Region.Framework.Scenes
3913 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // cut case 3914 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // cut case
3914 { 3915 {
3915 // removed sides 3916 // removed sides
3916 int cut = (Shape.ProfileEnd + Shape.ProfileBegin); 3917 if (Shape.ProfileBegin > 0)
3917 if(cut > 50000) // range is 0 to 50000 3918 {
3918 cut = 50000; 3919 cut = Shape.ProfileBegin;
3919 cut /= 12500; // ie 1/4 3920 cut /= 12500;
3920 ret -= cut; 3921 ret -= cut;
3921 ret += 2; // both cut faces 3922 }
3923 if (Shape.ProfileEnd > 0)
3924 {
3925 cut = Shape.ProfileEnd;
3926 cut /= 12500;
3927 ret -= cut;
3928 }
3929 ret += 2;
3922 } 3930 }
3923 break; 3931 break;
3924 case PrimType.PRISM: 3932 case PrimType.PRISM:
3925 ret = 5; 3933 ret = 5;
3926 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // cut case 3934 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // cut case
3927 { 3935 {
3928 // removed faces 3936 // removed sides
3929 int cut = (Shape.ProfileEnd + Shape.ProfileBegin); 3937 if (Shape.ProfileBegin > 0)
3930 if(cut >= 16667 ) // ie 1/3 3938 {
3931 ret--; 3939 cut = (Shape.ProfileBegin);
3932 if(cut >= 33333 ) // ie 2/3 3940 if(cut >= 16667 )
3933 ret--; 3941 ret--;
3942 if(cut >= 33333 )
3943 ret--;
3944 }
3945 if (Shape.ProfileEnd > 0)
3946 {
3947 cut = (Shape.ProfileEnd);
3948 if(cut >= 16667 )
3949 ret--;
3950 if(cut >= 33333 )
3951 ret--;
3952 }
3934 ret += 2; // both cut faces 3953 ret += 2; // both cut faces
3935 } 3954 }
3936 break; 3955 break;
@@ -3944,7 +3963,7 @@ namespace OpenSim.Region.Framework.Scenes
3944 // cut faces exist if cut or skew or unequal twist limits 3963 // cut faces exist if cut or skew or unequal twist limits
3945 if (Shape.PathBegin > 0 || Shape.PathEnd > 0 || Shape.PathSkew != 0 || (Shape.PathTwistBegin != Shape.PathTwist)) 3964 if (Shape.PathBegin > 0 || Shape.PathEnd > 0 || Shape.PathSkew != 0 || (Shape.PathTwistBegin != Shape.PathTwist))
3946 ret += 2; 3965 ret += 2;
3947 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0 || Shape.ProfileHollow > 0) // dimple faces also if hollow 3966 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0 || Shape.ProfileHollow > 0) // dimple also if hollow
3948 ret += 2; 3967 ret += 2;
3949 break; 3968 break;
3950 case PrimType.TORUS: 3969 case PrimType.TORUS:
@@ -3964,13 +3983,19 @@ namespace OpenSim.Region.Framework.Scenes
3964 ret += 2; 3983 ret += 2;
3965 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // profile cut 3984 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // profile cut
3966 { 3985 {
3967 // removed sides 3986 if (Shape.ProfileBegin > 0)
3968 int cut = (Shape.ProfileEnd + Shape.ProfileBegin); 3987 {
3969 if(cut > 50000) 3988 cut = Shape.ProfileBegin;
3970 cut = 50000; 3989 cut /= 12500;
3971 cut /= 12500; 3990 ret -= cut;
3972 ret -= cut; 3991 }
3973 ret += 2; // both cut faces 3992 if (Shape.ProfileEnd > 0)
3993 {
3994 cut = Shape.ProfileEnd;
3995 cut /= 12500;
3996 ret -= cut;
3997 }
3998 ret += 2;
3974 } 3999 }
3975 break; 4000 break;
3976 case PrimType.RING: 4001 case PrimType.RING:
@@ -3981,13 +4006,23 @@ namespace OpenSim.Region.Framework.Scenes
3981 ret += 2; 4006 ret += 2;
3982 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // profile cut 4007 if (Shape.ProfileBegin > 0 || Shape.ProfileEnd > 0) // profile cut
3983 { 4008 {
3984 // removed faces 4009 if (Shape.ProfileBegin > 0)
3985 int cut = (Shape.ProfileEnd + Shape.ProfileBegin); 4010 {
3986 if(cut >= 16667 ) 4011 cut = Shape.ProfileBegin;
3987 ret--; 4012 if(cut >= 16667 )
3988 if(cut >= 33333 ) 4013 ret--;
3989 ret--; 4014 if(cut >= 33333 )
3990 ret += 2; // both cut faces 4015 ret--;
4016 }
4017 if (Shape.ProfileEnd > 0)
4018 {
4019 cut = Shape.ProfileEnd;
4020 if(cut >= 16667 )
4021 ret--;
4022 if(cut >= 33333 )
4023 ret--;
4024 }
4025 ret += 2;
3991 } 4026 }
3992 break; 4027 break;
3993 } 4028 }