diff options
author | Melanie | 2013-02-07 22:25:28 +0000 |
---|---|---|
committer | Melanie | 2013-02-07 22:25:28 +0000 |
commit | 7bf33d333af6e7393a05940d1ab436f5dce73814 (patch) | |
tree | 481c437693114ddccbb48dbe53023c183b015942 /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Send the new physics params to the viewer build dialog (diff) | |
download | opensim-SC_OLD-7bf33d333af6e7393a05940d1ab436f5dce73814.zip opensim-SC_OLD-7bf33d333af6e7393a05940d1ab436f5dce73814.tar.gz opensim-SC_OLD-7bf33d333af6e7393a05940d1ab436f5dce73814.tar.bz2 opensim-SC_OLD-7bf33d333af6e7393a05940d1ab436f5dce73814.tar.xz |
Plumb the path from the client to the extra physics params and back
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 59 |
1 files changed, 55 insertions, 4 deletions
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 | } |