diff options
author | Robert Adams | 2013-04-28 14:55:46 -0700 |
---|---|---|
committer | Robert Adams | 2013-04-29 07:38:44 -0700 |
commit | 2da8e60b6deec472bc979ec33e99c16c5baf0b01 (patch) | |
tree | ec8e760bd48ab67744d62940c21d87a5df6446ff /OpenSim/Region/Physics | |
parent | BulletSim: massive refactor of shape classes. Removed shape specific code fro... (diff) | |
download | opensim-SC_OLD-2da8e60b6deec472bc979ec33e99c16c5baf0b01.zip opensim-SC_OLD-2da8e60b6deec472bc979ec33e99c16c5baf0b01.tar.gz opensim-SC_OLD-2da8e60b6deec472bc979ec33e99c16c5baf0b01.tar.bz2 opensim-SC_OLD-2da8e60b6deec472bc979ec33e99c16c5baf0b01.tar.xz |
BulletSim: code for creating the avatar capsule shape.
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index 3c23509..19855da 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -131,6 +131,17 @@ public sealed class BSShapeCollection : IDisposable | |||
131 | bool nativeShapePossible = true; | 131 | bool nativeShapePossible = true; |
132 | PrimitiveBaseShape pbs = prim.BaseShape; | 132 | PrimitiveBaseShape pbs = prim.BaseShape; |
133 | 133 | ||
134 | // Kludge to create the capsule for the avatar. | ||
135 | BSCharacter theChar = prim as BSCharacter; | ||
136 | if (theChar != null) | ||
137 | { | ||
138 | DereferenceExistingShape(prim, shapeCallback); | ||
139 | prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, | ||
140 | BSPhysicsShapeType.SHAPE_CAPSULE, FixedShapeKey.KEY_CAPSULE); | ||
141 | ret = true; | ||
142 | haveShape = true; | ||
143 | } | ||
144 | |||
134 | // If the prim attributes are simple, this could be a simple Bullet native shape | 145 | // If the prim attributes are simple, this could be a simple Bullet native shape |
135 | // Native shapes work whether to object is static or physical. | 146 | // Native shapes work whether to object is static or physical. |
136 | if (!haveShape | 147 | if (!haveShape |
@@ -160,6 +171,7 @@ public sealed class BSShapeCollection : IDisposable | |||
160 | DereferenceExistingShape(prim, shapeCallback); | 171 | DereferenceExistingShape(prim, shapeCallback); |
161 | prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, | 172 | prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, |
162 | BSPhysicsShapeType.SHAPE_SPHERE, FixedShapeKey.KEY_SPHERE); | 173 | BSPhysicsShapeType.SHAPE_SPHERE, FixedShapeKey.KEY_SPHERE); |
174 | ret = true; | ||
163 | } | 175 | } |
164 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,sphere,force={1},rebuilt={2},shape={3}", | 176 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,sphere,force={1},rebuilt={2},shape={3}", |
165 | prim.LocalID, forceRebuild, ret, prim.PhysShape); | 177 | prim.LocalID, forceRebuild, ret, prim.PhysShape); |
@@ -176,6 +188,7 @@ public sealed class BSShapeCollection : IDisposable | |||
176 | DereferenceExistingShape(prim, shapeCallback); | 188 | DereferenceExistingShape(prim, shapeCallback); |
177 | prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, | 189 | prim.PhysShape = BSShapeNative.GetReference(m_physicsScene, prim, |
178 | BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | 190 | BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); |
191 | ret = true; | ||
179 | } | 192 | } |
180 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,box,force={1},rebuilt={2},shape={3}", | 193 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,box,force={1},rebuilt={2},shape={3}", |
181 | prim.LocalID, forceRebuild, ret, prim.PhysShape); | 194 | prim.LocalID, forceRebuild, ret, prim.PhysShape); |