00001
00032 #ifndef LL_LLVIEWERJOINT_H
00033 #define LL_LLVIEWERJOINT_H
00034
00035
00036
00037
00038 #include "lljoint.h"
00039 #include "llapr.h"
00040
00041 class LLFace;
00042
00043
00044
00045
00046 class LLViewerJoint :
00047 public LLJoint
00048 {
00049 public:
00050 LLViewerJoint();
00051 LLViewerJoint(const std::string &name, LLJoint *parent = NULL);
00052 virtual ~LLViewerJoint();
00053
00054
00055 BOOL getValid() { return mValid; }
00056
00057
00058 virtual void setValid( BOOL valid, BOOL recursive=FALSE );
00059
00060
00061
00062
00063 virtual void renderSkeleton(BOOL recursive=TRUE);
00064
00065
00066
00067
00068
00069 virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE );
00070
00071
00072
00073
00074 virtual void drawBone();
00075
00076
00077
00078 virtual BOOL isTransparent();
00079
00080
00081 virtual BOOL inheritScale() { return FALSE; }
00082
00083
00084
00085 virtual U32 drawShape( F32 pixelArea, BOOL first_pass = TRUE );
00086 virtual void drawNormals() {}
00087
00088 enum Components
00089 {
00090 SC_BONE = 1,
00091 SC_JOINT = 2,
00092 SC_AXES = 4
00093 };
00094
00095
00096 void setSkeletonComponents( U32 comp, BOOL recursive = TRUE );
00097
00098
00099 U32 getSkeletonComponents() { return mComponents; }
00100
00101
00102
00103
00104
00105
00106
00107
00108 F32 getLOD() { return mMinPixelArea; }
00109 void setLOD( F32 pixelArea ) { mMinPixelArea = pixelArea; }
00110
00111
00112
00113
00114 enum PickName
00115 {
00116 PN_DEFAULT = -1,
00117 PN_0 = 0,
00118 PN_1 = 1,
00119 PN_2 = 2,
00120 PN_3 = 3,
00121 PN_4 = 4,
00122 PN_5 = 5
00123 };
00124 void setPickName(PickName name) { mPickName = name; }
00125 PickName getPickName() { return mPickName; }
00126
00127 virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
00128 virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE);
00129 virtual BOOL updateLOD(F32 pixel_area, BOOL activate);
00130 virtual void updateGeometry();
00131 virtual void dump();
00132
00133 void setVisible( BOOL visible, BOOL recursive );
00134 virtual void writeCAL3D(apr_file_t* fp);
00135
00136 public:
00137 static BOOL sDisableLOD;
00138
00139 protected:
00140 BOOL mValid;
00141 U32 mComponents;
00142 F32 mMinPixelArea;
00143 PickName mPickName;
00144 BOOL mVisible;
00145 };
00146
00147 class LLViewerJointCollisionVolume : public LLViewerJoint
00148 {
00149 public:
00150 LLViewerJointCollisionVolume();
00151 LLViewerJointCollisionVolume(const std::string &name, LLJoint *parent = NULL);
00152 virtual ~LLViewerJointCollisionVolume() {};
00153
00154 virtual BOOL inheritScale() { return TRUE; }
00155
00156 void render();
00157 LLVector3 getVolumePos(LLVector3 &offset);
00158 };
00159
00160 #endif // LL_LLVIEWERJOINT_H
00161
00162