diff options
author | Teravus Ovares | 2008-03-10 05:56:58 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-03-10 05:56:58 +0000 |
commit | d0123a796b0066a50914c6fae5d86550dcf58636 (patch) | |
tree | 5e7a5091afffc219c96c7649c4b2535215faf8e5 /OpenSim/Region/Physics | |
parent | * Added ODEPlugin Support for llSetBuoyancy. Set Buoyancy to 1 for space prim. (diff) | |
download | opensim-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 'OpenSim/Region/Physics')
7 files changed, 75 insertions, 0 deletions
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; } |