From 22be36be69bbf571b26753307b9c2c5456a34d73 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 18 Nov 2012 22:57:26 -0800 Subject: BulletSim: fix the problem with flying being disabled when crossing region boundries. --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index f33c124..3c48dcc 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -78,8 +78,8 @@ public sealed class BSCharacter : BSPhysObject private float _PIDHoverTao; public BSCharacter(uint localID, String avName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, bool isFlying) + : base(parent_scene, localID, avName, "BSCharacter") { - base.BaseInitialize(parent_scene, localID, avName, "BSCharacter"); _physicsActorType = (int)ActorTypes.Agent; _position = pos; _size = size; @@ -131,6 +131,10 @@ public sealed class BSCharacter : BSPhysObject // Set the velocity and compute the proper friction ForceVelocity = _velocity; + // This will enable or disable the flying buoyancy of the avatar. + // Needs to be reset especially when an avatar is recreated after crossing a region boundry. + Flying = _flying; + BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.avatarRestitution); BulletSimAPI.SetMargin2(PhysShape.ptr, PhysicsScene.Params.collisionMargin); BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); @@ -615,7 +619,7 @@ public sealed class BSCharacter : BSPhysObject newScale.Y = PhysicsScene.Params.avatarCapsuleRadius; // From the total height, remove the capsule half spheres that are at each end - newScale.Z = size.Z- (newScale.X + newScale.Y); + newScale.Z = size.Z - (newScale.X + newScale.Y); Scale = newScale; } -- cgit v1.1