PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 14ms app.codeStats 0ms

/indra/newview/llviewerjointattachment.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 112 lines | 47 code | 19 blank | 46 comment | 0 complexity | d1e07d191cbeefc4c4dea8cde630cdc0 MD5 | raw file
  1/** 
  2 * @file llviewerjointattachment.h
  3 * @brief Implementation of LLViewerJointAttachment class
  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_LLVIEWERJOINTATTACHMENT_H
 28#define LL_LLVIEWERJOINTATTACHMENT_H
 29
 30//-----------------------------------------------------------------------------
 31// Header Files
 32//-----------------------------------------------------------------------------
 33#include "llviewerjoint.h"
 34#include "llstring.h"
 35#include "lluuid.h"
 36
 37class LLDrawable;
 38class LLViewerObject;
 39
 40//-----------------------------------------------------------------------------
 41// class LLViewerJointAttachment
 42//-----------------------------------------------------------------------------
 43class LLViewerJointAttachment :
 44	public LLViewerJoint
 45{
 46public:
 47	LLViewerJointAttachment();
 48	virtual ~LLViewerJointAttachment();
 49
 50	//virtual U32 render( F32 pixelArea );	// Returns triangle count
 51
 52	// Returns true if this object is transparent.
 53	// This is used to determine in which order to draw objects.
 54	/*virtual*/ BOOL isTransparent();
 55
 56	// Draws the shape attached to a joint.
 57	// Called by render().
 58	/*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy );
 59	
 60	/*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate);
 61
 62	//
 63	// accessors
 64	//
 65
 66	void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; }	
 67	void setVisibleInFirstPerson(BOOL visibility) { mVisibleInFirst = visibility; }
 68	BOOL getVisibleInFirstPerson() const { return mVisibleInFirst; }
 69	void setGroup(S32 group) { mGroup = group; }
 70	void setOriginalPosition(LLVector3 &position);
 71	void setAttachmentVisibility(BOOL visible);
 72	void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; }
 73	BOOL getIsHUDAttachment() const { return mIsHUDAttachment; }
 74
 75	BOOL isAnimatable() const { return FALSE; }
 76
 77	S32 getGroup() const { return mGroup; }
 78	S32 getPieSlice() const { return mPieSlice; }
 79	S32	getNumObjects() const { return mAttachedObjects.size(); }
 80
 81	void clampObjectPosition();
 82
 83	//
 84	// unique methods
 85	//
 86	BOOL addObject(LLViewerObject* object);
 87	void removeObject(LLViewerObject *object);
 88
 89	// 
 90	// attachments operations
 91	//
 92	BOOL isObjectAttached(const LLViewerObject *viewer_object) const;
 93	const LLViewerObject *getAttachedObject(const LLUUID &object_id) const;
 94	LLViewerObject *getAttachedObject(const LLUUID &object_id);
 95
 96	// list of attachments for this joint
 97	typedef std::vector<LLViewerObject *> attachedobjs_vec_t;
 98	attachedobjs_vec_t mAttachedObjects;
 99
100protected:
101	void calcLOD();
102	void setupDrawable(LLViewerObject *object);
103
104private:
105	BOOL			mVisibleInFirst;
106	LLVector3		mOriginalPos;
107	S32				mGroup;
108	BOOL			mIsHUDAttachment;
109	S32				mPieSlice;
110};
111
112#endif // LL_LLVIEWERJOINTATTACHMENT_H