aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llsprite.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llsprite.h')
-rw-r--r--linden/indra/newview/llsprite.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/linden/indra/newview/llsprite.h b/linden/indra/newview/llsprite.h
new file mode 100644
index 0000000..a9de306
--- /dev/null
+++ b/linden/indra/newview/llsprite.h
@@ -0,0 +1,108 @@
1/**
2 * @file llsprite.h
3 * @brief LLSprite class definition
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLSPRITE_H
29#define LL_LLSPRITE_H
30
31////#include "vmath.h"
32//#include "llmath.h"
33#include "v3math.h"
34#include "v4math.h"
35#include "v4color.h"
36#include "lluuid.h"
37#include "llgl.h"
38#include "llviewerimage.h"
39
40class LLViewerCamera;
41
42class LLFace;
43
44class LLSprite
45{
46public:
47 LLSprite(const LLUUID &image_uuid);
48 LLSprite(const LLUUID &image_uuid, const F32 width, const F32 height, const BOOL b_usemipmap = TRUE);
49 ~LLSprite();
50
51 void render(LLViewerCamera * camerap);
52
53 F32 getWidth() const { return mWidth; }
54 F32 getHeight() const { return mHeight; }
55 F32 getYaw() const { return mYaw; }
56 F32 getPitch() const { return mPitch; }
57 F32 getAlpha() const { return mColor.mV[VALPHA]; }
58
59 LLVector3 getPosition() const { return mPosition; }
60 LLColor4 getColor() const { return mColor; }
61
62 void setPosition(const LLVector3 &position);
63 void setPitch(const F32 pitch);
64 void setSize(const F32 width, const F32 height);
65 void setYaw(const F32 yaw);
66 void setFollow(const BOOL follow);
67 void setUseCameraUp(const BOOL use_up);
68
69 void setTexMode(LLGLenum mode);
70 void setColor(const LLColor4 &color);
71 void setColor(const F32 r, const F32 g, const F32 b, const F32 a);
72 void setAlpha(const F32 alpha) { mColor.mV[VALPHA] = alpha; }
73 void setNormal(const LLVector3 &normal) { sNormal = normal; sNormal.normVec();}
74
75 F32 getAlpha();
76
77 void updateFace(LLFace &face);
78
79public:
80 LLUUID mImageID;
81 LLPointer<LLViewerImage> mImagep;
82private:
83 F32 mWidth;
84 F32 mHeight;
85 F32 mWidthDiv2;
86 F32 mHeightDiv2;
87 F32 mPitch;
88 F32 mYaw;
89 LLVector3 mPosition;
90 BOOL mFollow;
91 BOOL mUseCameraUp;
92
93 LLColor4 mColor;
94 LLGLenum mTexMode;
95
96 // put
97 LLVector3 mScaledUp;
98 LLVector3 mScaledRight;
99 static LLVector3 sCameraUp;
100 static LLVector3 sCameraRight;
101 static LLVector3 sCameraPosition;
102 static LLVector3 sNormal;
103 LLVector3 mA,mB,mC,mD; // the four corners of a quad
104
105};
106
107#endif
108