aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorRobert Adams2013-08-06 10:32:56 -0700
committerJustin Clark-Casey (justincc)2013-09-20 21:01:24 +0100
commit719380380a348c0b7948ce4ff4cf05d086f2a6eb (patch)
treed6e1c4a3f82c4ac6bf6e5802c2497f7b9efedfd1 /OpenSim/Region/OptionalModules
parentChange collision logic in SceneObjectPart so land_collision will happen. (diff)
downloadopensim-SC_OLD-719380380a348c0b7948ce4ff4cf05d086f2a6eb.zip
opensim-SC_OLD-719380380a348c0b7948ce4ff4cf05d086f2a6eb.tar.gz
opensim-SC_OLD-719380380a348c0b7948ce4ff4cf05d086f2a6eb.tar.bz2
opensim-SC_OLD-719380380a348c0b7948ce4ff4cf05d086f2a6eb.tar.xz
BulletSim: fixes for change linkset implementation of physical linksets.
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rwxr-xr-xOpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs29
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs b/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs
index d1d318c..4455df4 100755
--- a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
29using System.Linq; 29using System.Linq;
30using System.Reflection; 30using System.Reflection;
31using System.Text; 31using System.Text;
32using System.Threading;
32 33
33using OpenSim.Framework; 34using OpenSim.Framework;
34using OpenSim.Region.CoreModules; 35using OpenSim.Region.CoreModules;
@@ -198,7 +199,33 @@ public class ExtendedPhysics : INonSharedRegionModule
198 Physics.Manager.PhysicsActor rootPhysActor = rootPart.PhysActor; 199 Physics.Manager.PhysicsActor rootPhysActor = rootPart.PhysActor;
199 if (rootPhysActor != null) 200 if (rootPhysActor != null)
200 { 201 {
201 ret = (int)rootPhysActor.Extension(PhysFunctSetLinksetType, linksetType); 202 if (rootPhysActor.IsPhysical)
203 {
204 // Change a physical linkset by making non-physical, waiting for one heartbeat so all
205 // the prim and linkset state is updated, changing the type and making the
206 // linkset physical again.
207 containingGroup.ScriptSetPhysicsStatus(false);
208 Thread.Sleep(150); // longer than one heartbeat tick
209
210 // A kludge for the moment.
211 // Since compound linksets move the children but don't generate position updates to the
212 // simulator, it is possible for compound linkset children to have out-of-sync simulator
213 // and physical positions. The following causes the simulator to push the real child positions
214 // down into the physics engine to get everything synced.
215 containingGroup.UpdateGroupPosition(containingGroup.AbsolutePosition);
216 containingGroup.UpdateGroupRotationR(containingGroup.GroupRotation);
217
218 ret = (int)rootPhysActor.Extension(PhysFunctSetLinksetType, linksetType);
219 Thread.Sleep(150); // longer than one heartbeat tick
220
221 containingGroup.ScriptSetPhysicsStatus(true);
222 }
223 else
224 {
225 // Non-physical linksets don't have a physical instantiation so there is no state to
226 // worry about being updated.
227 ret = (int)rootPhysActor.Extension(PhysFunctSetLinksetType, linksetType);
228 }
202 } 229 }
203 else 230 else
204 { 231 {