diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerjointmesh.h | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerjointmesh.h b/linden/indra/newview/llviewerjointmesh.h new file mode 100644 index 0000000..30b2f29 --- /dev/null +++ b/linden/indra/newview/llviewerjointmesh.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /** | ||
2 | * @file llviewerjointmesh.h | ||
3 | * @brief Implementation of LLViewerJointMesh 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_LLVIEWERJOINTMESH_H | ||
29 | #define LL_LLVIEWERJOINTMESH_H | ||
30 | |||
31 | #include "llviewerjoint.h" | ||
32 | #include "llviewerimage.h" | ||
33 | #include "llpolymesh.h" | ||
34 | #include "v4color.h" | ||
35 | #include "llapr.h" | ||
36 | |||
37 | class LLDrawable; | ||
38 | class LLFace; | ||
39 | class LLCharacter; | ||
40 | class LLTexLayerSet; | ||
41 | |||
42 | typedef enum e_avatar_render_pass | ||
43 | { | ||
44 | AVATAR_RENDER_PASS_SINGLE, | ||
45 | AVATAR_RENDER_PASS_CLOTHING_INNER, | ||
46 | AVATAR_RENDER_PASS_CLOTHING_OUTER | ||
47 | } EAvatarRenderPass; | ||
48 | |||
49 | class LLSkinJoint | ||
50 | { | ||
51 | public: | ||
52 | LLSkinJoint(); | ||
53 | ~LLSkinJoint(); | ||
54 | BOOL setupSkinJoint( LLViewerJoint *joint); | ||
55 | |||
56 | LLViewerJoint *mJoint; | ||
57 | LLVector3 mRootToJointSkinOffset; | ||
58 | LLVector3 mRootToParentJointSkinOffset; | ||
59 | }; | ||
60 | |||
61 | //----------------------------------------------------------------------------- | ||
62 | // class LLViewerJointMesh | ||
63 | //----------------------------------------------------------------------------- | ||
64 | class LLViewerJointMesh : public LLViewerJoint | ||
65 | { | ||
66 | protected: | ||
67 | LLColor4 mColor; // color value | ||
68 | // LLColor4 mSpecular; // specular color (always white for now) | ||
69 | F32 mShiny; // shiny value | ||
70 | LLPointer<LLViewerImage> mTexture; // ptr to a global texture | ||
71 | LLTexLayerSet* mLayerSet; // ptr to a layer set owned by the avatar | ||
72 | U32 mTestImageName; // handle to a temporary texture for previewing uploads | ||
73 | LLPolyMesh* mMesh; // ptr to a global polymesh | ||
74 | BOOL mCullBackFaces; // true by default | ||
75 | LLFace* mFace; // ptr to a face w/ AGP copy of mesh | ||
76 | |||
77 | U32 mFaceIndexCount; | ||
78 | BOOL mIsTransparent; | ||
79 | |||
80 | U32 mNumSkinJoints; | ||
81 | LLSkinJoint* mSkinJoints; | ||
82 | S32 mMeshID; | ||
83 | |||
84 | public: | ||
85 | static BOOL sPipelineRender; | ||
86 | //RN: this is here for testing purposes | ||
87 | static U32 sClothingMaskImageName; | ||
88 | static EAvatarRenderPass sRenderPass; | ||
89 | static LLColor4 sClothingInnerColor; | ||
90 | |||
91 | public: | ||
92 | // Constructor | ||
93 | LLViewerJointMesh(); | ||
94 | |||
95 | // Destructor | ||
96 | virtual ~LLViewerJointMesh(); | ||
97 | |||
98 | // Gets the shape color | ||
99 | void getColor( F32 *red, F32 *green, F32 *blue, F32 *alpha ); | ||
100 | |||
101 | // Sets the shape color | ||
102 | void setColor( F32 red, F32 green, F32 blue, F32 alpha ); | ||
103 | |||
104 | // Sets the shininess | ||
105 | void setSpecular( const LLColor4& color, F32 shiny ) { /*mSpecular = color;*/ mShiny = shiny; }; | ||
106 | |||
107 | // Sets the shape texture | ||
108 | void setTexture( LLViewerImage *texture ); | ||
109 | |||
110 | void setTestTexture( U32 name ) { mTestImageName = name; } | ||
111 | |||
112 | // Sets layer set responsible for a dynamic shape texture (takes precedence over normal texture) | ||
113 | void setLayerSet( LLTexLayerSet* layer_set ); | ||
114 | |||
115 | // Gets the poly mesh | ||
116 | LLPolyMesh *getMesh(); | ||
117 | |||
118 | // Sets the poly mesh | ||
119 | void setMesh( LLPolyMesh *mesh ); | ||
120 | |||
121 | // Sets up joint matrix data for rendering | ||
122 | void setupJoint(LLViewerJoint* current_joint); | ||
123 | |||
124 | // Render time method to upload batches of joint matrices | ||
125 | void uploadJointMatrices(); | ||
126 | |||
127 | // Sets ID for picking | ||
128 | void setMeshID( S32 id ) {mMeshID = id;} | ||
129 | |||
130 | // Gets ID for picking | ||
131 | S32 getMeshID() { return mMeshID; } | ||
132 | |||
133 | // overloaded from base class | ||
134 | /*virtual*/ void drawBone(); | ||
135 | /*virtual*/ BOOL isTransparent(); | ||
136 | /*virtual*/ U32 drawShape( F32 pixelArea ); | ||
137 | |||
138 | /*virtual*/ void updateFaceSizes(U32 &num_vertices, F32 pixel_area); | ||
139 | /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); | ||
140 | /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); | ||
141 | /*virtual*/ void dump(); | ||
142 | |||
143 | void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; } | ||
144 | |||
145 | /*virtual*/ BOOL isAnimatable() { return FALSE; } | ||
146 | void writeCAL3D(apr_file_t* fp, S32 material_num, LLCharacter* characterp); | ||
147 | private: | ||
148 | // Allocate skin data | ||
149 | BOOL allocateSkinData( U32 numSkinJoints ); | ||
150 | |||
151 | S32 getBoundJointsByIndex(S32 index, S32 &joint_a, S32& joint_b); | ||
152 | |||
153 | // Free skin data | ||
154 | void freeSkinData(); | ||
155 | }; | ||
156 | |||
157 | #endif // LL_LLVIEWERJOINTMESH_H | ||