aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs33
1 files changed, 30 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 2d5be27..1a60f45 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -42,6 +42,7 @@ using OpenSim.Region.Environment.Interfaces;
42using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 42using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
43using OpenSim.Region.Environment.Modules.World.Land; 43using OpenSim.Region.Environment.Modules.World.Land;
44using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
45using OpenSim.Region.Physics.Manager;
45using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; 46using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
46 47
47//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; 48//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL;
@@ -1578,14 +1579,40 @@ namespace OpenSim.Region.ScriptEngine.Common
1578 public void llSetForce(LSL_Types.Vector3 force, int local) 1579 public void llSetForce(LSL_Types.Vector3 force, int local)
1579 { 1580 {
1580 m_host.AddScriptLPS(1); 1581 m_host.AddScriptLPS(1);
1581 NotImplemented("llSetForce"); 1582 //NotImplemented("llSetForce");
1583
1584 if (m_host.ParentGroup != null)
1585 {
1586 if (m_host.ParentGroup.RootPart != null)
1587 {
1588 if (local != 0)
1589 force *= llGetRot();
1590
1591 m_host.ParentGroup.RootPart.SetForce(new PhysicsVector((float)force.x, (float)force.y, (float)force.z));
1592 }
1593 }
1582 } 1594 }
1583 1595
1584 public LSL_Types.Vector3 llGetForce() 1596 public LSL_Types.Vector3 llGetForce()
1585 { 1597 {
1598 LSL_Types.Vector3 force = new LSL_Types.Vector3(0.0, 0.0, 0.0);
1599
1586 m_host.AddScriptLPS(1); 1600 m_host.AddScriptLPS(1);
1587 NotImplemented("llGetForce"); 1601 //NotImplemented("llGetForce");
1588 return new LSL_Types.Vector3(); 1602 //return new LSL_Types.Vector3();
1603
1604 if (m_host.ParentGroup != null)
1605 {
1606 if (m_host.ParentGroup.RootPart != null)
1607 {
1608 PhysicsVector tmpForce = m_host.ParentGroup.RootPart.GetForce();
1609 force.x = tmpForce.X;
1610 force.y = tmpForce.Y;
1611 force.z = tmpForce.Z;
1612 }
1613 }
1614
1615 return force;
1589 } 1616 }
1590 1617
1591 public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) 1618 public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range)