diff options
Diffstat (limited to 'OpenSim')
11 files changed, 92 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index f0b1686..a9709b1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -1374,6 +1374,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1374 | } | 1374 | } |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | public PhysicsVector GetForce() | ||
1378 | { | ||
1379 | if (PhysActor != null) | ||
1380 | return PhysActor.Force; | ||
1381 | else | ||
1382 | return new PhysicsVector(); | ||
1383 | } | ||
1384 | |||
1377 | [SecurityPermission(SecurityAction.LinkDemand, | 1385 | [SecurityPermission(SecurityAction.LinkDemand, |
1378 | Flags = SecurityPermissionFlag.SerializationFormatter)] | 1386 | Flags = SecurityPermissionFlag.SerializationFormatter)] |
1379 | public virtual void GetObjectData( | 1387 | public virtual void GetObjectData( |
@@ -2296,6 +2304,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
2296 | } | 2304 | } |
2297 | } | 2305 | } |
2298 | 2306 | ||
2307 | public void SetForce(PhysicsVector force) | ||
2308 | { | ||
2309 | if (PhysActor != null) | ||
2310 | { | ||
2311 | PhysActor.Force = force; | ||
2312 | } | ||
2313 | } | ||
2314 | |||
2299 | public void SetGroup(LLUUID groupID, IClientAPI client) | 2315 | public void SetGroup(LLUUID groupID, IClientAPI client) |
2300 | { | 2316 | { |
2301 | _groupID = groupID; | 2317 | _groupID = groupID; |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index ee30e54..213f1d4 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -332,6 +332,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
332 | public override PhysicsVector Force | 332 | public override PhysicsVector Force |
333 | { | 333 | { |
334 | get { return PhysicsVector.Zero; } | 334 | get { return PhysicsVector.Zero; } |
335 | set { return; } | ||
335 | } | 336 | } |
336 | 337 | ||
337 | public override PhysicsVector CenterOfMass | 338 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 5ef196f..cc55f6e 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -943,6 +943,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
943 | public override PhysicsVector Force | 943 | public override PhysicsVector Force |
944 | { | 944 | { |
945 | get { return PhysicsVector.Zero; } | 945 | get { return PhysicsVector.Zero; } |
946 | set { return; } | ||
946 | } | 947 | } |
947 | 948 | ||
948 | public override PhysicsVector CenterOfMass | 949 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 22e21a5..beca4da 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Physics.Manager | |||
173 | 173 | ||
174 | public abstract PhysicsVector Position { get; set; } | 174 | public abstract PhysicsVector Position { get; set; } |
175 | public abstract float Mass { get; } | 175 | public abstract float Mass { get; } |
176 | public abstract PhysicsVector Force { get; } | 176 | public abstract PhysicsVector Force { get; set; } |
177 | public abstract PhysicsVector GeometricCenter { get; } | 177 | public abstract PhysicsVector GeometricCenter { get; } |
178 | public abstract PhysicsVector CenterOfMass { get; } | 178 | public abstract PhysicsVector CenterOfMass { get; } |
179 | public abstract PhysicsVector Velocity { get; set; } | 179 | public abstract PhysicsVector Velocity { get; set; } |
@@ -277,6 +277,7 @@ namespace OpenSim.Region.Physics.Manager | |||
277 | public override PhysicsVector Force | 277 | public override PhysicsVector Force |
278 | { | 278 | { |
279 | get { return PhysicsVector.Zero; } | 279 | get { return PhysicsVector.Zero; } |
280 | set { return; } | ||
280 | } | 281 | } |
281 | 282 | ||
282 | public override PhysicsVector CenterOfMass | 283 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 7f08cb4..5d3e986 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -534,6 +534,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
534 | public override PhysicsVector Force | 534 | public override PhysicsVector Force |
535 | { | 535 | { |
536 | get { return new PhysicsVector(_target_velocity.X, _target_velocity.Y, _target_velocity.Z); } | 536 | get { return new PhysicsVector(_target_velocity.X, _target_velocity.Y, _target_velocity.Z); } |
537 | set { return; } | ||
537 | } | 538 | } |
538 | 539 | ||
539 | public override PhysicsVector CenterOfMass | 540 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 59655d7..a4c0d79 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
103 | private CollisionLocker ode; | 103 | private CollisionLocker ode; |
104 | 104 | ||
105 | private bool m_taintforce = false; | 105 | private bool m_taintforce = false; |
106 | private PhysicsVector m_force = new PhysicsVector(0.0f, 0.0f, 0.0f); | ||
106 | private List<PhysicsVector> m_forcelist = new List<PhysicsVector>(); | 107 | private List<PhysicsVector> m_forcelist = new List<PhysicsVector>(); |
107 | 108 | ||
108 | private IMesh _mesh; | 109 | private IMesh _mesh; |
@@ -749,7 +750,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
749 | changeshape(timestep); | 750 | changeshape(timestep); |
750 | // | 751 | // |
751 | 752 | ||
752 | if (m_taintforce) | 753 | if (m_taintforce || m_force != new PhysicsVector(0.0f, 0.0f, 0.0f)) |
753 | changeAddForce(timestep); | 754 | changeAddForce(timestep); |
754 | 755 | ||
755 | if (m_taintdisable) | 756 | if (m_taintdisable) |
@@ -1751,7 +1752,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1751 | //m_log.Info("[PHYSICS]: dequeing forcelist"); | 1752 | //m_log.Info("[PHYSICS]: dequeing forcelist"); |
1752 | if (IsPhysical) | 1753 | if (IsPhysical) |
1753 | { | 1754 | { |
1754 | PhysicsVector iforce = new PhysicsVector(); | 1755 | //PhysicsVector iforce = new PhysicsVector(); |
1756 | PhysicsVector iforce = m_force * 100.0f; | ||
1755 | for (int i = 0; i < m_forcelist.Count; i++) | 1757 | for (int i = 0; i < m_forcelist.Count; i++) |
1756 | { | 1758 | { |
1757 | iforce = iforce + (m_forcelist[i] * 100); | 1759 | iforce = iforce + (m_forcelist[i] * 100); |
@@ -1856,7 +1858,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1856 | 1858 | ||
1857 | public override PhysicsVector Force | 1859 | public override PhysicsVector Force |
1858 | { | 1860 | { |
1859 | get { return PhysicsVector.Zero; } | 1861 | //get { return PhysicsVector.Zero; } |
1862 | get { return m_force; } | ||
1863 | set { m_force = value; } | ||
1860 | } | 1864 | } |
1861 | 1865 | ||
1862 | public override PhysicsVector CenterOfMass | 1866 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index d146b60..c674d15 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | |||
@@ -156,6 +156,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
156 | public override PhysicsVector Force | 156 | public override PhysicsVector Force |
157 | { | 157 | { |
158 | get { return PhysicsVector.Zero; } | 158 | get { return PhysicsVector.Zero; } |
159 | set { return; } | ||
159 | } | 160 | } |
160 | 161 | ||
161 | public override PhysicsVector CenterOfMass | 162 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs index c767917..fed67dd 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs | |||
@@ -118,6 +118,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
118 | public override PhysicsVector Force | 118 | public override PhysicsVector Force |
119 | { | 119 | { |
120 | get { return PhysicsVector.Zero; } | 120 | get { return PhysicsVector.Zero; } |
121 | set { return; } | ||
121 | } | 122 | } |
122 | 123 | ||
123 | public override PhysicsVector CenterOfMass | 124 | public override PhysicsVector CenterOfMass |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index c9e1e30..197da0a 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -340,6 +340,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
340 | public override PhysicsVector Force | 340 | public override PhysicsVector Force |
341 | { | 341 | { |
342 | get { return PhysicsVector.Zero; } | 342 | get { return PhysicsVector.Zero; } |
343 | set { return; } | ||
343 | } | 344 | } |
344 | 345 | ||
345 | public override PhysicsVector CenterOfMass | 346 | public override PhysicsVector CenterOfMass |
@@ -669,6 +670,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
669 | public override PhysicsVector Force | 670 | public override PhysicsVector Force |
670 | { | 671 | { |
671 | get { return PhysicsVector.Zero; } | 672 | get { return PhysicsVector.Zero; } |
673 | set { return; } | ||
672 | } | 674 | } |
673 | 675 | ||
674 | public override PhysicsVector CenterOfMass | 676 | public override PhysicsVector CenterOfMass |
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; | |||
42 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; | 42 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; |
43 | using OpenSim.Region.Environment.Modules.World.Land; | 43 | using OpenSim.Region.Environment.Modules.World.Land; |
44 | using OpenSim.Region.Environment.Scenes; | 44 | using OpenSim.Region.Environment.Scenes; |
45 | using OpenSim.Region.Physics.Manager; | ||
45 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | 46 | using 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) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9832cfc..ed320f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -43,6 +43,7 @@ using OpenSim.Region.Environment.Interfaces; | |||
43 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; | 43 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; |
44 | using OpenSim.Region.Environment.Modules.World.Land; | 44 | using OpenSim.Region.Environment.Modules.World.Land; |
45 | using OpenSim.Region.Environment.Scenes; | 45 | using OpenSim.Region.Environment.Scenes; |
46 | using OpenSim.Region.Physics.Manager; | ||
46 | using OpenSim.Region.ScriptEngine.Shared; | 47 | using OpenSim.Region.ScriptEngine.Shared; |
47 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 48 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
48 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 49 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -1430,14 +1431,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1430 | public void llSetForce(LSL_Types.Vector3 force, int local) | 1431 | public void llSetForce(LSL_Types.Vector3 force, int local) |
1431 | { | 1432 | { |
1432 | m_host.AddScriptLPS(1); | 1433 | m_host.AddScriptLPS(1); |
1433 | NotImplemented("llSetForce"); | 1434 | //NotImplemented("llSetForce"); |
1435 | |||
1436 | if (m_host.ParentGroup != null) | ||
1437 | { | ||
1438 | if (m_host.ParentGroup.RootPart != null) | ||
1439 | { | ||
1440 | if (local != 0) | ||
1441 | force *= llGetRot(); | ||
1442 | |||
1443 | m_host.ParentGroup.RootPart.SetForce(new PhysicsVector((float)force.x, (float)force.y, (float)force.z)); | ||
1444 | } | ||
1445 | } | ||
1434 | } | 1446 | } |
1435 | 1447 | ||
1436 | public LSL_Types.Vector3 llGetForce() | 1448 | public LSL_Types.Vector3 llGetForce() |
1437 | { | 1449 | { |
1450 | LSL_Types.Vector3 force = new LSL_Types.Vector3(0.0, 0.0, 0.0); | ||
1451 | |||
1438 | m_host.AddScriptLPS(1); | 1452 | m_host.AddScriptLPS(1); |
1439 | NotImplemented("llGetForce"); | 1453 | //NotImplemented("llGetForce"); |
1440 | return new LSL_Types.Vector3(); | 1454 | //return new LSL_Types.Vector3(); |
1455 | |||
1456 | if (m_host.ParentGroup != null) | ||
1457 | { | ||
1458 | if (m_host.ParentGroup.RootPart != null) | ||
1459 | { | ||
1460 | PhysicsVector tmpForce = m_host.ParentGroup.RootPart.GetForce(); | ||
1461 | force.x = tmpForce.X; | ||
1462 | force.y = tmpForce.Y; | ||
1463 | force.z = tmpForce.Z; | ||
1464 | } | ||
1465 | } | ||
1466 | |||
1467 | return force; | ||
1441 | } | 1468 | } |
1442 | 1469 | ||
1443 | public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) | 1470 | public LSL_Types.LSLInteger llTarget(LSL_Types.Vector3 position, double range) |