diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 33 |
1 files changed, 29 insertions, 4 deletions
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]; |