aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
diff options
context:
space:
mode:
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