PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llhudeffectpointat.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 84 lines | 47 code | 11 blank | 26 comment | 0 complexity | 8340aeb7840601dbaa3b4851b8b6b971 MD5 | raw file
 1/** 
 2 * @file llhudeffectpointat.h
 3 * @brief LLHUDEffectPointAt class definition
 4 *
 5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLHUDEFFECTPOINTAT_H
28#define LL_LLHUDEFFECTPOINTAT_H
29
30#include "llframetimer.h"
31#include "llhudeffect.h"
32
33class LLViewerObject;
34class LLVOAvatar;
35
36typedef enum e_pointat_type
37{
38	POINTAT_TARGET_NONE,
39	POINTAT_TARGET_SELECT,
40	POINTAT_TARGET_GRAB,
41	POINTAT_TARGET_CLEAR,
42	POINTAT_NUM_TARGETS
43} EPointAtType;
44
45class LLHUDEffectPointAt : public LLHUDEffect
46{
47public:
48	friend class LLHUDObject;
49
50	/*virtual*/ void markDead();
51	/*virtual*/ void setSourceObject(LLViewerObject* objectp);
52
53	BOOL setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position);
54	void clearPointAtTarget();
55
56	EPointAtType getPointAtType() { return mTargetType; }
57	const LLVector3& getPointAtPosAgent() { return mTargetPos; }
58	const LLVector3d getPointAtPosGlobal();
59protected:
60	LLHUDEffectPointAt(const U8 type);
61	~LLHUDEffectPointAt();
62
63	/*virtual*/ void render();
64	/*virtual*/ void packData(LLMessageSystem *mesgsys);
65	/*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum);
66
67	// lookat behavior has either target position or target object with offset
68	void setTargetObjectAndOffset(LLViewerObject *objp, LLVector3d offset);
69	void setTargetPosGlobal(const LLVector3d &target_pos_global);
70	bool calcTargetPosition();
71	void update();
72public:
73	static BOOL sDebugPointAt;
74private:
75	EPointAtType				mTargetType;
76	LLVector3d					mTargetOffsetGlobal;
77	LLVector3					mLastSentOffsetGlobal;
78	F32							mKillTime;
79	LLFrameTimer				mTimer;
80	LLVector3					mTargetPos;
81	F32							mLastSendTime;
82};
83
84#endif // LL_LLHUDEFFECTPOINTAT_H