aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-09 22:10:32 -0800
committerRobert Adams2012-12-09 22:32:46 -0800
commitce5083a504a82712149f5e3dab622d42e260bba3 (patch)
tree37c54b8649e07ed227a947208ddad0f7bfa79043 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
parentHGAssetMapper: Get wasn't really working. It's true that some assets are copi... (diff)
downloadopensim-SC-ce5083a504a82712149f5e3dab622d42e260bba3.zip
opensim-SC-ce5083a504a82712149f5e3dab622d42e260bba3.tar.gz
opensim-SC-ce5083a504a82712149f5e3dab622d42e260bba3.tar.bz2
opensim-SC-ce5083a504a82712149f5e3dab622d42e260bba3.tar.xz
BulletSim: adjust friction and restitution based on material type.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs12
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