diff options
author | Robert Adams | 2013-02-03 16:08:09 -0800 |
---|---|---|
committer | Robert Adams | 2013-02-05 16:56:23 -0800 |
commit | ad438ee59fce1b262135ef0f7cd1213f3a79df50 (patch) | |
tree | 96871ce99daa85e8142c8ab3d6ec7e8ebeaa24ea /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: correct angular vertical attraction to properly correct an upside ... (diff) | |
download | opensim-SC_OLD-ad438ee59fce1b262135ef0f7cd1213f3a79df50.zip opensim-SC_OLD-ad438ee59fce1b262135ef0f7cd1213f3a79df50.tar.gz opensim-SC_OLD-ad438ee59fce1b262135ef0f7cd1213f3a79df50.tar.bz2 opensim-SC_OLD-ad438ee59fce1b262135ef0f7cd1213f3a79df50.tar.xz |
BulletSim: rework some parameter setting implementation moving functionality that was in BSScene to BSParam. Remove unused parameters that were passed to the unmanaged code. Update DLLs and SOs for the new param block.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index a4690ba..6cd72f2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -882,41 +882,41 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
882 | BSParam.ParameterDefn theParam; | 882 | BSParam.ParameterDefn theParam; |
883 | if (BSParam.TryGetParameter(parm, out theParam)) | 883 | if (BSParam.TryGetParameter(parm, out theParam)) |
884 | { | 884 | { |
885 | // Set the value in the C# code | ||
885 | theParam.setter(this, parm, localID, val); | 886 | theParam.setter(this, parm, localID, val); |
887 | |||
888 | // Optionally set the parameter in the unmanaged code | ||
889 | if (theParam.onObject != null) | ||
890 | { | ||
891 | // update all the localIDs specified | ||
892 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
893 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
894 | // If the localID is a specific object, apply the parameter change to only that object | ||
895 | List<uint> objectIDs = new List<uint>(); | ||
896 | switch (localID) | ||
897 | { | ||
898 | case PhysParameterEntry.APPLY_TO_NONE: | ||
899 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
900 | objectIDs.Add(TERRAIN_ID); | ||
901 | TaintedUpdateParameter(parm, objectIDs, val); | ||
902 | break; | ||
903 | case PhysParameterEntry.APPLY_TO_ALL: | ||
904 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
905 | TaintedUpdateParameter(parm, objectIDs, val); | ||
906 | break; | ||
907 | default: | ||
908 | // setting only one localID | ||
909 | objectIDs.Add(localID); | ||
910 | TaintedUpdateParameter(parm, objectIDs, val); | ||
911 | break; | ||
912 | } | ||
913 | } | ||
914 | |||
886 | ret = true; | 915 | ret = true; |
887 | } | 916 | } |
888 | return ret; | 917 | return ret; |
889 | } | 918 | } |
890 | 919 | ||
891 | // update all the localIDs specified | ||
892 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
893 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
894 | // If the localID is a specific object, apply the parameter change to only that object | ||
895 | internal delegate void AssignVal(float x); | ||
896 | internal void UpdateParameterObject(AssignVal setDefault, string parm, uint localID, float val) | ||
897 | { | ||
898 | List<uint> objectIDs = new List<uint>(); | ||
899 | switch (localID) | ||
900 | { | ||
901 | case PhysParameterEntry.APPLY_TO_NONE: | ||
902 | setDefault(val); // setting only the default value | ||
903 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
904 | objectIDs.Add(TERRAIN_ID); | ||
905 | TaintedUpdateParameter(parm, objectIDs, val); | ||
906 | break; | ||
907 | case PhysParameterEntry.APPLY_TO_ALL: | ||
908 | setDefault(val); // setting ALL also sets the default value | ||
909 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
910 | TaintedUpdateParameter(parm, objectIDs, val); | ||
911 | break; | ||
912 | default: | ||
913 | // setting only one localID | ||
914 | objectIDs.Add(localID); | ||
915 | TaintedUpdateParameter(parm, objectIDs, val); | ||
916 | break; | ||
917 | } | ||
918 | } | ||
919 | |||
920 | // schedule the actual updating of the paramter to when the phys engine is not busy | 920 | // schedule the actual updating of the paramter to when the phys engine is not busy |
921 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val) | 921 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val) |
922 | { | 922 | { |