#include <llhudeffectlookat.h>
Public Member Functions | |
void | markDead () |
void | setSourceObject (LLViewerObject *objectp) |
BOOL | setLookAt (ELookAtType target_type, LLViewerObject *object, LLVector3 position) |
void | clearLookAtTarget () |
ELookAtType | getLookAtType () |
const LLVector3 & | getTargetPos () |
const LLVector3d & | getTargetOffset () |
bool | calcTargetPosition () |
Static Public Attributes | |
static BOOL | sDebugLookAt = FALSE |
Protected Member Functions | |
LLHUDEffectLookAt (const U8 type) | |
~LLHUDEffectLookAt () | |
void | update () |
void | render () |
void | packData (LLMessageSystem *mesgsys) |
void | unpackData (LLMessageSystem *mesgsys, S32 blocknum) |
void | setTargetObjectAndOffset (LLViewerObject *objp, LLVector3d offset) |
void | setTargetPosGlobal (const LLVector3d &target_pos_global) |
Private Attributes | |
ELookAtType | mTargetType |
LLVector3d | mTargetOffsetGlobal |
LLVector3 | mLastSentOffsetGlobal |
F32 | mKillTime |
LLFrameTimer | mTimer |
LLVector3 | mTargetPos |
F32 | mLastSendTime |
LLAttentionSet * | mAttentions |
Friends | |
class | LLHUDObject |
Definition at line 57 of file llhudeffectlookat.h.
LLHUDEffectLookAt::LLHUDEffectLookAt | ( | const U8 | type | ) | [protected] |
Definition at line 243 of file llhudeffectlookat.cpp.
References clearLookAtTarget(), gGirlAttentions, loadAttentions(), and mAttentions.
LLHUDEffectLookAt::~LLHUDEffectLookAt | ( | ) | [protected] |
Definition at line 258 of file llhudeffectlookat.cpp.
void LLHUDEffectLookAt::markDead | ( | ) | [virtual] |
Reimplemented from LLHUDObject.
Definition at line 472 of file llhudeffectlookat.cpp.
References clearLookAtTarget(), LLHUDObject::markDead(), LLHUDObject::mSourceObject, LLPointer< Type >::notNull(), and NULL.
Referenced by update().
void LLHUDEffectLookAt::setSourceObject | ( | LLViewerObject * | objectp | ) | [virtual] |
Reimplemented from LLHUDObject.
Definition at line 484 of file llhudeffectlookat.cpp.
References LLPrimitive::isAvatar(), and LLHUDObject::setSourceObject().
Referenced by unpackData().
BOOL LLHUDEffectLookAt::setLookAt | ( | ELookAtType | target_type, | |
LLViewerObject * | object, | |||
LLVector3 | position | |||
) |
Definition at line 396 of file llhudeffectlookat.cpp.
References clearLookAtTarget(), dist_vec(), FALSE, gAgent, LLFrameTimer::getElapsedTimeF32(), LLAgent::getPosGlobalFromAgent(), llendl, llwarns, LOOKAT_NUM_TARGETS, LOOKAT_TARGET_CLEAR, mAttentions, MAX_SENDS_PER_SEC, LLHUDEffect::mDuration, MIN_DELTAPOS_FOR_UPDATE, mKillTime, mLastSendTime, mLastSentOffsetGlobal, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetOffsetGlobal, mTargetType, mTimer, LLHUDEffect::setDuration(), LLHUDEffect::setNeedsSendToSim(), LLVector3d::setVec(), TRUE, and update().
void LLHUDEffectLookAt::clearLookAtTarget | ( | ) |
Definition at line 458 of file llhudeffectlookat.cpp.
References ANIM_AGENT_HEAD_ROT, LLVector3d::clearVec(), LOOKAT_TARGET_NONE, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetOffsetGlobal, mTargetType, LLPointer< Type >::notNull(), and NULL.
Referenced by LLHUDEffectLookAt(), markDead(), setLookAt(), unpackData(), and update().
ELookAtType LLHUDEffectLookAt::getLookAtType | ( | ) | [inline] |
const LLVector3& LLHUDEffectLookAt::getTargetPos | ( | ) | [inline] |
const LLVector3d& LLHUDEffectLookAt::getTargetOffset | ( | ) | [inline] |
bool LLHUDEffectLookAt::calcTargetPosition | ( | ) |
Initializes the mTargetPos member from the current mSourceObjec and mTargetObject (and possibly mTargetOffsetGlobal). When mTargetObject is another avatar, it sets mTargetPos to be their eyes.
Has the side-effect of also calling setAnimationData("LookAtPoint") with the new mTargetPos on the source object which is assumed to be an avatar.
Returns whether we successfully calculated a finite target position.
Definition at line 590 of file llhudeffectlookat.cpp.
References LLAgent::cameraCustomizeAvatar(), LLQuaternion::DEFAULT, gAgent, LLAgent::getPosAgentFromGlobal(), LLViewerObject::getPositionAgent(), LLViewerObject::getRenderPosition(), LLViewerObject::getRenderRotation(), LLJoint::getWorldPosition(), LLXform::getWorldRotation(), LLJoint::getWorldRotation(), gNoRender, LLPrimitive::isAvatar(), LLVector3::isFinite(), LLVOAvatar::isSelf(), LOOKAT_TARGET_FREELOOK, LOOKAT_TARGET_MOUSELOOK, LLVector3d::magVecSquared(), LLViewerObject::mDrawable, LLVOAvatar::mHeadp, MIN_TARGET_OFFSET_SQUARED, LLVOAvatar::mPelvisp, LLVOAvatar::mRoot, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetOffsetGlobal, mTargetPos, mTargetType, LLPointer< Type >::notNull(), LLCharacter::setAnimationData(), LLVector3d::setVec(), and LLVector3::setVec().
Referenced by update().
void LLHUDEffectLookAt::update | ( | ) | [protected, virtual] |
Reimplemented from LLHUDEffect.
Definition at line 527 of file llhudeffectlookat.cpp.
References ANIM_AGENT_HEAD_ROT, calcTargetPosition(), clearLookAtTarget(), gBoyAttentions, LLFrameTimer::getElapsedTimeF32(), LLCharacter::getSex(), gGirlAttentions, LLPointer< Type >::isNull(), LLMotion::isStopped(), LOOKAT_TARGET_NONE, markDead(), mAttentions, mKillTime, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetType, mTimer, sDebugLookAt, LLHUDEffect::setNeedsSendToSim(), SEX_MALE, and TRUE.
Referenced by setLookAt().
void LLHUDEffectLookAt::render | ( | ) | [protected, virtual] |
Reimplemented from LLHUDEffect.
Definition at line 496 of file llhudeffectlookat.cpp.
References LLGLImmediate::begin(), LLGLImmediate::color3f(), LLGLImmediate::end(), gGL, LLVertexBuffer::LINES, LLHUDObject::mSourceObject, mTargetPos, mTargetType, LLColor3::mV, LLVector3::mV, LLPointer< Type >::notNull(), sDebugLookAt, VBLUE, LLGLImmediate::vertex3f(), VGREEN, VRED, VX, VY, and VZ.
void LLHUDEffectLookAt::packData | ( | LLMessageSystem * | mesgsys | ) | [protected, virtual] |
Reimplemented from LLHUDEffect.
Definition at line 265 of file llhudeffectlookat.cpp.
References _PREHASH_TypeData, LLMessageSystem::addBinaryDataFast(), LLFrameTimer::getElapsedTimeF32(), htonmemcpy(), LOOKAT_TYPE, mData, LLVector3d::mdV, mLastSendTime, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetOffsetGlobal, mTargetType, mTimer, MVT_LLUUID, MVT_LLVector3d, MVT_U8, LLUUID::null, LLHUDEffect::packData(), PKT_SIZE, SOURCE_AVATAR, TARGET_OBJECT, and TARGET_POS.
void LLHUDEffectLookAt::unpackData | ( | LLMessageSystem * | mesgsys, | |
S32 | blocknum | |||
) | [protected, virtual] |
Reimplemented from LLHUDEffect.
Definition at line 308 of file llhudeffectlookat.cpp.
References _PREHASH_Effect, _PREHASH_ID, _PREHASH_TypeData, clearLookAtTarget(), LLViewerObjectList::findObject(), gAgent, LLMessageSystem::getBinaryDataFast(), LLMessageSystem::getSizeFast(), LLMessageSystem::getUUIDFast(), gObjectList, htonmemcpy(), LLPrimitive::isAvatar(), LLUUID::isNull(), LLPointer< Type >::isNull(), llendl, llwarns, LOOKAT_TARGET_NONE, LOOKAT_TYPE, LLUUID::mData, LLVector3d::mdV, LLAgent::mLookAt, mTargetType, MVT_LLUUID, MVT_LLVector3d, MVT_U8, PKT_SIZE, S32, setSourceObject(), setTargetObjectAndOffset(), setTargetPosGlobal(), SOURCE_AVATAR, TARGET_OBJECT, TARGET_POS, and LLHUDEffect::unpackData().
void LLHUDEffectLookAt::setTargetObjectAndOffset | ( | LLViewerObject * | objp, | |
LLVector3d | offset | |||
) | [protected] |
Definition at line 377 of file llhudeffectlookat.cpp.
References LLHUDObject::mTargetObject, and mTargetOffsetGlobal.
Referenced by unpackData().
void LLHUDEffectLookAt::setTargetPosGlobal | ( | const LLVector3d & | target_pos_global | ) | [protected] |
Definition at line 386 of file llhudeffectlookat.cpp.
References LLHUDObject::mTargetObject, mTargetOffsetGlobal, and NULL.
Referenced by unpackData().
friend class LLHUDObject [friend] |
Definition at line 60 of file llhudeffectlookat.h.
BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE [static] |
Definition at line 87 of file llhudeffectlookat.h.
Referenced by init_debug_avatar_menu(), render(), and update().
ELookAtType LLHUDEffectLookAt::mTargetType [private] |
Definition at line 90 of file llhudeffectlookat.h.
Referenced by calcTargetPosition(), clearLookAtTarget(), getLookAtType(), packData(), render(), setLookAt(), unpackData(), and update().
Definition at line 91 of file llhudeffectlookat.h.
Referenced by calcTargetPosition(), clearLookAtTarget(), getTargetOffset(), packData(), setLookAt(), setTargetObjectAndOffset(), and setTargetPosGlobal().
F32 LLHUDEffectLookAt::mKillTime [private] |
LLFrameTimer LLHUDEffectLookAt::mTimer [private] |
Definition at line 94 of file llhudeffectlookat.h.
Referenced by packData(), setLookAt(), and update().
LLVector3 LLHUDEffectLookAt::mTargetPos [private] |
Definition at line 95 of file llhudeffectlookat.h.
Referenced by calcTargetPosition(), getTargetPos(), and render().
F32 LLHUDEffectLookAt::mLastSendTime [private] |
LLAttentionSet* LLHUDEffectLookAt::mAttentions [private] |
Definition at line 97 of file llhudeffectlookat.h.
Referenced by LLHUDEffectLookAt(), setLookAt(), and update().