aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs
diff options
context:
space:
mode:
authorRobert Adams2013-04-30 11:42:11 -0700
committerRobert Adams2013-04-30 11:42:11 -0700
commit7cdb07b386ffe88749fcc6cabadd9851f254699d (patch)
tree92b4a1851c00b1a3352e4e853adda013a98aa181 /OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs
parentBulletSim: Add non-static BSShape.GetReference for getting another reference (diff)
downloadopensim-SC-7cdb07b386ffe88749fcc6cabadd9851f254699d.zip
opensim-SC-7cdb07b386ffe88749fcc6cabadd9851f254699d.tar.gz
opensim-SC-7cdb07b386ffe88749fcc6cabadd9851f254699d.tar.bz2
opensim-SC-7cdb07b386ffe88749fcc6cabadd9851f254699d.tar.xz
BulletSim: improvements to LinksetCompound and PrimDisplaced. Not all working yet.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs22
1 files changed, 17 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs
index f1c3b5c..f5ee671 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs
@@ -78,14 +78,16 @@ public class BSPrimDisplaced : BSPrim
78 // Set this sets and computes the displacement from the passed prim to the center-of-mass. 78 // Set this sets and computes the displacement from the passed prim to the center-of-mass.
79 // A user set value for center-of-mass overrides whatever might be passed in here. 79 // A user set value for center-of-mass overrides whatever might be passed in here.
80 // The displacement is in local coordinates (relative to root prim in linkset oriented coordinates). 80 // The displacement is in local coordinates (relative to root prim in linkset oriented coordinates).
81 public virtual void SetEffectiveCenterOfMassW(Vector3 centerOfMassDisplacement) 81 public virtual void SetEffectiveCenterOfMassDisplacement(Vector3 centerOfMassDisplacement)
82 { 82 {
83 Vector3 comDisp; 83 Vector3 comDisp;
84 if (UserSetCenterOfMass.HasValue) 84 if (UserSetCenterOfMassDisplacement.HasValue)
85 comDisp = (OMV.Vector3)UserSetCenterOfMass; 85 comDisp = (OMV.Vector3)UserSetCenterOfMassDisplacement;
86 else 86 else
87 comDisp = centerOfMassDisplacement; 87 comDisp = centerOfMassDisplacement;
88 88
89 DetailLog("{0},BSPrimDisplaced.SetEffectiveCenterOfMassDisplacement,userSet={1},comDisp={2}",
90 LocalID, UserSetCenterOfMassDisplacement.HasValue, comDisp);
89 if (comDisp == Vector3.Zero) 91 if (comDisp == Vector3.Zero)
90 { 92 {
91 // If there is no diplacement. Things get reset. 93 // If there is no diplacement. Things get reset.
@@ -107,9 +109,15 @@ public class BSPrimDisplaced : BSPrim
107 set 109 set
108 { 110 {
109 if (PositionDisplacement != OMV.Vector3.Zero) 111 if (PositionDisplacement != OMV.Vector3.Zero)
110 base.ForcePosition = value - (PositionDisplacement * RawOrientation); 112 {
113 OMV.Vector3 displacedPos = value - (PositionDisplacement * RawOrientation);
114 DetailLog("{0},BSPrimDisplaced.ForcePosition,val={1},disp={2},newPos={3}", LocalID, value, PositionDisplacement, displacedPos);
115 base.ForcePosition = displacedPos;
116 }
111 else 117 else
118 {
112 base.ForcePosition = value; 119 base.ForcePosition = value;
120 }
113 } 121 }
114 } 122 }
115 123
@@ -118,6 +126,7 @@ public class BSPrimDisplaced : BSPrim
118 get { return base.ForceOrientation; } 126 get { return base.ForceOrientation; }
119 set 127 set
120 { 128 {
129 // TODO:
121 base.ForceOrientation = value; 130 base.ForceOrientation = value;
122 } 131 }
123 } 132 }
@@ -143,7 +152,10 @@ public class BSPrimDisplaced : BSPrim
143 { 152 {
144 // Correct for any rotation around the center-of-mass 153 // Correct for any rotation around the center-of-mass
145 // TODO!!! 154 // TODO!!!
146 entprop.Position = entprop.Position + (PositionDisplacement * entprop.Rotation); 155
156 OMV.Vector3 displacedPos = entprop.Position + (PositionDisplacement * entprop.Rotation);
157 DetailLog("{0},BSPrimDisplaced.ForcePosition,physPos={1},disp={2},newPos={3}", LocalID, entprop.Position, PositionDisplacement, displacedPos);
158 entprop.Position = displacedPos;
147 // entprop.Rotation = something; 159 // entprop.Rotation = something;
148 } 160 }
149 161