aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
diff options
context:
space:
mode:
authorRobert Adams2012-09-13 10:11:39 -0700
committerRobert Adams2012-09-15 15:31:44 -0700
commit7c347f4c5c966848669b979b367e1bc3912621d5 (patch)
tree25c249932b72be0e6174c94b4d9b59fa271cb37e /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
parentBulletSim: remove unused NeedsMeshing() code from BSScene. (diff)
downloadopensim-SC-7c347f4c5c966848669b979b367e1bc3912621d5.zip
opensim-SC-7c347f4c5c966848669b979b367e1bc3912621d5.tar.gz
opensim-SC-7c347f4c5c966848669b979b367e1bc3912621d5.tar.bz2
opensim-SC-7c347f4c5c966848669b979b367e1bc3912621d5.tar.xz
BulletSim: Add calls to linkset class when object going static or dynamic.
Reset center of mass on an object when going dynamic.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index dc1de6c..3d73887 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -202,6 +202,24 @@ public class BSLinkset
202 return com; 202 return com;
203 } 203 }
204 204
205 // The object is going dynamic (physical). Do any setup necessary
206 // for a dynamic linkset.
207 // Return 'true' if any properties updated on the passed object.
208 // Called at taint-time!
209 public bool MakeDynamic(BSPhysObject child)
210 {
211 return false;
212 }
213
214 // The object is going static (non-physical). Do any setup necessary
215 // for a static linkset.
216 // Return 'true' if any properties updated on the passed object.
217 // Called at taint-time!
218 public bool MakeStatic(BSPhysObject child)
219 {
220 return false;
221 }
222
205 // When physical properties are changed the linkset needs to recalculate 223 // When physical properties are changed the linkset needs to recalculate
206 // its internal properties. 224 // its internal properties.
207 public void Refresh(BSPhysObject requestor) 225 public void Refresh(BSPhysObject requestor)
@@ -255,13 +273,11 @@ public class BSLinkset
255 if (!somethingMissing) 273 if (!somethingMissing)
256 { 274 {
257 // The root prim takes on the weight of the whole linkset 275 // The root prim takes on the weight of the whole linkset
258 /*
259 OMV.Vector3 inertia = BulletSimAPI.CalculateLocalInertia2(LinksetRoot.BSShape.Ptr, linksetMass); 276 OMV.Vector3 inertia = BulletSimAPI.CalculateLocalInertia2(LinksetRoot.BSShape.Ptr, linksetMass);
260 BulletSimAPI.SetMassProps2(LinksetRoot.BSBody.Ptr, linksetMass, inertia); 277 BulletSimAPI.SetMassProps2(LinksetRoot.BSBody.Ptr, linksetMass, inertia);
261 OMV.Vector3 centerOfMass = ComputeLinksetCenterOfMass(); 278 OMV.Vector3 centerOfMass = ComputeLinksetCenterOfMass();
262 BulletSimAPI.SetCenterOfMassByPosRot2(LinksetRoot.BSBody.Ptr, centerOfMass, OMV.Quaternion.Identity); 279 BulletSimAPI.SetCenterOfMassByPosRot2(LinksetRoot.BSBody.Ptr, centerOfMass, OMV.Quaternion.Identity);
263 BulletSimAPI.UpdateInertiaTensor2(LinksetRoot.BSBody.Ptr); 280 BulletSimAPI.UpdateInertiaTensor2(LinksetRoot.BSBody.Ptr);
264 */
265 } 281 }
266 } 282 }
267 return; 283 return;