* 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.
This commit is contained in:
Teravus Ovares
2008-02-12 04:27:20 +00:00
parent fdc42481ed
commit 6e01769bcf
10 changed files with 133 additions and 34 deletions

View File

@@ -53,6 +53,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private bool m_taintshape = false;
private bool m_taintPhysics = false;
public bool m_taintremove = false;
public bool m_taintdisable = false;
private bool m_taintforce = false;
private List<PhysicsVector> m_forcelist = new List<PhysicsVector>();
@@ -451,6 +452,9 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_taintforce)
changeAddForce(timestep);
if (m_taintdisable)
changedisable(timestep);
}
public void Move(float timestep)
@@ -494,6 +498,13 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintrot = _orientation;
}
public void changedisable(float timestep)
{
if (Body != (IntPtr) 0)
d.BodyDisable(Body);
m_taintdisable = false;
}
public void changePhysicsStatus(float timestap)
{
@@ -862,7 +873,16 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PhysicsVector RotationalVelocity
{
get { return m_rotationalVelocity; }
get {
if (_zeroFlag)
return PhysicsVector.Zero;
m_lastUpdateSent = false;
if (m_rotationalVelocity.IsIdentical(PhysicsVector.Zero, 0.2f))
return PhysicsVector.Zero;
return m_rotationalVelocity;
}
set { m_rotationalVelocity = value; }
}
@@ -917,6 +937,7 @@ namespace OpenSim.Region.Physics.OdePlugin
&& (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02))
{
_zeroFlag = true;
m_throttleUpdates = false;
}
else
{
@@ -944,9 +965,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_throttleUpdates = false;
throttleCounter = 0;
m_rotationalVelocity.X = 0;
m_rotationalVelocity.Y = 0;
m_rotationalVelocity.Z = 0;
m_rotationalVelocity = PhysicsVector.Zero;
base.RequestPhysicsterseUpdate();
m_lastUpdateSent = true;
}
@@ -960,10 +979,15 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.X = vel.X;
_velocity.Y = vel.Y;
_velocity.Z = vel.Z;
m_rotationalVelocity.X = rotvel.X;
m_rotationalVelocity.Y = rotvel.Y;
m_rotationalVelocity.Z = rotvel.Z;
if (_velocity.IsIdentical(PhysicsVector.Zero, 0.5f))
{
m_rotationalVelocity = PhysicsVector.Zero;
}
else
{
m_rotationalVelocity.setValues(rotvel.X, rotvel.Y, rotvel.Z);
}
//System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString());
_orientation.w = ori.W;
_orientation.x = ori.X;

View File

@@ -405,8 +405,15 @@ namespace OpenSim.Region.Physics.OdePlugin
// If you interpenetrate a prim with another prim
if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)
{
// Don't collide, one or both prim will explode.
contacts[i].depth = 0f;
if (contacts[i].depth >= 0.25f)
{
// Don't collide, one or both prim will explode.
((OdePrim)p1).m_taintdisable = true;
AddPhysicsActorTaint(p1);
((OdePrim)p2).m_taintdisable = true;
AddPhysicsActorTaint(p2);
contacts[i].depth = 0f;
}
}
if (contacts[i].depth >= 1.00f)
{