diff options
author | UbitUmarov | 2017-04-25 17:59:53 +0100 |
---|---|---|
committer | UbitUmarov | 2017-04-25 17:59:53 +0100 |
commit | a680d8b8d700f78beb1a9eea98b52d59118efe2e (patch) | |
tree | dd084e74fb61400c704a14dcfa8689670acb9ec2 /OpenSim/Region/ClientStack/Linden/Caps | |
parent | Merge branch 'master' into httptests (diff) | |
parent | move mesh pbs creation code out of mesh upload code into to PrimitiveBaseShap... (diff) | |
download | opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.zip opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.gz opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.bz2 opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.xz |
fix merge
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
3 files changed, 20 insertions, 50 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 58b7b00..e1b9e08 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -946,17 +946,26 @@ namespace OpenSim.Region.ClientStack.Linden | |||
946 | continue; | 946 | continue; |
947 | } | 947 | } |
948 | 948 | ||
949 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); | 949 | OSDArray face_list = (OSDArray)inner_instance_list["face_list"]; |
950 | |||
951 | PrimitiveBaseShape pbs = null; | ||
952 | if (inner_instance_list.ContainsKey("mesh")) // seems to happen always but ... | ||
953 | { | ||
954 | int meshindx = inner_instance_list["mesh"].AsInteger(); | ||
955 | if (meshAssets.Count > meshindx) | ||
956 | pbs = PrimitiveBaseShape.CreateMesh(face_list.Count, meshAssets[meshindx]); | ||
957 | } | ||
958 | if(pbs == null) // fallback | ||
959 | pbs = PrimitiveBaseShape.CreateBox(); | ||
950 | 960 | ||
951 | Primitive.TextureEntry textureEntry | 961 | Primitive.TextureEntry textureEntry |
952 | = new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE); | 962 | = new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE); |
953 | 963 | ||
954 | |||
955 | OSDArray face_list = (OSDArray)inner_instance_list["face_list"]; | ||
956 | for (uint face = 0; face < face_list.Count; face++) | 964 | for (uint face = 0; face < face_list.Count; face++) |
957 | { | 965 | { |
958 | OSDMap faceMap = (OSDMap)face_list[(int)face]; | 966 | OSDMap faceMap = (OSDMap)face_list[(int)face]; |
959 | Primitive.TextureEntryFace f = pbs.Textures.CreateFace(face); | 967 | |
968 | Primitive.TextureEntryFace f = textureEntry.CreateFace(face); //clone the default | ||
960 | if (faceMap.ContainsKey("fullbright")) | 969 | if (faceMap.ContainsKey("fullbright")) |
961 | f.Fullbright = faceMap["fullbright"].AsBoolean(); | 970 | f.Fullbright = faceMap["fullbright"].AsBoolean(); |
962 | if (faceMap.ContainsKey("diffuse_color")) | 971 | if (faceMap.ContainsKey("diffuse_color")) |
@@ -986,51 +995,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
986 | 995 | ||
987 | if (textures.Count > textureNum) | 996 | if (textures.Count > textureNum) |
988 | f.TextureID = textures[textureNum]; | 997 | f.TextureID = textures[textureNum]; |
989 | else | 998 | |
990 | f.TextureID = Primitive.TextureEntry.WHITE_TEXTURE; | ||
991 | |||
992 | textureEntry.FaceTextures[face] = f; | 999 | textureEntry.FaceTextures[face] = f; |
993 | } | 1000 | } |
994 | |||
995 | pbs.TextureEntry = textureEntry.GetBytes(); | 1001 | pbs.TextureEntry = textureEntry.GetBytes(); |
996 | 1002 | ||
997 | if (inner_instance_list.ContainsKey("mesh")) // seems to happen always but ... | ||
998 | { | ||
999 | int meshindx = inner_instance_list["mesh"].AsInteger(); | ||
1000 | if (meshAssets.Count > meshindx) | ||
1001 | { | ||
1002 | pbs.SculptEntry = true; | ||
1003 | pbs.SculptType = (byte)SculptType.Mesh; | ||
1004 | pbs.SculptTexture = meshAssets[meshindx]; // actual asset UUID after meshs suport introduction | ||
1005 | // data will be requested from asset on rez (i hope) | ||
1006 | } | ||
1007 | } | ||
1008 | |||
1009 | // faces number to pbs shape | ||
1010 | switch(face_list.Count) | ||
1011 | { | ||
1012 | case 1: | ||
1013 | case 2: | ||
1014 | pbs.ProfileCurve = (byte)ProfileCurve.Circle; | ||
1015 | pbs.PathCurve = (byte)PathCurve.Circle; | ||
1016 | break; | ||
1017 | |||
1018 | case 3: | ||
1019 | case 4: | ||
1020 | pbs.ProfileCurve = (byte)ProfileCurve.Circle; | ||
1021 | pbs.PathCurve = (byte)PathCurve.Line; | ||
1022 | break; | ||
1023 | case 5: | ||
1024 | pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle; | ||
1025 | pbs.PathCurve = (byte)PathCurve.Line; | ||
1026 | break; | ||
1027 | |||
1028 | default: | ||
1029 | pbs.ProfileCurve = (byte)ProfileCurve.Square; | ||
1030 | pbs.PathCurve = (byte)PathCurve.Line; | ||
1031 | break; | ||
1032 | } | ||
1033 | |||
1034 | Vector3 position = inner_instance_list["position"].AsVector3(); | 1003 | Vector3 position = inner_instance_list["position"].AsVector3(); |
1035 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); | 1004 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); |
1036 | 1005 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs index 189fa36..69fcb7d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs | |||
@@ -121,6 +121,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
121 | 121 | ||
122 | 122 | ||
123 | OSD r = OSDParser.DeserializeLLSDXml((string)request["requestbody"]); | 123 | OSD r = OSDParser.DeserializeLLSDXml((string)request["requestbody"]); |
124 | if (r.Type != OSDType.Map) // not a proper req | ||
125 | return responsedata; | ||
126 | |||
124 | //UUID session_id = UUID.Zero; | 127 | //UUID session_id = UUID.Zero; |
125 | bool bypass_raycast = false; | 128 | bool bypass_raycast = false; |
126 | uint everyone_mask = 0; | 129 | uint everyone_mask = 0; |
@@ -157,9 +160,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
157 | int state = 0; | 160 | int state = 0; |
158 | int lastattach = 0; | 161 | int lastattach = 0; |
159 | 162 | ||
160 | if (r.Type != OSDType.Map) // not a proper req | ||
161 | return responsedata; | ||
162 | |||
163 | OSDMap rm = (OSDMap)r; | 163 | OSDMap rm = (OSDMap)r; |
164 | 164 | ||
165 | if (rm.ContainsKey("ObjectData")) //v2 | 165 | if (rm.ContainsKey("ObjectData")) //v2 |
@@ -307,8 +307,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||
310 | |||
311 | |||
312 | Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false); | 310 | Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false); |
313 | 311 | ||
314 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); | 312 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); |
@@ -359,6 +357,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
359 | rootpart.NextOwnerMask = next_owner_mask; | 357 | rootpart.NextOwnerMask = next_owner_mask; |
360 | rootpart.Material = (byte)material; | 358 | rootpart.Material = (byte)material; |
361 | 359 | ||
360 | obj.AggregatePerms(); | ||
361 | |||
362 | m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); | 362 | m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); |
363 | 363 | ||
364 | responsedata["int_response_code"] = 200; //501; //410; //404; | 364 | responsedata["int_response_code"] = 200; //501; //410; //404; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index 6874662..116c51f 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -335,6 +335,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
335 | grp.AbsolutePosition = obj.Position; | 335 | grp.AbsolutePosition = obj.Position; |
336 | prim.RotationOffset = obj.Rotation; | 336 | prim.RotationOffset = obj.Rotation; |
337 | 337 | ||
338 | |||
338 | // Required for linking | 339 | // Required for linking |
339 | grp.RootPart.ClearUpdateSchedule(); | 340 | grp.RootPart.ClearUpdateSchedule(); |
340 | 341 | ||