diff options
author | Robert Adams | 2012-12-24 08:56:02 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-24 08:56:02 -0800 |
commit | 80cee1b85a646045c02e2bb675056d532ce2fe27 (patch) | |
tree | dc9347a2eeb3241cdd30f50d448b630ce5d5c4f9 /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |
parent | * Update BulletSimN terrain implementation to default to Heightfield, it's le... (diff) | |
download | opensim-SC-80cee1b85a646045c02e2bb675056d532ce2fe27.zip opensim-SC-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.gz opensim-SC-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.bz2 opensim-SC-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.xz |
BulletSim: Fix single physical prim reporting its mass as zero.
Properly return root mass as mass of just the root prim rather
than the mass of the linkset. SOG has the logic to add the masses
together to get the linkset mass.
Update TODO list.
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 8580928..756faed 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |||
@@ -97,14 +97,7 @@ public abstract class BSLinkset | |||
97 | } | 97 | } |
98 | 98 | ||
99 | // We keep the prim's mass in the linkset structure since it could be dependent on other prims | 99 | // We keep the prim's mass in the linkset structure since it could be dependent on other prims |
100 | protected float m_mass; | 100 | public float LinksetMass { get; protected set; } |
101 | public float LinksetMass | ||
102 | { | ||
103 | get | ||
104 | { | ||
105 | return m_mass; | ||
106 | } | ||
107 | } | ||
108 | 101 | ||
109 | public virtual bool LinksetIsColliding { get { return false; } } | 102 | public virtual bool LinksetIsColliding { get { return false; } } |
110 | 103 | ||
@@ -128,7 +121,7 @@ public abstract class BSLinkset | |||
128 | PhysicsScene = scene; | 121 | PhysicsScene = scene; |
129 | LinksetRoot = parent; | 122 | LinksetRoot = parent; |
130 | m_children = new HashSet<BSPhysObject>(); | 123 | m_children = new HashSet<BSPhysObject>(); |
131 | m_mass = parent.RawMass; | 124 | LinksetMass = parent.RawMass; |
132 | Rebuilding = false; | 125 | Rebuilding = false; |
133 | } | 126 | } |
134 | 127 | ||
@@ -143,7 +136,7 @@ public abstract class BSLinkset | |||
143 | // Don't add the root to its own linkset | 136 | // Don't add the root to its own linkset |
144 | if (!IsRoot(child)) | 137 | if (!IsRoot(child)) |
145 | AddChildToLinkset(child); | 138 | AddChildToLinkset(child); |
146 | m_mass = ComputeLinksetMass(); | 139 | LinksetMass = ComputeLinksetMass(); |
147 | } | 140 | } |
148 | return this; | 141 | return this; |
149 | } | 142 | } |
@@ -162,7 +155,7 @@ public abstract class BSLinkset | |||
162 | return this; | 155 | return this; |
163 | } | 156 | } |
164 | RemoveChildFromLinkset(child); | 157 | RemoveChildFromLinkset(child); |
165 | m_mass = ComputeLinksetMass(); | 158 | LinksetMass = ComputeLinksetMass(); |
166 | } | 159 | } |
167 | 160 | ||
168 | // The child is down to a linkset of just itself | 161 | // The child is down to a linkset of just itself |
@@ -230,7 +223,10 @@ public abstract class BSLinkset | |||
230 | // When physical properties are changed the linkset needs to recalculate | 223 | // When physical properties are changed the linkset needs to recalculate |
231 | // its internal properties. | 224 | // its internal properties. |
232 | // May be called at runtime or taint-time. | 225 | // May be called at runtime or taint-time. |
233 | public abstract void Refresh(BSPhysObject requestor); | 226 | public virtual void Refresh(BSPhysObject requestor) |
227 | { | ||
228 | LinksetMass = ComputeLinksetMass(); | ||
229 | } | ||
234 | 230 | ||
235 | // Flag denoting the linkset is in the process of being rebuilt. | 231 | // Flag denoting the linkset is in the process of being rebuilt. |
236 | // Used to know not the schedule a rebuild in the middle of a rebuild. | 232 | // Used to know not the schedule a rebuild in the middle of a rebuild. |