本文整理汇总了C++中LLMessageSystem::addVector3Fast方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageSystem::addVector3Fast方法的具体用法?C++ LLMessageSystem::addVector3Fast怎么用?C++ LLMessageSystem::addVector3Fast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMessageSystem
的用法示例。
在下文中一共展示了LLMessageSystem::addVector3Fast方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plywood_above_head
void ImportTracker::plywood_above_head()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED);
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52345f, 0.52346f, 0.52347f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
if (!localids.size())
root = (initialPos + linksetoffset);
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例2: plyWood
void Object::plyWood()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
//msg->addU32Fast(_PREHASH_AddFlags, ); // CREATE_SELECTED
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52346f, 0.52347f, 0.52348f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
LLVector3 root(0.f,0.f,0.1f);
root+=gAgent.getCameraPositionAgent();
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例3: dxcmd
bool dxcmd(std::string revised_text, EChatType type)
{
std::istringstream i(revised_text);
std::string command;
i >> command;
LLStringUtil::toLower(command);
if(command != "")
{
if(command == "###test")
{
llinfos << "test chat dxchatcmd!" << llendl;
return false;
}
else if(command == "###platform")
{
llinfos << "rez a platform!" << llendl;
LLVector3 agentPos = gAgent.getPositionAgent()+(gAgent.getVelocity()*(F32)0.333);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_PCode, LL_PCODE_VOLUME);
msg->addU8Fast(_PREHASH_Material, LL_MCODE_METAL);
if(agentPos.mV[2] > 4096.0)msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED);
else msg->addU32Fast(_PREHASH_AddFlags, 0);
LLVolumeParams volume_params;
volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE );
volume_params.setBeginAndEndS( 0.f, 1.f );
volume_params.setBeginAndEndT( 0.f, 1.f );
volume_params.setRatio ( 1, 1 );
volume_params.setShear ( 0, 0 );
LLVolumeMessage::packVolumeParams(&volume_params, msg);
LLVector3 rezpos = agentPos - LLVector3(0.0f,0.0f,2.5f);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(20.0f,20.0f,0.25f) );
msg->addQuatFast(_PREHASH_Rotation, LLQuaternion() );
msg->addVector3Fast(_PREHASH_RayStart, rezpos );
msg->addVector3Fast(_PREHASH_RayEnd, rezpos );
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)1 );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, 0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null );
msg->sendReliable(gAgent.getRegionHost());
return false;
}
}
return true;
}
示例4: sendReportViaLegacy
void LLFloaterReporter::sendReportViaLegacy(const LLSD & report)
{
LLViewerRegion *regionp = gAgent.getRegion();
if (!regionp) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UserReport);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ReportData);
msg->addU8Fast(_PREHASH_ReportType, report["report-type"].asInteger());
msg->addU8(_PREHASH_Category, report["category"].asInteger());
msg->addVector3Fast(_PREHASH_Position, LLVector3(report["position"]));
msg->addU8Fast(_PREHASH_CheckFlags, report["check-flags"].asInteger());
msg->addUUIDFast(_PREHASH_ScreenshotID, report["screenshot-id"].asUUID());
msg->addUUIDFast(_PREHASH_ObjectID, report["object-id"].asUUID());
msg->addUUID("AbuserID", report["abuser-id"].asUUID());
msg->addString("AbuseRegionName", report["abuse-region-name"].asString());
msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID());
msg->addStringFast(_PREHASH_Summary, report["summary"].asString());
msg->addString("VersionString", report["version-string"]);
msg->addStringFast(_PREHASH_Details, report["details"] );
msg->sendReliable(regionp->getHost());
}
示例5: send_ObjectGrab_message
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast( _PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast( _PREHASH_ObjectData);
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
llinfos << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
<< llendl;
llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
llinfos << "Object pos: " << object->getPosition() << llendl;
*/
}
示例6: handle_play_in_world
// static
void LLFloaterExploreSounds::handle_play_in_world(void* user_data)
{
LLFloaterExploreSounds* floater = (LLFloaterExploreSounds*)user_data;
LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("sound_list");
std::vector<LLScrollListItem*> selection = list->getAllSelected();
std::vector<LLScrollListItem*>::iterator selection_iter = selection.begin();
std::vector<LLScrollListItem*>::iterator selection_end = selection.end();
for( ; selection_iter != selection_end; ++selection_iter)
{
LLSoundHistoryItem item = floater->getItem((*selection_iter)->getValue());
if(item.mID.isNull()) continue;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SoundTrigger);
msg->nextBlockFast(_PREHASH_SoundData);
msg->addUUIDFast(_PREHASH_SoundID, item.mAssetID);
// Client untrusted, ids set on sim
msg->addUUIDFast(_PREHASH_OwnerID, LLUUID::null );
msg->addUUIDFast(_PREHASH_ObjectID, LLUUID::null );
msg->addUUIDFast(_PREHASH_ParentID, LLUUID::null );
msg->addU64Fast(_PREHASH_Handle, gAgent.getRegion()->getHandle());
LLVector3 position = gAgent.getPositionAgent();
msg->addVector3Fast(_PREHASH_Position, position);
msg->addF32Fast(_PREHASH_Gain, 1.0f);
gAgent.sendMessage();
}
}
示例7: session_starter_helper
void session_starter_helper(
const LLUUID& temp_session_id,
const LLUUID& other_participant_id,
EInstantMessage im_type)
{
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MessageBlock);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
msg->addUUIDFast(_PREHASH_ToAgentID, other_participant_id);
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addU8Fast(_PREHASH_Dialog, im_type);
msg->addUUIDFast(_PREHASH_ID, temp_session_id);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
gAgent.buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, LLStringUtil::null);
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
}
示例8: startGrab
void LLToolGrab::startGrab()
{
// Compute grab_offset in the OBJECT's root's coordinate frame
// (sometimes root == object)
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp)
{
return;
}
LLViewerObject *root = (LLViewerObject *)objectp->getRoot();
// drag from center
LLVector3d grab_start_global = root->getPositionGlobal();
// Where the grab starts, relative to the center of the root object of the set.
// JC - This code looks wonky, but I believe it does the right thing.
// Otherwise, when you grab a linked object set, it "pops" on the start
// of the drag.
LLVector3d grab_offsetd = root->getPositionGlobal() - objectp->getPositionGlobal();
LLVector3 grab_offset;
grab_offset.setVec(grab_offsetd);
LLQuaternion rotation = root->getRotation();
rotation.conjQuat();
grab_offset = grab_offset * rotation;
// This planar drag starts at the grab point
mDragStartPointGlobal = grab_start_global;
mDragStartFromCamera = grab_start_global - gAgent.getCameraPositionGlobal();
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords));
msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace);
msg->addVector3("Position", mGrabPick.mIntersection);
msg->addVector3("Normal", mGrabPick.mNormal);
msg->addVector3("Binormal", mGrabPick.mBinormal);
msg->sendMessage( objectp->getRegion()->getHost());
mGrabOffsetFromCenterInitial = grab_offset;
mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
mGrabTimer.reset();
}
示例9: teleport_request_callback
void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response)
{
S32 option;
if (response.isInteger())
{
option = response.asInteger();
}
else
{
option = LLNotificationsUtil::getSelectedOption(notification, response);
}
if (0 == option)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MessageBlock);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, response["message"]);
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
gMessageSystem->addBinaryDataFast(
_PREHASH_BinaryBucket,
EMPTY_BINARY_BUCKET,
EMPTY_BINARY_BUCKET_SIZE);
gAgent.sendReliableMessage();
}
}
示例10: LuaTouch
void LuaTouch(const LLUUID& id)
{
LLViewerObject* object = gObjectList.findObject(id);
if(!object)
{
LuaError("No Object Found");
return;
}
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast( _PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast( _PREHASH_ObjectData);
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, LLVector3::zero );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3::zero);
msg->addVector3("STCoord", LLVector3::zero);
msg->addS32Fast(_PREHASH_FaceIndex, 0);
msg->addVector3("Position", LLVector3::zero);
msg->addVector3("Normal", LLVector3::zero);
msg->addVector3("Binormal", LLVector3::zero);
msg->sendMessage( object->getRegion()->getHost());
// *NOTE: Hope the packets arrive safely and in order or else
// there will be some problems.
// *TODO: Just fix this bad assumption.
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3::zero);
msg->addVector3("STCoord", LLVector3::zero);
msg->addS32Fast(_PREHASH_FaceIndex, 0);
msg->addVector3("Position", LLVector3::zero);
msg->addVector3("Normal", LLVector3::zero);
msg->addVector3("Binormal", LLVector3::zero);
msg->sendMessage(object->getRegion()->getHost());
}
示例11: handleHoverNonPhysical
void LLToolGrab::handleHoverNonPhysical(S32 x, S32 y, MASK mask)
{
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp || !hasMouseCapture() ) return;
if (objectp->isDead())
{
// Bail out of drag because object has been killed
setMouseCapture(FALSE);
return;
}
LLPickInfo pick = mGrabPick;
pick.mMousePt = LLCoordGL(x, y);
pick.getSurfaceInfo();
// compute elapsed time
F32 dt = mGrabTimer.getElapsedTimeAndResetF32();
U32 dt_milliseconds = (U32) (1000.f * dt);
// i'm not a big fan of the following code - it's been culled from the physical grab case.
// ideally these two would be nicely integrated - but the code in that method is a serious
// mess of spaghetti. so here we go:
LLVector3 grab_pos_region(0,0,0);
const BOOL SUPPORT_LLDETECTED_GRAB = TRUE;
if (SUPPORT_LLDETECTED_GRAB)
{
//--------------------------------------------------
// Toggle vertical dragging
//--------------------------------------------------
if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical)
{
mVerticalDragging = FALSE;
}
else if (!mVerticalDragging && (mask == MASK_VERTICAL) )
{
mVerticalDragging = TRUE;
}
S32 dx = x - mLastMouseX;
S32 dy = y - mLastMouseY;
if (dx != 0 || dy != 0)
{
mAccumDeltaX += dx;
mAccumDeltaY += dy;
S32 dist_sq = mAccumDeltaX * mAccumDeltaX + mAccumDeltaY * mAccumDeltaY;
if (dist_sq > SLOP_DIST_SQ)
{
mOutsideSlop = TRUE;
}
// mouse has moved
mHasMoved = TRUE;
//------------------------------------------------------
// Handle grabbing
//------------------------------------------------------
LLVector3d x_part;
x_part.setVec(LLViewerCamera::getInstance()->getLeftAxis());
x_part.mdV[VZ] = 0.0;
x_part.normVec();
LLVector3d y_part;
if( mVerticalDragging )
{
y_part.setVec(LLViewerCamera::getInstance()->getUpAxis());
// y_part.setVec(0.f, 0.f, 1.f);
}
else
{
// drag toward camera
y_part = x_part % LLVector3d::z_axis;
y_part.mdV[VZ] = 0.0;
y_part.normVec();
}
mGrabHiddenOffsetFromCamera = mGrabHiddenOffsetFromCamera
+ (x_part * (-dx * GRAB_SENSITIVITY_X))
+ (y_part * ( dy * GRAB_SENSITIVITY_Y));
}
// need to return offset from mGrabStartPoint
LLVector3d grab_point_global = gAgent.getCameraPositionGlobal() + mGrabHiddenOffsetFromCamera;
grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global );
}
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
//.........这里部分代码省略.........
示例12: handleHoverActive
//.........这里部分代码省略.........
// For safety, cap heights where objects can be dragged
if (grab_point_global.mdV[VZ] > MAX_OBJECT_Z)
{
grab_point_global.mdV[VZ] = MAX_OBJECT_Z;
}
grab_point_global = LLWorld::getInstance()->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global);
// propagate constrained grab point back to grab offset
mGrabHiddenOffsetFromCamera = grab_point_global - gAgent.getCameraPositionGlobal();
// Handle auto-rotation at screen edge.
LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global );
LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2);
LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl);
const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20;
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...build mode moves camera about focus point
if (grab_center_gl.mX < ROTATE_H_MARGIN)
{
if (gAgent.getFocusOnAvatar())
{
gAgent.yaw(rotate_angle);
}
else
{
gAgent.cameraOrbitAround(rotate_angle);
}
}
else if (grab_center_gl.mX > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
{
if (gAgent.getFocusOnAvatar())
{
gAgent.yaw(-rotate_angle);
}
else
{
gAgent.cameraOrbitAround(-rotate_angle);
}
}
// Don't move above top of screen or below bottom
if ((grab_center_gl.mY < gViewerWindow->getWindowHeight() - 6)
&& (grab_center_gl.mY > 24))
{
// Transmit update to simulator
LLVector3 grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global );
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
msg->addVector3Fast(_PREHASH_GrabPosition, grab_pos_region );
msg->addU32Fast(_PREHASH_TimeSinceLast, dt_milliseconds );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords));
msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace);
msg->addVector3("Position", mGrabPick.mIntersection);
msg->addVector3("Normal", mGrabPick.mNormal);
msg->addVector3("Binormal", mGrabPick.mBinormal);
msg->sendMessage( objectp->getRegion()->getHost() );
}
}
gViewerWindow->moveCursorToCenter();
LLSelectMgr::getInstance()->updateSelectionCenter();
}
// once we've initiated a drag, lock the camera down
if (mHasMoved)
{
if (!gAgent.cameraMouselook() &&
!objectp->isHUDAttachment() &&
objectp->getRoot() == gAgent.getAvatarObject()->getRoot())
{
// force focus to point in space where we were looking previously
gAgent.setFocusGlobal(gAgent.calcFocusPositionTargetGlobal(), LLUUID::null);
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
}
else
{
gAgent.clearFocusObject();
}
}
// HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden.
gViewerWindow->setCursor(UI_CURSOR_ARROW);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (active) [cursor hidden]" << llendl;
}