diff options
Diffstat (limited to 'linden/indra/llmath/llvolume.h')
-rw-r--r-- | linden/indra/llmath/llvolume.h | 59 |
1 files changed, 24 insertions, 35 deletions
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index 9dbea7a..c239685 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h | |||
@@ -643,9 +643,8 @@ protected: | |||
643 | class LLProfile | 643 | class LLProfile |
644 | { | 644 | { |
645 | public: | 645 | public: |
646 | LLProfile(const LLProfileParams ¶ms) | 646 | LLProfile() |
647 | : mParams(params), | 647 | : mOpen(FALSE), |
648 | mOpen(FALSE), | ||
649 | mConcave(FALSE), | 648 | mConcave(FALSE), |
650 | mDirty(TRUE), | 649 | mDirty(TRUE), |
651 | mTotalOut(0), | 650 | mTotalOut(0), |
@@ -657,15 +656,12 @@ public: | |||
657 | 656 | ||
658 | S32 getTotal() const { return mTotal; } | 657 | S32 getTotal() const { return mTotal; } |
659 | S32 getTotalOut() const { return mTotalOut; } // Total number of outside points | 658 | S32 getTotalOut() const { return mTotalOut; } // Total number of outside points |
660 | BOOL isHollow() const { return (mParams.getHollow() > 0); } | ||
661 | BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); } | 659 | BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); } |
662 | BOOL isOpen() const { return mOpen; } | 660 | BOOL isOpen() const { return mOpen; } |
663 | void setDirty() { mDirty = TRUE; } | 661 | void setDirty() { mDirty = TRUE; } |
664 | BOOL generate(BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE); | 662 | BOOL generate(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
665 | BOOL isConcave() const { return mConcave; } | 663 | BOOL isConcave() const { return mConcave; } |
666 | public: | 664 | public: |
667 | const LLProfileParams &mParams; | ||
668 | |||
669 | struct Face | 665 | struct Face |
670 | { | 666 | { |
671 | S32 mIndex; | 667 | S32 mIndex; |
@@ -687,10 +683,10 @@ public: | |||
687 | friend std::ostream& operator<<(std::ostream &s, const LLProfile &profile); | 683 | friend std::ostream& operator<<(std::ostream &s, const LLProfile &profile); |
688 | 684 | ||
689 | protected: | 685 | protected: |
690 | void genNormals(); | 686 | void genNormals(const LLProfileParams& params); |
691 | void genNGon(S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); | 687 | void genNGon(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); |
692 | 688 | ||
693 | Face* addHole(BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0); | 689 | Face* addHole(const LLProfileParams& params, BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0); |
694 | Face* addCap (S16 faceID); | 690 | Face* addCap (S16 faceID); |
695 | Face* addFace(S32 index, S32 count, F32 scaleU, S16 faceID, BOOL flat); | 691 | Face* addFace(S32 index, S32 count, F32 scaleU, S16 faceID, BOOL flat); |
696 | 692 | ||
@@ -720,9 +716,8 @@ public: | |||
720 | }; | 716 | }; |
721 | 717 | ||
722 | public: | 718 | public: |
723 | LLPath(const LLPathParams ¶ms) | 719 | LLPath() |
724 | : mParams(params), | 720 | : mOpen(FALSE), |
725 | mOpen(FALSE), | ||
726 | mTotal(0), | 721 | mTotal(0), |
727 | mDirty(TRUE), | 722 | mDirty(TRUE), |
728 | mStep(1) | 723 | mStep(1) |
@@ -731,8 +726,8 @@ public: | |||
731 | 726 | ||
732 | virtual ~LLPath(); | 727 | virtual ~LLPath(); |
733 | 728 | ||
734 | void genNGon(S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); | 729 | void genNGon(const LLPathParams& params, S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); |
735 | virtual BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); | 730 | virtual BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
736 | 731 | ||
737 | BOOL isOpen() const { return mOpen; } | 732 | BOOL isOpen() const { return mOpen; } |
738 | F32 getStep() const { return mStep; } | 733 | F32 getStep() const { return mStep; } |
@@ -745,7 +740,6 @@ public: | |||
745 | friend std::ostream& operator<<(std::ostream &s, const LLPath &path); | 740 | friend std::ostream& operator<<(std::ostream &s, const LLPath &path); |
746 | 741 | ||
747 | public: | 742 | public: |
748 | const LLPathParams &mParams; | ||
749 | std::vector<PathPt> mPath; | 743 | std::vector<PathPt> mPath; |
750 | 744 | ||
751 | protected: | 745 | protected: |
@@ -758,8 +752,8 @@ protected: | |||
758 | class LLDynamicPath : public LLPath | 752 | class LLDynamicPath : public LLPath |
759 | { | 753 | { |
760 | public: | 754 | public: |
761 | LLDynamicPath(const LLPathParams ¶ms) : LLPath(params) { } | 755 | LLDynamicPath() : LLPath() { } |
762 | BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); | 756 | /*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE); |
763 | }; | 757 | }; |
764 | 758 | ||
765 | // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) | 759 | // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) |
@@ -767,7 +761,7 @@ class LLVolumeFace | |||
767 | { | 761 | { |
768 | public: | 762 | public: |
769 | LLVolumeFace(); | 763 | LLVolumeFace(); |
770 | BOOL create(BOOL partial_build = FALSE); | 764 | BOOL create(LLVolume* volume, BOOL partial_build = FALSE); |
771 | void createBinormals(); | 765 | void createBinormals(); |
772 | 766 | ||
773 | class VertexData | 767 | class VertexData |
@@ -811,16 +805,11 @@ public: | |||
811 | std::vector<VertexData> mVertices; | 805 | std::vector<VertexData> mVertices; |
812 | std::vector<U16> mIndices; | 806 | std::vector<U16> mIndices; |
813 | std::vector<S32> mEdge; | 807 | std::vector<S32> mEdge; |
814 | LLVolume *mVolumep; // Deliberately NOT reference counted - djs 11/20/03 - otherwise would make an annoying circular reference | ||
815 | 808 | ||
816 | // Shouldn't need num_old and num_new, really - djs | 809 | private: |
817 | static BOOL updateColors(LLColor4U *old_colors, const S32 num_old, const LLVolumeFace &old_face, | 810 | BOOL createUnCutCubeCap(LLVolume* volume, BOOL partial_build = FALSE); |
818 | LLStrider<LLColor4U> &new_colors, const S32 num_new, const LLVolumeFace &new_face); | 811 | BOOL createCap(LLVolume* volume, BOOL partial_build = FALSE); |
819 | 812 | BOOL createSide(LLVolume* volume, BOOL partial_build = FALSE); | |
820 | protected: | ||
821 | BOOL createUnCutCubeCap(BOOL partial_build = FALSE); | ||
822 | BOOL createCap(BOOL partial_build = FALSE); | ||
823 | BOOL createSide(BOOL partial_build = FALSE); | ||
824 | }; | 813 | }; |
825 | 814 | ||
826 | class LLVolume : public LLRefCount | 815 | class LLVolume : public LLRefCount |
@@ -848,12 +837,12 @@ public: | |||
848 | 837 | ||
849 | LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face = FALSE, const BOOL is_unique = FALSE); | 838 | LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face = FALSE, const BOOL is_unique = FALSE); |
850 | 839 | ||
851 | U8 getProfileType() const { return mProfilep->mParams.getCurveType(); } | 840 | U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); } |
852 | U8 getPathType() const { return mPathp->mParams.getCurveType(); } | 841 | U8 getPathType() const { return mParams.getPathParams().getCurveType(); } |
853 | S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); } | 842 | S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); } |
854 | S32 getNumVolumeFaces() const { return mNumVolumeFaces; } | 843 | S32 getNumVolumeFaces() const { return mVolumeFaces.size(); } |
855 | F32 getDetail() const { return mDetail; } | 844 | F32 getDetail() const { return mDetail; } |
856 | const LLVolumeParams & getParams() const { return mParams; } | 845 | const LLVolumeParams& getParams() const { return mParams; } |
857 | LLVolumeParams getCopyOfParams() const { return mParams; } | 846 | LLVolumeParams getCopyOfParams() const { return mParams; } |
858 | const LLProfile& getProfile() const { return *mProfilep; } | 847 | const LLProfile& getProfile() const { return *mProfilep; } |
859 | LLPath& getPath() const { return *mPathp; } | 848 | LLPath& getPath() const { return *mPathp; } |
@@ -932,8 +921,8 @@ protected: | |||
932 | std::vector<Point> mMesh; | 921 | std::vector<Point> mMesh; |
933 | 922 | ||
934 | BOOL mGenerateSingleFace; | 923 | BOOL mGenerateSingleFace; |
935 | S32 mNumVolumeFaces; | 924 | typedef std::vector<LLVolumeFace> face_list_t; |
936 | LLVolumeFace *mVolumeFaces; | 925 | face_list_t mVolumeFaces; |
937 | }; | 926 | }; |
938 | 927 | ||
939 | std::ostream& operator<<(std::ostream &s, const LLVolumeParams &volume_params); | 928 | std::ostream& operator<<(std::ostream &s, const LLVolumeParams &volume_params); |