summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lltreeparams.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-29 07:43:28 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-29 07:56:09 +0300
commit1b68f71348ecf3983b76b40d7940da8377f049b7 (patch)
tree2974eddaef130a067c26033d60a59fc790365b3d /indra/llprimitive/lltreeparams.cpp
parentaf4ea94efc1999f3b19fd8d643d0331f0b77e265 (diff)
#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed
Diffstat (limited to 'indra/llprimitive/lltreeparams.cpp')
-rw-r--r--indra/llprimitive/lltreeparams.cpp262
1 files changed, 131 insertions, 131 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;
-
- mBaseSize = 0.3f;
+// 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;
+
+ mRatio = 0.015f;
+ mRatioPower = 1.3f;
+
+ mLobes = 0;
+ mLobeDepth = .1f;
- mRatio = 0.015f;
- mRatioPower = 1.3f;
+ mFlare = 1.2f;
+ mFlarePercentage = 0.1f;
+ mFlareRes = 3;
- mLobes = 0;
- mLobeDepth = .1f;
+ //mAttractionUp = .5f;
- mFlare = 1.2f;
- mFlarePercentage = 0.1f;
- mFlareRes = 3;
+ mBaseSplits = 0;
- //mAttractionUp = .5f;
+ mScale0 = 2.0;
+ mScaleV0 = 0.0;
- mBaseSplits = 0;
+ // level 0
- mScale0 = 2.0;
- mScaleV0 = 0.0;
+ // scaling
+ mLength[0] = 1.0f;
+ mLengthV[0] = 0;
+ mTaper[0] = 1.0f;
- // level 0
+ // stem splits
+ mSegSplits[0] = 0.15f;
+ mSplitAngle[0] = 15.0f;
+ mSplitAngleV[0] = 10.0f;
- // scaling
- mLength[0] = 1.0f;
- mLengthV[0] = 0;
- mTaper[0] = 1.0f;
+ mVertices[0] = 5;
- // stem splits
- mSegSplits[0] = 0.15f;
- mSplitAngle[0] = 15.0f;
- mSplitAngleV[0] = 10.0f;
+ // curvature
+ mCurveRes[0] = 4;
+ mCurve[0] = 0;
+ mCurveV[0] = 25;
+ mCurveBack[0] = 0;
- mVertices[0] = 5;
-
- // 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;
+ }
}