aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/PhysXPlugin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs122
1 files changed, 60 insertions, 62 deletions
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index e7d989c..8bdb18d 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -34,6 +34,7 @@ using PhysXWrapper;
34using Quaternion=OpenMetaverse.Quaternion; 34using Quaternion=OpenMetaverse.Quaternion;
35using System.Reflection; 35using System.Reflection;
36using log4net; 36using log4net;
37using OpenMetaverse;
37 38
38namespace OpenSim.Region.Physics.PhysXPlugin 39namespace OpenSim.Region.Physics.PhysXPlugin
39{ 40{
@@ -106,7 +107,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
106 107
107 } 108 }
108 109
109 public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size, bool isFlying) 110 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
110 { 111 {
111 Vec3 pos = new Vec3(); 112 Vec3 pos = new Vec3();
112 pos.X = position.X; 113 pos.X = position.X;
@@ -127,7 +128,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
127 { 128 {
128 } 129 }
129 130
130 private PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation) 131 private PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
131 { 132 {
132 Vec3 pos = new Vec3(); 133 Vec3 pos = new Vec3();
133 pos.X = position.X; 134 pos.X = position.X;
@@ -142,14 +143,14 @@ namespace OpenSim.Region.Physics.PhysXPlugin
142 return act; 143 return act;
143 } 144 }
144 145
145 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, 146 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
146 PhysicsVector size, Quaternion rotation) //To be removed 147 Vector3 size, Quaternion rotation) //To be removed
147 { 148 {
148 return AddPrimShape(primName, pbs, position, size, rotation, false); 149 return AddPrimShape(primName, pbs, position, size, rotation, false);
149 } 150 }
150 151
151 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, 152 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
152 PhysicsVector size, Quaternion rotation, bool isPhysical) 153 Vector3 size, Quaternion rotation, bool isPhysical)
153 { 154 {
154 return AddPrim(position, size, rotation); 155 return AddPrim(position, size, rotation);
155 } 156 }
@@ -219,10 +220,10 @@ namespace OpenSim.Region.Physics.PhysXPlugin
219 220
220 public class PhysXCharacter : PhysicsActor 221 public class PhysXCharacter : PhysicsActor
221 { 222 {
222 private PhysicsVector _position; 223 private Vector3 _position;
223 private PhysicsVector _velocity; 224 private Vector3 _velocity;
224 private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; 225 private Vector3 m_rotationalVelocity = Vector3.Zero;
225 private PhysicsVector _acceleration; 226 private Vector3 _acceleration;
226 private NxCharacter _character; 227 private NxCharacter _character;
227 private bool flying; 228 private bool flying;
228 private bool iscolliding = false; 229 private bool iscolliding = false;
@@ -230,9 +231,6 @@ namespace OpenSim.Region.Physics.PhysXPlugin
230 231
231 public PhysXCharacter(NxCharacter character) 232 public PhysXCharacter(NxCharacter character)
232 { 233 {
233 _velocity = new PhysicsVector();
234 _position = new PhysicsVector();
235 _acceleration = new PhysicsVector();
236 _character = character; 234 _character = character;
237 } 235 }
238 236
@@ -310,7 +308,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
310 set { return; } 308 set { return; }
311 } 309 }
312 310
313 public override PhysicsVector RotationalVelocity 311 public override Vector3 RotationalVelocity
314 { 312 {
315 get { return m_rotationalVelocity; } 313 get { return m_rotationalVelocity; }
316 set { m_rotationalVelocity = value; } 314 set { m_rotationalVelocity = value; }
@@ -321,7 +319,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
321 get { return false; } 319 get { return false; }
322 } 320 }
323 321
324 public override PhysicsVector Position 322 public override Vector3 Position
325 { 323 {
326 get { return _position; } 324 get { return _position; }
327 set 325 set
@@ -335,9 +333,9 @@ namespace OpenSim.Region.Physics.PhysXPlugin
335 } 333 }
336 } 334 }
337 335
338 public override PhysicsVector Size 336 public override Vector3 Size
339 { 337 {
340 get { return PhysicsVector.Zero; } 338 get { return Vector3.Zero; }
341 set { } 339 set { }
342 } 340 }
343 341
@@ -346,9 +344,9 @@ namespace OpenSim.Region.Physics.PhysXPlugin
346 get { return 0f; } 344 get { return 0f; }
347 } 345 }
348 346
349 public override PhysicsVector Force 347 public override Vector3 Force
350 { 348 {
351 get { return PhysicsVector.Zero; } 349 get { return Vector3.Zero; }
352 set { return; } 350 set { return; }
353 } 351 }
354 352
@@ -363,7 +361,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
363 361
364 } 362 }
365 363
366 public override void VehicleVectorParam(int param, PhysicsVector value) 364 public override void VehicleVectorParam(int param, Vector3 value)
367 { 365 {
368 366
369 } 367 }
@@ -379,17 +377,17 @@ namespace OpenSim.Region.Physics.PhysXPlugin
379 } 377 }
380 378
381 379
382 public override PhysicsVector CenterOfMass 380 public override Vector3 CenterOfMass
383 { 381 {
384 get { return PhysicsVector.Zero; } 382 get { return Vector3.Zero; }
385 } 383 }
386 384
387 public override PhysicsVector GeometricCenter 385 public override Vector3 GeometricCenter
388 { 386 {
389 get { return PhysicsVector.Zero; } 387 get { return Vector3.Zero; }
390 } 388 }
391 389
392 public override PhysicsVector Velocity 390 public override Vector3 Velocity
393 { 391 {
394 get { return _velocity; } 392 get { return _velocity; }
395 set { _velocity = value; } 393 set { _velocity = value; }
@@ -413,25 +411,25 @@ namespace OpenSim.Region.Physics.PhysXPlugin
413 set { } 411 set { }
414 } 412 }
415 413
416 public override PhysicsVector Acceleration 414 public override Vector3 Acceleration
417 { 415 {
418 get { return _acceleration; } 416 get { return _acceleration; }
419 } 417 }
420 418
421 public void SetAcceleration(PhysicsVector accel) 419 public void SetAcceleration(Vector3 accel)
422 { 420 {
423 _acceleration = accel; 421 _acceleration = accel;
424 } 422 }
425 423
426 public override void AddForce(PhysicsVector force, bool pushforce) 424 public override void AddForce(Vector3 force, bool pushforce)
427 { 425 {
428 } 426 }
429 public override PhysicsVector Torque 427 public override Vector3 Torque
430 { 428 {
431 get { return PhysicsVector.Zero; } 429 get { return Vector3.Zero; }
432 set { return; } 430 set { return; }
433 } 431 }
434 public override void AddAngularForce(PhysicsVector force, bool pushforce) 432 public override void AddAngularForce(Vector3 force, bool pushforce)
435 { 433 {
436 } 434 }
437 435
@@ -445,12 +443,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin
445 443
446 } 444 }
447 445
448 public override void LockAngularMotion(PhysicsVector axis) 446 public override void LockAngularMotion(Vector3 axis)
449 { 447 {
450 448
451 } 449 }
452 450
453 public override void SetMomentum(PhysicsVector momentum) 451 public override void SetMomentum(Vector3 momentum)
454 { 452 {
455 } 453 }
456 454
@@ -492,7 +490,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
492 490
493 } 491 }
494 492
495 public override PhysicsVector PIDTarget { set { return; } } 493 public override Vector3 PIDTarget { set { return; } }
496 public override bool PIDActive { set { return; } } 494 public override bool PIDActive { set { return; } }
497 public override float PIDTau { set { return; } } 495 public override float PIDTau { set { return; } }
498 496
@@ -518,15 +516,15 @@ namespace OpenSim.Region.Physics.PhysXPlugin
518 516
519 public class PhysXPrim : PhysicsActor 517 public class PhysXPrim : PhysicsActor
520 { 518 {
521 private PhysicsVector _velocity; 519 private Vector3 _velocity;
522 private PhysicsVector _acceleration; 520 private Vector3 _acceleration;
523 private PhysicsVector m_rotationalVelocity; 521 private Vector3 m_rotationalVelocity;
524 private NxActor _prim; 522 private NxActor _prim;
525 523
526 public PhysXPrim(NxActor prim) 524 public PhysXPrim(NxActor prim)
527 { 525 {
528 _velocity = new PhysicsVector(); 526 _velocity = Vector3.Zero;
529 _acceleration = new PhysicsVector(); 527 _acceleration = Vector3.Zero;
530 _prim = prim; 528 _prim = prim;
531 } 529 }
532 530
@@ -580,7 +578,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
580 set { return; } 578 set { return; }
581 } 579 }
582 580
583 public override PhysicsVector RotationalVelocity 581 public override Vector3 RotationalVelocity
584 { 582 {
585 get { return m_rotationalVelocity; } 583 get { return m_rotationalVelocity; }
586 set { m_rotationalVelocity = value; } 584 set { m_rotationalVelocity = value; }
@@ -616,11 +614,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
616 get { return false; } 614 get { return false; }
617 } 615 }
618 616
619 public override PhysicsVector Position 617 public override Vector3 Position
620 { 618 {
621 get 619 get
622 { 620 {
623 PhysicsVector pos = new PhysicsVector(); 621 Vector3 pos = Vector3.Zero;
624 Vec3 vec = _prim.Position; 622 Vec3 vec = _prim.Position;
625 pos.X = vec.X; 623 pos.X = vec.X;
626 pos.Y = vec.Y; 624 pos.Y = vec.Y;
@@ -629,7 +627,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
629 } 627 }
630 set 628 set
631 { 629 {
632 PhysicsVector vec = value; 630 Vector3 vec = value;
633 Vec3 pos = new Vec3(); 631 Vec3 pos = new Vec3();
634 pos.X = vec.X; 632 pos.X = vec.X;
635 pos.Y = vec.Y; 633 pos.Y = vec.Y;
@@ -643,15 +641,15 @@ namespace OpenSim.Region.Physics.PhysXPlugin
643 set { return; } 641 set { return; }
644 } 642 }
645 643
646 public override PhysicsVector Velocity 644 public override Vector3 Velocity
647 { 645 {
648 get { return _velocity; } 646 get { return _velocity; }
649 set { _velocity = value; } 647 set { _velocity = value; }
650 } 648 }
651 649
652 public override PhysicsVector Torque 650 public override Vector3 Torque
653 { 651 {
654 get { return PhysicsVector.Zero; } 652 get { return Vector3.Zero; }
655 set { return; } 653 set { return; }
656 } 654 }
657 655
@@ -682,31 +680,31 @@ namespace OpenSim.Region.Physics.PhysXPlugin
682 set { } 680 set { }
683 } 681 }
684 682
685 public override PhysicsVector Acceleration 683 public override Vector3 Acceleration
686 { 684 {
687 get { return _acceleration; } 685 get { return _acceleration; }
688 } 686 }
689 687
690 public void SetAcceleration(PhysicsVector accel) 688 public void SetAcceleration(Vector3 accel)
691 { 689 {
692 _acceleration = accel; 690 _acceleration = accel;
693 } 691 }
694 692
695 public override void AddForce(PhysicsVector force, bool pushforce) 693 public override void AddForce(Vector3 force, bool pushforce)
696 { 694 {
697 } 695 }
698 696
699 public override void AddAngularForce(PhysicsVector force, bool pushforce) 697 public override void AddAngularForce(Vector3 force, bool pushforce)
700 { 698 {
701 } 699 }
702 700
703 public override void SetMomentum(PhysicsVector momentum) 701 public override void SetMomentum(Vector3 momentum)
704 { 702 {
705 } 703 }
706 704
707 public override PhysicsVector Size 705 public override Vector3 Size
708 { 706 {
709 get { return PhysicsVector.Zero; } 707 get { return Vector3.Zero; }
710 set { } 708 set { }
711 } 709 }
712 710
@@ -718,7 +716,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
718 { 716 {
719 } 717 }
720 718
721 public override void LockAngularMotion(PhysicsVector axis) 719 public override void LockAngularMotion(Vector3 axis)
722 { 720 {
723 721
724 } 722 }
@@ -728,9 +726,9 @@ namespace OpenSim.Region.Physics.PhysXPlugin
728 get { return 0f; } 726 get { return 0f; }
729 } 727 }
730 728
731 public override PhysicsVector Force 729 public override Vector3 Force
732 { 730 {
733 get { return PhysicsVector.Zero; } 731 get { return Vector3.Zero; }
734 set { return; } 732 set { return; }
735 } 733 }
736 734
@@ -745,7 +743,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
745 743
746 } 744 }
747 745
748 public override void VehicleVectorParam(int param, PhysicsVector value) 746 public override void VehicleVectorParam(int param, Vector3 value)
749 { 747 {
750 748
751 } 749 }
@@ -760,21 +758,21 @@ namespace OpenSim.Region.Physics.PhysXPlugin
760 758
761 } 759 }
762 760
763 public override PhysicsVector CenterOfMass 761 public override Vector3 CenterOfMass
764 { 762 {
765 get { return PhysicsVector.Zero; } 763 get { return Vector3.Zero; }
766 } 764 }
767 765
768 public override PhysicsVector GeometricCenter 766 public override Vector3 GeometricCenter
769 { 767 {
770 get { return PhysicsVector.Zero; } 768 get { return Vector3.Zero; }
771 } 769 }
772 770
773 public override void CrossingFailure() 771 public override void CrossingFailure()
774 { 772 {
775 } 773 }
776 774
777 public override PhysicsVector PIDTarget { set { return; } } 775 public override Vector3 PIDTarget { set { return; } }
778 public override bool PIDActive { set { return; } } 776 public override bool PIDActive { set { return; } }
779 public override float PIDTau { set { return; } } 777 public override float PIDTau { set { return; } }
780 778