aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
diff options
context:
space:
mode:
authorRobert Adams2014-04-02 21:53:58 -0700
committerRobert Adams2014-04-02 21:53:58 -0700
commit65c4cb48ac49bd6aa9e813a401411be5226d01a7 (patch)
treeec930505cba9332628e9ce0d576814ada83ce741 /OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
parentFix problem with floating avatar by passing avatar size information (diff)
downloadopensim-SC-65c4cb48ac49bd6aa9e813a401411be5226d01a7.zip
opensim-SC-65c4cb48ac49bd6aa9e813a401411be5226d01a7.tar.gz
opensim-SC-65c4cb48ac49bd6aa9e813a401411be5226d01a7.tar.bz2
opensim-SC-65c4cb48ac49bd6aa9e813a401411be5226d01a7.tar.xz
BulletSim: make avatar physical shape to be a rectangle rather than
a capsule. Set the default to be the rectangle shape and adjust the parameters in OpenSimDefaults.ini for the new shape. The rectangle shape will perform better and avatar height can be computed more accurately.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs32
1 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index 32bbc8f..721a8eb 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
@@ -124,6 +124,10 @@ public sealed class BSShapeCollection : IDisposable
124 // Info in prim.BSShape is updated to the new shape. 124 // Info in prim.BSShape is updated to the new shape.
125 // Returns 'true' if the geometry was rebuilt. 125 // Returns 'true' if the geometry was rebuilt.
126 // Called at taint-time! 126 // Called at taint-time!
127 public const int AvatarShapeCapsule = 0;
128 public const int AvatarShapeCube = 1;
129 public const int AvatarShapeOvoid = 2;
130 public const int AvatarShapeMesh = 3;
127 private bool CreateGeom(bool forceRebuild, BSPhysObject prim, PhysicalDestructionCallback shapeCallback) 131 private bool CreateGeom(bool forceRebuild, BSPhysObject prim, PhysicalDestructionCallback shapeCallback)
128 { 132 {
129 bool ret = false; 133 bool ret = false;
@@ -137,10 +141,32 @@ public sealed class BSShapeCollection : IDisposable
137 if (theChar != null) 141 if (theChar != null)
138 { 142 {
139 DereferenceExistingShape(prim, shapeCallback); 143 DereferenceExistingShape(prim, shapeCallback);
140 prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, 144 switch (BSParam.AvatarShape)
145 {
146 case AvatarShapeCapsule:
147 prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim,
141 BSPhysicsShapeType.SHAPE_CAPSULE, FixedShapeKey.KEY_CAPSULE); 148 BSPhysicsShapeType.SHAPE_CAPSULE, FixedShapeKey.KEY_CAPSULE);
142 ret = true; 149 ret = true;
143 haveShape = true; 150 haveShape = true;
151 break;
152 case AvatarShapeCube:
153 prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim,
154 BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_CAPSULE);
155 ret = true;
156 haveShape = true;
157 break;
158 case AvatarShapeOvoid:
159 // Saddly, Bullet doesn't scale spheres so this doesn't work as an avatar shape
160 prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim,
161 BSPhysicsShapeType.SHAPE_SPHERE, FixedShapeKey.KEY_CAPSULE);
162 ret = true;
163 haveShape = true;
164 break;
165 case AvatarShapeMesh:
166 break;
167 default:
168 break;
169 }
144 } 170 }
145 171
146 // If the prim attributes are simple, this could be a simple Bullet native shape 172 // If the prim attributes are simple, this could be a simple Bullet native shape