aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 758d92b..68a0db6 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -100,10 +100,15 @@ public sealed class BSPrim : BSPhysObject
100 BaseShape = pbs; 100 BaseShape = pbs;
101 _isPhysical = pisPhysical; 101 _isPhysical = pisPhysical;
102 _isVolumeDetect = false; 102 _isVolumeDetect = false;
103 _friction = PhysicsScene.Params.defaultFriction; // TODO: compute based on object material 103
104 _density = PhysicsScene.Params.defaultDensity; // TODO: compute based on object material 104 // Someday set default attributes based on the material but, for now, we don't know the prim material yet.
105 // MaterialAttributes primMat = BSMaterials.GetAttributes(Material, pisPhysical);
106 _density = PhysicsScene.Params.defaultDensity;
107 _friction = PhysicsScene.Params.defaultFriction;
105 _restitution = PhysicsScene.Params.defaultRestitution; 108 _restitution = PhysicsScene.Params.defaultRestitution;
109
106 _vehicle = new BSDynamics(PhysicsScene, this); // add vehicleness 110 _vehicle = new BSDynamics(PhysicsScene, this); // add vehicleness
111
107 _mass = CalculateMass(); 112 _mass = CalculateMass();
108 113
109 // No body or shape yet 114 // No body or shape yet
@@ -527,16 +532,18 @@ public sealed class BSPrim : BSPhysObject
527 PhysicsScene.TaintedObject("BSPrim.setVelocity", delegate() 532 PhysicsScene.TaintedObject("BSPrim.setVelocity", delegate()
528 { 533 {
529 // DetailLog("{0},BSPrim.SetVelocity,taint,vel={1}", LocalID, _velocity); 534 // DetailLog("{0},BSPrim.SetVelocity,taint,vel={1}", LocalID, _velocity);
530 if (PhysBody.HasPhysicalBody) 535 ForceVelocity = _velocity;
531 BulletSimAPI.SetLinearVelocity2(PhysBody.ptr, _velocity);
532 }); 536 });
533 } 537 }
534 } 538 }
535 public override OMV.Vector3 ForceVelocity { 539 public override OMV.Vector3 ForceVelocity {
536 get { return _velocity; } 540 get { return _velocity; }
537 set { 541 set {
542 PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity");
543
538 _velocity = value; 544 _velocity = value;
539 BulletSimAPI.SetLinearVelocity2(PhysBody.ptr, _velocity); 545 if (PhysBody.HasPhysicalBody)
546 BulletSimAPI.SetLinearVelocity2(PhysBody.ptr, _velocity);
540 } 547 }
541 } 548 }
542 public override OMV.Vector3 Torque { 549 public override OMV.Vector3 Torque {