PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llsprite.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 106 lines | 60 code | 18 blank | 28 comment | 0 complexity | 67e6807da49e6d063ac835702bd19562 MD5 | raw file
  1/** 
  2 * @file llsprite.h
  3 * @brief LLSprite class definition
  4 *
  5 * $LicenseInfo:firstyear=2001&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_LLSPRITE_H
 28#define LL_LLSPRITE_H
 29
 30////#include "vmath.h"
 31//#include "llmath.h"
 32#include "v3math.h"
 33#include "v4math.h"
 34#include "v4color.h"
 35#include "lluuid.h"
 36#include "llgl.h"
 37#include "llviewertexture.h"
 38
 39class LLViewerCamera;
 40
 41class LLFace;
 42
 43class LLSprite  
 44{
 45public:
 46	LLSprite(const LLUUID &image_uuid);
 47	~LLSprite();
 48
 49	void render(LLViewerCamera * camerap);
 50
 51	F32 getWidth()				const	{ return mWidth; } 
 52	F32 getHeight()				const	{ return mHeight; }
 53	F32 getYaw()				const	{ return mYaw; } 
 54	F32 getPitch()				const	{ return mPitch; }
 55	F32	getAlpha()				const	{ return mColor.mV[VALPHA]; }
 56
 57	LLVector3 getPosition()		const	{ return mPosition; }
 58	LLColor4  getColor()		const	{ return mColor; }
 59
 60	void setPosition(const LLVector3 &position);
 61	void setPitch(const F32 pitch);
 62	void setSize(const F32 width, const F32 height);
 63	void setYaw(const F32 yaw);
 64	void setFollow(const BOOL follow);
 65	void setUseCameraUp(const BOOL use_up);
 66
 67	void setTexMode(LLGLenum mode);
 68	void setColor(const LLColor4 &color);
 69	void setColor(const F32 r, const F32 g, const F32 b, const F32 a);
 70	void setAlpha(const F32 alpha)					{ mColor.mV[VALPHA] = alpha; }
 71	void setNormal(const LLVector3 &normal)		{ sNormal = normal; sNormal.normalize();}
 72
 73	F32 getAlpha();
 74
 75	void updateFace(LLFace &face);
 76
 77public:
 78	LLUUID mImageID;
 79  	LLPointer<LLViewerTexture> mImagep;
 80private:
 81	F32 mWidth;
 82	F32 mHeight;
 83	F32 mWidthDiv2;
 84	F32 mHeightDiv2;
 85	F32 mPitch;
 86	F32 mYaw;
 87	LLVector3 mPosition;
 88	BOOL mFollow;
 89	BOOL mUseCameraUp;
 90
 91	LLColor4 mColor;
 92	LLGLenum mTexMode;
 93
 94	// put 
 95	LLVector3 mScaledUp;
 96	LLVector3 mScaledRight;
 97	static LLVector3 sCameraUp;
 98	static LLVector3 sCameraRight;
 99	static LLVector3 sCameraPosition;
100	static LLVector3 sNormal;
101	LLVector3 mA,mB,mC,mD;   // the four corners of a quad
102
103};
104
105#endif
106