LLWorld::getMinAllowedZ now passed an object and an explicit position (opposed to assuming object->getPositionGlobal())

This commit is contained in:
Shyotl
2011-08-19 01:32:35 -05:00
parent e4b640887a
commit 73d4722706
4 changed files with 5 additions and 5 deletions

View File

@@ -743,7 +743,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
LLVector3d new_position_global = selectNode->mSavedPositionGlobal + clamped_relative_move;
// Don't let object centers go too far underground
F64 min_height = LLWorld::getInstance()->getMinAllowedZ(object);
F64 min_height = LLWorld::getInstance()->getMinAllowedZ(object, object->getPositionGlobal());
if (new_position_global.mdV[VZ] < min_height)
{
new_position_global.mdV[VZ] = min_height;

View File

@@ -2154,7 +2154,7 @@ void LLPanelObject::sendPosition(BOOL btn_down)
// Clamp the Z height
const F32 height = newpos.mV[VZ];
const F32 min_height = LLWorld::getInstance()->getMinAllowedZ(mObject);
const F32 min_height = LLWorld::getInstance()->getMinAllowedZ(mObject, mObject->getPositionGlobal());
// <edit>
//const F32 max_height = LLWorld::getInstance()->getRegionMaxHeight();
const F32 max_height = F32(340282346638528859811704183484516925440.0f);

View File

@@ -439,9 +439,9 @@ BOOL LLWorld::positionRegionValidGlobal(const LLVector3d &pos_global)
// Allow objects to go up to their radius underground.
F32 LLWorld::getMinAllowedZ(LLViewerObject* object)
F32 LLWorld::getMinAllowedZ(LLViewerObject* object, const LLVector3d &global_pos)
{
F32 land_height = resolveLandHeightGlobal(object->getPositionGlobal());
F32 land_height = resolveLandHeightGlobal(global_pos);
F32 radius = 0.5f * object->getScale().length();
return land_height - radius;
}

View File

@@ -95,7 +95,7 @@ public:
// Return the lowest allowed Z point to prevent objects from being moved
// underground.
F32 getMinAllowedZ(LLViewerObject* object);
F32 getMinAllowedZ(LLViewerObject* object, const LLVector3d &global_pos);
// takes a line segment defined by point_a and point_b, then
// determines the closest (to point_a) point of intersection that is