mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Merge branch 'master' into vehicles
This commit is contained in:
@@ -906,7 +906,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SetAttachmentPoint(Convert.ToByte(attachmentpoint));
|
||||
|
||||
avatar.AddAttachment(this);
|
||||
m_log.DebugFormat("[SOG]: Added att {0} to avie {1}", UUID, avatar.UUID);
|
||||
m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
@@ -1824,7 +1824,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags)
|
||||
{
|
||||
|
||||
remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask,
|
||||
remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask,
|
||||
RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
|
||||
RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
|
||||
RootPart.CreatorID, RootPart.Name, RootPart.Description);
|
||||
@@ -3355,5 +3355,77 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public double GetUpdatePriority(IClientAPI client)
|
||||
{
|
||||
switch (Scene.UpdatePrioritizationScheme)
|
||||
{
|
||||
case Scene.UpdatePrioritizationSchemes.Time:
|
||||
return GetPriorityByTime();
|
||||
case Scene.UpdatePrioritizationSchemes.Distance:
|
||||
return GetPriorityByDistance(client);
|
||||
case Scene.UpdatePrioritizationSchemes.SimpleAngularDistance:
|
||||
return GetPriorityBySimpleAngularDistance(client);
|
||||
default:
|
||||
throw new InvalidOperationException("UpdatePrioritizationScheme not defined");
|
||||
}
|
||||
}
|
||||
|
||||
private double GetPriorityByTime()
|
||||
{
|
||||
return DateTime.Now.ToOADate();
|
||||
}
|
||||
|
||||
private double GetPriorityByDistance(IClientAPI client)
|
||||
{
|
||||
ScenePresence presence = Scene.GetScenePresence(client.AgentId);
|
||||
if (presence != null)
|
||||
{
|
||||
return GetPriorityByDistance((presence.IsChildAgent) ?
|
||||
presence.AbsolutePosition : presence.CameraPosition);
|
||||
}
|
||||
return double.NaN;
|
||||
}
|
||||
|
||||
private double GetPriorityBySimpleAngularDistance(IClientAPI client)
|
||||
{
|
||||
ScenePresence presence = Scene.GetScenePresence(client.AgentId);
|
||||
if (presence != null)
|
||||
{
|
||||
return GetPriorityBySimpleAngularDistance((presence.IsChildAgent) ?
|
||||
presence.AbsolutePosition : presence.CameraPosition);
|
||||
}
|
||||
return double.NaN;
|
||||
}
|
||||
|
||||
public double GetPriorityByDistance(Vector3 position)
|
||||
{
|
||||
return Vector3.Distance(AbsolutePosition, position);
|
||||
}
|
||||
|
||||
public double GetPriorityBySimpleAngularDistance(Vector3 position)
|
||||
{
|
||||
double distance = Vector3.Distance(position, AbsolutePosition);
|
||||
if (distance >= double.Epsilon)
|
||||
{
|
||||
float height;
|
||||
Vector3 box = GetAxisAlignedBoundingBox(out height);
|
||||
|
||||
double angle = box.X / distance;
|
||||
double max = angle;
|
||||
|
||||
angle = box.Y / distance;
|
||||
if (max < angle)
|
||||
max = angle;
|
||||
|
||||
angle = box.Z / distance;
|
||||
if (max < angle)
|
||||
max = angle;
|
||||
|
||||
return -max;
|
||||
}
|
||||
else
|
||||
return double.MinValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user