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/newview/llviewercamera.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 '')
-rw-r--r-- | linden/indra/newview/llviewercamera.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewercamera.h b/linden/indra/newview/llviewercamera.h new file mode 100644 index 0000000..8ea2738 --- /dev/null +++ b/linden/indra/newview/llviewercamera.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /** | ||
2 | * @file llviewercamera.h | ||
3 | * @brief LLViewerCamera class header file | ||
4 | * | ||
5 | * Copyright (c) 2002-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_LLVIEWERCAMERA_H | ||
29 | #define LL_LLVIEWERCAMERA_H | ||
30 | |||
31 | #include "llcamera.h" | ||
32 | #include "lltimer.h" | ||
33 | #include "llstat.h" | ||
34 | #include "m4math.h" | ||
35 | |||
36 | class LLCoordGL; | ||
37 | class LLViewerObject; | ||
38 | |||
39 | // This rotation matrix moves the default OpenGL reference frame | ||
40 | // (-Z at, Y up) to Cory's favorite reference frame (X at, Z up) | ||
41 | const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X | ||
42 | -1.f, 0.f, 0.f, 0.f, // -X becomes Y | ||
43 | 0.f, 1.f, 0.f, 0.f, // Y becomes Z | ||
44 | 0.f, 0.f, 0.f, 1.f }; | ||
45 | |||
46 | class LLViewerCamera : public LLCamera | ||
47 | { | ||
48 | public: | ||
49 | LLViewerCamera(); | ||
50 | |||
51 | // const LLVector3 &getPositionAgent() const; | ||
52 | // const LLVector3d &getPositionGlobal() const; | ||
53 | |||
54 | void updateCameraLocation(const LLVector3 ¢er, | ||
55 | const LLVector3 &up_direction, | ||
56 | const LLVector3 &point_of_interest); | ||
57 | |||
58 | void updateFrustumPlanes(); | ||
59 | void setPerspective(BOOL for_selection, S32 x, S32 y_from_bot, S32 width, S32 height, BOOL limit_select_distance, F32 z_near = 0, F32 z_far = 0); | ||
60 | |||
61 | const LLMatrix4 &getProjection() const; | ||
62 | const LLMatrix4 &getModelview() const; | ||
63 | |||
64 | // Warning! These assume the current global matrices are correct | ||
65 | void projectScreenToPosAgent(const S32 screen_x, const S32 screen_y, LLVector3* pos_agent ) const; | ||
66 | BOOL projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp = TRUE) const; | ||
67 | BOOL projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const; | ||
68 | |||
69 | |||
70 | LLStat *getVelocityStat() { return &mVelocityStat; } | ||
71 | LLStat *getAngularVelocityStat() { return &mAngularVelocityStat; } | ||
72 | |||
73 | void getPixelVectors(const LLVector3 &pos_agent, LLVector3 &up, LLVector3 &right); | ||
74 | LLVector3 roundToPixel(const LLVector3 &pos_agent); | ||
75 | |||
76 | void setDefaultFOV(F32 fov) { mCameraFOVDefault = fov; } | ||
77 | F32 getDefaultFOV() { return mCameraFOVDefault; } | ||
78 | |||
79 | BOOL cameraUnderWater() const; | ||
80 | |||
81 | const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; } | ||
82 | BOOL areVertsVisible(LLViewerObject* volumep, BOOL all_verts); | ||
83 | F32 getPixelMeterRatio() const { return mPixelMeterRatio; } | ||
84 | S32 getScreenPixelArea() const { return mScreenPixelArea; } | ||
85 | |||
86 | void setZoomParameters(F32 factor, S16 subregion) { mZoomFactor = factor; mZoomSubregion = subregion; } | ||
87 | F32 getZoomFactor() { return mZoomFactor; } | ||
88 | S16 getZoomSubRegion() { return mZoomSubregion; } | ||
89 | |||
90 | protected: | ||
91 | void calcProjection(const F32 far_distance) const; | ||
92 | |||
93 | LLStat mVelocityStat; | ||
94 | LLStat mAngularVelocityStat; | ||
95 | mutable LLMatrix4 mProjectionMatrix; // Cache of perspective matrix | ||
96 | mutable LLMatrix4 mModelviewMatrix; | ||
97 | F32 mCameraFOVDefault; | ||
98 | LLVector3 mLastPointOfInterest; | ||
99 | F32 mPixelMeterRatio; // Divide by distance from camera to get pixels per meter at that distance. | ||
100 | S32 mScreenPixelArea; // Pixel area of entire window | ||
101 | F32 mZoomFactor; | ||
102 | S16 mZoomSubregion; | ||
103 | |||
104 | public: | ||
105 | static BOOL sDisableCameraConstraints; | ||
106 | F64 mGLProjectionMatrix[16]; | ||
107 | |||
108 | }; | ||
109 | |||
110 | extern LLViewerCamera *gCamera; | ||
111 | extern F64 gGLModelView[16]; | ||
112 | extern S32 gGLViewport[4]; | ||
113 | |||
114 | #endif // LL_LLVIEWERCAMERA_H | ||