diff options
author | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
commit | 089fc07d207c71ce1401e72f09c31ad8c45872e2 (patch) | |
tree | 0028955add042c6f45b47a7b774adeeac9c592cb /linden/indra/llmath | |
parent | Second Life viewer sources 1.16.0.5 (diff) | |
download | meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.zip meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.gz meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.bz2 meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.xz |
Second Life viewer sources 1.17.0.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmath/lloctree.h | 1 | ||||
-rw-r--r-- | linden/indra/llmath/lltreenode.h | 1 | ||||
-rw-r--r-- | linden/indra/llmath/llvolume.cpp | 83 | ||||
-rw-r--r-- | linden/indra/llmath/llvolume.h | 22 |
4 files changed, 59 insertions, 48 deletions
diff --git a/linden/indra/llmath/lloctree.h b/linden/indra/llmath/lloctree.h index 81b9d8c..004b0a2 100644 --- a/linden/indra/llmath/lloctree.h +++ b/linden/indra/llmath/lloctree.h | |||
@@ -57,7 +57,6 @@ public: | |||
57 | typedef LLTreeListener<T> BaseType; | 57 | typedef LLTreeListener<T> BaseType; |
58 | typedef LLOctreeNode<T> oct_node; | 58 | typedef LLOctreeNode<T> oct_node; |
59 | 59 | ||
60 | virtual ~LLOctreeListener() { }; | ||
61 | virtual void handleChildAddition(const oct_node* parent, oct_node* child) = 0; | 60 | virtual void handleChildAddition(const oct_node* parent, oct_node* child) = 0; |
62 | virtual void handleChildRemoval(const oct_node* parent, const oct_node* child) = 0; | 61 | virtual void handleChildRemoval(const oct_node* parent, const oct_node* child) = 0; |
63 | }; | 62 | }; |
diff --git a/linden/indra/llmath/lltreenode.h b/linden/indra/llmath/lltreenode.h index a42a156..a47795d 100644 --- a/linden/indra/llmath/lltreenode.h +++ b/linden/indra/llmath/lltreenode.h | |||
@@ -57,7 +57,6 @@ template <class T> | |||
57 | class LLTreeListener: public LLRefCount | 57 | class LLTreeListener: public LLRefCount |
58 | { | 58 | { |
59 | public: | 59 | public: |
60 | virtual ~LLTreeListener() { }; | ||
61 | virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0; | 60 | virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0; |
62 | virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0; | 61 | virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0; |
63 | virtual void handleDestruction(const LLTreeNode<T>* node) = 0; | 62 | virtual void handleDestruction(const LLTreeNode<T>* node) = 0; |
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index fb745b8..327f1bf 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp | |||
@@ -1829,13 +1829,16 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, | |||
1829 | U32 x = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_width); | 1829 | U32 x = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_width); |
1830 | U32 y = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_height); | 1830 | U32 y = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_height); |
1831 | 1831 | ||
1832 | if (y == sculpt_height) // clamp to bottom row | 1832 | if (y == sculpt_height) // stitch bottom |
1833 | { | ||
1833 | y = sculpt_height - 1; | 1834 | y = sculpt_height - 1; |
1835 | x = sculpt_width / 2; | ||
1836 | } | ||
1834 | 1837 | ||
1835 | if (x == sculpt_width) // stitch sides | 1838 | if (x == sculpt_width) // stitch sides |
1836 | x = 0; | 1839 | x = 0; |
1837 | 1840 | ||
1838 | if ((y == 0) || (y == sculpt_height-1)) // stitch top and bottom | 1841 | if (y == 0) // stitch top |
1839 | x = sculpt_width / 2; | 1842 | x = sculpt_width / 2; |
1840 | 1843 | ||
1841 | U32 index = (x + y * sculpt_width) * sculpt_components; | 1844 | U32 index = (x + y * sculpt_width) * sculpt_components; |
@@ -1847,63 +1850,69 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, | |||
1847 | 1850 | ||
1848 | last_index = index; | 1851 | last_index = index; |
1849 | } | 1852 | } |
1853 | if ((F32)vertex_change / sizeS / sizeT < 0.05) // less than 5% | ||
1854 | data_is_empty = TRUE; | ||
1850 | } | 1855 | } |
1851 | 1856 | ||
1852 | |||
1853 | if ((F32)vertex_change / sizeS / sizeT < 0.05) // less than 5% | ||
1854 | data_is_empty = TRUE; | ||
1855 | |||
1856 | |||
1857 | //generate vertex positions | 1857 | //generate vertex positions |
1858 | // Run along the path. | 1858 | if (data_is_empty) // if empty, make a sphere |
1859 | S32 s = 0, t = 0; | ||
1860 | S32 line = 0; | ||
1861 | while (s < sizeS) | ||
1862 | { | 1859 | { |
1863 | t = 0; | 1860 | S32 line = 0; |
1864 | // Run along the profile. | ||
1865 | while (t < sizeT) | ||
1866 | { | ||
1867 | S32 i = t + line; | ||
1868 | Point& pt = mMesh[i]; | ||
1869 | |||
1870 | U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width); | ||
1871 | U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height); | ||
1872 | 1861 | ||
1873 | if (y == sculpt_height) // clamp to bottom row | 1862 | for (S32 s = 0; s < sizeS; s++) |
1874 | y = sculpt_height - 1; | 1863 | { |
1875 | 1864 | for (S32 t = 0; t < sizeT; t++) | |
1876 | if (x == sculpt_width) // stitch sides | 1865 | { |
1877 | x = 0; | 1866 | S32 i = t + line; |
1867 | Point& pt = mMesh[i]; | ||
1878 | 1868 | ||
1879 | if ((y == 0) || (y == sculpt_height-1)) // stitch top and bottom | ||
1880 | x = sculpt_width / 2; | ||
1881 | 1869 | ||
1882 | |||
1883 | if (data_is_empty) // if empty, make a sphere | ||
1884 | { | ||
1885 | F32 u = (F32)s/(sizeS-1); | 1870 | F32 u = (F32)s/(sizeS-1); |
1886 | F32 v = (F32)t/(sizeT-1); | 1871 | F32 v = (F32)t/(sizeT-1); |
1887 | 1872 | ||
1888 | const F32 RADIUS = (F32) 0.3; | 1873 | const F32 RADIUS = (F32) 0.3; |
1889 | 1874 | ||
1890 | pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS); | 1875 | pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS); |
1891 | pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); | 1876 | pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); |
1892 | pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS); | 1877 | pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS); |
1878 | |||
1893 | } | 1879 | } |
1894 | 1880 | line += sizeT; | |
1895 | else | 1881 | } |
1882 | } | ||
1883 | else | ||
1884 | { | ||
1885 | S32 line = 0; | ||
1886 | for (S32 s = 0; s < sizeS; s++) | ||
1887 | { | ||
1888 | // Run along the profile. | ||
1889 | for (S32 t = 0; t < sizeT; t++) | ||
1896 | { | 1890 | { |
1891 | S32 i = t + line; | ||
1892 | Point& pt = mMesh[i]; | ||
1893 | |||
1894 | U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width); | ||
1895 | U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height); | ||
1896 | |||
1897 | if (y == sculpt_height) // stitch bottom row | ||
1898 | { | ||
1899 | y = sculpt_height - 1; | ||
1900 | x = sculpt_width / 2; | ||
1901 | } | ||
1902 | |||
1903 | if (x == sculpt_width) // stitch sides | ||
1904 | x = 0; | ||
1905 | |||
1906 | if (y == 0) // stitch top row | ||
1907 | x = sculpt_width / 2; | ||
1908 | |||
1897 | U32 index = (x + y * sculpt_width) * sculpt_components; | 1909 | U32 index = (x + y * sculpt_width) * sculpt_components; |
1898 | pt.mPos.mV[0] = sculpt_data[index ] / 256.f - 0.5f; | 1910 | pt.mPos.mV[0] = sculpt_data[index ] / 256.f - 0.5f; |
1899 | pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f; | 1911 | pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f; |
1900 | pt.mPos.mV[2] = sculpt_data[index+2] / 256.f - 0.5f; | 1912 | pt.mPos.mV[2] = sculpt_data[index+2] / 256.f - 0.5f; |
1901 | } | 1913 | } |
1902 | 1914 | line += sizeT; | |
1903 | t++; | ||
1904 | } | 1915 | } |
1905 | line += sizeT; | ||
1906 | s++; | ||
1907 | } | 1916 | } |
1908 | 1917 | ||
1909 | for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++) | 1918 | for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++) |
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index a3e89ab..6ac07f5 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h | |||
@@ -635,12 +635,14 @@ protected: | |||
635 | class LLProfile | 635 | class LLProfile |
636 | { | 636 | { |
637 | public: | 637 | public: |
638 | LLProfile(const LLProfileParams ¶ms) : mParams(params) | 638 | LLProfile(const LLProfileParams ¶ms) |
639 | : mParams(params), | ||
640 | mOpen(FALSE), | ||
641 | mConcave(FALSE), | ||
642 | mDirty(TRUE), | ||
643 | mTotalOut(0), | ||
644 | mTotal(2) | ||
639 | { | 645 | { |
640 | mTotal = 2; | ||
641 | mTotalOut = 0; | ||
642 | mDirty = TRUE; | ||
643 | mConcave = FALSE; | ||
644 | } | 646 | } |
645 | 647 | ||
646 | ~LLProfile(); | 648 | ~LLProfile(); |
@@ -710,11 +712,13 @@ public: | |||
710 | }; | 712 | }; |
711 | 713 | ||
712 | public: | 714 | public: |
713 | LLPath(const LLPathParams ¶ms) : mParams(params) | 715 | LLPath(const LLPathParams ¶ms) |
716 | : mParams(params), | ||
717 | mOpen(FALSE), | ||
718 | mTotal(0), | ||
719 | mDirty(TRUE), | ||
720 | mStep(1) | ||
714 | { | 721 | { |
715 | mOpen = FALSE; | ||
716 | mDirty = TRUE; | ||
717 | mStep = 1; | ||
718 | } | 722 | } |
719 | 723 | ||
720 | virtual ~LLPath(); | 724 | virtual ~LLPath(); |