diff options
author | Robert Adams | 2013-01-11 16:36:34 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-11 16:47:53 -0800 |
commit | 459fcd81c9d6e7c92738b40f1b4b4fe746699379 (patch) | |
tree | 6555a0076aa18c3634ad89ef8c3d097d67edb08b /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |
parent | BulletSim: add osGetPhysicsEngineType() LSL function and update (diff) | |
download | opensim-SC-459fcd81c9d6e7c92738b40f1b4b4fe746699379.zip opensim-SC-459fcd81c9d6e7c92738b40f1b4b4fe746699379.tar.gz opensim-SC-459fcd81c9d6e7c92738b40f1b4b4fe746699379.tar.bz2 opensim-SC-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/BSLinkset.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 756faed..cbd160f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |||
@@ -152,6 +152,7 @@ public abstract class BSLinkset | |||
152 | if (IsRoot(child)) | 152 | if (IsRoot(child)) |
153 | { | 153 | { |
154 | // Cannot remove the root from a linkset. | 154 | // Cannot remove the root from a linkset. |
155 | child.PositionDisplacement = OMV.Vector3.Zero; | ||
155 | return this; | 156 | return this; |
156 | } | 157 | } |
157 | RemoveChildFromLinkset(child); | 158 | RemoveChildFromLinkset(child); |
@@ -159,6 +160,7 @@ public abstract class BSLinkset | |||
159 | } | 160 | } |
160 | 161 | ||
161 | // The child is down to a linkset of just itself | 162 | // The child is down to a linkset of just itself |
163 | child.PositionDisplacement = OMV.Vector3.Zero; | ||
162 | return BSLinkset.Factory(PhysicsScene, child); | 164 | return BSLinkset.Factory(PhysicsScene, child); |
163 | } | 165 | } |
164 | 166 | ||
@@ -310,7 +312,7 @@ public abstract class BSLinkset | |||
310 | 312 | ||
311 | foreach (BSPhysObject bp in m_children) | 313 | foreach (BSPhysObject bp in m_children) |
312 | { | 314 | { |
313 | com += bp.Position * bp.RawMass; | 315 | com += bp.Position; |
314 | } | 316 | } |
315 | com /= (m_children.Count + 1); | 317 | com /= (m_children.Count + 1); |
316 | } | 318 | } |