diff options
author | Teravus Ovares | 2008-02-12 04:27:20 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-12 04:27:20 +0000 |
commit | 6e01769bcff35be9cace62a0342cf2d275608891 (patch) | |
tree | 124df7910fc0f1d31a13e297ced2dd73ce91a292 /OpenSim/Region/Physics/OdePlugin | |
parent | default to appending for log files per Mantis 530, and per (diff) | |
download | opensim-SC_OLD-6e01769bcff35be9cace62a0342cf2d275608891.zip opensim-SC_OLD-6e01769bcff35be9cace62a0342cf2d275608891.tar.gz opensim-SC_OLD-6e01769bcff35be9cace62a0342cf2d275608891.tar.bz2 opensim-SC_OLD-6e01769bcff35be9cace62a0342cf2d275608891.tar.xz |
* A bunch of updates to make things more smooth.
** Sending the actual TimeDilation to the client now instead of the 62455 constant. The client is *supposed* to use that value to sync with the simulator. (actually sending ushort.maxvalue * TimeDilation)
** Disabling prim that inter-penetrate instead of just not attaching a joint
** Reduced prim spin a 'little' bit, but not *enough*
** Tweaked the TimeDilation algorithm to be closer to 1.0 by default and various changes to the sim stats reporter
** Created a .SetValues method to PhysicsVector so we can simply call the setvalues function instead of .x, .y, .z sets.
** Experimented with a .GetBytes Method on PhysicsActor to be able to use the LLVector3.FromBytes() method.
** Upped the Inter-penetration depth to 0.25 instead of .08.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 11 |
2 files changed, 41 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 12d7694..819d823 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
53 | private bool m_taintshape = false; | 53 | private bool m_taintshape = false; |
54 | private bool m_taintPhysics = false; | 54 | private bool m_taintPhysics = false; |
55 | public bool m_taintremove = false; | 55 | public bool m_taintremove = false; |
56 | public bool m_taintdisable = false; | ||
56 | 57 | ||
57 | private bool m_taintforce = false; | 58 | private bool m_taintforce = false; |
58 | private List<PhysicsVector> m_forcelist = new List<PhysicsVector>(); | 59 | private List<PhysicsVector> m_forcelist = new List<PhysicsVector>(); |
@@ -451,6 +452,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
451 | 452 | ||
452 | if (m_taintforce) | 453 | if (m_taintforce) |
453 | changeAddForce(timestep); | 454 | changeAddForce(timestep); |
455 | |||
456 | if (m_taintdisable) | ||
457 | changedisable(timestep); | ||
454 | } | 458 | } |
455 | 459 | ||
456 | public void Move(float timestep) | 460 | public void Move(float timestep) |
@@ -494,6 +498,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
494 | 498 | ||
495 | m_taintrot = _orientation; | 499 | m_taintrot = _orientation; |
496 | } | 500 | } |
501 | public void changedisable(float timestep) | ||
502 | { | ||
503 | if (Body != (IntPtr) 0) | ||
504 | d.BodyDisable(Body); | ||
505 | |||
506 | m_taintdisable = false; | ||
507 | } | ||
497 | 508 | ||
498 | public void changePhysicsStatus(float timestap) | 509 | public void changePhysicsStatus(float timestap) |
499 | { | 510 | { |
@@ -862,7 +873,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
862 | 873 | ||
863 | public override PhysicsVector RotationalVelocity | 874 | public override PhysicsVector RotationalVelocity |
864 | { | 875 | { |
865 | get { return m_rotationalVelocity; } | 876 | get { |
877 | if (_zeroFlag) | ||
878 | return PhysicsVector.Zero; | ||
879 | m_lastUpdateSent = false; | ||
880 | |||
881 | if (m_rotationalVelocity.IsIdentical(PhysicsVector.Zero, 0.2f)) | ||
882 | return PhysicsVector.Zero; | ||
883 | |||
884 | return m_rotationalVelocity; | ||
885 | } | ||
866 | set { m_rotationalVelocity = value; } | 886 | set { m_rotationalVelocity = value; } |
867 | } | 887 | } |
868 | 888 | ||
@@ -917,6 +937,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
917 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02)) | 937 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02)) |
918 | { | 938 | { |
919 | _zeroFlag = true; | 939 | _zeroFlag = true; |
940 | m_throttleUpdates = false; | ||
920 | } | 941 | } |
921 | else | 942 | else |
922 | { | 943 | { |
@@ -944,9 +965,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
944 | { | 965 | { |
945 | m_throttleUpdates = false; | 966 | m_throttleUpdates = false; |
946 | throttleCounter = 0; | 967 | throttleCounter = 0; |
947 | m_rotationalVelocity.X = 0; | 968 | m_rotationalVelocity = PhysicsVector.Zero; |
948 | m_rotationalVelocity.Y = 0; | ||
949 | m_rotationalVelocity.Z = 0; | ||
950 | base.RequestPhysicsterseUpdate(); | 969 | base.RequestPhysicsterseUpdate(); |
951 | m_lastUpdateSent = true; | 970 | m_lastUpdateSent = true; |
952 | } | 971 | } |
@@ -960,10 +979,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
960 | _velocity.X = vel.X; | 979 | _velocity.X = vel.X; |
961 | _velocity.Y = vel.Y; | 980 | _velocity.Y = vel.Y; |
962 | _velocity.Z = vel.Z; | 981 | _velocity.Z = vel.Z; |
963 | 982 | if (_velocity.IsIdentical(PhysicsVector.Zero, 0.5f)) | |
964 | m_rotationalVelocity.X = rotvel.X; | 983 | { |
965 | m_rotationalVelocity.Y = rotvel.Y; | 984 | m_rotationalVelocity = PhysicsVector.Zero; |
966 | m_rotationalVelocity.Z = rotvel.Z; | 985 | } |
986 | else | ||
987 | { | ||
988 | m_rotationalVelocity.setValues(rotvel.X, rotvel.Y, rotvel.Z); | ||
989 | } | ||
990 | |||
967 | //System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString()); | 991 | //System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString()); |
968 | _orientation.w = ori.W; | 992 | _orientation.w = ori.W; |
969 | _orientation.x = ori.X; | 993 | _orientation.x = ori.X; |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f1d8232..1aa141b 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -405,8 +405,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
405 | // If you interpenetrate a prim with another prim | 405 | // If you interpenetrate a prim with another prim |
406 | if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim) | 406 | if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim) |
407 | { | 407 | { |
408 | // Don't collide, one or both prim will explode. | 408 | if (contacts[i].depth >= 0.25f) |
409 | contacts[i].depth = 0f; | 409 | { |
410 | // Don't collide, one or both prim will explode. | ||
411 | ((OdePrim)p1).m_taintdisable = true; | ||
412 | AddPhysicsActorTaint(p1); | ||
413 | ((OdePrim)p2).m_taintdisable = true; | ||
414 | AddPhysicsActorTaint(p2); | ||
415 | contacts[i].depth = 0f; | ||
416 | } | ||
410 | } | 417 | } |
411 | if (contacts[i].depth >= 1.00f) | 418 | if (contacts[i].depth >= 1.00f) |
412 | { | 419 | { |