aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-19 22:42:06 +0000
committerTeravus Ovares2007-12-19 22:42:06 +0000
commit27e028752600921deac57e281f1df6d8c7310c5d (patch)
treef94a99a6e7ad4d4325d336561f0e6365ec44f6d3 /OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
parentThank you very much, CharlieO for: (diff)
downloadopensim-SC-27e028752600921deac57e281f1df6d8c7310c5d.zip
opensim-SC-27e028752600921deac57e281f1df6d8c7310c5d.tar.gz
opensim-SC-27e028752600921deac57e281f1df6d8c7310c5d.tar.bz2
opensim-SC-27e028752600921deac57e281f1df6d8c7310c5d.tar.xz
* Re-did the mass calculations in ODE for Prim
* Exposed the mass as a PhysicsActor read only property (so scripts can get at it - hint hint -) * Hollow and Path Cuts affect the prim mass (all Hollow Types are supported in this calculation (sphere,square,triangle)) * Prim no longer sink into the ground.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs46
1 files changed, 43 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 1760e50..5602301 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -511,10 +511,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
511 GC.Collect(); 511 GC.Collect();
512 } 512 }
513 } 513 }
514
514 public override void AddPhysicsActorTaint(PhysicsActor prim) 515 public override void AddPhysicsActorTaint(PhysicsActor prim)
515 { 516 {
516 517
517 } 518 }
519
518 public override float Simulate(float timeStep) 520 public override float Simulate(float timeStep)
519 { 521 {
520 float fps = 0; 522 float fps = 0;
@@ -735,11 +737,13 @@ namespace OpenSim.Region.Physics.BulletXPlugin
735 } 737 }
736 } 738 }
737 } 739 }
740
738 public override PhysicsVector RotationalVelocity 741 public override PhysicsVector RotationalVelocity
739 { 742 {
740 get { return m_rotationalVelocity; } 743 get { return m_rotationalVelocity; }
741 set { m_rotationalVelocity = value; } 744 set { m_rotationalVelocity = value; }
742 } 745 }
746
743 public override PhysicsVector Velocity 747 public override PhysicsVector Velocity
744 { 748 {
745 get { return _velocity; } 749 get { return _velocity; }
@@ -760,12 +764,28 @@ namespace OpenSim.Region.Physics.BulletXPlugin
760 } 764 }
761 } 765 }
762 } 766 }
767
763 public override PhysicsVector Size 768 public override PhysicsVector Size
764 { 769 {
765 get { return _size; } 770 get { return _size; }
766 set { lock (BulletXScene.BulletXLock) { _size = value; } } 771 set { lock (BulletXScene.BulletXLock) { _size = value; } }
767 } 772 }
768 773
774 public override PhysicsVector Force
775 {
776 get { return PhysicsVector.Zero; }
777 }
778
779 public override PhysicsVector CenterOfMass
780 {
781 get { return PhysicsVector.Zero; }
782 }
783
784 public override PhysicsVector GeometricCenter
785 {
786 get { return PhysicsVector.Zero; }
787 }
788
769 public override PrimitiveBaseShape Shape 789 public override PrimitiveBaseShape Shape
770 { 790 {
771 set 791 set
@@ -773,15 +793,18 @@ namespace OpenSim.Region.Physics.BulletXPlugin
773 return; 793 return;
774 } 794 }
775 } 795 }
796
776 public override bool SetAlwaysRun 797 public override bool SetAlwaysRun
777 { 798 {
778 get { return false; } 799 get { return false; }
779 set { return; } 800 set { return; }
780 } 801 }
802
781 public override PhysicsVector Acceleration 803 public override PhysicsVector Acceleration
782 { 804 {
783 get { return _acceleration; } 805 get { return _acceleration; }
784 } 806 }
807
785 public override AxiomQuaternion Orientation 808 public override AxiomQuaternion Orientation
786 { 809 {
787 get { return _orientation; } 810 get { return _orientation; }
@@ -794,10 +817,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin
794 } 817 }
795 } 818 }
796 } 819 }
797 public virtual float Mass 820
821 public override float Mass
798 { 822 {
799 get { return 0; } 823 get { return ActorMass; }
824 }
825
826 public virtual float ActorMass
827 {
828 get { return 0; }
800 } 829 }
830
801 public override int PhysicsActorType 831 public override int PhysicsActorType
802 { 832 {
803 get { return (int) m_PhysicsActorType; } 833 get { return (int) m_PhysicsActorType; }
@@ -808,6 +838,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
808 { 838 {
809 get { return rigidBody; } 839 get { return rigidBody; }
810 } 840 }
841
811 public Vector3 RigidBodyPosition 842 public Vector3 RigidBodyPosition
812 { 843 {
813 get { return this.rigidBody.CenterOfMassPosition; } 844 get { return this.rigidBody.CenterOfMassPosition; }
@@ -829,21 +860,25 @@ namespace OpenSim.Region.Physics.BulletXPlugin
829 get { return false; } 860 get { return false; }
830 set { return; } 861 set { return; }
831 } 862 }
863
832 public override bool IsColliding 864 public override bool IsColliding
833 { 865 {
834 get { return iscolliding; } 866 get { return iscolliding; }
835 set { iscolliding = value; } 867 set { iscolliding = value; }
836 } 868 }
869
837 public override bool CollidingGround 870 public override bool CollidingGround
838 { 871 {
839 get { return false; } 872 get { return false; }
840 set { return; } 873 set { return; }
841 } 874 }
875
842 public override bool CollidingObj 876 public override bool CollidingObj
843 { 877 {
844 get { return false; } 878 get { return false; }
845 set { return; } 879 set { return; }
846 } 880 }
881
847 public virtual void SetAcceleration(PhysicsVector accel) 882 public virtual void SetAcceleration(PhysicsVector accel)
848 { 883 {
849 lock (BulletXScene.BulletXLock) 884 lock (BulletXScene.BulletXLock)
@@ -851,6 +886,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
851 _acceleration = accel; 886 _acceleration = accel;
852 } 887 }
853 } 888 }
889
854 public override bool Kinematic 890 public override bool Kinematic
855 { 891 {
856 get 892 get
@@ -862,16 +898,20 @@ namespace OpenSim.Region.Physics.BulletXPlugin
862 898
863 } 899 }
864 } 900 }
901
865 public override void AddForce(PhysicsVector force) 902 public override void AddForce(PhysicsVector force)
866 { 903 {
867 904
868 } 905 }
906
869 public override void SetMomentum(PhysicsVector momentum) 907 public override void SetMomentum(PhysicsVector momentum)
870 { 908 {
871 } 909 }
910
872 internal virtual void ValidateHeight(float heighmapPositionValue) 911 internal virtual void ValidateHeight(float heighmapPositionValue)
873 { 912 {
874 } 913 }
914
875 internal virtual void UpdateKinetics() 915 internal virtual void UpdateKinetics()
876 { 916 {
877 } 917 }
@@ -1176,7 +1216,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
1176 get { return base.Orientation; } 1216 get { return base.Orientation; }
1177 set { base.Orientation = value; } 1217 set { base.Orientation = value; }
1178 } 1218 }
1179 public override float Mass 1219 public override float ActorMass
1180 { 1220 {
1181 get 1221 get
1182 { 1222 {