diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 9e1206a..2a5397e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -200,7 +200,9 @@ public sealed class BSCharacter : BSPhysObject | |||
200 | } | 200 | } |
201 | // I want the physics engine to make an avatar capsule | 201 | // I want the physics engine to make an avatar capsule |
202 | public override ShapeData.PhysicsShapeType PreferredPhysicalShape | 202 | public override ShapeData.PhysicsShapeType PreferredPhysicalShape |
203 | { get { return ShapeData.PhysicsShapeType.SHAPE_AVATAR; } } | 203 | { |
204 | get {return ShapeData.PhysicsShapeType.SHAPE_AVATAR; } | ||
205 | } | ||
204 | 206 | ||
205 | public override bool Grabbed { | 207 | public override bool Grabbed { |
206 | set { _grabbed = value; } | 208 | set { _grabbed = value; } |
@@ -238,6 +240,7 @@ public sealed class BSCharacter : BSPhysObject | |||
238 | } | 240 | } |
239 | public override OMV.Vector3 Position { | 241 | public override OMV.Vector3 Position { |
240 | get { | 242 | get { |
243 | // Don't refetch the position because this function is called a zillion times | ||
241 | // _position = BulletSimAPI.GetObjectPosition2(Scene.World.ptr, LocalID); | 244 | // _position = BulletSimAPI.GetObjectPosition2(Scene.World.ptr, LocalID); |
242 | return _position; | 245 | return _position; |
243 | } | 246 | } |
@@ -304,15 +307,11 @@ public sealed class BSCharacter : BSPhysObject | |||
304 | { | 307 | { |
305 | // The new position value must be pushed into the physics engine but we can't | 308 | // The new position value must be pushed into the physics engine but we can't |
306 | // just assign to "Position" because of potential call loops. | 309 | // just assign to "Position" because of potential call loops. |
307 | BSScene.TaintCallback sanityOperation = delegate() | 310 | PhysicsScene.TaintedObject(inTaintTime, "BSCharacter.PositionSanityCheck", delegate() |
308 | { | 311 | { |
309 | DetailLog("{0},BSCharacter.PositionSanityCheck,taint,pos={1},orient={2}", LocalID, _position, _orientation); | 312 | DetailLog("{0},BSCharacter.PositionSanityCheck,taint,pos={1},orient={2}", LocalID, _position, _orientation); |
310 | BulletSimAPI.SetTranslation2(PhysBody.ptr, _position, _orientation); | 313 | BulletSimAPI.SetTranslation2(PhysBody.ptr, _position, _orientation); |
311 | }; | 314 | }); |
312 | if (inTaintTime) | ||
313 | sanityOperation(); | ||
314 | else | ||
315 | PhysicsScene.TaintedObject("BSCharacter.PositionSanityCheck", sanityOperation); | ||
316 | ret = true; | 315 | ret = true; |
317 | } | 316 | } |
318 | return ret; | 317 | return ret; |