diff options
Diffstat (limited to 'OpenSim/Region')
3 files changed, 41 insertions, 33 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 58b7b00..46932b1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -1006,28 +1006,41 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1006 | } | 1006 | } |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | // faces number to pbs shape | 1009 | // faces number to pbs shape for viewers LOD |
1010 | switch(face_list.Count) | 1010 | // now extended to full faces equivalent |
1011 | int nfaces = face_list.Count; | ||
1012 | switch(nfaces) | ||
1011 | { | 1013 | { |
1012 | case 1: | 1014 | case 1: |
1013 | case 2: | 1015 | case 2: |
1014 | pbs.ProfileCurve = (byte)ProfileCurve.Circle; | 1016 | pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle; |
1015 | pbs.PathCurve = (byte)PathCurve.Circle; | 1017 | pbs.PathCurve = (byte)PathCurve.Circle; |
1018 | if(nfaces == 2) | ||
1019 | pbs.ProfileHollow = 1; | ||
1016 | break; | 1020 | break; |
1017 | 1021 | ||
1018 | case 3: | 1022 | case 3: |
1019 | case 4: | 1023 | case 4: |
1020 | pbs.ProfileCurve = (byte)ProfileCurve.Circle; | 1024 | pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle; |
1021 | pbs.PathCurve = (byte)PathCurve.Line; | 1025 | pbs.PathCurve = (byte)PathCurve.Line; |
1026 | if(nfaces == 4) | ||
1027 | pbs.ProfileHollow = 1; | ||
1022 | break; | 1028 | break; |
1029 | |||
1023 | case 5: | 1030 | case 5: |
1024 | pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle; | 1031 | pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle | (byte)HollowShape.Triangle; |
1025 | pbs.PathCurve = (byte)PathCurve.Line; | 1032 | pbs.PathCurve = (byte)PathCurve.Line; |
1026 | break; | 1033 | break; |
1027 | 1034 | ||
1028 | default: | 1035 | default: |
1029 | pbs.ProfileCurve = (byte)ProfileCurve.Square; | 1036 | // hack to flag that pbs does represent number of faces |
1037 | //meshs where never uploaded with this | ||
1038 | pbs.ProfileCurve = (byte)ProfileCurve.Square | (byte)HollowShape.Triangle; | ||
1030 | pbs.PathCurve = (byte)PathCurve.Line; | 1039 | pbs.PathCurve = (byte)PathCurve.Line; |
1040 | if(nfaces == 7) | ||
1041 | pbs.ProfileHollow = 1; | ||
1042 | else if(nfaces == 8) | ||
1043 | pbs.ProfileBegin = 1; | ||
1031 | break; | 1044 | break; |
1032 | } | 1045 | } |
1033 | 1046 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index dc8d267..cf96a8b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4212,12 +4212,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4212 | SceneObjectGroup grp = part.ParentGroup; | 4212 | SceneObjectGroup grp = part.ParentGroup; |
4213 | if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit)) | 4213 | if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit)) |
4214 | continue; | 4214 | continue; |
4215 | /* debug | ||
4215 | if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit)) | 4216 | if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit)) |
4216 | { | 4217 | { |
4217 | 4218 | ||
4218 | 4219 | ||
4219 | } | 4220 | } |
4220 | 4221 | */ | |
4221 | if (grp.IsDeleted) | 4222 | if (grp.IsDeleted) |
4222 | { | 4223 | { |
4223 | // Don't send updates for objects that have been marked deleted. | 4224 | // Don't send updates for objects that have been marked deleted. |
@@ -4274,14 +4275,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4274 | { | 4275 | { |
4275 | part.Shape.LightEntry = false; | 4276 | part.Shape.LightEntry = false; |
4276 | } | 4277 | } |
4277 | |||
4278 | if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh)) | ||
4279 | { | ||
4280 | // Ensure that mesh has at least 8 valid faces | ||
4281 | part.Shape.ProfileBegin = 12500; | ||
4282 | part.Shape.ProfileEnd = 0; | ||
4283 | part.Shape.ProfileHollow = 27500; | ||
4284 | } | ||
4285 | } | 4278 | } |
4286 | 4279 | ||
4287 | if(doCulling && !grp.IsAttachment) | 4280 | if(doCulling && !grp.IsAttachment) |
@@ -4309,14 +4302,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4309 | continue; | 4302 | continue; |
4310 | } | 4303 | } |
4311 | } | 4304 | } |
4312 | |||
4313 | if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh)) | ||
4314 | { | ||
4315 | // Ensure that mesh has at least 8 valid faces | ||
4316 | part.Shape.ProfileBegin = 12500; | ||
4317 | part.Shape.ProfileEnd = 0; | ||
4318 | part.Shape.ProfileHollow = 27500; | ||
4319 | } | ||
4320 | } | 4305 | } |
4321 | else if (update.Entity is ScenePresence) | 4306 | else if (update.Entity is ScenePresence) |
4322 | { | 4307 | { |
@@ -5877,6 +5862,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5877 | update.PCode = part.Shape.PCode; | 5862 | update.PCode = part.Shape.PCode; |
5878 | update.ProfileBegin = part.Shape.ProfileBegin; | 5863 | update.ProfileBegin = part.Shape.ProfileBegin; |
5879 | update.ProfileCurve = part.Shape.ProfileCurve; | 5864 | update.ProfileCurve = part.Shape.ProfileCurve; |
5865 | |||
5866 | if(part.Shape.SculptType == (byte)SculptType.Mesh) // filter out hack | ||
5867 | update.ProfileCurve = (byte)(part.Shape.ProfileCurve & 0x0f); | ||
5868 | else | ||
5869 | update.ProfileCurve = part.Shape.ProfileCurve; | ||
5870 | |||
5880 | update.ProfileEnd = part.Shape.ProfileEnd; | 5871 | update.ProfileEnd = part.Shape.ProfileEnd; |
5881 | update.ProfileHollow = part.Shape.ProfileHollow; | 5872 | update.ProfileHollow = part.Shape.ProfileHollow; |
5882 | update.PSBlock = part.ParticleSystem ?? Utils.EmptyBytes; | 5873 | update.PSBlock = part.ParticleSystem ?? Utils.EmptyBytes; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index affd4de..19bf53f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3728,7 +3728,18 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3728 | bool hasDimple; | 3728 | bool hasDimple; |
3729 | bool hasProfileCut; | 3729 | bool hasProfileCut; |
3730 | 3730 | ||
3731 | PrimType primType = GetPrimType(); | 3731 | if(Shape.SculptEntry) |
3732 | { | ||
3733 | if (Shape.SculptType != (byte)SculptType.Mesh) | ||
3734 | return 1; // sculp | ||
3735 | |||
3736 | //hack to detect new upload with faces data enconded on pbs | ||
3737 | if ((Shape.ProfileCurve & 0xf0) != (byte)HollowShape.Triangle) | ||
3738 | // old broken upload TODO | ||
3739 | return 8; | ||
3740 | } | ||
3741 | |||
3742 | PrimType primType = GetPrimType(true); | ||
3732 | HasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); | 3743 | HasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); |
3733 | 3744 | ||
3734 | switch (primType) | 3745 | switch (primType) |
@@ -3772,13 +3783,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3772 | if (hasProfileCut) ret += 2; | 3783 | if (hasProfileCut) ret += 2; |
3773 | if (hasHollow) ret += 1; | 3784 | if (hasHollow) ret += 1; |
3774 | break; | 3785 | break; |
3775 | case PrimType.SCULPT: | ||
3776 | // Special mesh handling | ||
3777 | if (Shape.SculptType == (byte)SculptType.Mesh) | ||
3778 | ret = 8; // if it's a mesh then max 8 faces | ||
3779 | else | ||
3780 | ret = 1; // if it's a sculpt then max 1 face | ||
3781 | break; | ||
3782 | } | 3786 | } |
3783 | 3787 | ||
3784 | return ret; | 3788 | return ret; |
@@ -3789,9 +3793,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3789 | /// </summary> | 3793 | /// </summary> |
3790 | /// <param name="primShape"></param> | 3794 | /// <param name="primShape"></param> |
3791 | /// <returns></returns> | 3795 | /// <returns></returns> |
3792 | public PrimType GetPrimType() | 3796 | public PrimType GetPrimType(bool ignoreSculpt = false) |
3793 | { | 3797 | { |
3794 | if (Shape.SculptEntry) | 3798 | if (Shape.SculptEntry && !ignoreSculpt) |
3795 | return PrimType.SCULPT; | 3799 | return PrimType.SCULPT; |
3796 | 3800 | ||
3797 | if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) | 3801 | if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) |