aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-10 05:56:58 +0000
committerTeravus Ovares2008-03-10 05:56:58 +0000
commitd0123a796b0066a50914c6fae5d86550dcf58636 (patch)
tree5e7a5091afffc219c96c7649c4b2535215faf8e5 /OpenSim
parent* Added ODEPlugin Support for llSetBuoyancy. Set Buoyancy to 1 for space prim. (diff)
downloadopensim-SC_OLD-d0123a796b0066a50914c6fae5d86550dcf58636.zip
opensim-SC_OLD-d0123a796b0066a50914c6fae5d86550dcf58636.tar.gz
opensim-SC_OLD-d0123a796b0066a50914c6fae5d86550dcf58636.tar.bz2
opensim-SC_OLD-d0123a796b0066a50914c6fae5d86550dcf58636.tar.xz
ODEPlugin
* Added osSetPrimFloatOnWater(BOOL) to make Physical prim float at the water level. * osSetPrimFloatOnWater(TRUE); or osSetPrimFloatOnWater(FALSE); * By default, prim do not float at the water level. * More work is needed on the floating, but it's a start.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs16
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs5
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs5
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs8
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs5
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs32
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs10
-rw-r--r--OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs1
11 files changed, 111 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index a8f08ec..6ed63be 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -942,6 +942,22 @@ namespace OpenSim.Region.Environment.Scenes
942 } 942 }
943 } 943 }
944 944
945 public void SetFloatOnWater(int floatYN)
946 {
947 if (PhysActor != null)
948 {
949 if (floatYN == 1)
950 {
951 PhysActor.FloatOnWater = true;
952 }
953 else
954 {
955 PhysActor.FloatOnWater = false;
956 }
957
958 }
959 }
960
945 public LLVector3 GetSitTargetPositionLL() 961 public LLVector3 GetSitTargetPositionLL()
946 { 962 {
947 return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y, m_sitTargetPosition.z); 963 return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y, m_sitTargetPosition.z);
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index 2b4bbc4..429894d 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -254,6 +254,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
254 set { return; } 254 set { return; }
255 } 255 }
256 256
257 public override bool FloatOnWater
258 {
259 set { return; }
260 }
261
257 public override bool IsPhysical 262 public override bool IsPhysical
258 { 263 {
259 get { return false; } 264 get { return false; }
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index feb9ca1..80cc086 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -930,6 +930,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
930 set { return; } 930 set { return; }
931 } 931 }
932 932
933 public override bool FloatOnWater
934 {
935 set { return; }
936 }
937
933 public virtual void SetAcceleration(PhysicsVector accel) 938 public virtual void SetAcceleration(PhysicsVector accel)
934 { 939 {
935 lock (BulletXScene.BulletXLock) 940 lock (BulletXScene.BulletXLock)
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 82b7450..2a35d43 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -204,6 +204,8 @@ namespace OpenSim.Region.Physics.Manager
204 public abstract bool CollidingGround { get; set; } 204 public abstract bool CollidingGround { get; set; }
205 public abstract bool CollidingObj { get; set; } 205 public abstract bool CollidingObj { get; set; }
206 206
207 public abstract bool FloatOnWater { set; }
208
207 public abstract PhysicsVector RotationalVelocity { get; set; } 209 public abstract PhysicsVector RotationalVelocity { get; set; }
208 210
209 public abstract bool Kinematic { get; set; } 211 public abstract bool Kinematic { get; set; }
@@ -256,6 +258,12 @@ namespace OpenSim.Region.Physics.Manager
256 set { return; } 258 set { return; }
257 } 259 }
258 260
261 public override bool FloatOnWater
262 {
263 set { return; }
264 }
265
266
259 public override bool CollidingGround 267 public override bool CollidingGround
260 { 268 {
261 get { return false; } 269 get { return false; }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 7047ec1..9bbbb22 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -185,6 +185,11 @@ namespace OpenSim.Region.Physics.OdePlugin
185 set { m_buoyancy = value; } 185 set { m_buoyancy = value; }
186 } 186 }
187 187
188 public override bool FloatOnWater
189 {
190 set { return; }
191 }
192
188 public override bool IsPhysical 193 public override bool IsPhysical
189 { 194 {
190 get { return false; } 195 get { return false; }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 5291cbf..7cdc558 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -73,6 +73,7 @@ namespace OpenSim.Region.Physics.OdePlugin
73 public bool m_disabled = false; 73 public bool m_disabled = false;
74 public bool m_taintadd = false; 74 public bool m_taintadd = false;
75 public bool m_taintselected = false; 75 public bool m_taintselected = false;
76 public bool m_taintCollidesWater = false;
76 77
77 78
78 public uint m_localID = 0; 79 public uint m_localID = 0;
@@ -739,6 +740,11 @@ namespace OpenSim.Region.Physics.OdePlugin
739 740
740 if (m_taintparent != _parent) 741 if (m_taintparent != _parent)
741 changelink(timestep); 742 changelink(timestep);
743
744 if (m_taintCollidesWater != m_collidesWater)
745 changefloatonwater(timestep);
746
747
742 } 748 }
743 else 749 else
744 { 750 {
@@ -1333,6 +1339,24 @@ namespace OpenSim.Region.Physics.OdePlugin
1333 m_taintsize = _size; 1339 m_taintsize = _size;
1334 } 1340 }
1335 1341
1342 public void changefloatonwater(float timestep)
1343 {
1344 m_collidesWater = m_taintCollidesWater;
1345
1346 if (prim_geom != (IntPtr)0)
1347 {
1348 if (m_collidesWater)
1349 {
1350 m_collisionFlags |= CollisionCategories.Water;
1351 }
1352 else
1353 {
1354 m_collisionFlags &= ~CollisionCategories.Water;
1355 }
1356 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1357 }
1358 }
1359
1336 public void changeshape(float timestamp) 1360 public void changeshape(float timestamp)
1337 { 1361 {
1338 1362
@@ -1895,6 +1919,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1895 } 1919 }
1896 } 1920 }
1897 1921
1922 public override bool FloatOnWater
1923 {
1924 set {
1925 m_taintCollidesWater = value;
1926 _parent_scene.AddPhysicsActorTaint(this);
1927 }
1928 }
1929
1898 public override void SetMomentum(PhysicsVector momentum) 1930 public override void SetMomentum(PhysicsVector momentum)
1899 { 1931 {
1900 } 1932 }
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index dd2c0dd..d6c8202 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -383,6 +383,11 @@ namespace OpenSim.Region.Physics.POSPlugin
383 set { return; } 383 set { return; }
384 } 384 }
385 385
386 public override bool FloatOnWater
387 {
388 set { return; }
389 }
390
386 public override bool IsPhysical 391 public override bool IsPhysical
387 { 392 {
388 get { return false; } 393 get { return false; }
@@ -622,6 +627,11 @@ namespace OpenSim.Region.Physics.POSPlugin
622 set { return; } 627 set { return; }
623 } 628 }
624 629
630 public override bool FloatOnWater
631 {
632 set { return; }
633 }
634
625 public override PhysicsVector Velocity 635 public override PhysicsVector Velocity
626 { 636 {
627 get { return _velocity; } 637 get { return _velocity; }
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index b03da31..910b2d2 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -253,6 +253,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
253 set { return; } 253 set { return; }
254 } 254 }
255 255
256 public override bool FloatOnWater
257 {
258 set { return; }
259 }
260
256 public override bool IsPhysical 261 public override bool IsPhysical
257 { 262 {
258 get { return false; } 263 get { return false; }
@@ -484,6 +489,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
484 set { return; } 489 set { return; }
485 } 490 }
486 491
492 public override bool FloatOnWater
493 {
494 set { return; }
495 }
496
487 public override bool ThrottleUpdates 497 public override bool ThrottleUpdates
488 { 498 {
489 get { return false; } 499 get { return false; }
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index 79a106b..05a1a1d 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -1897,6 +1897,11 @@ namespace OpenSim.Region.ScriptEngine.Common
1897 m_LSL_Functions.osSetParcelMediaURL(url); 1897 m_LSL_Functions.osSetParcelMediaURL(url);
1898 } 1898 }
1899 1899
1900 public void osSetPrimFloatOnWater(int floatYN)
1901 {
1902 m_LSL_Functions.osSetPrimFloatOnWater(floatYN);
1903 }
1904
1900 public double llList2Float(LSL_Types.list src, int index) 1905 public double llList2Float(LSL_Types.list src, int index)
1901 { 1906 {
1902 return m_LSL_Functions.llList2Float(src, index); 1907 return m_LSL_Functions.llList2Float(src, index);
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 010961e..623ac29 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1508,6 +1508,8 @@ namespace OpenSim.Region.ScriptEngine.Common
1508 } 1508 }
1509 } 1509 }
1510 1510
1511
1512
1511 public void llSetHoverHeight(double height, int water, double tau) 1513 public void llSetHoverHeight(double height, int water, double tau)
1512 { 1514 {
1513 m_host.AddScriptLPS(1); 1515 m_host.AddScriptLPS(1);
@@ -4405,6 +4407,18 @@ namespace OpenSim.Region.ScriptEngine.Common
4405 return false; 4407 return false;
4406 } 4408 }
4407 4409
4410 public void osSetPrimFloatOnWater(int floatYN)
4411 {
4412 m_host.AddScriptLPS(1);
4413 if (m_host.ParentGroup != null)
4414 {
4415 if (m_host.ParentGroup.RootPart != null)
4416 {
4417 m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN);
4418 }
4419 }
4420 }
4421
4408 private void NotImplemented(string command) 4422 private void NotImplemented(string command)
4409 { 4423 {
4410 m_host.AddScriptLPS(1); 4424 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
index d60d70e..381ca62 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
@@ -648,6 +648,7 @@ namespace OpenSim.Region.ScriptEngine.Common
648 void osRegionNotice(string msg); 648 void osRegionNotice(string msg);
649 bool osConsoleCommand(string Command); 649 bool osConsoleCommand(string Command);
650 void osSetParcelMediaURL(string url); 650 void osSetParcelMediaURL(string url);
651 void osSetPrimFloatOnWater(int floatYN);
651 652
652 } 653 }
653} 654}