diff options
author | KittoFlora | 2009-10-27 22:42:55 +0100 |
---|---|---|
committer | KittoFlora | 2009-10-27 22:42:55 +0100 |
commit | 1113b3b6ebba3e358326a7be90b338d8c95af688 (patch) | |
tree | d923340600e5a2699ceaceeb52fd6c45994f334a /OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |
parent | llRotLookAt Pt 2 (diff) | |
parent | Merge branch 'master' into vehicles (diff) | |
download | opensim-SC-1113b3b6ebba3e358326a7be90b338d8c95af688.zip opensim-SC-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.gz opensim-SC-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.bz2 opensim-SC-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.xz |
Merge branch 'vehicles' into tests
Conflicts:
OpenSim/Region/Physics/Manager/PhysicsActor.cs
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index b3bf70b..24eb6b1 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -34,6 +34,7 @@ using PhysXWrapper; | |||
34 | using Quaternion=OpenMetaverse.Quaternion; | 34 | using Quaternion=OpenMetaverse.Quaternion; |
35 | using System.Reflection; | 35 | using System.Reflection; |
36 | using log4net; | 36 | using log4net; |
37 | using OpenMetaverse; | ||
37 | 38 | ||
38 | namespace OpenSim.Region.Physics.PhysXPlugin | 39 | namespace 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 | ||
@@ -540,15 +538,15 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
540 | 538 | ||
541 | public class PhysXPrim : PhysicsActor | 539 | public class PhysXPrim : PhysicsActor |
542 | { | 540 | { |
543 | private PhysicsVector _velocity; | 541 | private Vector3 _velocity; |
544 | private PhysicsVector _acceleration; | 542 | private Vector3 _acceleration; |
545 | private PhysicsVector m_rotationalVelocity; | 543 | private Vector3 m_rotationalVelocity; |
546 | private NxActor _prim; | 544 | private NxActor _prim; |
547 | 545 | ||
548 | public PhysXPrim(NxActor prim) | 546 | public PhysXPrim(NxActor prim) |
549 | { | 547 | { |
550 | _velocity = new PhysicsVector(); | 548 | _velocity = Vector3.Zero; |
551 | _acceleration = new PhysicsVector(); | 549 | _acceleration = Vector3.Zero; |
552 | _prim = prim; | 550 | _prim = prim; |
553 | } | 551 | } |
554 | 552 | ||
@@ -602,7 +600,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
602 | set { return; } | 600 | set { return; } |
603 | } | 601 | } |
604 | 602 | ||
605 | public override PhysicsVector RotationalVelocity | 603 | public override Vector3 RotationalVelocity |
606 | { | 604 | { |
607 | get { return m_rotationalVelocity; } | 605 | get { return m_rotationalVelocity; } |
608 | set { m_rotationalVelocity = value; } | 606 | set { m_rotationalVelocity = value; } |
@@ -638,11 +636,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
638 | get { return false; } | 636 | get { return false; } |
639 | } | 637 | } |
640 | 638 | ||
641 | public override PhysicsVector Position | 639 | public override Vector3 Position |
642 | { | 640 | { |
643 | get | 641 | get |
644 | { | 642 | { |
645 | PhysicsVector pos = new PhysicsVector(); | 643 | Vector3 pos = Vector3.Zero; |
646 | Vec3 vec = _prim.Position; | 644 | Vec3 vec = _prim.Position; |
647 | pos.X = vec.X; | 645 | pos.X = vec.X; |
648 | pos.Y = vec.Y; | 646 | pos.Y = vec.Y; |
@@ -651,7 +649,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
651 | } | 649 | } |
652 | set | 650 | set |
653 | { | 651 | { |
654 | PhysicsVector vec = value; | 652 | Vector3 vec = value; |
655 | Vec3 pos = new Vec3(); | 653 | Vec3 pos = new Vec3(); |
656 | pos.X = vec.X; | 654 | pos.X = vec.X; |
657 | pos.Y = vec.Y; | 655 | pos.Y = vec.Y; |
@@ -665,15 +663,15 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
665 | set { return; } | 663 | set { return; } |
666 | } | 664 | } |
667 | 665 | ||
668 | public override PhysicsVector Velocity | 666 | public override Vector3 Velocity |
669 | { | 667 | { |
670 | get { return _velocity; } | 668 | get { return _velocity; } |
671 | set { _velocity = value; } | 669 | set { _velocity = value; } |
672 | } | 670 | } |
673 | 671 | ||
674 | public override PhysicsVector Torque | 672 | public override Vector3 Torque |
675 | { | 673 | { |
676 | get { return PhysicsVector.Zero; } | 674 | get { return Vector3.Zero; } |
677 | set { return; } | 675 | set { return; } |
678 | } | 676 | } |
679 | 677 | ||
@@ -704,31 +702,31 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
704 | set { } | 702 | set { } |
705 | } | 703 | } |
706 | 704 | ||
707 | public override PhysicsVector Acceleration | 705 | public override Vector3 Acceleration |
708 | { | 706 | { |
709 | get { return _acceleration; } | 707 | get { return _acceleration; } |
710 | } | 708 | } |
711 | 709 | ||
712 | public void SetAcceleration(PhysicsVector accel) | 710 | public void SetAcceleration(Vector3 accel) |
713 | { | 711 | { |
714 | _acceleration = accel; | 712 | _acceleration = accel; |
715 | } | 713 | } |
716 | 714 | ||
717 | public override void AddForce(PhysicsVector force, bool pushforce) | 715 | public override void AddForce(Vector3 force, bool pushforce) |
718 | { | 716 | { |
719 | } | 717 | } |
720 | 718 | ||
721 | public override void AddAngularForce(PhysicsVector force, bool pushforce) | 719 | public override void AddAngularForce(Vector3 force, bool pushforce) |
722 | { | 720 | { |
723 | } | 721 | } |
724 | 722 | ||
725 | public override void SetMomentum(PhysicsVector momentum) | 723 | public override void SetMomentum(Vector3 momentum) |
726 | { | 724 | { |
727 | } | 725 | } |
728 | 726 | ||
729 | public override PhysicsVector Size | 727 | public override Vector3 Size |
730 | { | 728 | { |
731 | get { return PhysicsVector.Zero; } | 729 | get { return Vector3.Zero; } |
732 | set { } | 730 | set { } |
733 | } | 731 | } |
734 | 732 | ||
@@ -740,7 +738,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
740 | { | 738 | { |
741 | } | 739 | } |
742 | 740 | ||
743 | public override void LockAngularMotion(PhysicsVector axis) | 741 | public override void LockAngularMotion(Vector3 axis) |
744 | { | 742 | { |
745 | 743 | ||
746 | } | 744 | } |
@@ -750,9 +748,9 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
750 | get { return 0f; } | 748 | get { return 0f; } |
751 | } | 749 | } |
752 | 750 | ||
753 | public override PhysicsVector Force | 751 | public override Vector3 Force |
754 | { | 752 | { |
755 | get { return PhysicsVector.Zero; } | 753 | get { return Vector3.Zero; } |
756 | set { return; } | 754 | set { return; } |
757 | } | 755 | } |
758 | 756 | ||
@@ -767,7 +765,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
767 | 765 | ||
768 | } | 766 | } |
769 | 767 | ||
770 | public override void VehicleVectorParam(int param, PhysicsVector value) | 768 | public override void VehicleVectorParam(int param, Vector3 value) |
771 | { | 769 | { |
772 | 770 | ||
773 | } | 771 | } |
@@ -782,21 +780,21 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
782 | 780 | ||
783 | } | 781 | } |
784 | 782 | ||
785 | public override PhysicsVector CenterOfMass | 783 | public override Vector3 CenterOfMass |
786 | { | 784 | { |
787 | get { return PhysicsVector.Zero; } | 785 | get { return Vector3.Zero; } |
788 | } | 786 | } |
789 | 787 | ||
790 | public override PhysicsVector GeometricCenter | 788 | public override Vector3 GeometricCenter |
791 | { | 789 | { |
792 | get { return PhysicsVector.Zero; } | 790 | get { return Vector3.Zero; } |
793 | } | 791 | } |
794 | 792 | ||
795 | public override void CrossingFailure() | 793 | public override void CrossingFailure() |
796 | { | 794 | { |
797 | } | 795 | } |
798 | 796 | ||
799 | public override PhysicsVector PIDTarget { set { return; } } | 797 | public override Vector3 PIDTarget { set { return; } } |
800 | public override bool PIDActive { set { return; } } | 798 | public override bool PIDActive { set { return; } } |
801 | public override float PIDTau { set { return; } } | 799 | public override float PIDTau { set { return; } } |
802 | 800 | ||