aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs212
1 files changed, 106 insertions, 106 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index e65e42b..8688485 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -158,12 +158,12 @@ public sealed class BSPrim : BSPhysObject
158 BulletSimAPI.DestroyObject(PhysicsScene.WorldID, LocalID); 158 BulletSimAPI.DestroyObject(PhysicsScene.WorldID, LocalID);
159 }); 159 });
160 } 160 }
161 161
162 public override bool Stopped { 162 public override bool Stopped {
163 get { return _stopped; } 163 get { return _stopped; }
164 } 164 }
165 public override OMV.Vector3 Size { 165 public override OMV.Vector3 Size {
166 get { return _size; } 166 get { return _size; }
167 set { 167 set {
168 _size = value; 168 _size = value;
169 PhysicsScene.TaintedObject("BSPrim.setSize", delegate() 169 PhysicsScene.TaintedObject("BSPrim.setSize", delegate()
@@ -174,7 +174,7 @@ public sealed class BSPrim : BSPhysObject
174 CreateGeomAndObject(true); 174 CreateGeomAndObject(true);
175 // DetailLog("{0},BSPrim.setSize,size={1},scale={2},mass={3},physical={4}", LocalID, _size, _scale, _mass, IsPhysical); 175 // DetailLog("{0},BSPrim.setSize,size={1},scale={2},mass={3},physical={4}", LocalID, _size, _scale, _mass, IsPhysical);
176 }); 176 });
177 } 177 }
178 } 178 }
179 // Scale is what we set in the physics engine. It is different than 'size' in that 179 // Scale is what we set in the physics engine. It is different than 'size' in that
180 // 'size' can be encorporated into the mesh. In that case, the scale is <1,1,1>. 180 // 'size' can be encorporated into the mesh. In that case, the scale is <1,1,1>.
@@ -183,7 +183,7 @@ public sealed class BSPrim : BSPhysObject
183 get { return _scale; } 183 get { return _scale; }
184 set { _scale = value; } 184 set { _scale = value; }
185 } 185 }
186 public override PrimitiveBaseShape Shape { 186 public override PrimitiveBaseShape Shape {
187 set { 187 set {
188 _pbs = value; 188 _pbs = value;
189 PhysicsScene.TaintedObject("BSPrim.setShape", delegate() 189 PhysicsScene.TaintedObject("BSPrim.setShape", delegate()
@@ -191,13 +191,13 @@ public sealed class BSPrim : BSPhysObject
191 _mass = CalculateMass(); // changing the shape changes the mass 191 _mass = CalculateMass(); // changing the shape changes the mass
192 CreateGeomAndObject(true); 192 CreateGeomAndObject(true);
193 }); 193 });
194 } 194 }
195 } 195 }
196 public override bool Grabbed { 196 public override bool Grabbed {
197 set { _grabbed = value; 197 set { _grabbed = value;
198 } 198 }
199 } 199 }
200 public override bool Selected { 200 public override bool Selected {
201 set { 201 set {
202 _isSelected = value; 202 _isSelected = value;
203 PhysicsScene.TaintedObject("BSPrim.setSelected", delegate() 203 PhysicsScene.TaintedObject("BSPrim.setSelected", delegate()
@@ -205,7 +205,7 @@ public sealed class BSPrim : BSPhysObject
205 // DetailLog("{0},BSPrim.selected,taint,selected={1}", LocalID, _isSelected); 205 // DetailLog("{0},BSPrim.selected,taint,selected={1}", LocalID, _isSelected);
206 SetObjectDynamic(false); 206 SetObjectDynamic(false);
207 }); 207 });
208 } 208 }
209 } 209 }
210 public override void CrossingFailure() { return; } 210 public override void CrossingFailure() { return; }
211 211
@@ -219,10 +219,10 @@ public sealed class BSPrim : BSPhysObject
219 219
220 Linkset = parent.Linkset.AddMeToLinkset(this); 220 Linkset = parent.Linkset.AddMeToLinkset(this);
221 221
222 DetailLog("{0},BSPrim.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}", 222 DetailLog("{0},BSPrim.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}",
223 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren); 223 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
224 } 224 }
225 return; 225 return;
226 } 226 }
227 227
228 // delink me from my linkset 228 // delink me from my linkset
@@ -232,12 +232,12 @@ public sealed class BSPrim : BSPhysObject
232 232
233 BSPhysObject parentBefore = Linkset.LinksetRoot; 233 BSPhysObject parentBefore = Linkset.LinksetRoot;
234 int childrenBefore = Linkset.NumberOfChildren; 234 int childrenBefore = Linkset.NumberOfChildren;
235 235
236 Linkset = Linkset.RemoveMeFromLinkset(this); 236 Linkset = Linkset.RemoveMeFromLinkset(this);
237 237
238 DetailLog("{0},BSPrim.delink,parentBefore={1},childrenBefore={2},parentAfter={3},childrenAfter={4}, ", 238 DetailLog("{0},BSPrim.delink,parentBefore={1},childrenBefore={2},parentAfter={3},childrenAfter={4}, ",
239 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren); 239 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
240 return; 240 return;
241 } 241 }
242 242
243 // Set motion values to zero. 243 // Set motion values to zero.
@@ -258,21 +258,21 @@ public sealed class BSPrim : BSPhysObject
258 } 258 }
259 259
260 public override void LockAngularMotion(OMV.Vector3 axis) 260 public override void LockAngularMotion(OMV.Vector3 axis)
261 { 261 {
262 DetailLog("{0},BSPrim.LockAngularMotion,call,axis={1}", LocalID, axis); 262 DetailLog("{0},BSPrim.LockAngularMotion,call,axis={1}", LocalID, axis);
263 return; 263 return;
264 } 264 }
265 265
266 public override OMV.Vector3 Position { 266 public override OMV.Vector3 Position {
267 get { 267 get {
268 if (!Linkset.IsRoot(this)) 268 if (!Linkset.IsRoot(this))
269 // child prims move around based on their parent. Need to get the latest location 269 // child prims move around based on their parent. Need to get the latest location
270 _position = BulletSimAPI.GetPosition2(BSBody.ptr); 270 _position = BulletSimAPI.GetPosition2(BSBody.ptr);
271 271
272 // don't do the GetObjectPosition for root elements because this function is called a zillion times 272 // don't do the GetObjectPosition for root elements because this function is called a zillion times
273 // _position = BulletSimAPI.GetObjectPosition2(PhysicsScene.World.ptr, BSBody.ptr); 273 // _position = BulletSimAPI.GetObjectPosition2(PhysicsScene.World.ptr, BSBody.ptr);
274 return _position; 274 return _position;
275 } 275 }
276 set { 276 set {
277 _position = value; 277 _position = value;
278 // TODO: what does it mean to set the position of a child prim?? Rebuild the constraint? 278 // TODO: what does it mean to set the position of a child prim?? Rebuild the constraint?
@@ -281,13 +281,13 @@ public sealed class BSPrim : BSPhysObject
281 // DetailLog("{0},BSPrim.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); 281 // DetailLog("{0},BSPrim.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation);
282 BulletSimAPI.SetTranslation2(BSBody.ptr, _position, _orientation); 282 BulletSimAPI.SetTranslation2(BSBody.ptr, _position, _orientation);
283 }); 283 });
284 } 284 }
285 } 285 }
286 286
287 // Return the effective mass of the object. 287 // Return the effective mass of the object.
288 // If there are multiple items in the linkset, add them together for the root 288 // If there are multiple items in the linkset, add them together for the root
289 public override float Mass 289 public override float Mass
290 { 290 {
291 get 291 get
292 { 292 {
293 // return Linkset.LinksetMass; 293 // return Linkset.LinksetMass;
@@ -310,8 +310,8 @@ public sealed class BSPrim : BSPhysObject
310 get { return Linkset.GeometricCenter; } 310 get { return Linkset.GeometricCenter; }
311 } 311 }
312 312
313 public override OMV.Vector3 Force { 313 public override OMV.Vector3 Force {
314 get { return _force; } 314 get { return _force; }
315 set { 315 set {
316 _force = value; 316 _force = value;
317 PhysicsScene.TaintedObject("BSPrim.setForce", delegate() 317 PhysicsScene.TaintedObject("BSPrim.setForce", delegate()
@@ -319,13 +319,13 @@ public sealed class BSPrim : BSPhysObject
319 // DetailLog("{0},BSPrim.setForce,taint,force={1}", LocalID, _force); 319 // DetailLog("{0},BSPrim.setForce,taint,force={1}", LocalID, _force);
320 BulletSimAPI.SetObjectForce2(BSBody.ptr, _force); 320 BulletSimAPI.SetObjectForce2(BSBody.ptr, _force);
321 }); 321 });
322 } 322 }
323 } 323 }
324 324
325 public override int VehicleType { 325 public override int VehicleType {
326 get { 326 get {
327 return (int)_vehicle.Type; // if we are a vehicle, return that type 327 return (int)_vehicle.Type; // if we are a vehicle, return that type
328 } 328 }
329 set { 329 set {
330 Vehicle type = (Vehicle)value; 330 Vehicle type = (Vehicle)value;
331 BSPrim vehiclePrim = this; 331 BSPrim vehiclePrim = this;
@@ -337,30 +337,30 @@ public sealed class BSPrim : BSPhysObject
337 // Tell the scene about the vehicle so it will get processing each frame. 337 // Tell the scene about the vehicle so it will get processing each frame.
338 PhysicsScene.VehicleInSceneTypeChanged(this, type); 338 PhysicsScene.VehicleInSceneTypeChanged(this, type);
339 }); 339 });
340 } 340 }
341 } 341 }
342 public override void VehicleFloatParam(int param, float value) 342 public override void VehicleFloatParam(int param, float value)
343 { 343 {
344 PhysicsScene.TaintedObject("BSPrim.VehicleFloatParam", delegate() 344 PhysicsScene.TaintedObject("BSPrim.VehicleFloatParam", delegate()
345 { 345 {
346 _vehicle.ProcessFloatVehicleParam((Vehicle)param, value); 346 _vehicle.ProcessFloatVehicleParam((Vehicle)param, value);
347 }); 347 });
348 } 348 }
349 public override void VehicleVectorParam(int param, OMV.Vector3 value) 349 public override void VehicleVectorParam(int param, OMV.Vector3 value)
350 { 350 {
351 PhysicsScene.TaintedObject("BSPrim.VehicleVectorParam", delegate() 351 PhysicsScene.TaintedObject("BSPrim.VehicleVectorParam", delegate()
352 { 352 {
353 _vehicle.ProcessVectorVehicleParam((Vehicle)param, value); 353 _vehicle.ProcessVectorVehicleParam((Vehicle)param, value);
354 }); 354 });
355 } 355 }
356 public override void VehicleRotationParam(int param, OMV.Quaternion rotation) 356 public override void VehicleRotationParam(int param, OMV.Quaternion rotation)
357 { 357 {
358 PhysicsScene.TaintedObject("BSPrim.VehicleRotationParam", delegate() 358 PhysicsScene.TaintedObject("BSPrim.VehicleRotationParam", delegate()
359 { 359 {
360 _vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation); 360 _vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation);
361 }); 361 });
362 } 362 }
363 public override void VehicleFlags(int param, bool remove) 363 public override void VehicleFlags(int param, bool remove)
364 { 364 {
365 PhysicsScene.TaintedObject("BSPrim.VehicleFlags", delegate() 365 PhysicsScene.TaintedObject("BSPrim.VehicleFlags", delegate()
366 { 366 {
@@ -388,11 +388,11 @@ public sealed class BSPrim : BSPhysObject
388 SetObjectDynamic(true); 388 SetObjectDynamic(true);
389 }); 389 });
390 } 390 }
391 return; 391 return;
392 } 392 }
393 393
394 public override OMV.Vector3 Velocity { 394 public override OMV.Vector3 Velocity {
395 get { return _velocity; } 395 get { return _velocity; }
396 set { 396 set {
397 _velocity = value; 397 _velocity = value;
398 PhysicsScene.TaintedObject("BSPrim.setVelocity", delegate() 398 PhysicsScene.TaintedObject("BSPrim.setVelocity", delegate()
@@ -400,24 +400,24 @@ public sealed class BSPrim : BSPhysObject
400 // DetailLog("{0},BSPrim.SetVelocity,taint,vel={1}", LocalID, _velocity); 400 // DetailLog("{0},BSPrim.SetVelocity,taint,vel={1}", LocalID, _velocity);
401 BulletSimAPI.SetLinearVelocity2(BSBody.ptr, _velocity); 401 BulletSimAPI.SetLinearVelocity2(BSBody.ptr, _velocity);
402 }); 402 });
403 } 403 }
404 } 404 }
405 public override OMV.Vector3 Torque { 405 public override OMV.Vector3 Torque {
406 get { return _torque; } 406 get { return _torque; }
407 set { _torque = value; 407 set { _torque = value;
408 // DetailLog("{0},BSPrim.SetTorque,call,torque={1}", LocalID, _torque); 408 // DetailLog("{0},BSPrim.SetTorque,call,torque={1}", LocalID, _torque);
409 } 409 }
410 } 410 }
411 public override float CollisionScore { 411 public override float CollisionScore {
412 get { return _collisionScore; } 412 get { return _collisionScore; }
413 set { _collisionScore = value; 413 set { _collisionScore = value;
414 } 414 }
415 } 415 }
416 public override OMV.Vector3 Acceleration { 416 public override OMV.Vector3 Acceleration {
417 get { return _acceleration; } 417 get { return _acceleration; }
418 set { _acceleration = value; } 418 set { _acceleration = value; }
419 } 419 }
420 public override OMV.Quaternion Orientation { 420 public override OMV.Quaternion Orientation {
421 get { 421 get {
422 if (!Linkset.IsRoot(this)) 422 if (!Linkset.IsRoot(this))
423 { 423 {
@@ -425,7 +425,7 @@ public sealed class BSPrim : BSPhysObject
425 _orientation = BulletSimAPI.GetOrientation2(BSBody.ptr); 425 _orientation = BulletSimAPI.GetOrientation2(BSBody.ptr);
426 } 426 }
427 return _orientation; 427 return _orientation;
428 } 428 }
429 set { 429 set {
430 _orientation = value; 430 _orientation = value;
431 // TODO: what does it mean if a child in a linkset changes its orientation? Rebuild the constraint? 431 // TODO: what does it mean if a child in a linkset changes its orientation? Rebuild the constraint?
@@ -435,14 +435,14 @@ public sealed class BSPrim : BSPhysObject
435 // DetailLog("{0},BSPrim.setOrientation,taint,pos={1},orient={2}", LocalID, _position, _orientation); 435 // DetailLog("{0},BSPrim.setOrientation,taint,pos={1},orient={2}", LocalID, _position, _orientation);
436 BulletSimAPI.SetTranslation2(BSBody.ptr, _position, _orientation); 436 BulletSimAPI.SetTranslation2(BSBody.ptr, _position, _orientation);
437 }); 437 });
438 } 438 }
439 } 439 }
440 public override int PhysicsActorType { 440 public override int PhysicsActorType {
441 get { return _physicsActorType; } 441 get { return _physicsActorType; }
442 set { _physicsActorType = value; } 442 set { _physicsActorType = value; }
443 } 443 }
444 public override bool IsPhysical { 444 public override bool IsPhysical {
445 get { return _isPhysical; } 445 get { return _isPhysical; }
446 set { 446 set {
447 if (_isPhysical != value) 447 if (_isPhysical != value)
448 { 448 {
@@ -453,7 +453,7 @@ public sealed class BSPrim : BSPhysObject
453 SetObjectDynamic(true); 453 SetObjectDynamic(true);
454 }); 454 });
455 } 455 }
456 } 456 }
457 } 457 }
458 458
459 // An object is static (does not move) if selected or not physical 459 // An object is static (does not move) if selected or not physical
@@ -519,7 +519,7 @@ public sealed class BSPrim : BSPhysObject
519 // had been automatically disabled when the mass was set to zero. 519 // had been automatically disabled when the mass was set to zero.
520 Linkset.Refresh(this); 520 Linkset.Refresh(this);
521 521
522 DetailLog("{0},BSPrim.UpdatePhysicalParameters,exit,static={1},solid={2},mass={3},collide={4},cf={5:X},body={6},shape={7}", 522 DetailLog("{0},BSPrim.UpdatePhysicalParameters,exit,static={1},solid={2},mass={3},collide={4},cf={5:X},body={6},shape={7}",
523 LocalID, IsStatic, IsSolid, _mass, SubscribedEvents(), CurrentCollisionFlags, BSBody, BSShape); 523 LocalID, IsStatic, IsSolid, _mass, SubscribedEvents(), CurrentCollisionFlags, BSBody, BSShape);
524 } 524 }
525 525
@@ -630,31 +630,31 @@ public sealed class BSPrim : BSPhysObject
630 } 630 }
631 631
632 // prims don't fly 632 // prims don't fly
633 public override bool Flying { 633 public override bool Flying {
634 get { return _flying; } 634 get { return _flying; }
635 set { 635 set {
636 _flying = value; 636 _flying = value;
637 } 637 }
638 } 638 }
639 public override bool SetAlwaysRun { 639 public override bool SetAlwaysRun {
640 get { return _setAlwaysRun; } 640 get { return _setAlwaysRun; }
641 set { _setAlwaysRun = value; } 641 set { _setAlwaysRun = value; }
642 } 642 }
643 public override bool ThrottleUpdates { 643 public override bool ThrottleUpdates {
644 get { return _throttleUpdates; } 644 get { return _throttleUpdates; }
645 set { _throttleUpdates = value; } 645 set { _throttleUpdates = value; }
646 } 646 }
647 public override bool IsColliding { 647 public override bool IsColliding {
648 get { return (CollidingStep == PhysicsScene.SimulationStep); } 648 get { return (CollidingStep == PhysicsScene.SimulationStep); }
649 set { _isColliding = value; } 649 set { _isColliding = value; }
650 } 650 }
651 public override bool CollidingGround { 651 public override bool CollidingGround {
652 get { return (CollidingGroundStep == PhysicsScene.SimulationStep); } 652 get { return (CollidingGroundStep == PhysicsScene.SimulationStep); }
653 set { _collidingGround = value; } 653 set { _collidingGround = value; }
654 } 654 }
655 public override bool CollidingObj { 655 public override bool CollidingObj {
656 get { return _collidingObj; } 656 get { return _collidingObj; }
657 set { _collidingObj = value; } 657 set { _collidingObj = value; }
658 } 658 }
659 public bool IsPhantom { 659 public bool IsPhantom {
660 get { 660 get {
@@ -664,10 +664,10 @@ public sealed class BSPrim : BSPhysObject
664 return false; 664 return false;
665 } 665 }
666 } 666 }
667 public override bool FloatOnWater { 667 public override bool FloatOnWater {
668 set { _floatOnWater = value; } 668 set { _floatOnWater = value; }
669 } 669 }
670 public override OMV.Vector3 RotationalVelocity { 670 public override OMV.Vector3 RotationalVelocity {
671 get { 671 get {
672 /* 672 /*
673 OMV.Vector3 pv = OMV.Vector3.Zero; 673 OMV.Vector3 pv = OMV.Vector3.Zero;
@@ -679,7 +679,7 @@ public sealed class BSPrim : BSPhysObject
679 */ 679 */
680 680
681 return _rotationalVelocity; 681 return _rotationalVelocity;
682 } 682 }
683 set { 683 set {
684 _rotationalVelocity = value; 684 _rotationalVelocity = value;
685 // m_log.DebugFormat("{0}: RotationalVelocity={1}", LogHeader, _rotationalVelocity); 685 // m_log.DebugFormat("{0}: RotationalVelocity={1}", LogHeader, _rotationalVelocity);
@@ -688,16 +688,16 @@ public sealed class BSPrim : BSPhysObject
688 // DetailLog("{0},BSPrim.SetRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); 688 // DetailLog("{0},BSPrim.SetRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity);
689 BulletSimAPI.SetAngularVelocity2(BSBody.ptr, _rotationalVelocity); 689 BulletSimAPI.SetAngularVelocity2(BSBody.ptr, _rotationalVelocity);
690 }); 690 });
691 } 691 }
692 } 692 }
693 public override bool Kinematic { 693 public override bool Kinematic {
694 get { return _kinematic; } 694 get { return _kinematic; }
695 set { _kinematic = value; 695 set { _kinematic = value;
696 // m_log.DebugFormat("{0}: Kinematic={1}", LogHeader, _kinematic); 696 // m_log.DebugFormat("{0}: Kinematic={1}", LogHeader, _kinematic);
697 } 697 }
698 } 698 }
699 public override float Buoyancy { 699 public override float Buoyancy {
700 get { return _buoyancy; } 700 get { return _buoyancy; }
701 set { 701 set {
702 _buoyancy = value; 702 _buoyancy = value;
703 PhysicsScene.TaintedObject("BSPrim.setBuoyancy", delegate() 703 PhysicsScene.TaintedObject("BSPrim.setBuoyancy", delegate()
@@ -707,32 +707,32 @@ public sealed class BSPrim : BSPhysObject
707 float grav = PhysicsScene.Params.gravity * (1f - _buoyancy); 707 float grav = PhysicsScene.Params.gravity * (1f - _buoyancy);
708 BulletSimAPI.SetGravity2(BSBody.ptr, new OMV.Vector3(0f, 0f, grav)); 708 BulletSimAPI.SetGravity2(BSBody.ptr, new OMV.Vector3(0f, 0f, grav));
709 }); 709 });
710 } 710 }
711 } 711 }
712 712
713 // Used for MoveTo 713 // Used for MoveTo
714 public override OMV.Vector3 PIDTarget { 714 public override OMV.Vector3 PIDTarget {
715 set { _PIDTarget = value; } 715 set { _PIDTarget = value; }
716 } 716 }
717 public override bool PIDActive { 717 public override bool PIDActive {
718 set { _usePID = value; } 718 set { _usePID = value; }
719 } 719 }
720 public override float PIDTau { 720 public override float PIDTau {
721 set { _PIDTau = value; } 721 set { _PIDTau = value; }
722 } 722 }
723 723
724 // Used for llSetHoverHeight and maybe vehicle height 724 // Used for llSetHoverHeight and maybe vehicle height
725 // Hover Height will override MoveTo target's Z 725 // Hover Height will override MoveTo target's Z
726 public override bool PIDHoverActive { 726 public override bool PIDHoverActive {
727 set { _useHoverPID = value; } 727 set { _useHoverPID = value; }
728 } 728 }
729 public override float PIDHoverHeight { 729 public override float PIDHoverHeight {
730 set { _PIDHoverHeight = value; } 730 set { _PIDHoverHeight = value; }
731 } 731 }
732 public override PIDHoverType PIDHoverType { 732 public override PIDHoverType PIDHoverType {
733 set { _PIDHoverType = value; } 733 set { _PIDHoverType = value; }
734 } 734 }
735 public override float PIDHoverTau { 735 public override float PIDHoverTau {
736 set { _PIDHoverTao = value; } 736 set { _PIDHoverTao = value; }
737 } 737 }
738 738
@@ -773,11 +773,11 @@ public sealed class BSPrim : BSPhysObject
773 }); 773 });
774 } 774 }
775 775
776 public override void AddAngularForce(OMV.Vector3 force, bool pushforce) { 776 public override void AddAngularForce(OMV.Vector3 force, bool pushforce) {
777 // DetailLog("{0},BSPrim.AddAngularForce,call,angForce={1},push={2}", LocalID, force, pushforce); 777 // DetailLog("{0},BSPrim.AddAngularForce,call,angForce={1},push={2}", LocalID, force, pushforce);
778 // m_log.DebugFormat("{0}: AddAngularForce. f={1}, push={2}", LogHeader, force, pushforce); 778 // m_log.DebugFormat("{0}: AddAngularForce. f={1}, push={2}", LogHeader, force, pushforce);
779 } 779 }
780 public override void SetMomentum(OMV.Vector3 momentum) { 780 public override void SetMomentum(OMV.Vector3 momentum) {
781 // DetailLog("{0},BSPrim.SetMomentum,call,mom={1}", LocalID, momentum); 781 // DetailLog("{0},BSPrim.SetMomentum,call,mom={1}", LocalID, momentum);
782 } 782 }
783 #region Mass Calculation 783 #region Mass Calculation
@@ -789,8 +789,8 @@ public sealed class BSPrim : BSPhysObject
789 789
790 float returnMass = 0; 790 float returnMass = 0;
791 float hollowAmount = (float)_pbs.ProfileHollow * 2.0e-5f; 791 float hollowAmount = (float)_pbs.ProfileHollow * 2.0e-5f;
792 float hollowVolume = hollowAmount * hollowAmount; 792 float hollowVolume = hollowAmount * hollowAmount;
793 793
794 switch (_pbs.ProfileShape) 794 switch (_pbs.ProfileShape)
795 { 795 {
796 case ProfileShape.Square: 796 case ProfileShape.Square:
@@ -826,16 +826,16 @@ public sealed class BSPrim : BSPhysObject
826 826
827 else if (_pbs.PathCurve == (byte)Extrusion.Curve1) 827 else if (_pbs.PathCurve == (byte)Extrusion.Curve1)
828 { 828 {
829 //a tube 829 //a tube
830 830
831 volume *= 0.78539816339e-2f * (float)(200 - _pbs.PathScaleX); 831 volume *= 0.78539816339e-2f * (float)(200 - _pbs.PathScaleX);
832 tmp= 1.0f -2.0e-2f * (float)(200 - _pbs.PathScaleY); 832 tmp= 1.0f -2.0e-2f * (float)(200 - _pbs.PathScaleY);
833 volume -= volume*tmp*tmp; 833 volume -= volume*tmp*tmp;
834 834
835 if (hollowAmount > 0.0) 835 if (hollowAmount > 0.0)
836 { 836 {
837 hollowVolume *= hollowAmount; 837 hollowVolume *= hollowAmount;
838 838
839 switch (_pbs.HollowShape) 839 switch (_pbs.HollowShape)
840 { 840 {
841 case HollowShape.Square: 841 case HollowShape.Square:
@@ -894,7 +894,7 @@ public sealed class BSPrim : BSPhysObject
894 volume *= 0.61685027506808491367715568749226e-2f * (float)(200 - _pbs.PathScaleX); 894 volume *= 0.61685027506808491367715568749226e-2f * (float)(200 - _pbs.PathScaleX);
895 tmp = 1.0f - .02f * (float)(200 - _pbs.PathScaleY); 895 tmp = 1.0f - .02f * (float)(200 - _pbs.PathScaleY);
896 volume *= (1.0f - tmp * tmp); 896 volume *= (1.0f - tmp * tmp);
897 897
898 if (hollowAmount > 0.0) 898 if (hollowAmount > 0.0)
899 { 899 {
900 900
@@ -1118,7 +1118,7 @@ public sealed class BSPrim : BSPhysObject
1118 PhysicsScene.Shapes.GetBodyAndShape(forceRebuild, PhysicsScene.World, this, shapeData, _pbs); 1118 PhysicsScene.Shapes.GetBodyAndShape(forceRebuild, PhysicsScene.World, this, shapeData, _pbs);
1119 1119
1120 Linkset = Linkset.AddMeToLinkset(this); 1120 Linkset = Linkset.AddMeToLinkset(this);
1121 1121
1122 // Make sure the properties are set on the new object 1122 // Make sure the properties are set on the new object
1123 UpdatePhysicalParameters(); 1123 UpdatePhysicalParameters();
1124 return; 1124 return;
@@ -1210,7 +1210,7 @@ public sealed class BSPrim : BSPhysObject
1210 { 1210 {
1211 // For debugging, we can also report the movement of children 1211 // For debugging, we can also report the movement of children
1212 DetailLog("{0},BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", 1212 DetailLog("{0},BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}",
1213 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, 1213 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
1214 entprop.Acceleration, entprop.RotationalVelocity); 1214 entprop.Acceleration, entprop.RotationalVelocity);
1215 } 1215 }
1216 */ 1216 */