Merge branch 'master' into BulletSim2017
commit
8f3c17189c
|
@ -145,7 +145,12 @@
|
||||||
</exec>
|
</exec>
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
|
||||||
|
|
||||||
<delete dir="%temp%"/>
|
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.permissions">
|
||||||
|
<arg value="./bin/OpenSim.Tests.Permissions.dll" />
|
||||||
|
</exec>
|
||||||
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests.permissions)==0}" />
|
||||||
|
|
||||||
|
<delete dir="%temp%"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="test-stress" depends="build, find-nunit">
|
<target name="test-stress" depends="build, find-nunit">
|
||||||
|
@ -260,6 +265,11 @@
|
||||||
<arg value="-xml=test-results/OpenSim.Services.InventoryService.Tests.dll-Results.xml" />
|
<arg value="-xml=test-results/OpenSim.Services.InventoryService.Tests.dll-Results.xml" />
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
|
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.tests.permissions">
|
||||||
|
<arg value="./bin/OpenSim.Tests.Permissions.dll" />
|
||||||
|
<arg value="-xml=test-results/OpenSim.Tests.Permissions.dll-Results.xml" />
|
||||||
|
</exec>
|
||||||
|
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" />
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
|
||||||
|
@ -271,6 +281,7 @@
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
|
||||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
|
||||||
|
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests.permissions)==0}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="doxygen">
|
<target name="doxygen">
|
||||||
|
|
|
@ -657,6 +657,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(!m_scene.IsRunning)
|
||||||
|
// return sog;
|
||||||
|
|
||||||
if (root.KeyframeMotion != null)
|
if (root.KeyframeMotion != null)
|
||||||
root.KeyframeMotion.StartCrossingCheck();
|
root.KeyframeMotion.StartCrossingCheck();
|
||||||
|
|
||||||
|
@ -3018,12 +3021,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// If we somehow got here to updating the SOG and its root part is not scheduled for update,
|
// If we somehow got here to updating the SOG and its root part is not scheduled for update,
|
||||||
// check to see if the physical position or rotation warrant an update.
|
// check to see if the physical position or rotation warrant an update.
|
||||||
|
/*
|
||||||
if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
|
if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
|
||||||
{
|
{
|
||||||
// rootpart SendScheduledUpdates will check if a update is needed
|
// rootpart SendScheduledUpdates will check if a update is needed
|
||||||
m_rootPart.UpdateFlag = UpdateRequired.TERSE;
|
m_rootPart.UpdateFlag = UpdateRequired.TERSE;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (IsAttachment)
|
if (IsAttachment)
|
||||||
{
|
{
|
||||||
ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
|
ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
|
||||||
|
|
|
@ -238,12 +238,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool SoundQueueing { get; set; }
|
public bool SoundQueueing { get; set; }
|
||||||
|
|
||||||
public uint TimeStampFull;
|
|
||||||
|
|
||||||
public uint TimeStampLastActivity; // Will be used for AutoReturn
|
|
||||||
|
|
||||||
public uint TimeStampTerse;
|
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public Quaternion AttachRotation = Quaternion.Identity;
|
public Quaternion AttachRotation = Quaternion.Identity;
|
||||||
|
|
||||||
|
@ -1219,6 +1213,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
public UpdateRequired UpdateFlag { get; set; }
|
public UpdateRequired UpdateFlag { get; set; }
|
||||||
|
private object UpdateFlagLock = new object();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for media on a prim.
|
/// Used for media on a prim.
|
||||||
|
@ -1641,8 +1636,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
PhysActor.SetMaterial((int)value);
|
PhysActor.SetMaterial((int)value);
|
||||||
}
|
}
|
||||||
if(ParentGroup != null)
|
if(ParentGroup != null)
|
||||||
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
ScheduleFullUpdateIfNone();
|
ScheduleFullUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1730,7 +1727,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public byte PhysicsShapeType
|
public byte PhysicsShapeType
|
||||||
{
|
{
|
||||||
get { return m_physicsShapeType; }
|
get
|
||||||
|
{
|
||||||
|
// if (PhysActor != null)
|
||||||
|
// m_physicsShapeType = PhysActor.PhysicsShapeType;
|
||||||
|
return m_physicsShapeType;
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
byte oldv = m_physicsShapeType;
|
byte oldv = m_physicsShapeType;
|
||||||
|
@ -1781,10 +1783,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_density = value;
|
m_density = value;
|
||||||
|
|
||||||
ScheduleFullUpdateIfNone();
|
|
||||||
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
ScheduleFullUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
|
@ -1802,10 +1806,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_gravitymod = value;
|
m_gravitymod = value;
|
||||||
|
|
||||||
ScheduleFullUpdateIfNone();
|
|
||||||
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
ScheduleFullUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
|
@ -1823,10 +1828,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_friction = value;
|
m_friction = value;
|
||||||
|
|
||||||
ScheduleFullUpdateIfNone();
|
|
||||||
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
ScheduleFullUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
|
@ -1844,10 +1850,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_bounce = value;
|
m_bounce = value;
|
||||||
|
|
||||||
ScheduleFullUpdateIfNone();
|
|
||||||
|
|
||||||
if (ParentGroup != null)
|
if (ParentGroup != null)
|
||||||
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
ScheduleFullUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
|
@ -1876,7 +1883,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearUpdateSchedule()
|
public void ClearUpdateSchedule()
|
||||||
{
|
{
|
||||||
UpdateFlag = UpdateRequired.NONE;
|
lock(UpdateFlagLock)
|
||||||
|
UpdateFlag = UpdateRequired.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3239,17 +3247,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
APIDActive = false;
|
APIDActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScheduleFullUpdateIfNone()
|
|
||||||
{
|
|
||||||
if (ParentGroup == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// ??? ParentGroup.HasGroupChanged = true;
|
|
||||||
|
|
||||||
if (UpdateFlag != UpdateRequired.FULL)
|
|
||||||
ScheduleFullUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Schedules this prim for a full update
|
/// Schedules this prim for a full update
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3260,30 +3257,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup == null)
|
if (ParentGroup == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ParentGroup.QueueForUpdateCheck();
|
lock(UpdateFlagLock)
|
||||||
|
|
||||||
int timeNow = Util.UnixTimeSinceEpoch();
|
|
||||||
|
|
||||||
// If multiple updates are scheduled on the same second, we still need to perform all of them
|
|
||||||
// So we'll force the issue by bumping up the timestamp so that later processing sees these need
|
|
||||||
// to be performed.
|
|
||||||
if (timeNow <= TimeStampFull)
|
|
||||||
{
|
{
|
||||||
TimeStampFull += 1;
|
ParentGroup.QueueForUpdateCheck(); // just in case
|
||||||
|
if(UpdateFlag != UpdateRequired.FULL)
|
||||||
|
{
|
||||||
|
UpdateFlag = UpdateRequired.FULL;
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
|
||||||
|
// UUID, Name, TimeStampFull);
|
||||||
|
|
||||||
|
if (ParentGroup.Scene != null)
|
||||||
|
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
TimeStampFull = (uint)timeNow;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateFlag = UpdateRequired.FULL;
|
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
|
|
||||||
// UUID, Name, TimeStampFull);
|
|
||||||
|
|
||||||
if (ParentGroup.Scene != null)
|
|
||||||
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3304,21 +3292,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UpdateFlag == UpdateRequired.NONE)
|
lock(UpdateFlagLock)
|
||||||
{
|
{
|
||||||
ParentGroup.HasGroupChanged = true;
|
if (UpdateFlag == UpdateRequired.NONE)
|
||||||
ParentGroup.QueueForUpdateCheck();
|
{
|
||||||
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
ParentGroup.QueueForUpdateCheck();
|
||||||
|
|
||||||
TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
|
UpdateFlag = UpdateRequired.TERSE;
|
||||||
UpdateFlag = UpdateRequired.TERSE;
|
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
|
// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
|
||||||
// UUID, Name, TimeStampTerse);
|
// UUID, Name, TimeStampTerse);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ParentGroup.Scene != null)
|
||||||
|
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParentGroup.Scene != null)
|
|
||||||
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
||||||
|
@ -3362,12 +3352,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update the "last" values
|
// Update the "last" values
|
||||||
m_lastPosition = AbsolutePosition;
|
lock(UpdateFlagLock)
|
||||||
m_lastRotation = RotationOffset;
|
{
|
||||||
m_lastVelocity = Velocity;
|
m_lastPosition = AbsolutePosition;
|
||||||
m_lastAcceleration = Acceleration;
|
m_lastRotation = RotationOffset;
|
||||||
m_lastAngularVelocity = AngularVelocity;
|
m_lastVelocity = Velocity;
|
||||||
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
m_lastAcceleration = Acceleration;
|
||||||
|
m_lastAngularVelocity = AngularVelocity;
|
||||||
|
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
||||||
|
}
|
||||||
|
|
||||||
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
|
@ -3381,12 +3374,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update the "last" values
|
// Update the "last" values
|
||||||
m_lastPosition = AbsolutePosition;
|
lock(UpdateFlagLock)
|
||||||
m_lastRotation = RotationOffset;
|
{
|
||||||
m_lastVelocity = Velocity;
|
m_lastPosition = AbsolutePosition;
|
||||||
m_lastAcceleration = Acceleration;
|
m_lastRotation = RotationOffset;
|
||||||
m_lastAngularVelocity = AngularVelocity;
|
m_lastVelocity = Velocity;
|
||||||
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
m_lastAcceleration = Acceleration;
|
||||||
|
m_lastAngularVelocity = AngularVelocity;
|
||||||
|
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
||||||
|
}
|
||||||
|
|
||||||
if (ParentGroup.IsAttachment)
|
if (ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
|
@ -3443,107 +3439,117 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendScheduledUpdates()
|
public void SendScheduledUpdates()
|
||||||
{
|
{
|
||||||
switch (UpdateFlag)
|
UpdateRequired currentUpdate;
|
||||||
|
lock(UpdateFlagLock)
|
||||||
|
{
|
||||||
|
currentUpdate = UpdateFlag;
|
||||||
|
ClearUpdateSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (currentUpdate)
|
||||||
{
|
{
|
||||||
case UpdateRequired.NONE:
|
case UpdateRequired.NONE:
|
||||||
ClearUpdateSchedule();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UpdateRequired.TERSE:
|
case UpdateRequired.TERSE:
|
||||||
|
|
||||||
ClearUpdateSchedule();
|
|
||||||
bool needupdate = true;
|
bool needupdate = true;
|
||||||
double now = Util.GetTimeStampMS();
|
lock(UpdateFlagLock)
|
||||||
Vector3 curvel = Velocity;
|
|
||||||
Vector3 curacc = Acceleration;
|
|
||||||
Vector3 angvel = AngularVelocity;
|
|
||||||
|
|
||||||
while(true) // just to avoid ugly goto
|
|
||||||
{
|
{
|
||||||
double elapsed = now - m_lastUpdateSentTime;
|
double now = Util.GetTimeStampMS();
|
||||||
if (elapsed > TIME_MS_TOLERANCE)
|
Vector3 curvel = Velocity;
|
||||||
break;
|
Vector3 curacc = Acceleration;
|
||||||
|
Vector3 angvel = AngularVelocity;
|
||||||
|
|
||||||
if( Math.Abs(curacc.X - m_lastAcceleration.X) > VELOCITY_TOLERANCE ||
|
while(true) // just to avoid ugly goto
|
||||||
Math.Abs(curacc.Y - m_lastAcceleration.Y) > VELOCITY_TOLERANCE ||
|
|
||||||
Math.Abs(curacc.Z - m_lastAcceleration.Z) > VELOCITY_TOLERANCE)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// velocity change is also direction not only norm)
|
|
||||||
if( Math.Abs(curvel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE ||
|
|
||||||
Math.Abs(curvel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE ||
|
|
||||||
Math.Abs(curvel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE)
|
|
||||||
break;
|
|
||||||
|
|
||||||
float vx = Math.Abs(curvel.X);
|
|
||||||
if(vx > 128.0)
|
|
||||||
break;
|
|
||||||
float vy = Math.Abs(curvel.Y);
|
|
||||||
if(vy > 128.0)
|
|
||||||
break;
|
|
||||||
float vz = Math.Abs(curvel.Z);
|
|
||||||
if(vz > 128.0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (
|
|
||||||
vx < VELOCITY_TOLERANCE &&
|
|
||||||
vy < VELOCITY_TOLERANCE &&
|
|
||||||
vz < VELOCITY_TOLERANCE
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))
|
double elapsed = now - m_lastUpdateSentTime;
|
||||||
|
if (elapsed > TIME_MS_TOLERANCE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (vx < 1e-4 &&
|
if( Math.Abs(curacc.X - m_lastAcceleration.X) > VELOCITY_TOLERANCE ||
|
||||||
vy < 1e-4 &&
|
Math.Abs(curacc.Y - m_lastAcceleration.Y) > VELOCITY_TOLERANCE ||
|
||||||
vz < 1e-4 &&
|
Math.Abs(curacc.Z - m_lastAcceleration.Z) > VELOCITY_TOLERANCE)
|
||||||
(
|
|
||||||
Math.Abs(m_lastVelocity.X) > 1e-4 ||
|
|
||||||
Math.Abs(m_lastVelocity.Y) > 1e-4 ||
|
|
||||||
Math.Abs(m_lastVelocity.Z) > 1e-4
|
|
||||||
))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// velocity change is also direction not only norm)
|
||||||
|
if( Math.Abs(curvel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE ||
|
||||||
|
Math.Abs(curvel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE ||
|
||||||
|
Math.Abs(curvel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE)
|
||||||
|
break;
|
||||||
|
|
||||||
|
float vx = Math.Abs(curvel.X);
|
||||||
|
if(vx > 128.0)
|
||||||
|
break;
|
||||||
|
float vy = Math.Abs(curvel.Y);
|
||||||
|
if(vy > 128.0)
|
||||||
|
break;
|
||||||
|
float vz = Math.Abs(curvel.Z);
|
||||||
|
if(vz > 128.0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (
|
||||||
|
vx < VELOCITY_TOLERANCE &&
|
||||||
|
vy < VELOCITY_TOLERANCE &&
|
||||||
|
vz < VELOCITY_TOLERANCE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (vx < 1e-4 &&
|
||||||
|
vy < 1e-4 &&
|
||||||
|
vz < 1e-4 &&
|
||||||
|
(
|
||||||
|
Math.Abs(m_lastVelocity.X) > 1e-4 ||
|
||||||
|
Math.Abs(m_lastVelocity.Y) > 1e-4 ||
|
||||||
|
Math.Abs(m_lastVelocity.Z) > 1e-4
|
||||||
|
))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Math.Abs(angvel.X - m_lastAngularVelocity.X) > VELOCITY_TOLERANCE ||
|
||||||
|
Math.Abs(angvel.Y - m_lastAngularVelocity.Y) > VELOCITY_TOLERANCE ||
|
||||||
|
Math.Abs(angvel.Z - m_lastAngularVelocity.Z) > VELOCITY_TOLERANCE)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// viewer interpolators have a limit of 128m/s
|
||||||
|
float ax = Math.Abs(angvel.X);
|
||||||
|
if(ax > 64.0)
|
||||||
|
break;
|
||||||
|
float ay = Math.Abs(angvel.Y);
|
||||||
|
if(ay > 64.0)
|
||||||
|
break;
|
||||||
|
float az = Math.Abs(angvel.Z);
|
||||||
|
if(az > 64.0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (
|
||||||
|
ax < VELOCITY_TOLERANCE &&
|
||||||
|
ay < VELOCITY_TOLERANCE &&
|
||||||
|
az < VELOCITY_TOLERANCE &&
|
||||||
|
!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)
|
||||||
|
)
|
||||||
|
break;
|
||||||
|
|
||||||
|
needupdate = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Math.Abs(angvel.X - m_lastAngularVelocity.X) > VELOCITY_TOLERANCE ||
|
if(needupdate)
|
||||||
Math.Abs(angvel.Y - m_lastAngularVelocity.Y) > VELOCITY_TOLERANCE ||
|
{
|
||||||
Math.Abs(angvel.Z - m_lastAngularVelocity.Z) > VELOCITY_TOLERANCE)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// viewer interpolators have a limit of 128m/s
|
// Update the "last" values
|
||||||
float ax = Math.Abs(angvel.X);
|
m_lastPosition = AbsolutePosition;
|
||||||
if(ax > 64.0)
|
m_lastRotation = RotationOffset;
|
||||||
break;
|
m_lastVelocity = curvel;
|
||||||
float ay = Math.Abs(angvel.Y);
|
m_lastAcceleration = curacc;
|
||||||
if(ay > 64.0)
|
m_lastAngularVelocity = angvel;
|
||||||
break;
|
m_lastUpdateSentTime = now;
|
||||||
float az = Math.Abs(angvel.Z);
|
}
|
||||||
if(az > 64.0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (
|
|
||||||
ax < VELOCITY_TOLERANCE &&
|
|
||||||
ay < VELOCITY_TOLERANCE &&
|
|
||||||
az < VELOCITY_TOLERANCE &&
|
|
||||||
!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)
|
|
||||||
)
|
|
||||||
break;
|
|
||||||
|
|
||||||
needupdate = false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(needupdate)
|
if(needupdate)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Update the "last" values
|
|
||||||
m_lastPosition = AbsolutePosition;
|
|
||||||
m_lastRotation = RotationOffset;
|
|
||||||
m_lastVelocity = curvel;
|
|
||||||
m_lastAcceleration = curacc;
|
|
||||||
m_lastAngularVelocity = angvel;
|
|
||||||
m_lastUpdateSentTime = now;
|
|
||||||
|
|
||||||
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
|
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
SendTerseUpdateToClient(client);
|
SendTerseUpdateToClient(client);
|
||||||
|
@ -3552,7 +3558,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UpdateRequired.FULL:
|
case UpdateRequired.FULL:
|
||||||
ClearUpdateSchedule();
|
|
||||||
SendFullUpdateToAllClientsInternal();
|
SendFullUpdateToAllClientsInternal();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3567,15 +3572,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup == null || ParentGroup.Scene == null)
|
if (ParentGroup == null || ParentGroup.Scene == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ClearUpdateSchedule();
|
lock(UpdateFlagLock)
|
||||||
|
{
|
||||||
|
if(UpdateFlag != UpdateRequired.NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
// Update the "last" values
|
// Update the "last" values
|
||||||
m_lastPosition = AbsolutePosition;
|
m_lastPosition = AbsolutePosition;
|
||||||
m_lastRotation = RotationOffset;
|
m_lastRotation = RotationOffset;
|
||||||
m_lastVelocity = Velocity;
|
m_lastVelocity = Velocity;
|
||||||
m_lastAcceleration = Acceleration;
|
m_lastAcceleration = Acceleration;
|
||||||
m_lastAngularVelocity = AngularVelocity;
|
m_lastAngularVelocity = AngularVelocity;
|
||||||
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
||||||
|
}
|
||||||
|
|
||||||
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
|
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
|
@ -3588,15 +3597,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup == null || ParentGroup.Scene == null)
|
if (ParentGroup == null || ParentGroup.Scene == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ClearUpdateSchedule();
|
lock(UpdateFlagLock)
|
||||||
|
{
|
||||||
|
if(UpdateFlag != UpdateRequired.NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
// Update the "last" values
|
// Update the "last" values
|
||||||
m_lastPosition = AbsolutePosition;
|
m_lastPosition = AbsolutePosition;
|
||||||
m_lastRotation = RotationOffset;
|
m_lastRotation = RotationOffset;
|
||||||
m_lastVelocity = Velocity;
|
m_lastVelocity = Velocity;
|
||||||
m_lastAcceleration = Acceleration;
|
m_lastAcceleration = Acceleration;
|
||||||
m_lastAngularVelocity = AngularVelocity;
|
m_lastAngularVelocity = AngularVelocity;
|
||||||
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
m_lastUpdateSentTime = Util.GetTimeStampMS();
|
||||||
|
}
|
||||||
|
|
||||||
if (ParentGroup.IsAttachment)
|
if (ParentGroup.IsAttachment)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,13 @@ namespace OpenSim.Tests.Permissions
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
|
// In case we're dealing with some older version of nunit
|
||||||
|
if (Common.TheInstance == null)
|
||||||
|
{
|
||||||
|
Common.TheInstance = new Common();
|
||||||
|
Common.TheInstance.SetUp();
|
||||||
|
}
|
||||||
|
|
||||||
Common.TheInstance.DeleteObjectsFolders();
|
Common.TheInstance.DeleteObjectsFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,12 @@ namespace OpenSim.Tests.Permissions
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
|
// In case we're dealing with some older version of nunit
|
||||||
|
if (Common.TheInstance == null)
|
||||||
|
{
|
||||||
|
Common.TheInstance = new Common();
|
||||||
|
Common.TheInstance.SetUp();
|
||||||
|
}
|
||||||
Common.TheInstance.DeleteObjectsFolders();
|
Common.TheInstance.DeleteObjectsFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +80,7 @@ namespace OpenSim.Tests.Permissions
|
||||||
// Try A2 takes copies of objects that cannot be copied.
|
// Try A2 takes copies of objects that cannot be copied.
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
|
TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
|
||||||
|
// Ad-hoc. Enough time to let the take work.
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
|
|
||||||
List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
|
List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
|
||||||
|
@ -86,6 +93,7 @@ namespace OpenSim.Tests.Permissions
|
||||||
// Try A2 takes copies of objects that can be copied.
|
// Try A2 takes copies of objects that can be copied.
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
|
TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
|
||||||
|
// Ad-hoc. Enough time to let the take work.
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
|
|
||||||
items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
|
items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
|
||||||
|
@ -101,6 +109,7 @@ namespace OpenSim.Tests.Permissions
|
||||||
|
|
||||||
private void TakeOneBox(List<SceneObjectGroup> objs, string name, PermissionMask mask)
|
private void TakeOneBox(List<SceneObjectGroup> objs, string name, PermissionMask mask)
|
||||||
{
|
{
|
||||||
|
// Find the object inworld
|
||||||
SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID);
|
SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID);
|
||||||
Assert.That(box, Is.Not.Null, name);
|
Assert.That(box, Is.Not.Null, name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue