summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-08-31 14:35:41 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-08-31 14:35:41 -0400
commit822d521e46d70359985e4d6e8ccb34766492a980 (patch)
tree4f9aefc823d6e6840cf6ec55561a502261c4ca93 /indra/llmath
parente58d50e509d060320174c80af647da6ff9a3839f (diff)
parent5e5869c63a05e3d773fc4d19deaff171efa5014c (diff)
merge
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llcalc.cpp25
-rw-r--r--indra/llmath/llcalc.h23
-rw-r--r--indra/llmath/llcalcparser.cpp23
-rw-r--r--indra/llmath/llcalcparser.h23
-rw-r--r--indra/llmath/llmath.h7
-rwxr-xr-xindra/llmath/llvolume.cpp2
6 files changed, 89 insertions, 14 deletions
diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp
index 597d0815fb..1b2d609b67 100644
--- a/indra/llmath/llcalc.cpp
+++ b/indra/llmath/llcalc.cpp
@@ -1,9 +1,26 @@
/*
* LLCalc.cpp
- * SecondLife
- *
- * Created by Aimee Walton on 28/09/2008.
- * Copyright 2008 Aimee Walton.
+ * Copyright 2008 Aimee Walton.
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2008, 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$
*
*/
diff --git a/indra/llmath/llcalc.h b/indra/llmath/llcalc.h
index cc31950cb6..ceb9dce585 100644
--- a/indra/llmath/llcalc.h
+++ b/indra/llmath/llcalc.h
@@ -1,9 +1,26 @@
/*
* LLCalc.h
- * SecondLife
- *
- * Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2008, 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$
*
*/
diff --git a/indra/llmath/llcalcparser.cpp b/indra/llmath/llcalcparser.cpp
index fd55376fa9..b4ca320659 100644
--- a/indra/llmath/llcalcparser.cpp
+++ b/indra/llmath/llcalcparser.cpp
@@ -1,9 +1,26 @@
/*
* LLCalcParser.cpp
- * SecondLife
- *
- * Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2008, 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$
*
*/
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index 600e173661..bd9c8c2519 100644
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -1,9 +1,26 @@
/*
* LLCalcParser.h
- * SecondLife
- *
- * Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2008, 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$
*
*/
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index eea7c977fb..9297bcbac2 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -510,6 +510,13 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
VEC_TYPE Q1 = data[data.size()/4];
VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
+ if ((F32)(Q3-Q1) < 1.f)
+ {
+ // not enough variation to detect outliers
+ return;
+ }
+
+
VEC_TYPE min = (VEC_TYPE) ((F32) Q1-k * (F32) (Q3-Q1));
VEC_TYPE max = (VEC_TYPE) ((F32) Q3+k * (F32) (Q3-Q1));
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index b2fe9ba6c2..1a95f9cd46 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2734,7 +2734,7 @@ void LLVolume::cacheOptimize()
S32 LLVolume::getNumFaces() const
{
- return (S32)mProfilep->mFaces.size();
+ return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size();
}