parent
ab352a5592
commit
95dca768d9
|
|
@ -203,6 +203,7 @@ enum ERlvBehaviour {
|
|||
RLV_BHVR_ATTACHALLTHIS, // "attachallthis"
|
||||
RLV_BHVR_ATTACHALLTHISOVER, // "attachallthisover"
|
||||
RLV_BHVR_DETACHALLTHIS, // "detachallthis"
|
||||
RLV_BHVR_ADJUSTHEIGHT, // "adjustheight"
|
||||
RLV_BHVR_TPTO, // "tpto"
|
||||
RLV_BHVR_VERSION, // "version"
|
||||
RLV_BHVR_VERSIONNEW, // "versionnew"
|
||||
|
|
|
|||
|
|
@ -1435,6 +1435,18 @@ ERlvCmdRet RlvHandler::processForceCommand(const RlvCommand& rlvCmd) const
|
|||
case RLV_BHVR_SIT: // @sit:<option>=force
|
||||
eRet = onForceSit(rlvCmd);
|
||||
break;
|
||||
case RLV_BHVR_ADJUSTHEIGHT: // @adjustheight:<options>=force - Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f
|
||||
{
|
||||
RlvCommandOptionAdjustHeight rlvOption(rlvCmd);
|
||||
VERIFY_OPTION( (rlvOption.m_fValid) && (0.0f != rlvOption.m_nPelvisToFootDeltaMult) );
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
F32 nValue = (rlvOption.m_nPelvisToFoot - gAgentAvatarp->getPelvisToFoot()) * rlvOption.m_nPelvisToFootDeltaMult;
|
||||
nValue += rlvOption.m_nPelvisToFootOffset;
|
||||
gSavedSettings.setF32(RLV_SETTING_AVATAROFFSET_Z, llclamp<F32>(nValue, -1.0f, 1.0f));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RLV_BHVR_TPTO: // @tpto:<option>=force - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0h
|
||||
{
|
||||
eRet = RLV_RET_FAILED_OPTION;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
#include "rlvhandler.h"
|
||||
#include "rlvinventory.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
// ============================================================================
|
||||
// RlvCommmand
|
||||
//
|
||||
|
|
@ -157,10 +159,10 @@ void RlvCommand::initLookupTable()
|
|||
"displayname", "edit", "editobj", "rez", "fartouch", "interact", "touchthis", "touchattach", "touchattachself",
|
||||
"touchattachother", "touchhud", "touchworld", "touchall", "fly", "setgroup", "unsit", "sit", "sittp", "standtp",
|
||||
"setdebug", "setenv", "detachme", "attachover", "attachthis", "attachthisover", "detachthis", "attachall",
|
||||
"attachallover", "detachall", "attachallthis", "attachallthisover", "detachallthis", "tpto", "version", "versionnew",
|
||||
"versionnum", "getattach", "getattachnames", "getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames",
|
||||
"getaddoutfitnames", "getremoutfitnames", "findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn",
|
||||
"getgroup", "getsitid", "getcommand", "getstatus", "getstatusall"
|
||||
"attachallover", "detachall", "attachallthis", "attachallthisover", "detachallthis", "adjustheight", "tpto",
|
||||
"version", "versionnew", "versionnum", "getattach", "getattachnames", "getaddattachnames", "getremattachnames",
|
||||
"getoutfit", "getoutfitnames", "getaddoutfitnames", "getremoutfitnames", "findfolder", "findfolders",
|
||||
"getpath", "getpathnew", "getinv", "getinvworn", "getgroup", "getsitid", "getcommand", "getstatus", "getstatusall"
|
||||
};
|
||||
|
||||
for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++)
|
||||
|
|
@ -254,6 +256,25 @@ bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_
|
|||
return (cntItemsPrev != idItems.size());
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f
|
||||
RlvCommandOptionAdjustHeight::RlvCommandOptionAdjustHeight(const RlvCommand& rlvCmd)
|
||||
: m_fValid(false), m_nPelvisToFoot(0.0f), m_nPelvisToFootDeltaMult(1.0f), m_nPelvisToFootOffset(0.0f)
|
||||
{
|
||||
std::vector<std::string> cmdTokens;
|
||||
boost::split(cmdTokens, rlvCmd.getOption(), boost::is_any_of(";"));
|
||||
if (1 == cmdTokens.size())
|
||||
{
|
||||
m_fValid = (LLStringUtil::convertToF32(cmdTokens[0], m_nPelvisToFootOffset));
|
||||
m_nPelvisToFoot = llclamp<F32>(m_nPelvisToFootOffset / 100, -1.0f, 1.0f);
|
||||
}
|
||||
else if ( (2 <= cmdTokens.size()) && (cmdTokens.size() <= 3) )
|
||||
{
|
||||
m_fValid = (LLStringUtil::convertToF32(cmdTokens[0], m_nPelvisToFoot)) &&
|
||||
(LLStringUtil::convertToF32(cmdTokens[1], m_nPelvisToFootDeltaMult)) &&
|
||||
( (2 == cmdTokens.size()) || (LLStringUtil::convertToF32(cmdTokens[2], m_nPelvisToFootOffset)) );
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// RlvObject
|
||||
//
|
||||
|
|
|
|||
|
|
@ -175,6 +175,16 @@ protected:
|
|||
uuid_vec_t m_idItems;
|
||||
};
|
||||
|
||||
struct RlvCommandOptionAdjustHeight
|
||||
{
|
||||
RlvCommandOptionAdjustHeight(const RlvCommand& rlvCmd);
|
||||
|
||||
bool m_fValid;
|
||||
F32 m_nPelvisToFoot;
|
||||
F32 m_nPelvisToFootDeltaMult;
|
||||
F32 m_nPelvisToFootOffset;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// RlvObject
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue