diff options
author | Melanie | 2009-10-22 07:12:10 +0100 |
---|---|---|
committer | Melanie | 2009-10-22 07:12:10 +0100 |
commit | c4969d47d9bbc22b37054451cd31451ca8d8c78a (patch) | |
tree | 788e3b034254bcf068ca950ee97a78b6aa07b386 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Remove the "mel_t" from version string (diff) | |
download | opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.zip opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.gz opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.bz2 opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 76 |
1 files changed, 74 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b8bd9b4..69b3ded 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -906,7 +906,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
906 | SetAttachmentPoint(Convert.ToByte(attachmentpoint)); | 906 | SetAttachmentPoint(Convert.ToByte(attachmentpoint)); |
907 | 907 | ||
908 | avatar.AddAttachment(this); | 908 | avatar.AddAttachment(this); |
909 | m_log.DebugFormat("[SOG]: Added att {0} to avie {1}", UUID, avatar.UUID); | 909 | m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID); |
910 | 910 | ||
911 | if (!silent) | 911 | if (!silent) |
912 | { | 912 | { |
@@ -1824,7 +1824,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1824 | public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags) | 1824 | public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags) |
1825 | { | 1825 | { |
1826 | 1826 | ||
1827 | remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask, | 1827 | remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask, |
1828 | RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask, | 1828 | RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask, |
1829 | RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category, | 1829 | RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category, |
1830 | RootPart.CreatorID, RootPart.Name, RootPart.Description); | 1830 | RootPart.CreatorID, RootPart.Name, RootPart.Description); |
@@ -3355,5 +3355,77 @@ namespace OpenSim.Region.Framework.Scenes | |||
3355 | 3355 | ||
3356 | return true; | 3356 | return true; |
3357 | } | 3357 | } |
3358 | |||
3359 | public double GetUpdatePriority(IClientAPI client) | ||
3360 | { | ||
3361 | switch (Scene.UpdatePrioritizationScheme) | ||
3362 | { | ||
3363 | case Scene.UpdatePrioritizationSchemes.Time: | ||
3364 | return GetPriorityByTime(); | ||
3365 | case Scene.UpdatePrioritizationSchemes.Distance: | ||
3366 | return GetPriorityByDistance(client); | ||
3367 | case Scene.UpdatePrioritizationSchemes.SimpleAngularDistance: | ||
3368 | return GetPriorityBySimpleAngularDistance(client); | ||
3369 | default: | ||
3370 | throw new InvalidOperationException("UpdatePrioritizationScheme not defined"); | ||
3371 | } | ||
3372 | } | ||
3373 | |||
3374 | private double GetPriorityByTime() | ||
3375 | { | ||
3376 | return DateTime.Now.ToOADate(); | ||
3377 | } | ||
3378 | |||
3379 | private double GetPriorityByDistance(IClientAPI client) | ||
3380 | { | ||
3381 | ScenePresence presence = Scene.GetScenePresence(client.AgentId); | ||
3382 | if (presence != null) | ||
3383 | { | ||
3384 | return GetPriorityByDistance((presence.IsChildAgent) ? | ||
3385 | presence.AbsolutePosition : presence.CameraPosition); | ||
3386 | } | ||
3387 | return double.NaN; | ||
3388 | } | ||
3389 | |||
3390 | private double GetPriorityBySimpleAngularDistance(IClientAPI client) | ||
3391 | { | ||
3392 | ScenePresence presence = Scene.GetScenePresence(client.AgentId); | ||
3393 | if (presence != null) | ||
3394 | { | ||
3395 | return GetPriorityBySimpleAngularDistance((presence.IsChildAgent) ? | ||
3396 | presence.AbsolutePosition : presence.CameraPosition); | ||
3397 | } | ||
3398 | return double.NaN; | ||
3399 | } | ||
3400 | |||
3401 | public double GetPriorityByDistance(Vector3 position) | ||
3402 | { | ||
3403 | return Vector3.Distance(AbsolutePosition, position); | ||
3404 | } | ||
3405 | |||
3406 | public double GetPriorityBySimpleAngularDistance(Vector3 position) | ||
3407 | { | ||
3408 | double distance = Vector3.Distance(position, AbsolutePosition); | ||
3409 | if (distance >= double.Epsilon) | ||
3410 | { | ||
3411 | float height; | ||
3412 | Vector3 box = GetAxisAlignedBoundingBox(out height); | ||
3413 | |||
3414 | double angle = box.X / distance; | ||
3415 | double max = angle; | ||
3416 | |||
3417 | angle = box.Y / distance; | ||
3418 | if (max < angle) | ||
3419 | max = angle; | ||
3420 | |||
3421 | angle = box.Z / distance; | ||
3422 | if (max < angle) | ||
3423 | max = angle; | ||
3424 | |||
3425 | return -max; | ||
3426 | } | ||
3427 | else | ||
3428 | return double.MinValue; | ||
3429 | } | ||
3358 | } | 3430 | } |
3359 | } | 3431 | } |