LLHUDEffectLookAt Class Reference

#include <llhudeffectlookat.h>

Inheritance diagram for LLHUDEffectLookAt:

Inheritance graph
[legend]
Collaboration diagram for LLHUDEffectLookAt:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void markDead ()
void setSourceObject (LLViewerObject *objectp)
BOOL setLookAt (ELookAtType target_type, LLViewerObject *object, LLVector3 position)
void clearLookAtTarget ()
ELookAtType getLookAtType ()
const LLVector3getTargetPos ()
const LLVector3dgetTargetOffset ()
void 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
LLAttentionSetmAttentions

Friends

class LLHUDObject

Detailed Description

Definition at line 58 of file llhudeffectlookat.h.


Constructor & Destructor Documentation

LLHUDEffectLookAt::LLHUDEffectLookAt ( const U8  type  )  [protected]

Definition at line 241 of file llhudeffectlookat.cpp.

References clearLookAtTarget(), gGirlAttentions, loadAttentions(), and mAttentions.

LLHUDEffectLookAt::~LLHUDEffectLookAt (  )  [protected]

Definition at line 256 of file llhudeffectlookat.cpp.


Member Function Documentation

void 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.

Definition at line 581 of file llhudeffectlookat.cpp.

References LLAgent::cameraCustomizeAvatar(), LLQuaternion::DEFAULT, gAgent, LLAgent::getPosAgentFromGlobal(), LLViewerObject::getPositionAgent(), LLViewerObject::getRenderPosition(), LLViewerObject::getRenderRotation(), LLJoint::getWorldPosition(), LLXform::getWorldRotation(), gNoRender, LLPrimitive::isAvatar(), LLVOAvatar::isSelf(), LOOKAT_TARGET_FREELOOK, LOOKAT_TARGET_MOUSELOOK, LLVector3d::magVecSquared(), LLViewerObject::mDrawable, LLVOAvatar::mHeadp, MIN_TARGET_OFFSET_SQUARED, LLHUDObject::mSourceObject, LLHUDObject::mTargetObject, mTargetOffsetGlobal, mTargetPos, mTargetType, LLPointer< Type >::notNull(), LLCharacter::setAnimationData(), LLVector3d::setVec(), and LLVector3::setVec().

Referenced by update().

void LLHUDEffectLookAt::clearLookAtTarget (  ) 

Definition at line 452 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]

Definition at line 69 of file llhudeffectlookat.h.

References mTargetType.

const LLVector3d& LLHUDEffectLookAt::getTargetOffset (  )  [inline]

Definition at line 71 of file llhudeffectlookat.h.

References mTargetOffsetGlobal.

const LLVector3& LLHUDEffectLookAt::getTargetPos (  )  [inline]

Definition at line 70 of file llhudeffectlookat.h.

References mTargetPos.

void LLHUDEffectLookAt::markDead (  )  [virtual]

Reimplemented from LLHUDObject.

Definition at line 466 of file llhudeffectlookat.cpp.

References clearLookAtTarget(), LLHUDObject::markDead(), LLHUDObject::mSourceObject, LLPointer< Type >::notNull(), and NULL.

Referenced by update().

void LLHUDEffectLookAt::packData ( LLMessageSystem mesgsys  )  [protected, virtual]

Reimplemented from LLHUDEffect.

Definition at line 263 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::render (  )  [protected, virtual]

Reimplemented from LLHUDEffect.

Definition at line 490 of file llhudeffectlookat.cpp.

References f, glBegin, glEnd, glPopMatrix, glTranslatef, LLHUDObject::mSourceObject, mTargetPos, mTargetType, LLColor3::mV, LLPointer< Type >::notNull(), sDebugLookAt, target, VBLUE, VGREEN, VRED, VX, VY, and VZ.

BOOL LLHUDEffectLookAt::setLookAt ( ELookAtType  target_type,
LLViewerObject object,
LLVector3  position 
)

Definition at line 394 of file llhudeffectlookat.cpp.

References clearLookAtTarget(), dist_vec(), f, FALSE, gAgent, LLFrameTimer::getElapsedTimeF32(), LLAgent::getPosGlobalFromAgent(), llassert, 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::setSourceObject ( LLViewerObject objectp  )  [virtual]

Reimplemented from LLHUDObject.

Definition at line 478 of file llhudeffectlookat.cpp.

References LLPrimitive::isAvatar(), and LLHUDObject::setSourceObject().

Referenced by unpackData().

void LLHUDEffectLookAt::setTargetObjectAndOffset ( LLViewerObject objp,
LLVector3d  offset 
) [protected]

Definition at line 375 of file llhudeffectlookat.cpp.

References LLHUDObject::mTargetObject, and mTargetOffsetGlobal.

Referenced by unpackData().

void LLHUDEffectLookAt::setTargetPosGlobal ( const LLVector3d target_pos_global  )  [protected]

Definition at line 384 of file llhudeffectlookat.cpp.

References LLHUDObject::mTargetObject, mTargetOffsetGlobal, and NULL.

Referenced by unpackData().

void LLHUDEffectLookAt::unpackData ( LLMessageSystem mesgsys,
S32  blocknum 
) [protected, virtual]

Reimplemented from LLHUDEffect.

Definition at line 306 of file llhudeffectlookat.cpp.

References _PREHASH_Effect, _PREHASH_ID, _PREHASH_TypeData, clearLookAtTarget(), LLViewerObjectList::findObject(), gAgent, 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(), size, SOURCE_AVATAR, TARGET_OBJECT, TARGET_POS, and LLHUDEffect::unpackData().

void LLHUDEffectLookAt::update (  )  [protected, virtual]

Reimplemented from LLHUDEffect.

Definition at line 521 of file llhudeffectlookat.cpp.

References ANIM_AGENT_HEAD_ROT, calcTargetPosition(), clearLookAtTarget(), f, 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().


Friends And Related Function Documentation

friend class LLHUDObject [friend]

Definition at line 61 of file llhudeffectlookat.h.


Member Data Documentation

LLAttentionSet* LLHUDEffectLookAt::mAttentions [private]

Definition at line 98 of file llhudeffectlookat.h.

Referenced by LLHUDEffectLookAt(), setLookAt(), and update().

F32 LLHUDEffectLookAt::mKillTime [private]

Definition at line 94 of file llhudeffectlookat.h.

Referenced by setLookAt(), and update().

F32 LLHUDEffectLookAt::mLastSendTime [private]

Definition at line 97 of file llhudeffectlookat.h.

Referenced by packData(), and setLookAt().

LLVector3 LLHUDEffectLookAt::mLastSentOffsetGlobal [private]

Definition at line 93 of file llhudeffectlookat.h.

Referenced by setLookAt().

LLVector3d LLHUDEffectLookAt::mTargetOffsetGlobal [private]

Definition at line 92 of file llhudeffectlookat.h.

Referenced by calcTargetPosition(), clearLookAtTarget(), getTargetOffset(), packData(), setLookAt(), setTargetObjectAndOffset(), and setTargetPosGlobal().

LLVector3 LLHUDEffectLookAt::mTargetPos [private]

Definition at line 96 of file llhudeffectlookat.h.

Referenced by calcTargetPosition(), getTargetPos(), and render().

ELookAtType LLHUDEffectLookAt::mTargetType [private]

Definition at line 91 of file llhudeffectlookat.h.

Referenced by calcTargetPosition(), clearLookAtTarget(), getLookAtType(), packData(), render(), setLookAt(), unpackData(), and update().

LLFrameTimer LLHUDEffectLookAt::mTimer [private]

Definition at line 95 of file llhudeffectlookat.h.

Referenced by packData(), setLookAt(), and update().

BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE [static]

Definition at line 88 of file llhudeffectlookat.h.

Referenced by init_debug_avatar_menu(), render(), and update().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:24 2010 for Second Life Viewer by  doxygen 1.4.7