diff options
| author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
|---|---|---|
| committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
| commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
| tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/llprimitive/lltreeparams.cpp | |
| parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
| parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) | |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/llprimitive/lltreeparams.cpp')
| -rw-r--r-- | indra/llprimitive/lltreeparams.cpp | 258 |
1 files changed, 129 insertions, 129 deletions
diff --git a/indra/llprimitive/lltreeparams.cpp b/indra/llprimitive/lltreeparams.cpp index 19a6db20ae..b85aa3acf2 100644 --- a/indra/llprimitive/lltreeparams.cpp +++ b/indra/llprimitive/lltreeparams.cpp @@ -1,25 +1,25 @@ -/** +/** * @file lltreeparams.cpp * @brief implementation of the LLTreeParams class. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -40,129 +40,129 @@ LLTreeParams::LLTreeParams() { -// LL_INFOS() << "TREE PARAMS INITIALIZED" << LL_ENDL; - // init to basic something or other... - mShape = SR_TEND_FLAME; - mLevels = 1; - mScale = 15; - mScaleV = 0; +// LL_INFOS() << "TREE PARAMS INITIALIZED" << LL_ENDL; + // init to basic something or other... + mShape = SR_TEND_FLAME; + mLevels = 1; + mScale = 15; + mScaleV = 0; + + mBaseSize = 0.3f; - mBaseSize = 0.3f; + mRatio = 0.015f; + mRatioPower = 1.3f; - mRatio = 0.015f; - mRatioPower = 1.3f; + mLobes = 0; + mLobeDepth = .1f; - mLobes = 0; - mLobeDepth = .1f; + mFlare = 1.2f; + mFlarePercentage = 0.1f; + mFlareRes = 3; - mFlare = 1.2f; - mFlarePercentage = 0.1f; - mFlareRes = 3; + //mAttractionUp = .5f; - //mAttractionUp = .5f; + mBaseSplits = 0; - mBaseSplits = 0; + mScale0 = 2.0; + mScaleV0 = 0.0; - mScale0 = 2.0; - mScaleV0 = 0.0; + // level 0 - // level 0 + // scaling + mLength[0] = 1.0f; + mLengthV[0] = 0; + mTaper[0] = 1.0f; - // scaling - mLength[0] = 1.0f; - mLengthV[0] = 0; - mTaper[0] = 1.0f; + // stem splits + mSegSplits[0] = 0.15f; + mSplitAngle[0] = 15.0f; + mSplitAngleV[0] = 10.0f; - // stem splits - mSegSplits[0] = 0.15f; - mSplitAngle[0] = 15.0f; - mSplitAngleV[0] = 10.0f; + mVertices[0] = 5; - mVertices[0] = 5; - - // curvature - mCurveRes[0] = 4; - mCurve[0] = 0; - mCurveV[0] = 25; - mCurveBack[0] = 0; + // curvature + mCurveRes[0] = 4; + mCurve[0] = 0; + mCurveV[0] = 25; + mCurveBack[0] = 0; - // level 1 + // level 1 - // scaling - mLength[1] = .3f; - mLengthV[1] = 0.05f; - mTaper[1] = 1.0f; + // scaling + mLength[1] = .3f; + mLengthV[1] = 0.05f; + mTaper[1] = 1.0f; - // angle params - mDownAngle[0] = 60.0f; - mDownAngleV[0] = 20.0f; - mRotate[0] = 140.0f; - mRotateV[0] = 0.0f; - mBranches[0] = 35; + // angle params + mDownAngle[0] = 60.0f; + mDownAngleV[0] = 20.0f; + mRotate[0] = 140.0f; + mRotateV[0] = 0.0f; + mBranches[0] = 35; - mVertices[1] = 3; + mVertices[1] = 3; - // stem splits - mSplitAngle[1] = 0.0f; - mSplitAngleV[1] = 0.0f; - mSegSplits[1] = 0.0f; + // stem splits + mSplitAngle[1] = 0.0f; + mSplitAngleV[1] = 0.0f; + mSegSplits[1] = 0.0f; - // curvature - mCurveRes[1] = 4; - mCurve[1] = 0; - mCurveV[1] = 0; - mCurveBack[1] = 40; + // curvature + mCurveRes[1] = 4; + mCurve[1] = 0; + mCurveV[1] = 0; + mCurveBack[1] = 40; - // level 2 - mLength[2] = .6f; - mLengthV[2] = .1f; - mTaper[2] = 1; + // level 2 + mLength[2] = .6f; + mLengthV[2] = .1f; + mTaper[2] = 1; - mDownAngle[1] = 30; - mDownAngleV[1] = 10; - mRotate[1] = 140; - mRotateV[1] = 0; + mDownAngle[1] = 30; + mDownAngleV[1] = 10; + mRotate[1] = 140; + mRotateV[1] = 0; - mBranches[1] = 20; - mVertices[2] = 3; + mBranches[1] = 20; + mVertices[2] = 3; - mSplitAngle[2] = 0; - mSplitAngleV[2] = 0; - mSegSplits[2] = 0; + mSplitAngle[2] = 0; + mSplitAngleV[2] = 0; + mSegSplits[2] = 0; - mCurveRes[2] = 3; - mCurve[2] = 10; - mCurveV[2] = 150; - mCurveBack[2] = 0; + mCurveRes[2] = 3; + mCurve[2] = 10; + mCurveV[2] = 150; + mCurveBack[2] = 0; - // level 3 - mLength[3] = .4f; - mLengthV[3] = 0; - mTaper[3] = 1; + // level 3 + mLength[3] = .4f; + mLengthV[3] = 0; + mTaper[3] = 1; - mDownAngle[2] = 45; - mDownAngleV[2] = 10; - mRotate[2] = 140; - mRotateV[2] = 0; + mDownAngle[2] = 45; + mDownAngleV[2] = 10; + mRotate[2] = 140; + mRotateV[2] = 0; - mBranches[2] = 5; - mVertices[3] = 3; + mBranches[2] = 5; + mVertices[3] = 3; - mSplitAngle[3] = 0; - mSplitAngleV[3] = 0; - mSegSplits[3] = 0; + mSplitAngle[3] = 0; + mSplitAngleV[3] = 0; + mSegSplits[3] = 0; - mCurveRes[3] = 2; - mCurve[3] = 0; - mCurveV[3] = 0; - mCurveBack[3] = 0; + mCurveRes[3] = 2; + mCurve[3] = 0; + mCurveV[3] = 0; + mCurveBack[3] = 0; - mLeaves = 0; - mLeafScaleX = 1.0f; - mLeafScaleY = 1.0f; + mLeaves = 0; + mLeafScaleX = 1.0f; + mLeafScaleY = 1.0f; - mLeafQuality = 1.25; + mLeafQuality = 1.25; } LLTreeParams::~LLTreeParams() @@ -170,36 +170,36 @@ LLTreeParams::~LLTreeParams() } -F32 LLTreeParams::ShapeRatio(EShapeRatio shape, F32 ratio) +F32 LLTreeParams::ShapeRatio(EShapeRatio shape, F32 ratio) { - switch (shape) { - case (SR_CONICAL): - return (.2f + .8f * ratio); - case (SR_SPHERICAL): - return (.2f + .8f * sinf(F_PI*ratio)); - case (SR_HEMISPHERICAL): - return (.2f + .8f * sinf(.5*F_PI*ratio)); - case (SR_CYLINDRICAL): - return (1); - case (SR_TAPERED_CYLINDRICAL): - return (.5f + .5f * ratio); - case (SR_FLAME): - if (ratio <= .7f) { - return ratio/.7f; - } else { - return ((1 - ratio)/.3f); - } - case (SR_INVERSE_CONICAL): - return (1 - .8f * ratio); - case (SR_TEND_FLAME): - if (ratio <= .7) { - return (.5f + .5f*(ratio/.7f)); - } else { - return (.5f + .5f * (1 - ratio)/.3f); - } - case (SR_ENVELOPE): - return 1; - default: - return 1; - } + switch (shape) { + case (SR_CONICAL): + return (.2f + .8f * ratio); + case (SR_SPHERICAL): + return (.2f + .8f * sinf(F_PI*ratio)); + case (SR_HEMISPHERICAL): + return (.2f + .8f * sinf(.5*F_PI*ratio)); + case (SR_CYLINDRICAL): + return (1); + case (SR_TAPERED_CYLINDRICAL): + return (.5f + .5f * ratio); + case (SR_FLAME): + if (ratio <= .7f) { + return ratio/.7f; + } else { + return ((1 - ratio)/.3f); + } + case (SR_INVERSE_CONICAL): + return (1 - .8f * ratio); + case (SR_TEND_FLAME): + if (ratio <= .7) { + return (.5f + .5f*(ratio/.7f)); + } else { + return (.5f + .5f * (1 - ratio)/.3f); + } + case (SR_ENVELOPE): + return 1; + default: + return 1; + } } |
