aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerjoint.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llviewerjoint.h
parentREADME.txt (diff)
downloadmeta-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/llviewerjoint.h156
1 files changed, 156 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerjoint.h b/linden/indra/newview/llviewerjoint.h
new file mode 100644
index 0000000..44ad8e7
--- /dev/null
+++ b/linden/indra/newview/llviewerjoint.h
@@ -0,0 +1,156 @@
1/**
2 * @file llviewerjoint.h
3 * @brief Implementation of LLViewerJoint class
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_LLVIEWERJOINT_H
29#define LL_LLVIEWERJOINT_H
30
31//-----------------------------------------------------------------------------
32// Header Files
33//-----------------------------------------------------------------------------
34#include "lljoint.h"
35#include "llapr.h"
36
37class LLFace;
38
39//-----------------------------------------------------------------------------
40// class LLViewerJoint
41//-----------------------------------------------------------------------------
42class LLViewerJoint :
43 public LLJoint
44{
45public:
46 LLViewerJoint();
47 LLViewerJoint(const std::string &name, LLJoint *parent = NULL);
48 virtual ~LLViewerJoint();
49
50 // Gets the validity of this joint
51 BOOL getValid() { return mValid; }
52
53 // Sets the validity of this joint
54 virtual void setValid( BOOL valid, BOOL recursive=FALSE );
55
56 // Primarily for debugging and character setup
57 // Derived classes may add text/graphic output.
58 // Draw skeleton graphic for debugging and character setup
59 virtual void renderSkeleton(BOOL recursive=TRUE);
60
61 // Render character hierarchy.
62 // Traverses the entire joint hierarchy, setting up
63 // transforms and calling the drawShape().
64 // Derived classes may add text/graphic output.
65 virtual U32 render( F32 pixelArea ); // Returns triangle count
66
67 // Draws a bone graphic to the parent joint.
68 // Derived classes may add text/graphic output.
69 // Called by renderSkeleton().
70 virtual void drawBone();
71
72 // Returns true if this object is transparent.
73 // This is used to determine in which order to draw objects.
74 virtual BOOL isTransparent();
75
76 // Returns true if this object should inherit scale modifiers from its immediate parent
77 virtual BOOL inheritScale() { return FALSE; }
78
79 // Draws the shape attached to a joint.
80 // Called by render().
81 virtual U32 drawShape( F32 pixelArea );
82 virtual void drawNormals() {}
83
84 enum Components
85 {
86 SC_BONE = 1,
87 SC_JOINT = 2,
88 SC_AXES = 4
89 };
90
91 // Selects which skeleton components to draw
92 void setSkeletonComponents( U32 comp, BOOL recursive = TRUE );
93
94 // Returns which skeleton components are enables for drawing
95 U32 getSkeletonComponents() { return mComponents; }
96
97 // Sets the level of detail for this node as a minimum
98 // pixel area threshold. If the current pixel area for this
99 // object is less than the specified threshold, the node is
100 // not traversed. In additin, if a value is specified (not
101 // default of 0.0), and the pixel area is larger than the
102 // specified miniumn, the node is rendered, but no other siblings
103 // of this node under the same parent will be.
104 F32 getLOD() { return mMinPixelArea; }
105 void setLOD( F32 pixelArea ) { mMinPixelArea = pixelArea; }
106
107 // Sets the OpenGL selection stack name that is pushed and popped
108 // with this joint state. The default value indicates that no name
109 // should be pushed/popped.
110 enum PickName
111 {
112 PN_DEFAULT = -1,
113 PN_0 = 0,
114 PN_1 = 1,
115 PN_2 = 2,
116 PN_3 = 3,
117 PN_4 = 4,
118 PN_5 = 5
119 };
120 void setPickName(PickName name) { mPickName = name; }
121 PickName getPickName() { return mPickName; }
122
123 virtual void updateFaceSizes(U32 &num_vertices, F32 pixel_area);
124 virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE);
125 virtual BOOL updateLOD(F32 pixel_area, BOOL activate);
126 virtual void dump();
127
128 void setVisible( BOOL visible, BOOL recursive );
129 virtual void writeCAL3D(apr_file_t* fp);
130
131public:
132 static BOOL sDisableLOD;
133
134protected:
135 BOOL mValid;
136 U32 mComponents;
137 F32 mMinPixelArea;
138 PickName mPickName;
139 BOOL mVisible;
140};
141
142class LLViewerJointCollisionVolume : public LLViewerJoint
143{
144public:
145 LLViewerJointCollisionVolume();
146 LLViewerJointCollisionVolume(const std::string &name, LLJoint *parent = NULL);
147 virtual ~LLViewerJointCollisionVolume() {};
148
149 virtual BOOL inheritScale() { return TRUE; }
150
151 void render();
152 LLVector3 getVolumePos(LLVector3 &offset);
153};
154
155#endif // LL_LLVIEWERJOINT_H
156