diff options
Diffstat (limited to 'OpenSim')
6 files changed, 57 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index eba881f..b85fd8b 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
246 | /// <param name="objlist">The scene objects</param> | 246 | /// <param name="objlist">The scene objects</param> |
247 | /// <param name="veclist">Relative offsets for each object</param> | 247 | /// <param name="veclist">Relative offsets for each object</param> |
248 | /// <returns>true = success, false = the scene object asset couldn't be found</returns> | 248 | /// <returns>true = success, false = the scene object asset couldn't be found</returns> |
249 | bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist); | 249 | bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight); |
250 | 250 | ||
251 | /// <summary> | 251 | /// <summary> |
252 | /// Update an existing inventory item. | 252 | /// Update an existing inventory item. |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 746a5ce..1dd3d2f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2447 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | 2447 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, |
2448 | BypassRayCast, bRayEndIsIntersection, true, scale, false); | 2448 | BypassRayCast, bRayEndIsIntersection, true, scale, false); |
2449 | 2449 | ||
2450 | RezObject(part, item, pos, null, Vector3.Zero, 0); | 2450 | RezObject(part, item, pos, null, Vector3.Zero, 0, false); |
2451 | } | 2451 | } |
2452 | } | 2452 | } |
2453 | 2453 | ||
@@ -2463,15 +2463,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2463 | /// <param name="param"></param> | 2463 | /// <param name="param"></param> |
2464 | /// <returns>The SceneObjectGroup(s) rezzed, or null if rez was unsuccessful</returns> | 2464 | /// <returns>The SceneObjectGroup(s) rezzed, or null if rez was unsuccessful</returns> |
2465 | public virtual List<SceneObjectGroup> RezObject( | 2465 | public virtual List<SceneObjectGroup> RezObject( |
2466 | SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param) | 2466 | SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot) |
2467 | { | 2467 | { |
2468 | if (null == item) | 2468 | if (null == item) |
2469 | return null; | 2469 | return null; |
2470 | 2470 | ||
2471 | List<SceneObjectGroup> objlist; | 2471 | List<SceneObjectGroup> objlist; |
2472 | List<Vector3> veclist; | 2472 | List<Vector3> veclist; |
2473 | 2473 | Vector3 bbox; | |
2474 | bool success = sourcePart.Inventory.GetRezReadySceneObjects(item, out objlist, out veclist); | 2474 | float offsetHeight; |
2475 | |||
2476 | bool success = sourcePart.Inventory.GetRezReadySceneObjects(item, out objlist, out veclist,out bbox, out offsetHeight); | ||
2477 | |||
2475 | if (!success) | 2478 | if (!success) |
2476 | return null; | 2479 | return null; |
2477 | 2480 | ||
@@ -2488,6 +2491,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2488 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); | 2491 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); |
2489 | } | 2492 | } |
2490 | 2493 | ||
2494 | SceneObjectGroup sog; | ||
2495 | // position adjust | ||
2496 | if (totalPrims > 1) // nothing to do on a single prim | ||
2497 | { | ||
2498 | if (objlist.Count == 1) | ||
2499 | { | ||
2500 | // current object position is root position | ||
2501 | if(!atRoot) | ||
2502 | { | ||
2503 | sog = objlist[0]; | ||
2504 | Quaternion orot; | ||
2505 | if (rot == null) | ||
2506 | orot = sog.RootPart.GetWorldRotation(); | ||
2507 | else | ||
2508 | orot = rot.Value; | ||
2509 | Vector3 off = sog.GetGeometricCenter(); | ||
2510 | off *= orot; | ||
2511 | pos -= off; | ||
2512 | } | ||
2513 | } | ||
2514 | } | ||
2515 | |||
2491 | for (int i = 0; i < objlist.Count; i++) | 2516 | for (int i = 0; i < objlist.Count; i++) |
2492 | { | 2517 | { |
2493 | SceneObjectGroup group = objlist[i]; | 2518 | SceneObjectGroup group = objlist[i]; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9a2707b..89c7a1a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2468,12 +2468,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2468 | 2468 | ||
2469 | public void stopMoveToTarget() | 2469 | public void stopMoveToTarget() |
2470 | { | 2470 | { |
2471 | PhysicsActor pa = RootPart.PhysActor; | 2471 | if (IsAttachment) |
2472 | { | ||
2473 | ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); | ||
2474 | if (avatar != null) | ||
2475 | { | ||
2476 | avatar.ResetMoveToTarget(); | ||
2477 | } | ||
2478 | } | ||
2479 | else | ||
2480 | { | ||
2481 | PhysicsActor pa = RootPart.PhysActor; | ||
2472 | 2482 | ||
2473 | if (pa != null) | 2483 | if (pa != null) |
2474 | pa.PIDActive = false; | 2484 | pa.PIDActive = false; |
2475 | 2485 | ||
2476 | RootPart.ScheduleTerseUpdate(); // send a stop information | 2486 | RootPart.ScheduleTerseUpdate(); // send a stop information |
2487 | } | ||
2477 | } | 2488 | } |
2478 | 2489 | ||
2479 | public void rotLookAt(Quaternion target, float strength, float damping) | 2490 | public void rotLookAt(Quaternion target, float strength, float damping) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2fa9139..b9f3f94 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -871,7 +871,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
871 | return items; | 871 | return items; |
872 | } | 872 | } |
873 | 873 | ||
874 | public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist) | 874 | public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight) |
875 | { | 875 | { |
876 | AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); | 876 | AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); |
877 | 877 | ||
@@ -882,12 +882,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
882 | item.AssetID, item.Name, m_part.Name); | 882 | item.AssetID, item.Name, m_part.Name); |
883 | objlist = null; | 883 | objlist = null; |
884 | veclist = null; | 884 | veclist = null; |
885 | bbox = Vector3.Zero; | ||
886 | offsetHeight = 0; | ||
885 | return false; | 887 | return false; |
886 | } | 888 | } |
887 | 889 | ||
888 | Vector3 bbox; | ||
889 | float offsetHeight; | ||
890 | |||
891 | bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); | 890 | bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); |
892 | 891 | ||
893 | for (int i = 0; i < objlist.Count; i++) | 892 | for (int i = 0; i < objlist.Count; i++) |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 6e0ea7d..020bb6c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -97,7 +97,7 @@ namespace OpenSim.Region.Framework.Tests | |||
97 | Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f); | 97 | Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f); |
98 | Vector3 rezVel = new Vector3(2, 2, 2); | 98 | Vector3 rezVel = new Vector3(2, 2, 2); |
99 | 99 | ||
100 | scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0); | 100 | scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0,false); |
101 | 101 | ||
102 | SceneObjectGroup rezzedObject = scene.GetSceneObjectGroup("tso"); | 102 | SceneObjectGroup rezzedObject = scene.GetSceneObjectGroup("tso"); |
103 | 103 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index aaf1170..a5d8292 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3234,6 +3234,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3234 | 3234 | ||
3235 | public void llRezAtRoot(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) | 3235 | public void llRezAtRoot(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) |
3236 | { | 3236 | { |
3237 | doObjectRez(inventory, pos, vel, rot, param, true); | ||
3238 | } | ||
3239 | |||
3240 | public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot) | ||
3241 | { | ||
3237 | m_host.AddScriptLPS(1); | 3242 | m_host.AddScriptLPS(1); |
3238 | 3243 | ||
3239 | Util.FireAndForget(x => | 3244 | Util.FireAndForget(x => |
@@ -3260,10 +3265,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3260 | return; | 3265 | return; |
3261 | } | 3266 | } |
3262 | 3267 | ||
3263 | // need the magnitude later | 3268 | List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param, atRoot); |
3264 | // float velmag = (float)Util.GetMagnitude(llvel); | ||
3265 | |||
3266 | List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param); | ||
3267 | 3269 | ||
3268 | // If either of these are null, then there was an unknown error. | 3270 | // If either of these are null, then there was an unknown error. |
3269 | if (new_groups == null) | 3271 | if (new_groups == null) |
@@ -3311,7 +3313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3311 | 3313 | ||
3312 | public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) | 3314 | public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) |
3313 | { | 3315 | { |
3314 | llRezAtRoot(inventory, pos, vel, rot, param); | 3316 | doObjectRez(inventory, pos, vel, rot, param, false); |
3315 | } | 3317 | } |
3316 | 3318 | ||
3317 | public void llLookAt(LSL_Vector target, double strength, double damping) | 3319 | public void llLookAt(LSL_Vector target, double strength, double damping) |