aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapes.cs145
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs2
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt12
-rwxr-xr-xbin/lib32/BulletSim.dllbin551936 -> 551936 bytes
-rwxr-xr-xbin/lib32/libBulletSim.sobin1715168 -> 1715168 bytes
-rwxr-xr-xbin/lib64/BulletSim.dllbin700928 -> 700928 bytes
-rwxr-xr-xbin/lib64/libBulletSim.sobin1857493 -> 1857493 bytes
8 files changed, 151 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 13c2539..a9fbc8b 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -137,6 +137,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
137 get { return Type != Vehicle.TYPE_NONE && Prim.IsPhysical; } 137 get { return Type != Vehicle.TYPE_NONE && Prim.IsPhysical; }
138 } 138 }
139 139
140 #region Vehicle parameter setting
140 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) 141 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
141 { 142 {
142 VDetailLog("{0},ProcessFloatVehicleParam,param={1},val={2}", Prim.LocalID, pParam, pValue); 143 VDetailLog("{0},ProcessFloatVehicleParam,param={1},val={2}", Prim.LocalID, pParam, pValue);
@@ -546,6 +547,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
546 m_verticalAttractionMotor.FrictionTimescale = new Vector3(BSMotor.Infinite, BSMotor.Infinite, 0.1f); 547 m_verticalAttractionMotor.FrictionTimescale = new Vector3(BSMotor.Infinite, BSMotor.Infinite, 0.1f);
547 m_verticalAttractionMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG DEBUG (enables detail logging) 548 m_verticalAttractionMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG DEBUG (enables detail logging)
548 } 549 }
550 #endregion // Vehicle parameter setting
549 551
550 // Some of the properties of this prim may have changed. 552 // Some of the properties of this prim may have changed.
551 // Do any updating needed for a vehicle 553 // Do any updating needed for a vehicle
@@ -925,7 +927,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
925 // TODO: Consider taking the rotated size of the object or possibly casting a ray. 927 // TODO: Consider taking the rotated size of the object or possibly casting a ray.
926 if (VehiclePosition.Z < GetTerrainHeight(VehiclePosition)) 928 if (VehiclePosition.Z < GetTerrainHeight(VehiclePosition))
927 { 929 {
928 // TODO: correct position by applying force rather than forcing position. 930 // Force position because applying force won't get the vehicle through the terrain
929 Vector3 newPosition = VehiclePosition; 931 Vector3 newPosition = VehiclePosition;
930 newPosition.Z = GetTerrainHeight(VehiclePosition) + 1f; 932 newPosition.Z = GetTerrainHeight(VehiclePosition) + 1f;
931 VehiclePosition = newPosition; 933 VehiclePosition = newPosition;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
index c75eb9b..cc725e8 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
@@ -27,24 +27,19 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Linq;
31using System.Text; 30using System.Text;
32 31
32using OMV = OpenMetaverse;
33
33namespace OpenSim.Region.Physics.BulletSPlugin 34namespace OpenSim.Region.Physics.BulletSPlugin
34{ 35{
35public abstract class BSShape 36public abstract class BSShape
36{ 37{
37 public IntPtr ptr { get; set; }
38 public BSPhysicsShapeType type { get; set; }
39 public System.UInt64 key { get; set; }
40 public int referenceCount { get; set; } 38 public int referenceCount { get; set; }
41 public DateTime lastReferenced { get; set; } 39 public DateTime lastReferenced { get; set; }
42 40
43 public BSShape() 41 public BSShape()
44 { 42 {
45 ptr = IntPtr.Zero;
46 type = BSPhysicsShapeType.SHAPE_UNKNOWN;
47 key = 0;
48 referenceCount = 0; 43 referenceCount = 0;
49 lastReferenced = DateTime.Now; 44 lastReferenced = DateTime.Now;
50 } 45 }
@@ -63,7 +58,7 @@ public abstract class BSShape
63 } 58 }
64 59
65 // Compound shapes are handled special as they are rebuilt from scratch. 60 // Compound shapes are handled special as they are rebuilt from scratch.
66 // This isn't too great a hardship since most of the child shapes will already been created. 61 // This isn't too great a hardship since most of the child shapes will have already been created.
67 if (ret == null && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_COMPOUND) 62 if (ret == null && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_COMPOUND)
68 { 63 {
69 // Getting a reference to a compound shape gets you the compound shape with the root prim shape added 64 // Getting a reference to a compound shape gets you the compound shape with the root prim shape added
@@ -71,6 +66,14 @@ public abstract class BSShape
71 physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,compoundShape,shape={1}", prim.LocalID, ret); 66 physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,compoundShape,shape={1}", prim.LocalID, ret);
72 } 67 }
73 68
69 // Avatars have their own unique shape
70 if (ret == null && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_AVATAR)
71 {
72 // Getting a reference to a compound shape gets you the compound shape with the root prim shape added
73 ret = BSShapeAvatar.GetReference(prim);
74 physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,avatarShape,shape={1}", prim.LocalID, ret);
75 }
76
74 if (ret == null) 77 if (ret == null)
75 ret = GetShapeReferenceNonSpecial(physicsScene, forceRebuild, prim); 78 ret = GetShapeReferenceNonSpecial(physicsScene, forceRebuild, prim);
76 79
@@ -228,5 +231,131 @@ public class BSShapeAvatar : BSShape
228 return new BSShapeNull(); 231 return new BSShapeNull();
229 } 232 }
230 public override void Dereference(BSScene physicsScene) { } 233 public override void Dereference(BSScene physicsScene) { }
234
235 // From the front:
236 // A---A
237 // / \
238 // B-------B
239 // / \ +Z
240 // C-----------C |
241 // \ / -Y --+-- +Y
242 // \ / |
243 // \ / -Z
244 // D-----D
245 // \ /
246 // E-E
247
248 // From the top A and E are just lines.
249 // B, C and D are hexagons:
250 //
251 // C1--C2 +X
252 // / \ |
253 // C0 C3 -Y --+-- +Y
254 // \ / |
255 // C5--C4 -X
256
257 // Zero goes directly through the middle so the offsets are from that middle axis
258 // and up and down from a middle horizon (A and E are the same distance from the zero).
259 // The height, width and depth is one. All scaling is done by the simulator.
260
261 // Z component -- how far the level is from the middle zero
262 private const float Aup = 0.5f;
263 private const float Bup = 0.4f;
264 private const float Cup = 0.3f;
265 private const float Dup = -0.4f;
266 private const float Eup = -0.5f;
267
268 // Y component -- distance from center to x0 and x3
269 private const float Awid = 0.25f;
270 private const float Bwid = 0.3f;
271 private const float Cwid = 0.5f;
272 private const float Dwid = 0.3f;
273 private const float Ewid = 0.2f;
274
275 // Y component -- distance from center to x1, x2, x4 and x5
276 private const float Afwid = 0.0f;
277 private const float Bfwid = 0.2f;
278 private const float Cfwid = 0.4f;
279 private const float Dfwid = 0.2f;
280 private const float Efwid = 0.0f;
281
282 // X component -- distance from zero to the front or back of a level
283 private const float Adep = 0f;
284 private const float Bdep = 0.3f;
285 private const float Cdep = 0.5f;
286 private const float Ddep = 0.2f;
287 private const float Edep = 0f;
288
289 private OMV.Vector3[] avatarVertices = {
290 new OMV.Vector3( 0.0f, -Awid, Aup), // A0
291 new OMV.Vector3( 0.0f, +Awid, Aup), // A3
292
293 new OMV.Vector3( 0.0f, -Bwid, Bup), // B0
294 new OMV.Vector3(+Bdep, -Bfwid, Bup), // B1
295 new OMV.Vector3(+Bdep, +Bfwid, Bup), // B2
296 new OMV.Vector3( 0.0f, +Bwid, Bup), // B3
297 new OMV.Vector3(-Bdep, +Bfwid, Bup), // B4
298 new OMV.Vector3(-Bdep, -Bfwid, Bup), // B5
299
300 new OMV.Vector3( 0.0f, -Cwid, Cup), // C0
301 new OMV.Vector3(+Cdep, -Cfwid, Cup), // C1
302 new OMV.Vector3(+Cdep, +Cfwid, Cup), // C2
303 new OMV.Vector3( 0.0f, +Cwid, Cup), // C3
304 new OMV.Vector3(-Cdep, +Cfwid, Cup), // C4
305 new OMV.Vector3(-Cdep, -Cfwid, Cup), // C5
306
307 new OMV.Vector3( 0.0f, -Dwid, Dup), // D0
308 new OMV.Vector3(+Ddep, -Dfwid, Dup), // D1
309 new OMV.Vector3(+Ddep, +Dfwid, Dup), // D2
310 new OMV.Vector3( 0.0f, +Dwid, Dup), // D3
311 new OMV.Vector3(-Ddep, +Dfwid, Dup), // D4
312 new OMV.Vector3(-Ddep, -Dfwid, Dup), // D5
313
314 new OMV.Vector3( 0.0f, -Ewid, Eup), // E0
315 new OMV.Vector3( 0.0f, +Ewid, Eup), // E3
316 };
317
318 // Offsets of the vertices in the vertices array
319 private enum Ind : int
320 {
321 A0, A3,
322 B0, B1, B2, B3, B4, B5,
323 C0, C1, C2, C3, C4, C5,
324 D0, D1, D2, D3, D4, D5,
325 E0, E3
326 }
327
328 // Comments specify trianges and quads in clockwise direction
329 private Ind[] avatarIndices = {
330 Ind.A0, Ind.B0, Ind.B1, // A0,B0,B1
331 Ind.A0, Ind.B1, Ind.B2, Ind.B2, Ind.A3, Ind.A0, // A0,B1,B2,A3
332 Ind.A3, Ind.B2, Ind.B3, // A3,B2,B3
333 Ind.A3, Ind.B3, Ind.B4, // A3,B3,B4
334 Ind.A3, Ind.B4, Ind.B5, Ind.B5, Ind.A0, Ind.A3, // A3,B4,B5,A0
335 Ind.A0, Ind.B5, Ind.B0, // A0,B5,B0
336
337 Ind.B0, Ind.C0, Ind.C1, Ind.C1, Ind.B1, Ind.B0, // B0,C0,C1,B1
338 Ind.B1, Ind.C1, Ind.C2, Ind.C2, Ind.B2, Ind.B1, // B1,C1,C2,B2
339 Ind.B2, Ind.C2, Ind.C3, Ind.C3, Ind.B3, Ind.B2, // B2,C2,C3,B3
340 Ind.B3, Ind.C3, Ind.C4, Ind.C4, Ind.B4, Ind.B3, // B3,C3,C4,B4
341 Ind.B4, Ind.C4, Ind.C5, Ind.C5, Ind.B5, Ind.B4, // B4,C4,C5,B5
342 Ind.B5, Ind.C5, Ind.C0, Ind.C0, Ind.B0, Ind.B5, // B5,C5,C0,B0
343
344 Ind.C0, Ind.D0, Ind.D1, Ind.D1, Ind.C1, Ind.C0, // C0,D0,D1,C1
345 Ind.C1, Ind.D1, Ind.D2, Ind.D2, Ind.C2, Ind.C1, // C1,D1,D2,C2
346 Ind.C2, Ind.D2, Ind.D3, Ind.D3, Ind.C3, Ind.C2, // C2,D2,D3,C3
347 Ind.C3, Ind.D3, Ind.D4, Ind.D4, Ind.C4, Ind.C3, // C3,D3,D4,C4
348 Ind.C4, Ind.D4, Ind.D5, Ind.D5, Ind.C5, Ind.C4, // C4,D4,D5,C5
349 Ind.C5, Ind.D5, Ind.D0, Ind.D0, Ind.C0, Ind.C5, // C5,D5,D0,C0
350
351 Ind.E0, Ind.D0, Ind.D1, // E0,D0,D1
352 Ind.E0, Ind.D1, Ind.D2, Ind.D2, Ind.E3, Ind.E0, // E0,D1,D2,E3
353 Ind.E3, Ind.D2, Ind.D3, // E3,D2,D3
354 Ind.E3, Ind.D3, Ind.D4, // E3,D3,D4
355 Ind.E3, Ind.D4, Ind.D5, Ind.D5, Ind.E0, Ind.E3, // E3,D4,D5,E0
356 Ind.E0, Ind.D5, Ind.D0, // E0,D5,D0
357
358 };
359
231} 360}
232} 361}
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
index 662dd68..c7a2f7e 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
@@ -114,8 +114,10 @@ public class BulletShape
114 114
115 public virtual void Clear() { } 115 public virtual void Clear() { }
116 public virtual bool HasPhysicalShape { get { return false; } } 116 public virtual bool HasPhysicalShape { get { return false; } }
117
117 // Make another reference to this physical object. 118 // Make another reference to this physical object.
118 public virtual BulletShape Clone() { return new BulletShape(); } 119 public virtual BulletShape Clone() { return new BulletShape(); }
120
119 // Return 'true' if this and other refer to the same physical object 121 // Return 'true' if this and other refer to the same physical object
120 public virtual bool ReferenceSame(BulletShape xx) { return false; } 122 public virtual bool ReferenceSame(BulletShape xx) { return false; }
121 123
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
index facf720..7b59e60 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
@@ -1,8 +1,6 @@
1CURRENT PRIORITIES 1CURRENT PRIORITIES
2================================================= 2=================================================
3Redo BulletSimAPI to allow native C# implementation of Bullet option (DONE) 3Avatars walking up stairs
4Meshes rendering as bounding boxes
5llMoveToTarget
6Vehicle movement on terrain smoothness 4Vehicle movement on terrain smoothness
7limitMotorUp calibration (more down?) 5limitMotorUp calibration (more down?)
8Preferred orientatino angular correction fix 6Preferred orientatino angular correction fix
@@ -135,6 +133,9 @@ Eliminate collisions between objects in a linkset. (LinksetConstraint)
135 133
136MORE 134MORE
137====================================================== 135======================================================
136Use the HACD convex hull routine in Bullet rather than the C# version.
137Do we need to do convex hulls all the time? Can complex meshes be left meshes?
138 There is some problem with meshes and collisions
138Test avatar walking up stairs. How does compare with SL. 139Test avatar walking up stairs. How does compare with SL.
139 Radius of the capsule affects ability to climb edges. 140 Radius of the capsule affects ability to climb edges.
140Debounce avatar contact so legs don't keep folding up when standing. 141Debounce avatar contact so legs don't keep folding up when standing.
@@ -274,3 +275,8 @@ llSetBuoyancy() (DONE)
274 (Resolution: Bullet resets object gravity when added to world. Moved set gravity) 275 (Resolution: Bullet resets object gravity when added to world. Moved set gravity)
275Avatar density is WAY off. Compare and calibrate with what's in SL. (DONE) 276Avatar density is WAY off. Compare and calibrate with what's in SL. (DONE)
276 (Resolution: set default density to 3.5 (from 60) which is closer to SL) 277 (Resolution: set default density to 3.5 (from 60) which is closer to SL)
278Redo BulletSimAPI to allow native C# implementation of Bullet option (DONE)
279 (Resolution: added BSAPITemplate and then interfaces for C++ Bullet and C# BulletXNA
280Meshes rendering as bounding boxes (DONE)
281 (Resolution: Added test for mesh/sculpties in native shapes so it didn't think it was a box)
282llMoveToTarget (Resolution: added simple motor to update the position.)
diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll
index b01896e..093ea31 100755
--- a/bin/lib32/BulletSim.dll
+++ b/bin/lib32/BulletSim.dll
Binary files differ
diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so
index d964c11..4d7018a 100755
--- a/bin/lib32/libBulletSim.so
+++ b/bin/lib32/libBulletSim.so
Binary files differ
diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll
index 20eed6a..7956447 100755
--- a/bin/lib64/BulletSim.dll
+++ b/bin/lib64/BulletSim.dll
Binary files differ
diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so
index 5bb28ed..2ce7f77 100755
--- a/bin/lib64/libBulletSim.so
+++ b/bin/lib64/libBulletSim.so
Binary files differ