diff options
author | Robert Adams | 2012-11-18 22:57:26 -0800 |
---|---|---|
committer | Robert Adams | 2012-11-18 22:57:26 -0800 |
commit | 22be36be69bbf571b26753307b9c2c5456a34d73 (patch) | |
tree | 06795bbe39a9e45b0ade50484dfc1b51b0952ea2 | |
parent | BulletSim: remove the obsolete interface to the Bullet code. Update BulletSim... (diff) | |
download | opensim-SC-22be36be69bbf571b26753307b9c2c5456a34d73.zip opensim-SC-22be36be69bbf571b26753307b9c2c5456a34d73.tar.gz opensim-SC-22be36be69bbf571b26753307b9c2c5456a34d73.tar.bz2 opensim-SC-22be36be69bbf571b26753307b9c2c5456a34d73.tar.xz |
BulletSim: fix the problem with flying being disabled when crossing region boundries.
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 8 |
1 files 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 | |||
78 | private float _PIDHoverTao; | 78 | private float _PIDHoverTao; |
79 | 79 | ||
80 | public BSCharacter(uint localID, String avName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, bool isFlying) | 80 | public BSCharacter(uint localID, String avName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, bool isFlying) |
81 | : base(parent_scene, localID, avName, "BSCharacter") | ||
81 | { | 82 | { |
82 | base.BaseInitialize(parent_scene, localID, avName, "BSCharacter"); | ||
83 | _physicsActorType = (int)ActorTypes.Agent; | 83 | _physicsActorType = (int)ActorTypes.Agent; |
84 | _position = pos; | 84 | _position = pos; |
85 | _size = size; | 85 | _size = size; |
@@ -131,6 +131,10 @@ public sealed class BSCharacter : BSPhysObject | |||
131 | // Set the velocity and compute the proper friction | 131 | // Set the velocity and compute the proper friction |
132 | ForceVelocity = _velocity; | 132 | ForceVelocity = _velocity; |
133 | 133 | ||
134 | // This will enable or disable the flying buoyancy of the avatar. | ||
135 | // Needs to be reset especially when an avatar is recreated after crossing a region boundry. | ||
136 | Flying = _flying; | ||
137 | |||
134 | BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.avatarRestitution); | 138 | BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.avatarRestitution); |
135 | BulletSimAPI.SetMargin2(PhysShape.ptr, PhysicsScene.Params.collisionMargin); | 139 | BulletSimAPI.SetMargin2(PhysShape.ptr, PhysicsScene.Params.collisionMargin); |
136 | BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); | 140 | BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); |
@@ -615,7 +619,7 @@ public sealed class BSCharacter : BSPhysObject | |||
615 | newScale.Y = PhysicsScene.Params.avatarCapsuleRadius; | 619 | newScale.Y = PhysicsScene.Params.avatarCapsuleRadius; |
616 | 620 | ||
617 | // From the total height, remove the capsule half spheres that are at each end | 621 | // From the total height, remove the capsule half spheres that are at each end |
618 | newScale.Z = size.Z- (newScale.X + newScale.Y); | 622 | newScale.Z = size.Z - (newScale.X + newScale.Y); |
619 | Scale = newScale; | 623 | Scale = newScale; |
620 | } | 624 | } |
621 | 625 | ||