aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
diff options
context:
space:
mode:
authorRobert Adams2013-01-11 16:36:34 -0800
committerRobert Adams2013-01-11 16:47:53 -0800
commit459fcd81c9d6e7c92738b40f1b4b4fe746699379 (patch)
tree6555a0076aa18c3634ad89ef8c3d097d67edb08b /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
parentBulletSim: add osGetPhysicsEngineType() LSL function and update (diff)
downloadopensim-SC_OLD-459fcd81c9d6e7c92738b40f1b4b4fe746699379.zip
opensim-SC_OLD-459fcd81c9d6e7c92738b40f1b4b4fe746699379.tar.gz
opensim-SC_OLD-459fcd81c9d6e7c92738b40f1b4b4fe746699379.tar.bz2
opensim-SC_OLD-459fcd81c9d6e7c92738b40f1b4b4fe746699379.tar.xz
BulletSim: move center of gravity of linkset to its geometric center.
Necessitated allowing simulator and physical position of a body to get out of sync since Bullet assumes that <0,0,0> is the center of mass. Update DLLs and SOs for the UpdateChildTransform so positions of individual prim in a linkset can be implemented.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index 2c84293..185f111 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -73,6 +73,8 @@ public abstract class BSPhysObject : PhysicsActor
73 73
74 // A linkset of just me 74 // A linkset of just me
75 Linkset = BSLinkset.Factory(PhysicsScene, this); 75 Linkset = BSLinkset.Factory(PhysicsScene, this);
76 PositionDisplacement = OMV.Vector3.Zero;
77
76 LastAssetBuildFailed = false; 78 LastAssetBuildFailed = false;
77 79
78 // Default material type 80 // Default material type
@@ -157,6 +159,14 @@ public abstract class BSPhysObject : PhysicsActor
157 public abstract OMV.Vector3 RawPosition { get; set; } 159 public abstract OMV.Vector3 RawPosition { get; set; }
158 public abstract OMV.Vector3 ForcePosition { get; set; } 160 public abstract OMV.Vector3 ForcePosition { get; set; }
159 161
162 // Position is what the simulator thinks the positions of the prim is.
163 // Because Bullet needs the zero coordinate to be the center of mass of the linkset,
164 // sometimes it is necessary to displace the position the physics engine thinks
165 // the position is. PositionDisplacement must be added and removed from the
166 // position as the simulator position is stored and fetched from the physics
167 // engine.
168 public virtual OMV.Vector3 PositionDisplacement { get; set; }
169
160 public abstract OMV.Quaternion RawOrientation { get; set; } 170 public abstract OMV.Quaternion RawOrientation { get; set; }
161 public abstract OMV.Quaternion ForceOrientation { get; set; } 171 public abstract OMV.Quaternion ForceOrientation { get; set; }
162 172