diff options
author | MW | 2009-07-13 12:08:14 +0000 |
---|---|---|
committer | MW | 2009-07-13 12:08:14 +0000 |
commit | a7043ebf53fc469af79877dfb1cde4c3588c969e (patch) | |
tree | dff3d841672c1f9b8a766cfe68736e297189d020 /OpenSim/Region | |
parent | Fixed bug in AvatarCreationModule, where during the cloning of a folder it wo... (diff) | |
download | opensim-SC-a7043ebf53fc469af79877dfb1cde4c3588c969e.zip opensim-SC-a7043ebf53fc469af79877dfb1cde4c3588c969e.tar.gz opensim-SC-a7043ebf53fc469af79877dfb1cde4c3588c969e.tar.bz2 opensim-SC-a7043ebf53fc469af79877dfb1cde4c3588c969e.tar.xz |
Attempt to make it so items rezzed from inventory aren't half in the ground or half in the prim they are being rezzed on top off. This is currently only correct for single prims (not link groups) and unrotated prims. Next step is to fix for link sets and rotated prims.
This needs a lot more testing to find use cases where it might be wrong (like half way up a hill?)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index d8c7b84..63a93aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | |||
@@ -303,7 +303,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
303 | if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) | 303 | if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) |
304 | { | 304 | { |
305 | // rez ON the ground, not IN the ground | 305 | // rez ON the ground, not IN the ground |
306 | pos.Z += 0.25F; | 306 | // pos.Z += 0.25F; |
307 | 307 | ||
308 | obj = m_scene.AddNewPrim(avatar.UUID, group_id, pos, rotation, pbs); | 308 | obj = m_scene.AddNewPrim(avatar.UUID, group_id, pos, rotation, pbs); |
309 | } | 309 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 92cea43..ac2d02e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1349,8 +1349,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1349 | Vector3 offset = (normal * (ScaleOffset / 2f)); | 1349 | Vector3 offset = (normal * (ScaleOffset / 2f)); |
1350 | pos = (intersectionpoint + offset); | 1350 | pos = (intersectionpoint + offset); |
1351 | 1351 | ||
1352 | //Seems to make no sense to do this as this call is used for rezzing from inventory as well, and with inventory items their size is not always 0.5f | ||
1353 | //And in cases when we weren't rezzing from inventory we were re-adding the 0.25 straight after calling this method | ||
1352 | // Un-offset the prim (it gets offset later by the consumer method) | 1354 | // Un-offset the prim (it gets offset later by the consumer method) |
1353 | pos.Z -= 0.25F; | 1355 | //pos.Z -= 0.25F; |
1356 | |||
1354 | } | 1357 | } |
1355 | 1358 | ||
1356 | return pos; | 1359 | return pos; |
@@ -1380,6 +1383,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1380 | { | 1383 | { |
1381 | // fall back to our stupid functionality | 1384 | // fall back to our stupid functionality |
1382 | pos = RayEnd; | 1385 | pos = RayEnd; |
1386 | |||
1387 | //increase height so its above the ground. | ||
1388 | //should be getting the normal of the ground at the rez point and using that? | ||
1389 | float ScaleOffset = Math.Abs(scale.Z); | ||
1390 | pos.Z += ScaleOffset / 2f; | ||
1383 | return pos; | 1391 | return pos; |
1384 | } | 1392 | } |
1385 | } | 1393 | } |
@@ -1393,7 +1401,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1393 | if (Permissions.CanRezObject(1, ownerID, pos)) | 1401 | if (Permissions.CanRezObject(1, ownerID, pos)) |
1394 | { | 1402 | { |
1395 | // rez ON the ground, not IN the ground | 1403 | // rez ON the ground, not IN the ground |
1396 | pos.Z += 0.25F; | 1404 | // pos.Z += 0.25F; The rez point should now be correct so that its not in the ground |
1397 | 1405 | ||
1398 | AddNewPrim(ownerID, groupID, pos, rot, shape); | 1406 | AddNewPrim(ownerID, groupID, pos, rot, shape); |
1399 | } | 1407 | } |