diff options
author | UbitUmarov | 2012-03-15 02:24:13 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-15 02:24:13 +0000 |
commit | 84ca09f7c5cec051014181853083e52691bb7e07 (patch) | |
tree | d7c2730dd58c96599b84789b017d78542aba4875 /OpenSim/Region/ClientStack/Linden | |
parent | bug fixs, added a default physics shape estimator based on being a mesh or no... (diff) | |
download | opensim-SC_OLD-84ca09f7c5cec051014181853083e52691bb7e07.zip opensim-SC_OLD-84ca09f7c5cec051014181853083e52691bb7e07.tar.gz opensim-SC_OLD-84ca09f7c5cec051014181853083e52691bb7e07.tar.bz2 opensim-SC_OLD-84ca09f7c5cec051014181853083e52691bb7e07.tar.xz |
added ObjectPhysicsProperties http event message to send viewer that data. For now on caps/EventQueue, and still only used on a material change...
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
3 files changed, 56 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 7c07c56..a91b02c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -805,5 +805,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
805 | { | 805 | { |
806 | return EventQueueHelper.BuildEvent(eventName, eventBody); | 806 | return EventQueueHelper.BuildEvent(eventName, eventBody); |
807 | } | 807 | } |
808 | |||
809 | public void partPhysicsProperties(uint localID, byte physhapetype, | ||
810 | float density, float friction, float bounce, float gravmod,UUID avatarID) | ||
811 | { | ||
812 | OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype, | ||
813 | density, friction, bounce, gravmod); | ||
814 | Enqueue(item, avatarID); | ||
815 | } | ||
808 | } | 816 | } |
809 | } | 817 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 3f49aba..b9222e3 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 160a5d1..dd3b8aa 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -2609,6 +2609,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2609 | } | 2609 | } |
2610 | } | 2610 | } |
2611 | 2611 | ||
2612 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
2613 | { | ||
2614 | SceneObjectPart part = (SceneObjectPart)entity; | ||
2615 | if (part != null && AgentId != UUID.Zero) | ||
2616 | { | ||
2617 | try | ||
2618 | { | ||
2619 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
2620 | if (eq != null) | ||
2621 | { | ||
2622 | uint localid = part.LocalId; | ||
2623 | byte physshapetype = part.PhysicsShapeType; | ||
2624 | float density = part.Density; | ||
2625 | float friction = part.Friction; | ||
2626 | float bounce = part.Bounciness; | ||
2627 | float gravmod = part.GravityModifier; | ||
2628 | |||
2629 | eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); | ||
2630 | } | ||
2631 | } | ||
2632 | catch (Exception ex) | ||
2633 | { | ||
2634 | m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString()); | ||
2635 | } | ||
2636 | } | ||
2637 | } | ||
2638 | |||
2639 | |||
2612 | 2640 | ||
2613 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) | 2641 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) |
2614 | { | 2642 | { |