Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster

avinationmerge
Melanie 2012-04-25 19:15:40 +01:00
commit db31c9fe58
7 changed files with 159 additions and 54 deletions

View File

@ -1386,10 +1386,12 @@ namespace OpenSim.Region.Framework.Scenes
int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS;
int previousFrameTick;
int maintc;
int sleepMS;
int framestart;
while (!m_shuttingDown && (endFrame == null || Frame < endFrame))
{
maintc = Util.EnvironmentTickCount();
framestart = Util.EnvironmentTickCount();
++Frame;
// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
@ -1476,7 +1478,7 @@ namespace OpenSim.Region.Framework.Scenes
// landMS = Util.EnvironmentTickCountSubtract(ldMS);
//}
frameMS = Util.EnvironmentTickCountSubtract(maintc);
// frameMS = Util.EnvironmentTickCountSubtract(maintc);
otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
// if (Frame%m_update_avatars == 0)
@ -1491,7 +1493,7 @@ namespace OpenSim.Region.Framework.Scenes
// frameMS currently records work frame times, not total frame times (work + any required sleep to
// reach min frame time.
StatsReporter.addFrameMS(frameMS);
// StatsReporter.addFrameMS(frameMS);
StatsReporter.addAgentMS(agentMS);
StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
@ -1548,14 +1550,22 @@ namespace OpenSim.Region.Framework.Scenes
previousFrameTick = m_lastFrameTick;
m_lastFrameTick = Util.EnvironmentTickCount();
maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, framestart);
maintc = (int)(MinFrameTime * 1000) - maintc;
m_firstHeartbeat = false;
sleepMS = Util.EnvironmentTickCount();
if (maintc > 0)
Thread.Sleep(maintc);
sleepMS = Util.EnvironmentTickCountSubtract(sleepMS);
frameMS = Util.EnvironmentTickCountSubtract(framestart);
StatsReporter.addSleepMS(sleepMS);
StatsReporter.addFrameMS(frameMS);
// Optionally warn if a frame takes double the amount of time that it should.
if (DebugUpdates
&& Util.EnvironmentTickCountSubtract(

View File

@ -2339,7 +2339,7 @@ namespace OpenSim.Region.Framework.Scenes
{
pa.PIDHoverHeight = height;
pa.PIDHoverType = hoverType;
pa.PIDTau = tau;
pa.PIDHoverTau = tau;
pa.PIDHoverActive = true;
}
else
@ -2664,19 +2664,21 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion oldRootRotation = linkPart.RotationOffset;
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
linkPart.ParentID = m_rootPart.LocalId;
linkPart.GroupPosition = AbsolutePosition;
Vector3 axPos = linkPart.OffsetPosition;
linkPart.ParentID = m_rootPart.LocalId;
linkPart.GroupPosition = AbsolutePosition;
Vector3 axPos = linkPart.OffsetPosition;
Quaternion parentRot = m_rootPart.RotationOffset;
axPos *= Quaternion.Inverse(parentRot);
linkPart.OffsetPosition = axPos;
Quaternion oldRot = linkPart.RotationOffset;
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
linkPart.RotationOffset = newRot;
linkPart.ParentID = m_rootPart.LocalId;
// linkPart.ParentID = m_rootPart.LocalId; done above
if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1;
@ -3708,15 +3710,24 @@ namespace OpenSim.Region.Framework.Scenes
if (togroup)
{
// related to group
if ((change & (ObjectChangeType.Rotation | ObjectChangeType.Position)) != 0)
{
if ((change & ObjectChangeType.Rotation) != 0)
{
group.RootPart.UpdateRotation(data.rotation);
updateType = updatetype.none;
}
if ((change & ObjectChangeType.Position) != 0)
{
group.AbsolutePosition = data.position;
updateType = updatetype.groupterse;
}
if ((change & ObjectChangeType.Rotation) != 0)
else
// ugly rotation update of all parts
{
group.RootPart.UpdateRotation(data.rotation);
updateType = updatetype.none;
group.AbsolutePosition = AbsolutePosition;
}
}
if ((change & ObjectChangeType.Scale) != 0)
{
@ -3741,10 +3752,10 @@ namespace OpenSim.Region.Framework.Scenes
if (part == group.RootPart)
{
if ((change & ObjectChangeType.Position) != 0)
group.UpdateRootPosition(data.position);
if ((change & ObjectChangeType.Rotation) != 0)
group.UpdateRootRotation(data.rotation);
if ((change & ObjectChangeType.Position) != 0)
group.UpdateRootPosition(data.position);
if ((change & ObjectChangeType.Scale) != 0)
part.Resize(data.scale);
}

View File

@ -755,7 +755,7 @@ namespace OpenSim.Region.Framework.Scenes
m_movementAnimationUpdateCounter = 0;
if (Animator != null)
{
if(ParentID == 0) // skip it if sitting
if(ParentID == 0 && !SitGround) // skip it if sitting
Animator.UpdateMovementAnimations();
}
else

View File

@ -75,7 +75,20 @@ namespace OpenSim.Region.Framework.Scenes
OutPacketsPerSecond = 18,
PendingDownloads = 19,
PendingUploads = 20,
VirtualSizeKB = 21,
ResidentSizeKB = 22,
PendingLocalUploads = 23,
UnAckedBytes = 24,
PhysicsPinnedTasks = 25,
PhysicsLODTasks = 26,
PhysicsStepMS = 27,
PhysicsShapeMS = 28,
PhysicsOtherMS = 29,
PhysicsMemory = 30,
ScriptEPS = 31,
SimSpareTime = 32,
SimSleepTime = 33,
IOPumpTime = 34
}
/// <summary>
@ -123,7 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
// saved last reported value so there is something available for llGetRegionFPS
private float lastReportedSimFPS = 0;
private float[] lastReportedSimStats = new float[21];
private float[] lastReportedSimStats = new float[23];
private float m_pfps = 0;
/// <summary>
@ -142,6 +155,8 @@ namespace OpenSim.Region.Framework.Scenes
private int m_physicsMS = 0;
private int m_imageMS = 0;
private int m_otherMS = 0;
private int m_sleeptimeMS = 0;
//Ckrinke: (3-21-08) Comment out to remove a compiler warning. Bring back into play when needed.
//Ckrinke private int m_scriptMS = 0;
@ -200,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
private void statsHeartBeat(object sender, EventArgs e)
{
SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21];
SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[23];
SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
// Know what's not thread safe in Mono... modifying timers.
@ -238,18 +253,38 @@ namespace OpenSim.Region.Framework.Scenes
physfps = 0;
#endregion
float factor = 1 / statsUpdateFactor;
if (reportedFPS <= 0)
reportedFPS = 1;
//Our time dilation is 0.91 when we're running a full speed,
// therefore to make sure we get an appropriate range,
// we have to factor in our error. (0.10f * statsUpdateFactor)
// multiplies the fix for the error times the amount of times it'll occur a second
// / 10 divides the value by the number of times the sim heartbeat runs (10fps)
// Then we divide the whole amount by the amount of seconds pass in between stats updates.
float perframe = 1.0f / (float)reportedFPS;
// 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change
// values to X-per-second values.
float TotalFrameTime = m_frameMS * perframe;
for (int i = 0; i < 21; i++)
float targetframetime = 1100.0f / (float)m_nominalReportedFps;
float sparetime;
if (TotalFrameTime > targetframetime )
sparetime = 0;
else
{
sparetime = m_frameMS - m_physicsMS - m_agentMS;
sparetime *= perframe;
if (sparetime < 0)
sparetime = 0;
else if (sparetime > TotalFrameTime)
sparetime = TotalFrameTime;
}
// other MS is actually simulation time
// m_otherMS = m_frameMS - m_physicsMS - m_imageMS - m_netMS - m_agentMS;
// m_imageMS m_netMS are not included in m_frameMS
m_otherMS = m_frameMS - m_physicsMS - m_agentMS - m_sleeptimeMS;
if (m_otherMS < 0)
m_otherMS = 0;
for (int i = 0; i < 23; i++)
{
sb[i] = new SimStatsPacket.StatBlock();
}
@ -279,19 +314,25 @@ namespace OpenSim.Region.Framework.Scenes
sb[7].StatValue = m_activePrim;
sb[8].StatID = (uint)Stats.FrameMS;
sb[8].StatValue = m_frameMS / statsUpdateFactor;
// sb[8].StatValue = m_frameMS / statsUpdateFactor;
sb[8].StatValue = TotalFrameTime;
sb[9].StatID = (uint)Stats.NetMS;
sb[9].StatValue = m_netMS / statsUpdateFactor;
// sb[9].StatValue = m_netMS / statsUpdateFactor;
sb[9].StatValue = m_netMS * perframe;
sb[10].StatID = (uint)Stats.PhysicsMS;
sb[10].StatValue = m_physicsMS / statsUpdateFactor;
// sb[10].StatValue = m_physicsMS / statsUpdateFactor;
sb[10].StatValue = m_physicsMS * perframe;
sb[11].StatID = (uint)Stats.ImageMS ;
sb[11].StatValue = m_imageMS / statsUpdateFactor;
// sb[11].StatValue = m_imageMS / statsUpdateFactor;
sb[11].StatValue = m_imageMS * perframe;
sb[12].StatID = (uint)Stats.OtherMS;
sb[12].StatValue = m_otherMS / statsUpdateFactor;
// sb[12].StatValue = m_otherMS / statsUpdateFactor;
sb[12].StatValue = m_otherMS * perframe;
sb[13].StatID = (uint)Stats.InPacketsPerSecond;
sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor);
@ -303,7 +344,8 @@ namespace OpenSim.Region.Framework.Scenes
sb[15].StatValue = m_unAckedBytes;
sb[16].StatID = (uint)Stats.AgentMS;
sb[16].StatValue = m_agentMS / statsUpdateFactor;
// sb[16].StatValue = m_agentMS / statsUpdateFactor;
sb[16].StatValue = m_agentMS * perframe;
sb[17].StatID = (uint)Stats.PendingDownloads;
sb[17].StatValue = m_pendingDownloads;
@ -317,7 +359,13 @@ namespace OpenSim.Region.Framework.Scenes
sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
for (int i = 0; i < 21; i++)
sb[21].StatID = (uint)Stats.SimSpareTime;
sb[21].StatValue = sparetime;
sb[22].StatID = (uint)Stats.SimSleepTime;
sb[22].StatValue = m_sleeptimeMS * perframe;
for (int i = 0; i < 23; i++)
{
lastReportedSimStats[i] = sb[i].StatValue;
}
@ -358,6 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
m_physicsMS = 0;
m_imageMS = 0;
m_otherMS = 0;
m_sleeptimeMS = 0;
//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
//Ckrinke m_scriptMS = 0;
@ -484,6 +533,11 @@ namespace OpenSim.Region.Framework.Scenes
m_otherMS += ms;
}
public void addSleepMS(int ms)
{
m_sleeptimeMS += ms;
}
public void AddPendingDownloads(int count)
{
m_pendingDownloads += count;

View File

@ -461,6 +461,13 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public override bool IsVolumeDtc
{
set { return; }
get { return m_isVolumeDetect; }
}
public override bool Phantom
{
get { return m_isphantom; }
@ -598,6 +605,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public override Vector3 CenterOfMass
{
get { return Vector3.Zero; }
@ -1372,6 +1380,25 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
private void UpdateDataFromGeom()
{
if (prim_geom != IntPtr.Zero)
{
d.Quaternion qtmp;
d.GeomCopyQuaternion(prim_geom, out qtmp);
_orientation.W = qtmp.W;
_orientation.X = qtmp.X;
_orientation.Y = qtmp.Y;
_orientation.Z = qtmp.Z;
d.Vector3 lpos = d.GeomGetPosition(prim_geom);
_position.X = lpos.X;
_position.Y = lpos.Y;
_position.Z = lpos.Z;
}
}
public void disableBody()
{
//this kills the body so things like 'mesh' can re-create it.
@ -1400,25 +1427,31 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
d.BodyDestroy(Body);
UpdateDataFromGeom();
lock (childrenPrim)
{
if (childrenPrim.Count > 0)
{
foreach (OdePrim prm in childrenPrim)
{
if (prm.m_NoColide && prm.prim_geom != IntPtr.Zero)
if (prm.prim_geom != IntPtr.Zero)
{
if (prm.m_NoColide)
{
d.GeomSetCategoryBits(prm.prim_geom, 0);
d.GeomSetCollideBits(prm.prim_geom, 0);
d.GeomDisable(prm.prim_geom);
}
}
prm.UpdateDataFromGeom();
}
_parent_scene.remActivePrim(prm);
prm.Body = IntPtr.Zero;
}
}
}
d.BodyDestroy(Body);
Body = IntPtr.Zero;
}
}

View File

@ -346,12 +346,11 @@ namespace OpenSim.Region.Physics.OdePlugin
m_iscollidingObj = true;
// m_iscollidingObj = value;
/*
if (m_iscollidingObj)
m_pidControllerActive = false;
else
m_pidControllerActive = true;
*/
}
}

View File

@ -2467,15 +2467,14 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (prim_geom != IntPtr.Zero)
{
d.Quaternion qtmp = new d.Quaternion { };
d.Quaternion qtmp;
d.GeomCopyQuaternion(prim_geom, out qtmp);
_orientation.W = qtmp.W;
_orientation.X = qtmp.X;
_orientation.Y = qtmp.Y;
_orientation.Z = qtmp.Z;
d.Vector3 lpos;
d.GeomCopyPosition(prim_geom, out lpos);
d.Vector3 lpos = d.GeomGetPosition(prim_geom);
_position.X = lpos.X;
_position.Y = lpos.Y;
_position.Z = lpos.Z;
@ -3565,8 +3564,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
bool lastZeroFlag = _zeroFlag;
d.Vector3 lpos;
d.GeomCopyPosition(prim_geom, out lpos); // root position that is seem by rest of simulator
d.Vector3 lpos = d.GeomGetPosition(prim_geom);
d.Quaternion ori;
d.GeomCopyQuaternion(prim_geom, out ori);