diff options
author | Jacek Antonelli | 2008-08-15 23:44:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:57 -0500 |
commit | da68d3a57ecb27eba5d7efb8ff77d9640c0be65e (patch) | |
tree | f2fa2b9ed6e8cf49c8a3cb2a1893c4e5c61916a1 /linden/indra/llmath/llvolume.h | |
parent | Second Life viewer sources 1.15.1.3 (diff) | |
download | meta-impy-da68d3a57ecb27eba5d7efb8ff77d9640c0be65e.zip meta-impy-da68d3a57ecb27eba5d7efb8ff77d9640c0be65e.tar.gz meta-impy-da68d3a57ecb27eba5d7efb8ff77d9640c0be65e.tar.bz2 meta-impy-da68d3a57ecb27eba5d7efb8ff77d9640c0be65e.tar.xz |
Second Life viewer sources 1.16.0.5
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmath/llvolume.h | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index 7137346..a3e89ab 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h | |||
@@ -169,6 +169,16 @@ const LLFaceID LL_FACE_OUTER_SIDE_3 = 0x1 << 8; | |||
169 | 169 | ||
170 | //============================================================================ | 170 | //============================================================================ |
171 | 171 | ||
172 | // sculpt types | ||
173 | |||
174 | const U8 LL_SCULPT_TYPE_NONE = 0; | ||
175 | const U8 LL_SCULPT_TYPE_SPHERE = 1; | ||
176 | const U8 LL_SCULPT_TYPE_TORUS = 2; | ||
177 | const U8 LL_SCULPT_TYPE_PLAIN = 3; | ||
178 | const U8 LL_SCULPT_TYPE_CYLINDER = 4; | ||
179 | |||
180 | |||
181 | |||
172 | class LLProfileParams | 182 | class LLProfileParams |
173 | { | 183 | { |
174 | public: | 184 | public: |
@@ -512,8 +522,9 @@ public: | |||
512 | { | 522 | { |
513 | } | 523 | } |
514 | 524 | ||
515 | LLVolumeParams(LLProfileParams &profile, LLPathParams &path) | 525 | LLVolumeParams(LLProfileParams &profile, LLPathParams &path, |
516 | : mProfileParams(profile), mPathParams(path) | 526 | LLUUID sculpt_id = LLUUID::null, U8 sculpt_type = LL_SCULPT_TYPE_NONE) |
527 | : mProfileParams(profile), mPathParams(path), mSculptID(sculpt_id), mSculptType(sculpt_type) | ||
517 | { | 528 | { |
518 | } | 529 | } |
519 | 530 | ||
@@ -564,6 +575,7 @@ public: | |||
564 | bool setRevolutions(const F32 revolutions); // 1 to 4 | 575 | bool setRevolutions(const F32 revolutions); // 1 to 4 |
565 | bool setRadiusOffset(const F32 radius_offset); | 576 | bool setRadiusOffset(const F32 radius_offset); |
566 | bool setSkew(const F32 skew); | 577 | bool setSkew(const F32 skew); |
578 | bool setSculptID(const LLUUID sculpt_id, U8 sculpt_type); | ||
567 | 579 | ||
568 | static bool validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 hollow, | 580 | static bool validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 hollow, |
569 | U8 path_curve, F32 path_begin, F32 path_end, | 581 | U8 path_curve, F32 path_begin, F32 path_end, |
@@ -591,6 +603,8 @@ public: | |||
591 | const F32& getTaperY() const { return mPathParams.getTaperY(); } | 603 | const F32& getTaperY() const { return mPathParams.getTaperY(); } |
592 | const F32& getRevolutions() const { return mPathParams.getRevolutions(); } | 604 | const F32& getRevolutions() const { return mPathParams.getRevolutions(); } |
593 | const F32& getSkew() const { return mPathParams.getSkew(); } | 605 | const F32& getSkew() const { return mPathParams.getSkew(); } |
606 | const LLUUID& getSculptID() const { return mSculptID; } | ||
607 | const U8& getSculptType() const { return mSculptType; } | ||
594 | 608 | ||
595 | BOOL isConvex() const; | 609 | BOOL isConvex() const; |
596 | 610 | ||
@@ -613,6 +627,8 @@ public: | |||
613 | protected: | 627 | protected: |
614 | LLProfileParams mProfileParams; | 628 | LLProfileParams mProfileParams; |
615 | LLPathParams mPathParams; | 629 | LLPathParams mPathParams; |
630 | LLUUID mSculptID; | ||
631 | U8 mSculptType; | ||
616 | }; | 632 | }; |
617 | 633 | ||
618 | 634 | ||
@@ -635,7 +651,7 @@ public: | |||
635 | BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); } | 651 | BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); } |
636 | BOOL isOpen() const { return mOpen; } | 652 | BOOL isOpen() const { return mOpen; } |
637 | void setDirty() { mDirty = TRUE; } | 653 | void setDirty() { mDirty = TRUE; } |
638 | BOOL generate(BOOL path_open, F32 detail = 1.0f, S32 split = 0); | 654 | BOOL generate(BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
639 | BOOL isConcave() const { return mConcave; } | 655 | BOOL isConcave() const { return mConcave; } |
640 | public: | 656 | public: |
641 | const LLProfileParams &mParams; | 657 | const LLProfileParams &mParams; |
@@ -704,7 +720,7 @@ public: | |||
704 | virtual ~LLPath(); | 720 | virtual ~LLPath(); |
705 | 721 | ||
706 | void genNGon(S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); | 722 | void genNGon(S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); |
707 | virtual BOOL generate(F32 detail=1.0f, S32 split = 0); | 723 | virtual BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
708 | 724 | ||
709 | BOOL isOpen() const { return mOpen; } | 725 | BOOL isOpen() const { return mOpen; } |
710 | F32 getStep() const { return mStep; } | 726 | F32 getStep() const { return mStep; } |
@@ -731,7 +747,7 @@ class LLDynamicPath : public LLPath | |||
731 | { | 747 | { |
732 | public: | 748 | public: |
733 | LLDynamicPath(const LLPathParams ¶ms) : LLPath(params) { } | 749 | LLDynamicPath(const LLPathParams ¶ms) : LLPath(params) { } |
734 | BOOL generate(F32 detail=1.0f, S32 split = 0); | 750 | BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
735 | }; | 751 | }; |
736 | 752 | ||
737 | // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) | 753 | // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) |
@@ -821,7 +837,7 @@ public: | |||
821 | U8 getProfileType() const { return mProfilep->mParams.getCurveType(); } | 837 | U8 getProfileType() const { return mProfilep->mParams.getCurveType(); } |
822 | U8 getPathType() const { return mPathp->mParams.getCurveType(); } | 838 | U8 getPathType() const { return mPathp->mParams.getCurveType(); } |
823 | S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); } | 839 | S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); } |
824 | 840 | S32 getNumVolumeFaces() const { return mNumVolumeFaces; } | |
825 | const F32 getDetail() const { return mDetail; } | 841 | const F32 getDetail() const { return mDetail; } |
826 | const LLVolumeParams & getParams() const { return mParams; } | 842 | const LLVolumeParams & getParams() const { return mParams; } |
827 | LLVolumeParams getCopyOfParams() const { return mParams; } | 843 | LLVolumeParams getCopyOfParams() const { return mParams; } |
@@ -839,6 +855,11 @@ public: | |||
839 | BOOL isFlat(S32 face); | 855 | BOOL isFlat(S32 face); |
840 | BOOL isUnique() const { return mUnique; } | 856 | BOOL isUnique() const { return mUnique; } |
841 | 857 | ||
858 | S32 getSculptLevel() const { return mSculptLevel; } | ||
859 | void setSculptLevel(S32 level) { mSculptLevel = level; } | ||
860 | |||
861 | U8 getSculptType() const { return mSculptType; } | ||
862 | |||
842 | S32 *getTriangleIndices(U32 &num_indices) const; | 863 | S32 *getTriangleIndices(U32 &num_indices) const; |
843 | void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, std::vector<S32> &segments, const LLVector3& view_vec, | 864 | void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, std::vector<S32> &segments, const LLVector3& view_vec, |
844 | const LLMatrix4& mat, | 865 | const LLMatrix4& mat, |
@@ -863,7 +884,7 @@ public: | |||
863 | LLFaceID generateFaceMask(); | 884 | LLFaceID generateFaceMask(); |
864 | 885 | ||
865 | BOOL isFaceMaskValid(LLFaceID face_mask); | 886 | BOOL isFaceMaskValid(LLFaceID face_mask); |
866 | static S32 mNumMeshPoints; | 887 | static S32 sNumMeshPoints; |
867 | 888 | ||
868 | friend std::ostream& operator<<(std::ostream &s, const LLVolume &volume); | 889 | friend std::ostream& operator<<(std::ostream &s, const LLVolume &volume); |
869 | friend std::ostream& operator<<(std::ostream &s, const LLVolume *volumep); // HACK to bypass Windoze confusion over | 890 | friend std::ostream& operator<<(std::ostream &s, const LLVolume *volumep); // HACK to bypass Windoze confusion over |
@@ -872,14 +893,19 @@ public: | |||
872 | 893 | ||
873 | U32 mFaceMask; // bit array of which faces exist in this volume | 894 | U32 mFaceMask; // bit array of which faces exist in this volume |
874 | LLVector3 mLODScaleBias; // vector for biasing LOD based on scale | 895 | LLVector3 mLODScaleBias; // vector for biasing LOD based on scale |
875 | 896 | ||
897 | void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level); | ||
898 | |||
876 | protected: | 899 | protected: |
877 | BOOL generate(); | 900 | BOOL generate(); |
878 | void createVolumeFaces(); | 901 | void createVolumeFaces(); |
879 | 902 | ||
880 | protected: | 903 | protected: |
881 | BOOL mUnique; | 904 | BOOL mUnique; |
882 | F32 mDetail; | 905 | F32 mDetail; |
906 | S32 mSculptLevel; | ||
907 | U8 mSculptType; | ||
908 | |||
883 | LLVolumeParams mParams; | 909 | LLVolumeParams mParams; |
884 | LLPath *mPathp; | 910 | LLPath *mPathp; |
885 | LLProfile *mProfilep; | 911 | LLProfile *mProfilep; |