aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2008-06-06 19:58:39 +0000
committerTeravus Ovares2008-06-06 19:58:39 +0000
commitbe4496992750f907195083a8f92d601fe4f623fb (patch)
treed83321ffc9603e0b4c5b9b93d1e104dc6bbd0237 /OpenSim/Region
parent* How tall are you? Certainly not 127 meters! (diff)
downloadopensim-SC_OLD-be4496992750f907195083a8f92d601fe4f623fb.zip
opensim-SC_OLD-be4496992750f907195083a8f92d601fe4f623fb.tar.gz
opensim-SC_OLD-be4496992750f907195083a8f92d601fe4f623fb.tar.bz2
opensim-SC_OLD-be4496992750f907195083a8f92d601fe4f623fb.tar.xz
* Adds semi broken PRIM_FLEXIBLE support for prim. It's semi-broken because it won't do the setting of the prim flexi from not-flexi, however, it'll tweak the parameters of an already existing flexi prim.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs51
1 files changed, 46 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 4c58e36..1999945 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1042,6 +1042,33 @@ namespace OpenSim.Region.ScriptEngine.Common
1042 } 1042 }
1043 } 1043 }
1044 1044
1045 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
1046 float wind, float tension, LSL_Types.Vector3 Force)
1047 {
1048 if (part == null)
1049 return;
1050
1051 if (flexi)
1052 {
1053 part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
1054 // work once the prim is already flexi
1055 part.Shape.FlexiSoftness = softness;
1056 part.Shape.FlexiGravity = gravity;
1057 part.Shape.FlexiDrag = friction;
1058 part.Shape.FlexiWind = wind;
1059 part.Shape.FlexiTension = tension;
1060 part.Shape.FlexiForceX = (float)Force.x;
1061 part.Shape.FlexiForceY = (float)Force.y;
1062 part.Shape.FlexiForceZ = (float)Force.z;
1063
1064 }
1065 else
1066 {
1067 part.Shape.FlexiEntry = false;
1068 }
1069 part.SendFullUpdateToAllClients();
1070 }
1071
1045 public LSL_Types.Vector3 llGetColor(int face) 1072 public LSL_Types.Vector3 llGetColor(int face)
1046 { 1073 {
1047 m_host.AddScriptLPS(1); 1074 m_host.AddScriptLPS(1);
@@ -4612,7 +4639,14 @@ namespace OpenSim.Region.ScriptEngine.Common
4612 SetPos(part, v); 4639 SetPos(part, v);
4613 4640
4614 break; 4641 break;
4642 case 7: // PRIM_SIZE
4643 if (remain < 1)
4644 return;
4615 4645
4646 v=new LSL_Types.Vector3(rules.Data[idx++].ToString());
4647 SetScale(part, v);
4648
4649 break;
4616 case 8: // PRIM_ROTATION 4650 case 8: // PRIM_ROTATION
4617 if (remain < 1) 4651 if (remain < 1)
4618 return; 4652 return;
@@ -4651,15 +4685,22 @@ namespace OpenSim.Region.ScriptEngine.Common
4651 SetAlpha(part, alpha, face); 4685 SetAlpha(part, alpha, face);
4652 4686
4653 break; 4687 break;
4654 4688 case 21: // PRIM_FLEXI
4655 case 7: // PRIM_SIZE 4689 if (remain < 7)
4656 if (remain < 1)
4657 return; 4690 return;
4658 4691
4659 v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 4692 int flexi = Convert.ToInt32(rules.Data[idx++]);
4660 SetScale(part, v); 4693 int softness = Convert.ToInt32(rules.Data[idx++]);
4694 float gravity = (float)Convert.ToDouble(rules.Data[idx++]);
4695 float friction = (float)Convert.ToDouble(rules.Data[idx++]);
4696 float wind = (float)Convert.ToDouble(rules.Data[idx++]);
4697 float tension = (float)Convert.ToDouble(rules.Data[idx++]);
4698 LSL_Types.Vector3 force =new LSL_Types.Vector3(rules.Data[idx++].ToString());
4699
4700 SetFlexi(part, (flexi == 1), softness, gravity, friction, wind, tension, force);
4661 4701
4662 break; 4702 break;
4703
4663 } 4704 }
4664 } 4705 }
4665 } 4706 }