aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs51
3 files changed, 51 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d3d5d08..74d24a6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -680,6 +680,9 @@ namespace OpenSim.Region.Framework.Scenes
680 680
681 ApplyPhysics(m_scene.m_physicalPrim); 681 ApplyPhysics(m_scene.m_physicalPrim);
682 682
683 if (RootPart.PhysActor != null)
684 RootPart.Buoyancy = RootPart.Buoyancy;
685
683 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 686 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
684 // for the same object with very different properties. The caller must schedule the update. 687 // for the same object with very different properties. The caller must schedule the update.
685 //ScheduleGroupForFullUpdate(); 688 //ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4e1d6b6..cb321aa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -338,6 +338,7 @@ namespace OpenSim.Region.Framework.Scenes
338 protected Vector3 m_lastAcceleration; 338 protected Vector3 m_lastAcceleration;
339 protected Vector3 m_lastAngularVelocity; 339 protected Vector3 m_lastAngularVelocity;
340 protected int m_lastTerseSent; 340 protected int m_lastTerseSent;
341 protected float m_buoyancy = 0.0f;
341 342
342 /// <summary> 343 /// <summary>
343 /// Stores media texture data 344 /// Stores media texture data
@@ -1335,6 +1336,19 @@ namespace OpenSim.Region.Framework.Scenes
1335 set { m_collisionSoundVolume = value; } 1336 set { m_collisionSoundVolume = value; }
1336 } 1337 }
1337 1338
1339 public float Buoyancy
1340 {
1341 get { return m_buoyancy; }
1342 set
1343 {
1344 m_buoyancy = value;
1345 if (PhysActor != null)
1346 {
1347 PhysActor.Buoyancy = value;
1348 }
1349 }
1350 }
1351
1338 #endregion Public Properties with only Get 1352 #endregion Public Properties with only Get
1339 1353
1340 #region Private Methods 1354 #region Private Methods
@@ -3275,14 +3289,6 @@ namespace OpenSim.Region.Framework.Scenes
3275 STATUS_ROTATE_Z = rotate; 3289 STATUS_ROTATE_Z = rotate;
3276 } 3290 }
3277 3291
3278 public void SetBuoyancy(float fvalue)
3279 {
3280 if (PhysActor != null)
3281 {
3282 PhysActor.Buoyancy = fvalue;
3283 }
3284 }
3285
3286 public void SetDieAtEdge(bool p) 3292 public void SetDieAtEdge(bool p)
3287 { 3293 {
3288 if (m_parentGroup == null) 3294 if (m_parentGroup == null)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index f7c44d1..b87bf5a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3453,7 +3453,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3453 { 3453 {
3454 if (!m_host.ParentGroup.IsDeleted) 3454 if (!m_host.ParentGroup.IsDeleted)
3455 { 3455 {
3456 m_host.ParentGroup.RootPart.SetBuoyancy((float)buoyancy); 3456 m_host.ParentGroup.RootPart.Buoyancy = (float)buoyancy;
3457 } 3457 }
3458 } 3458 }
3459 } 3459 }
@@ -3707,27 +3707,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3707 return; 3707 return;
3708 } 3708 }
3709 } 3709 }
3710 else if (m_host.SitTargetAvatar == agentID) // Sitting avatar 3710 else
3711 { 3711 {
3712 // When agent is sitting, certain permissions are implicit if requested from sitting agent 3712 bool sitting = false;
3713 int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | 3713 if (m_host.SitTargetAvatar == agentID)
3714 ScriptBaseClass.PERMISSION_CONTROL_CAMERA | 3714 {
3715 ScriptBaseClass.PERMISSION_TRACK_CAMERA | 3715 sitting = true;
3716 ScriptBaseClass.PERMISSION_TAKE_CONTROLS; 3716 }
3717 else
3718 {
3719 foreach (SceneObjectPart p in m_host.ParentGroup.Parts)
3720 {
3721 if (p.SitTargetAvatar == agentID)
3722 sitting = true;
3723 }
3724 }
3717 3725
3718 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms 3726 if (sitting)
3719 { 3727 {
3720 m_host.TaskInventory.LockItemsForWrite(true); 3728 // When agent is sitting, certain permissions are implicit if requested from sitting agent
3721 m_host.TaskInventory[invItemID].PermsGranter = agentID; 3729 int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION |
3722 m_host.TaskInventory[invItemID].PermsMask = perm; 3730 ScriptBaseClass.PERMISSION_CONTROL_CAMERA |
3723 m_host.TaskInventory.LockItemsForWrite(false); 3731 ScriptBaseClass.PERMISSION_TRACK_CAMERA |
3732 ScriptBaseClass.PERMISSION_TAKE_CONTROLS;
3724 3733
3725 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( 3734 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
3726 "run_time_permissions", new Object[] { 3735 {
3727 new LSL_Integer(perm) }, 3736 m_host.TaskInventory.LockItemsForWrite(true);
3728 new DetectParams[0])); 3737 m_host.TaskInventory[invItemID].PermsGranter = agentID;
3738 m_host.TaskInventory[invItemID].PermsMask = perm;
3739 m_host.TaskInventory.LockItemsForWrite(false);
3729 3740
3730 return; 3741 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
3742 "run_time_permissions", new Object[] {
3743 new LSL_Integer(perm) },
3744 new DetectParams[0]));
3745
3746 return;
3747 }
3731 } 3748 }
3732 } 3749 }
3733 3750