diff options
Diffstat (limited to '')
10 files changed, 127 insertions, 7 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 87433cc..f6b7689 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Framework | |||
124 | public delegate void ObjectDrop(uint localID, IClientAPI remoteClient); | 124 | public delegate void ObjectDrop(uint localID, IClientAPI remoteClient); |
125 | 125 | ||
126 | public delegate void UpdatePrimFlags( | 126 | public delegate void UpdatePrimFlags( |
127 | uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, IClientAPI remoteClient); | 127 | uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient); |
128 | 128 | ||
129 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | 129 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); |
130 | 130 | ||
@@ -1356,6 +1356,8 @@ namespace OpenSim.Framework | |||
1356 | 1356 | ||
1357 | void SendObjectPropertiesReply(ISceneEntity Entity); | 1357 | void SendObjectPropertiesReply(ISceneEntity Entity); |
1358 | 1358 | ||
1359 | void SendPartPhysicsProprieties(ISceneEntity Entity); | ||
1360 | |||
1359 | void SendAgentOffline(UUID[] agentIDs); | 1361 | void SendAgentOffline(UUID[] agentIDs); |
1360 | 1362 | ||
1361 | void SendAgentOnline(UUID[] agentIDs); | 1363 | void SendAgentOnline(UUID[] agentIDs); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 4d2c0f2..3cc3950 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -807,5 +807,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
807 | { | 807 | { |
808 | return EventQueueHelper.BuildEvent(eventName, eventBody); | 808 | return EventQueueHelper.BuildEvent(eventName, eventBody); |
809 | } | 809 | } |
810 | |||
811 | public void partPhysicsProperties(uint localID, byte physhapetype, | ||
812 | float density, float friction, float bounce, float gravmod,UUID avatarID) | ||
813 | { | ||
814 | OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype, | ||
815 | density, friction, bounce, gravmod); | ||
816 | Enqueue(item, avatarID); | ||
817 | } | ||
810 | } | 818 | } |
811 | } | 819 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 3f49aba..dab727f 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs | |||
@@ -395,5 +395,25 @@ namespace OpenSim.Region.ClientStack.Linden | |||
395 | return message; | 395 | return message; |
396 | } | 396 | } |
397 | 397 | ||
398 | public static OSD partPhysicsProperties(uint localID, byte physhapetype, | ||
399 | float density, float friction, float bounce, float gravmod) | ||
400 | { | ||
401 | |||
402 | OSDMap physinfo = new OSDMap(6); | ||
403 | physinfo["LocalID"] = localID; | ||
404 | physinfo["Density"] = density; | ||
405 | physinfo["Friction"] = friction; | ||
406 | physinfo["GravityMultiplier"] = gravmod; | ||
407 | physinfo["Restitution"] = bounce; | ||
408 | physinfo["PhysicsShapeType"] = (int)physhapetype; | ||
409 | |||
410 | OSDArray array = new OSDArray(1); | ||
411 | array.Add(physinfo); | ||
412 | |||
413 | OSDMap llsdBody = new OSDMap(1); | ||
414 | llsdBody.Add("ObjectData", array); | ||
415 | |||
416 | return BuildEvent("ObjectPhysicsProperties", llsdBody); | ||
417 | } | ||
398 | } | 418 | } |
399 | } | 419 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 88b64f5..bd4a2d1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -2627,6 +2627,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2627 | } | 2627 | } |
2628 | } | 2628 | } |
2629 | 2629 | ||
2630 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
2631 | { | ||
2632 | SceneObjectPart part = (SceneObjectPart)entity; | ||
2633 | if (part != null && AgentId != UUID.Zero) | ||
2634 | { | ||
2635 | try | ||
2636 | { | ||
2637 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
2638 | if (eq != null) | ||
2639 | { | ||
2640 | uint localid = part.LocalId; | ||
2641 | byte physshapetype = part.PhysicsShapeType; | ||
2642 | float density = part.Density; | ||
2643 | float friction = part.Friction; | ||
2644 | float bounce = part.Restitution; | ||
2645 | float gravmod = part.GravityModifier; | ||
2646 | eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); | ||
2647 | } | ||
2648 | } | ||
2649 | catch (Exception ex) | ||
2650 | { | ||
2651 | m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString()); | ||
2652 | } | ||
2653 | part.UpdatePhysRequired = false; | ||
2654 | } | ||
2655 | } | ||
2656 | |||
2657 | |||
2630 | 2658 | ||
2631 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) | 2659 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) |
2632 | { | 2660 | { |
@@ -7035,10 +7063,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7035 | // 46,47,48 are special positions within the packet | 7063 | // 46,47,48 are special positions within the packet |
7036 | // This may change so perhaps we need a better way | 7064 | // This may change so perhaps we need a better way |
7037 | // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) | 7065 | // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) |
7038 | bool UsePhysics = (data[46] != 0) ? true : false; | 7066 | /* |
7039 | bool IsTemporary = (data[47] != 0) ? true : false; | 7067 | bool UsePhysics = (data[46] != 0) ? true : false; |
7040 | bool IsPhantom = (data[48] != 0) ? true : false; | 7068 | bool IsTemporary = (data[47] != 0) ? true : false; |
7041 | handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, this); | 7069 | bool IsPhantom = (data[48] != 0) ? true : false; |
7070 | handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, this); | ||
7071 | */ | ||
7072 | bool UsePhysics = flags.AgentData.UsePhysics; | ||
7073 | bool IsPhantom = flags.AgentData.IsPhantom; | ||
7074 | bool IsTemporary = flags.AgentData.IsTemporary; | ||
7075 | ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = flags.ExtraPhysics; | ||
7076 | ExtraPhysicsData physdata = new ExtraPhysicsData(); | ||
7077 | |||
7078 | if (blocks == null || blocks.Length == 0) | ||
7079 | { | ||
7080 | physdata.PhysShapeType = PhysShapeType.invalid; | ||
7081 | } | ||
7082 | else | ||
7083 | { | ||
7084 | ObjectFlagUpdatePacket.ExtraPhysicsBlock phsblock = blocks[0]; | ||
7085 | physdata.PhysShapeType = (PhysShapeType)phsblock.PhysicsShapeType; | ||
7086 | physdata.Bounce = phsblock.Restitution; | ||
7087 | physdata.Density = phsblock.Density; | ||
7088 | physdata.Friction = phsblock.Friction; | ||
7089 | physdata.GravitationModifier = phsblock.GravityMultiplier; | ||
7090 | } | ||
7091 | |||
7092 | handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, physdata, this); | ||
7042 | } | 7093 | } |
7043 | return true; | 7094 | return true; |
7044 | } | 7095 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index bfa5d17..5512642 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs | |||
@@ -59,5 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
59 | void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); | 59 | void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); |
60 | OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); | 60 | OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); |
61 | OSD BuildEvent(string eventName, OSD eventBody); | 61 | OSD BuildEvent(string eventName, OSD eventBody); |
62 | void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID); | ||
63 | |||
62 | } | 64 | } |
63 | } | 65 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a4383fd..a84f6d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1408,7 +1408,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1408 | /// <param name="SetPhantom"></param> | 1408 | /// <param name="SetPhantom"></param> |
1409 | /// <param name="remoteClient"></param> | 1409 | /// <param name="remoteClient"></param> |
1410 | protected internal void UpdatePrimFlags( | 1410 | protected internal void UpdatePrimFlags( |
1411 | uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, IClientAPI remoteClient) | 1411 | uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient) |
1412 | { | 1412 | { |
1413 | SceneObjectGroup group = GetGroupByPrim(localID); | 1413 | SceneObjectGroup group = GetGroupByPrim(localID); |
1414 | if (group != null) | 1414 | if (group != null) |
@@ -1416,7 +1416,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1416 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1416 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) |
1417 | { | 1417 | { |
1418 | // VolumeDetect can't be set via UI and will always be off when a change is made there | 1418 | // VolumeDetect can't be set via UI and will always be off when a change is made there |
1419 | group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, false); | 1419 | // now only change volume dtc if phantom off |
1420 | |||
1421 | if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data | ||
1422 | { | ||
1423 | bool vdtc; | ||
1424 | if (SetPhantom) // if phantom keep volumedtc | ||
1425 | vdtc = group.RootPart.VolumeDetectActive; | ||
1426 | else // else turn it off | ||
1427 | vdtc = false; | ||
1428 | |||
1429 | group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc); | ||
1430 | } | ||
1431 | else | ||
1432 | { | ||
1433 | SceneObjectPart part = GetSceneObjectPart(localID); | ||
1434 | if (part != null) | ||
1435 | { | ||
1436 | part.UpdateExtraPhysics(PhysData); | ||
1437 | if (part.UpdatePhysRequired) | ||
1438 | remoteClient.SendPartPhysicsProprieties(part); | ||
1439 | } | ||
1440 | } | ||
1420 | } | 1441 | } |
1421 | } | 1442 | } |
1422 | } | 1443 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b00f388..cd40b29 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1042,6 +1042,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | public UpdateRequired UpdateFlag { get; set; } | 1044 | public UpdateRequired UpdateFlag { get; set; } |
1045 | public bool UpdatePhysRequired { get; set; } | ||
1045 | 1046 | ||
1046 | /// <summary> | 1047 | /// <summary> |
1047 | /// Used for media on a prim. | 1048 | /// Used for media on a prim. |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 781539a..0ac56fa 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1678,5 +1678,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1678 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) | 1678 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) |
1679 | { | 1679 | { |
1680 | } | 1680 | } |
1681 | |||
1682 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
1683 | { | ||
1684 | } | ||
1685 | |||
1681 | } | 1686 | } |
1682 | } | 1687 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 5ea2bcd..6bd27f0 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -1234,5 +1234,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
1234 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) | 1234 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) |
1235 | { | 1235 | { |
1236 | } | 1236 | } |
1237 | |||
1238 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
1239 | { | ||
1240 | } | ||
1241 | |||
1237 | } | 1242 | } |
1238 | } | 1243 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dde37ab..182f4d9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -1276,5 +1276,10 @@ namespace OpenSim.Tests.Common.Mock | |||
1276 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) | 1276 | public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) |
1277 | { | 1277 | { |
1278 | } | 1278 | } |
1279 | |||
1280 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
1281 | { | ||
1282 | } | ||
1283 | |||
1279 | } | 1284 | } |
1280 | } | 1285 | } |