From c6a6631efc74ac8c139e0ae8cad683496fdd0050 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 7 Aug 2013 10:24:37 -0700 Subject: BulletSim: move linkset extension operations into BSPrimLinkable where they should be. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 32 +---------------- .../Region/Physics/BulletSPlugin/BSPrimLinkable.cs | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 31 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index d5b999d..4685b48 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin [Serializable] public class BSPrim : BSPhysObject { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly string LogHeader = "[BULLETS PRIM]"; // _size is what the user passed. Scale is what we pass to the physics engine with the mesh. @@ -1555,36 +1555,6 @@ public class BSPrim : BSPhysObject object ret = null; switch (pFunct) { - case BSScene.PhysFunctGetLinksetType: - { - BSPrimLinkable myHandle = this as BSPrimLinkable; - if (myHandle != null) - { - ret = (object)myHandle.LinksetType; - } - m_log.DebugFormat("{0} Extension.physGetLinksetType, type={1}", LogHeader, ret); - break; - } - case BSScene.PhysFunctSetLinksetType: - { - if (pParams.Length > 0) - { - BSLinkset.LinksetImplementation linksetType = (BSLinkset.LinksetImplementation)pParams[0]; - BSPrimLinkable myHandle = this as BSPrimLinkable; - if (myHandle != null && myHandle.Linkset.IsRoot(myHandle)) - { - PhysScene.TaintedObject("BSPrim.PhysFunctSetLinksetType", delegate() - { - // Cause the linkset type to change - m_log.DebugFormat("{0} Extension.physSetLinksetType, oldType={1}, newType={2}", - LogHeader, myHandle.Linkset.LinksetImpl, linksetType); - myHandle.ConvertLinkset(linksetType); - }); - } - ret = (object)(int)linksetType; - } - break; - } default: ret = base.Extension(pFunct, pParams); break; diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs index 38d1f88..fc639ad 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs @@ -41,6 +41,8 @@ public class BSPrimLinkable : BSPrimDisplaced // operations necessary for keeping the linkset created and, additionally, this // calls the linkset implementation for its creation and management. + private static readonly string LogHeader = "[BULLETS PRIMLINKABLE]"; + // This adds the overrides for link() and delink() so the prim is linkable. public BSLinkset Linkset { get; set; } @@ -279,5 +281,44 @@ public class BSPrimLinkable : BSPrimDisplaced } return ret; } + + #region Extension + public override object Extension(string pFunct, params object[] pParams) + { + object ret = null; + switch (pFunct) + { + case BSScene.PhysFunctGetLinksetType: + { + ret = (object)LinksetType; + m_log.DebugFormat("{0} Extension.physGetLinksetType, type={1}", LogHeader, ret); + break; + } + case BSScene.PhysFunctSetLinksetType: + { + if (pParams.Length > 0) + { + BSLinkset.LinksetImplementation linksetType = (BSLinkset.LinksetImplementation)pParams[0]; + if (Linkset.IsRoot(this)) + { + PhysScene.TaintedObject("BSPrim.PhysFunctSetLinksetType", delegate() + { + // Cause the linkset type to change + m_log.DebugFormat("{0} Extension.physSetLinksetType, oldType={1}, newType={2}", + LogHeader, Linkset.LinksetImpl, linksetType); + ConvertLinkset(linksetType); + }); + } + ret = (object)(int)linksetType; + } + break; + } + default: + ret = base.Extension(pFunct, pParams); + break; + } + return ret; + } + #endregion // Extension } } -- cgit v1.1