diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 4d203ff..627393a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -683,8 +683,9 @@ public sealed class BSPrim : BSPhysObject | |||
683 | ZeroMotion(true); | 683 | ZeroMotion(true); |
684 | 684 | ||
685 | // Set various physical properties so other object interact properly | 685 | // Set various physical properties so other object interact properly |
686 | BulletSimAPI.SetFriction2(PhysBody.ptr, PhysicsScene.Params.defaultFriction); | 686 | MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, false); |
687 | BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.defaultRestitution); | 687 | BulletSimAPI.SetFriction2(PhysBody.ptr, matAttrib.friction); |
688 | BulletSimAPI.SetRestitution2(PhysBody.ptr, matAttrib.restitution); | ||
688 | 689 | ||
689 | // Mass is zero which disables a bunch of physics stuff in Bullet | 690 | // Mass is zero which disables a bunch of physics stuff in Bullet |
690 | UpdatePhysicalMassProperties(0f); | 691 | UpdatePhysicalMassProperties(0f); |
@@ -711,9 +712,10 @@ public sealed class BSPrim : BSPhysObject | |||
711 | // Not a Bullet static object | 712 | // Not a Bullet static object |
712 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(PhysBody.ptr, CollisionFlags.CF_STATIC_OBJECT); | 713 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(PhysBody.ptr, CollisionFlags.CF_STATIC_OBJECT); |
713 | 714 | ||
714 | // Set various physical properties so internal dynamic properties will get computed correctly as they are set | 715 | // Set various physical properties so other object interact properly |
715 | BulletSimAPI.SetFriction2(PhysBody.ptr, PhysicsScene.Params.defaultFriction); | 716 | MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, true); |
716 | BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.defaultRestitution); | 717 | BulletSimAPI.SetFriction2(PhysBody.ptr, matAttrib.friction); |
718 | BulletSimAPI.SetRestitution2(PhysBody.ptr, matAttrib.restitution); | ||
717 | 719 | ||
718 | // per http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=3382 | 720 | // per http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=3382 |
719 | // Since this can be called multiple times, only zero forces when becoming physical | 721 | // Since this can be called multiple times, only zero forces when becoming physical |