mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
* 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:
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (TryGetAvatar(remoteClient.AgentId, out av)) {
|
||||
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
|
||||
objupdate.RegionData.RegionHandle = m_regInfo.RegionHandle;
|
||||
objupdate.RegionData.TimeDilation = 64096;
|
||||
objupdate.RegionData.TimeDilation = ushort.MaxValue;
|
||||
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[2];
|
||||
// avatar stuff - horrible group copypaste
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
public InnerScene m_innerScene;
|
||||
|
||||
private Random Rand = new Random();
|
||||
private uint _primCount = 702000;
|
||||
private uint _primCount = 720000;
|
||||
private readonly Mutex _primAllocateMutex = new Mutex(false);
|
||||
|
||||
private int m_timePhase = 24;
|
||||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
protected int m_fps = 10;
|
||||
protected int m_frame = 0;
|
||||
protected float m_timespan = 0.1f;
|
||||
protected float m_timespan = 0.089f;
|
||||
protected DateTime m_lastupdate = DateTime.Now;
|
||||
|
||||
protected float m_timedilation = 1.0f;
|
||||
@@ -750,8 +750,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
finally
|
||||
{
|
||||
updateLock.ReleaseMutex();
|
||||
// Get actual time dilation
|
||||
float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds);
|
||||
|
||||
m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds;
|
||||
// If actual time dilation is greater then one, we're catching up, so subtract
|
||||
// the amount that's greater then 1 from the time dilation
|
||||
if (tmpval > 1.0)
|
||||
{
|
||||
tmpval = tmpval - (tmpval - 1.0f);
|
||||
}
|
||||
m_timedilation = tmpval;
|
||||
|
||||
m_lastupdate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1593,7 +1593,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
part.UpdateMovement();
|
||||
}
|
||||
}
|
||||
|
||||
public float GetTimeDilation()
|
||||
{
|
||||
return m_scene.TimeDilation;
|
||||
}
|
||||
/// <summary>
|
||||
/// Added as a way for the storage provider to reset the scene,
|
||||
/// most likely a better way to do this sort of thing but for now...
|
||||
|
||||
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
public byte ObjectSaleType;
|
||||
public int SalePrice;
|
||||
public uint Category;
|
||||
|
||||
|
||||
public Int32 CreationDate;
|
||||
public uint ParentID = 0;
|
||||
|
||||
private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero;
|
||||
private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0);
|
||||
private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||
private LLUUID m_sitTargetAvatar = LLUUID.Zero;
|
||||
@@ -417,9 +419,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (PhysActor.IsPhysical)
|
||||
{
|
||||
m_rotationalvelocity.X = PhysActor.RotationalVelocity.X;
|
||||
m_rotationalvelocity.Y = PhysActor.RotationalVelocity.Y;
|
||||
m_rotationalvelocity.Z = PhysActor.RotationalVelocity.Z;
|
||||
m_rotationalvelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(),0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
|
||||
byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
|
||||
remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid,
|
||||
remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, m_shape, lPos, clientFlags, m_uuid,
|
||||
OwnerID,
|
||||
m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation);
|
||||
}
|
||||
@@ -1741,12 +1741,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
LLQuaternion mRot = RotationOffset;
|
||||
if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
|
||||
{
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot);
|
||||
}
|
||||
else
|
||||
{
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity,
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot, Velocity,
|
||||
RotationalVelocity);
|
||||
//System.Console.WriteLine("LID: " + LocalID + " RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1755,13 +1756,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
LLQuaternion mRot = RotationOffset;
|
||||
if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
|
||||
{
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot);
|
||||
}
|
||||
else
|
||||
{
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity,
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot, Velocity,
|
||||
RotationalVelocity);
|
||||
//System.Console.WriteLine("RVel:" + RotationalVelocity);
|
||||
//System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1289,7 +1289,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
LLVector3 pos = m_pos;
|
||||
LLVector3 vel = Velocity;
|
||||
LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w);
|
||||
remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z),
|
||||
remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new LLVector3(pos.X, pos.Y, pos.Z),
|
||||
new LLVector3(vel.X, vel.Y, vel.Z), rot);
|
||||
|
||||
m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// Then we divide the whole amount by the amount of seconds pass in between stats updates.
|
||||
|
||||
sb[0].StatID = (uint) Stats.TimeDilation;
|
||||
sb[0].StatValue = ((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
|
||||
sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
|
||||
|
||||
sb[1].StatID = (uint) Stats.SimFPS;
|
||||
sb[1].StatValue = simfps/statsUpdateFactor;
|
||||
@@ -280,13 +280,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public void AddTimeDilation(float td)
|
||||
{
|
||||
float tdsetting = td;
|
||||
if (tdsetting > 1.0f)
|
||||
tdsetting = (tdsetting - (tdsetting - 0.91f));
|
||||
//float tdsetting = td;
|
||||
//if (tdsetting > 1.0f)
|
||||
//tdsetting = (tdsetting - (tdsetting - 0.91f));
|
||||
|
||||
if (tdsetting < 0)
|
||||
tdsetting = 0.0f;
|
||||
m_timeDilation += tdsetting;
|
||||
//if (tdsetting < 0)
|
||||
//tdsetting = 0.0f;
|
||||
m_timeDilation = td;
|
||||
}
|
||||
|
||||
public void SetRootAgents(int rootAgents)
|
||||
|
||||
Reference in New Issue
Block a user