diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmath/llcoord.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llmath/llcoord.h')
-rw-r--r-- | linden/indra/llmath/llcoord.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/linden/indra/llmath/llcoord.h b/linden/indra/llmath/llcoord.h new file mode 100644 index 0000000..6aa6b64 --- /dev/null +++ b/linden/indra/llmath/llcoord.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /** | ||
2 | * @file llcoord.h | ||
3 | * | ||
4 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
5 | * | ||
6 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
7 | * to you under the terms of the GNU General Public License, version 2.0 | ||
8 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
9 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
10 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
11 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
12 | * | ||
13 | * There are special exceptions to the terms and conditions of the GPL as | ||
14 | * it is applied to this Source Code. View the full text of the exception | ||
15 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
16 | * online at http://secondlife.com/developers/opensource/flossexception | ||
17 | * | ||
18 | * By copying, modifying or distributing this software, you acknowledge | ||
19 | * that you have read and understood your obligations described above, | ||
20 | * and agree to abide by those obligations. | ||
21 | * | ||
22 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
23 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
24 | * COMPLETENESS OR PERFORMANCE. | ||
25 | */ | ||
26 | |||
27 | #ifndef LL_LLCOORD_H | ||
28 | #define LL_LLCOORD_H | ||
29 | |||
30 | // A two-dimensional pixel value | ||
31 | class LLCoord | ||
32 | { | ||
33 | public: | ||
34 | S32 mX; | ||
35 | S32 mY; | ||
36 | |||
37 | LLCoord(): mX(0), mY(0) | ||
38 | {} | ||
39 | LLCoord(S32 x, S32 y): mX(x), mY(y) | ||
40 | {} | ||
41 | virtual ~LLCoord() | ||
42 | {} | ||
43 | |||
44 | virtual void set(S32 x, S32 y) { mX = x; mY = y; } | ||
45 | }; | ||
46 | |||
47 | |||
48 | // GL coordinates start in the client region of a window, | ||
49 | // with left, bottom = 0, 0 | ||
50 | class LLCoordGL : public LLCoord | ||
51 | { | ||
52 | public: | ||
53 | LLCoordGL() : LLCoord() | ||
54 | {} | ||
55 | LLCoordGL(S32 x, S32 y) : LLCoord(x, y) | ||
56 | {} | ||
57 | }; | ||
58 | |||
59 | |||
60 | // Window coords include things like window borders, | ||
61 | // menu regions, etc. | ||
62 | class LLCoordWindow : public LLCoord | ||
63 | { | ||
64 | public: | ||
65 | LLCoordWindow() : LLCoord() | ||
66 | {} | ||
67 | LLCoordWindow(S32 x, S32 y) : LLCoord(x, y) | ||
68 | {} | ||
69 | }; | ||
70 | |||
71 | |||
72 | // Screen coords start at left, top = 0, 0 | ||
73 | class LLCoordScreen : public LLCoord | ||
74 | { | ||
75 | public: | ||
76 | LLCoordScreen() : LLCoord() | ||
77 | {} | ||
78 | LLCoordScreen(S32 x, S32 y) : LLCoord(x, y) | ||
79 | {} | ||
80 | }; | ||
81 | |||
82 | class LLCoordFont : public LLCoord | ||
83 | { | ||
84 | public: | ||
85 | F32 mZ; | ||
86 | |||
87 | LLCoordFont() : LLCoord(), mZ(0.f) | ||
88 | {} | ||
89 | LLCoordFont(S32 x, S32 y, F32 z = 0) : LLCoord(x,y), mZ(z) | ||
90 | {} | ||
91 | |||
92 | void set(S32 x, S32 y) { LLCoord::set(x,y); mZ = 0.f; } | ||
93 | void set(S32 x, S32 y, F32 z) { mX = x; mY = y; mZ = z; } | ||
94 | }; | ||
95 | |||
96 | |||
97 | #endif | ||