aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorUbitUmarov2013-05-29 06:32:26 +0100
committerUbitUmarov2013-05-29 06:32:26 +0100
commit269febc87e1aba24fff09e9fb0d77eee0a73b185 (patch)
tree196cd7cab7dbd301c3deda7ff605776ed14ae059 /OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
parent make sure friction slip parameters are zero ( or other value ) and not (diff)
downloadopensim-SC_OLD-269febc87e1aba24fff09e9fb0d77eee0a73b185.zip
opensim-SC_OLD-269febc87e1aba24fff09e9fb0d77eee0a73b185.tar.gz
opensim-SC_OLD-269febc87e1aba24fff09e9fb0d77eee0a73b185.tar.bz2
opensim-SC_OLD-269febc87e1aba24fff09e9fb0d77eee0a73b185.tar.xz
let gravity modifier, friction, restitution and density changes be applied
to prim. Only have efect on root prim. Density doesn't get effect imediatly, only on next change of size or shape. density change implies a full body rebuild to be done later, after reducing the number of sets sop does. Other parameters should work. **** mainly untested ***
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs52
1 files changed, 51 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
index 7cabddd..e3f88c6 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -115,6 +115,7 @@ namespace OpenSim.Region.Physics.OdePlugin
115 115
116 private int body_autodisable_frames; 116 private int body_autodisable_frames;
117 public int bodydisablecontrol; 117 public int bodydisablecontrol;
118 private float m_gravmod = 1.0f;
118 119
119 120
120 // Default we're a Geometry 121 // Default we're a Geometry
@@ -914,6 +915,55 @@ namespace OpenSim.Region.Physics.OdePlugin
914 bounce = _parent_scene.m_materialContactsData[pMaterial].bounce; 915 bounce = _parent_scene.m_materialContactsData[pMaterial].bounce;
915 } 916 }
916 917
918 public override float Density
919 {
920 get
921 {
922 return m_density * 100f;
923 }
924 set
925 {
926 m_density = value / 100f;
927 // for not prim mass is not updated since this implies full rebuild of body inertia TODO
928 }
929 }
930 public override float GravModifier
931 {
932 get
933 {
934 return m_gravmod;
935 }
936 set
937 {
938 m_gravmod = value;
939 if (m_vehicle != null)
940 m_vehicle.GravMod = m_gravmod;
941 }
942 }
943 public override float Friction
944 {
945 get
946 {
947 return mu;
948 }
949 set
950 {
951 mu = value;
952 }
953 }
954
955 public override float Restitution
956 {
957 get
958 {
959 return bounce;
960 }
961 set
962 {
963 bounce = value;
964 }
965 }
966
917 public void setPrimForRemoval() 967 public void setPrimForRemoval()
918 { 968 {
919 AddChange(changes.Remove, null); 969 AddChange(changes.Remove, null);
@@ -3336,7 +3386,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3336 } 3386 }
3337 else 3387 else
3338 { 3388 {
3339 float b = (1.0f - m_buoyancy); 3389 float b = (1.0f - m_buoyancy) * m_gravmod;
3340 fx = _parent_scene.gravityx * b; 3390 fx = _parent_scene.gravityx * b;
3341 fy = _parent_scene.gravityy * b; 3391 fy = _parent_scene.gravityy * b;
3342 fz = _parent_scene.gravityz * b; 3392 fz = _parent_scene.gravityz * b;