Sync with viewer-tiger~
Syncs up llmath stuffs. Thanks to Shyotl for the CMakeLists fix for Wbemuuid.
This commit is contained in:
@@ -2,31 +2,25 @@
|
||||
* @file llcoordframe.cpp
|
||||
* @brief LLCoordFrame class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llcoordframe.h
|
||||
* @brief LLCoordFrame class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llinterp.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,31 +3,25 @@
|
||||
* @author Andrew Meadows
|
||||
* @brief Simple line class that can compute nearest approach between two lines
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,31 +4,25 @@
|
||||
* @author Andrew Meadows
|
||||
* @brief Simple line for computing nearest approach between two infinite lines
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include "lldefs.h"
|
||||
//#include "llstl.h" // *TODO: Remove when LLString is gone
|
||||
//#include "llstring.h" // *TODO: Remove when LLString is gone
|
||||
@@ -72,15 +73,21 @@ const F32 F_E = 2.71828182845904523536f;
|
||||
const F32 F_SQRT2 = 1.4142135623730950488016887242097f;
|
||||
const F32 F_SQRT3 = 1.73205080756888288657986402541f;
|
||||
const F32 OO_SQRT2 = 0.7071067811865475244008443621049f;
|
||||
const F32 OO_SQRT3 = 0.577350269189625764509f;
|
||||
const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
|
||||
const F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
|
||||
const F32 F_APPROXIMATELY_ZERO = 0.00001f;
|
||||
const F32 F_LN10 = 2.3025850929940456840179914546844f;
|
||||
const F32 OO_LN10 = 0.43429448190325182765112891891661;
|
||||
const F32 F_LN2 = 0.69314718056f;
|
||||
const F32 OO_LN2 = 1.4426950408889634073599246810019f;
|
||||
|
||||
const F32 F_ALMOST_ZERO = 0.0001f;
|
||||
const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO;
|
||||
|
||||
const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees
|
||||
// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle);
|
||||
|
||||
// BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
|
||||
const F32 FP_MAG_THRESHOLD = 0.0000001f;
|
||||
|
||||
@@ -111,6 +118,12 @@ inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f <
|
||||
// WARNING: Infinity is comparable with F32_MAX and negative
|
||||
// infinity is comparable with F32_MIN
|
||||
|
||||
// handles negative and positive zeros
|
||||
inline bool is_zero(F32 x)
|
||||
{
|
||||
return (*(U32*)(&x) & 0x7fffffff) == 0;
|
||||
}
|
||||
|
||||
inline bool is_approx_equal(F32 x, F32 y)
|
||||
{
|
||||
const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "sys.h"
|
||||
#include "llmath.h"
|
||||
|
||||
static LL_ALIGN_16(const F32 M_IDENT_3A[12]) =
|
||||
|
||||
@@ -2,36 +2,28 @@
|
||||
* @file llmodularmath.cpp
|
||||
* @brief LLModularMath class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
// implementation is all in the header, this include dep ensures the unit test is rerun if the implementation changes.
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llmodularmath.h
|
||||
* @brief Useful modular math functions.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2008-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llperlin.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llperlin.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
|
||||
|
||||
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX] * s;
|
||||
mQ[VY] = v.mV[VY] * s;
|
||||
mQ[VZ] = v.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX] * s;
|
||||
mQ[VY] = v.mV[VY] * s;
|
||||
mQ[VZ] = v.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
LLQuaternion::LLQuaternion(const LLVector3 &x_axis,
|
||||
@@ -136,57 +142,61 @@ void LLQuaternion::quantize8(F32 lower, F32 upper)
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)
|
||||
{
|
||||
LLVector3 vec(x, y, z);
|
||||
vec.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = vec.mV[VX]*s;
|
||||
mQ[VY] = vec.mV[VY]*s;
|
||||
mQ[VZ] = vec.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(x * x + y * y + z * z);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = x * s;
|
||||
mQ[VY] = y * s;
|
||||
mQ[VZ] = z * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
@@ -219,68 +229,80 @@ const LLQuaternion& LLQuaternion::set(const LLMatrix4 &mat)
|
||||
// deprecated
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)
|
||||
{
|
||||
LLVector3 vec(x, y, z);
|
||||
vec.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = vec.mV[VX]*s;
|
||||
mQ[VY] = vec.mV[VY]*s;
|
||||
mQ[VZ] = vec.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(x * x + y * y + z * z);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = x * s;
|
||||
mQ[VY] = y * s;
|
||||
mQ[VZ] = z * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)
|
||||
{
|
||||
LLMatrix3 rot_mat(roll, pitch, yaw);
|
||||
rot_mat.orthogonalize();
|
||||
*this = rot_mat.quaternion();
|
||||
|
||||
normalize();
|
||||
roll *= 0.5f;
|
||||
pitch *= 0.5f;
|
||||
yaw *= 0.5f;
|
||||
F32 sinX = sinf(roll);
|
||||
F32 cosX = cosf(roll);
|
||||
F32 sinY = sinf(pitch);
|
||||
F32 cosY = cosf(pitch);
|
||||
F32 sinZ = sinf(yaw);
|
||||
F32 cosZ = cosf(yaw);
|
||||
mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ;
|
||||
mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ;
|
||||
mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ;
|
||||
mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
@@ -425,68 +447,44 @@ LLMatrix4 LLQuaternion::getMatrix4(void) const
|
||||
// calculate the shortest rotation from a to b
|
||||
void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)
|
||||
{
|
||||
// Make a local copy of both vectors.
|
||||
LLVector3 vec_a = a;
|
||||
LLVector3 vec_b = b;
|
||||
|
||||
// Make sure neither vector is zero length. Also normalize
|
||||
// the vectors while we are at it.
|
||||
F32 vec_a_mag = vec_a.normalize();
|
||||
F32 vec_b_mag = vec_b.normalize();
|
||||
if (vec_a_mag < F_APPROXIMATELY_ZERO ||
|
||||
vec_b_mag < F_APPROXIMATELY_ZERO)
|
||||
F32 ab = a * b; // dotproduct
|
||||
LLVector3 c = a % b; // crossproduct
|
||||
F32 cc = c * c; // squared length of the crossproduct
|
||||
if (ab * ab + cc) // test if the arguments have sufficient magnitude
|
||||
{
|
||||
// Can't calculate a rotation from this.
|
||||
// Just return ZERO_ROTATION instead.
|
||||
loadIdentity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Create an axis to rotate around, and the cos of the angle to rotate.
|
||||
LLVector3 axis = vec_a % vec_b;
|
||||
F32 cos_theta = vec_a * vec_b;
|
||||
|
||||
// Check the angle between the vectors to see if they are parallel or anti-parallel.
|
||||
if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO)
|
||||
{
|
||||
// a and b are parallel. No rotation is necessary.
|
||||
loadIdentity();
|
||||
}
|
||||
else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO)
|
||||
{
|
||||
// a and b are anti-parallel.
|
||||
// Rotate 180 degrees around some orthogonal axis.
|
||||
// Find the projection of the x-axis onto a, and try
|
||||
// using the vector between the projection and the x-axis
|
||||
// as the orthogonal axis.
|
||||
LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a;
|
||||
LLVector3 ortho_axis(1.f, 0.f, 0.f);
|
||||
ortho_axis -= proj;
|
||||
|
||||
// Turn this into an orthonormal axis.
|
||||
F32 ortho_length = ortho_axis.normalize();
|
||||
// If the axis' length is 0, then our guess at an orthogonal axis
|
||||
// was wrong (a is parallel to the x-axis).
|
||||
if (ortho_length < F_APPROXIMATELY_ZERO)
|
||||
if (cc > 0.0f) // test if the arguments are (anti)parallel
|
||||
{
|
||||
// Use the z-axis instead.
|
||||
ortho_axis.setVec(0.f, 0.f, 1.f);
|
||||
F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line
|
||||
F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion
|
||||
mQ[VX] = c.mV[VX] * m;
|
||||
mQ[VY] = c.mV[VY] * m;
|
||||
mQ[VZ] = c.mV[VZ] * m;
|
||||
mQ[VW] = s * m;
|
||||
return;
|
||||
}
|
||||
if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel)
|
||||
{
|
||||
c = a - b; // the arguments are anti-parallel, we have to choose an axis
|
||||
F32 m = sqrtf(c.mV[VX] * c.mV[VX] + c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane
|
||||
if (m > FP_MAG_THRESHOLD)
|
||||
{
|
||||
mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane
|
||||
mQ[VY] = c.mV[VX] / m;
|
||||
mQ[VZ] = 0.0f;
|
||||
mQ[VW] = 0.0f;
|
||||
return;
|
||||
}
|
||||
else // the vectors are parallel to the Z-axis
|
||||
{
|
||||
mQ[VX] = 1.0f; // rotate around the X-axis
|
||||
mQ[VY] = 0.0f;
|
||||
mQ[VZ] = 0.0f;
|
||||
mQ[VW] = 0.0f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a quaternion from this orthonormal axis.
|
||||
mQ[VX] = ortho_axis.mV[VX];
|
||||
mQ[VY] = ortho_axis.mV[VY];
|
||||
mQ[VZ] = ortho_axis.mV[VZ];
|
||||
mQ[VW] = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// a and b are NOT parallel or anti-parallel.
|
||||
// Return the rotation between these vectors.
|
||||
F32 theta = (F32)acos(cos_theta);
|
||||
|
||||
setAngleAxis(theta, axis);
|
||||
}
|
||||
loadIdentity();
|
||||
}
|
||||
|
||||
// constrains rotation to a cone angle specified in radians
|
||||
@@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )
|
||||
|
||||
void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const
|
||||
{
|
||||
F32 cos_a = mQ[VW];
|
||||
if (cos_a > 1.0f) cos_a = 1.0f;
|
||||
if (cos_a < -1.0f) cos_a = -1.0f;
|
||||
|
||||
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
|
||||
|
||||
if ( fabs( sin_a ) < 0.0005f )
|
||||
sin_a = 1.0f;
|
||||
else
|
||||
sin_a = 1.f/sin_a;
|
||||
|
||||
F32 temp_angle = 2.0f * (F32) acos( cos_a );
|
||||
if (temp_angle > F_PI)
|
||||
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
|
||||
if (v > FP_MAG_THRESHOLD)
|
||||
{
|
||||
// The (angle,axis) pair should never have angles outside [PI, -PI]
|
||||
// since we want the _shortest_ (angle,axis) solution.
|
||||
// Since acos is defined for [0, PI], and we multiply by 2.0, we
|
||||
// can push the angle outside the acceptible range.
|
||||
// When this happens we set the angle to the other portion of a
|
||||
// full 2PI rotation, and negate the axis, which reverses the
|
||||
// direction of the rotation (by the right-hand rule).
|
||||
*angle = 2.f * F_PI - temp_angle;
|
||||
vec.mV[VX] = - mQ[VX] * sin_a;
|
||||
vec.mV[VY] = - mQ[VY] * sin_a;
|
||||
vec.mV[VZ] = - mQ[VZ] * sin_a;
|
||||
F32 oomag = 1.0f / v;
|
||||
F32 w = mQ[VW];
|
||||
if (mQ[VW] < 0.0f)
|
||||
{
|
||||
w = -w; // make VW positive
|
||||
oomag = -oomag; // invert the axis
|
||||
}
|
||||
vec.mV[VX] = mQ[VX] * oomag; // normalize the axis
|
||||
vec.mV[VY] = mQ[VY] * oomag;
|
||||
vec.mV[VZ] = mQ[VZ] * oomag;
|
||||
*angle = 2.0f * atan2f(v, w); // get the angle
|
||||
}
|
||||
else
|
||||
{
|
||||
*angle = temp_angle;
|
||||
vec.mV[VX] = mQ[VX] * sin_a;
|
||||
vec.mV[VY] = mQ[VY] * sin_a;
|
||||
vec.mV[VZ] = mQ[VZ] * sin_a;
|
||||
*angle = 0.0f; // no rotation
|
||||
vec.mV[VX] = 0.0f; // around some dummy axis
|
||||
vec.mV[VY] = 0.0f;
|
||||
vec.mV[VZ] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// quaternion does not need to be normalized
|
||||
void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
|
||||
{
|
||||
LLMatrix3 rot_mat(*this);
|
||||
rot_mat.orthogonalize();
|
||||
rot_mat.getEulerAngles(roll, pitch, yaw);
|
||||
|
||||
// // NOTE: LLQuaternion's are actually inverted with respect to
|
||||
// // the matrices, so this code also assumes inverted quaternions
|
||||
// // (-x, -y, -z, w). The result is that roll,pitch,yaw are applied
|
||||
// // in reverse order (yaw,pitch,roll).
|
||||
// F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW];
|
||||
// F64 m20 = 2.0*(x*z-y*w);
|
||||
// if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO)
|
||||
// {
|
||||
// *roll = 0.0f;
|
||||
// *pitch = (F32)asin(m20);
|
||||
// *yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// *roll = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y));
|
||||
// *pitch = (F32)asin(m20);
|
||||
// *yaw = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z));
|
||||
// }
|
||||
F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll
|
||||
F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch
|
||||
F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1
|
||||
F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2
|
||||
F32 cx = ys - xz; // cosine of the roll
|
||||
F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch
|
||||
if (cy > GIMBAL_THRESHOLD) // no gimbal lock
|
||||
{
|
||||
*roll = atan2f(sx, cx);
|
||||
*pitch = atan2f(sy, cy);
|
||||
*yaw = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz);
|
||||
}
|
||||
else // gimbal lock
|
||||
{
|
||||
if (sy > 0)
|
||||
{
|
||||
*pitch = F_PI_BY_TWO;
|
||||
*yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]);
|
||||
}
|
||||
else
|
||||
{
|
||||
*pitch = -F_PI_BY_TWO;
|
||||
*yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]);
|
||||
}
|
||||
*roll = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Saves space by using the fact that our quaternions are normalized
|
||||
LLVector3 LLQuaternion::packToVector3() const
|
||||
{
|
||||
F32 x = mQ[VX];
|
||||
F32 y = mQ[VY];
|
||||
F32 z = mQ[VZ];
|
||||
F32 w = mQ[VW];
|
||||
F32 mag = sqrtf(x * x + y * y + z * z + w * w);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
x /= mag;
|
||||
y /= mag;
|
||||
z /= mag; // no need to normalize w, it's not used
|
||||
}
|
||||
if( mQ[VW] >= 0 )
|
||||
{
|
||||
return LLVector3( mQ[VX], mQ[VY], mQ[VZ] );
|
||||
return LLVector3( x, y , z );
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] );
|
||||
return LLVector3( -x, -y, -z );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,43 +304,29 @@ inline const LLQuaternion& LLQuaternion::setQuat(const F32 *q)
|
||||
return (*this);
|
||||
}
|
||||
|
||||
// There may be a cheaper way that avoids the sqrt.
|
||||
// Does sin_a = VX*VX + VY*VY + VZ*VZ?
|
||||
// Copied from Matrix and Quaternion FAQ 1.12
|
||||
inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const
|
||||
{
|
||||
F32 cos_a = mQ[VW];
|
||||
if (cos_a > 1.0f) cos_a = 1.0f;
|
||||
if (cos_a < -1.0f) cos_a = -1.0f;
|
||||
|
||||
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
|
||||
|
||||
if ( fabs( sin_a ) < 0.0005f )
|
||||
sin_a = 1.0f;
|
||||
else
|
||||
sin_a = 1.f/sin_a;
|
||||
|
||||
F32 temp_angle = 2.0f * (F32) acos( cos_a );
|
||||
if (temp_angle > F_PI)
|
||||
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
|
||||
if (v > FP_MAG_THRESHOLD)
|
||||
{
|
||||
// The (angle,axis) pair should never have angles outside [PI, -PI]
|
||||
// since we want the _shortest_ (angle,axis) solution.
|
||||
// Since acos is defined for [0, PI], and we multiply by 2.0, we
|
||||
// can push the angle outside the acceptible range.
|
||||
// When this happens we set the angle to the other portion of a
|
||||
// full 2PI rotation, and negate the axis, which reverses the
|
||||
// direction of the rotation (by the right-hand rule).
|
||||
*angle = 2.f * F_PI - temp_angle;
|
||||
*x = - mQ[VX] * sin_a;
|
||||
*y = - mQ[VY] * sin_a;
|
||||
*z = - mQ[VZ] * sin_a;
|
||||
F32 oomag = 1.0f / v;
|
||||
F32 w = mQ[VW];
|
||||
if (w < 0.0f)
|
||||
{
|
||||
w = -w; // make VW positive
|
||||
oomag = -oomag; // invert the axis
|
||||
}
|
||||
*x = mQ[VX] * oomag; // normalize the axis
|
||||
*y = mQ[VY] * oomag;
|
||||
*z = mQ[VZ] * oomag;
|
||||
*angle = 2.0f * atan2f(v, w); // get the angle
|
||||
}
|
||||
else
|
||||
{
|
||||
*angle = temp_angle;
|
||||
*x = mQ[VX] * sin_a;
|
||||
*y = mQ[VY] * sin_a;
|
||||
*z = mQ[VZ] * sin_a;
|
||||
*angle = 0.0f; // no rotation
|
||||
*x = 0.0f; // around some dummy axis
|
||||
*y = 0.0f;
|
||||
*z = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1649,7 +1649,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
||||
F32 t = (F32)i * mStep;
|
||||
mPath[i].mPos.set(0,
|
||||
lerp(0, -sin(F_PI*params.getTwist()*t)*0.5f,t),
|
||||
lerp(-0.5, cos(F_PI*params.getTwist()*t)*0.5f,t));
|
||||
lerp(-0.5f, cos(F_PI*params.getTwist()*t)*0.5f,t));
|
||||
mPath[i].mScale.set(lerp(1,params.getScale().mV[0],t),
|
||||
lerp(1,params.getScale().mV[1],t), 0,1);
|
||||
mPath[i].mTexT = t;
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llvolumemgr.h
|
||||
* @brief LLVolumeMgr class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m3math.cpp
|
||||
* @brief LLMatrix3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m3math.h
|
||||
* @brief LLMatrix3 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m4math.cpp
|
||||
* @brief LLMatrix4 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -684,37 +678,6 @@ const LLMatrix4& LLMatrix4::initMatrix(const LLMatrix3 &mat, const LLVector4 &
|
||||
|
||||
// LLMatrix4 Operators
|
||||
|
||||
|
||||
/* Not implemented to help enforce code consistency with the syntax of
|
||||
row-major notation. This is a Good Thing.
|
||||
LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b)
|
||||
{
|
||||
// Operate "to the right" on column-vector b
|
||||
LLVector4 vec;
|
||||
vec.mV[VX] = a.mMatrix[VX][VX] * b.mV[VX] +
|
||||
a.mMatrix[VY][VX] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VX] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VX] * b.mV[VW];
|
||||
|
||||
vec.mV[VY] = a.mMatrix[VX][VY] * b.mV[VX] +
|
||||
a.mMatrix[VY][VY] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VY] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VY] * b.mV[VW];
|
||||
|
||||
vec.mV[VZ] = a.mMatrix[VX][VZ] * b.mV[VX] +
|
||||
a.mMatrix[VY][VZ] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VZ] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VZ] * b.mV[VW];
|
||||
|
||||
vec.mV[VW] = a.mMatrix[VX][VW] * b.mV[VX] +
|
||||
a.mMatrix[VY][VW] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VW] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VW] * b.mV[VW];
|
||||
return vec;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b)
|
||||
{
|
||||
// Operate "to the left" on row-vector a
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m4math.h
|
||||
* @brief LLMatrix4 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -229,9 +223,6 @@ public:
|
||||
// Operators
|
||||
//
|
||||
|
||||
// Not implemented to enforce code that agrees with symbolic syntax
|
||||
// friend LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b); // Apply rotation a to vector b
|
||||
|
||||
// friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b
|
||||
friend LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b); // Return transform of vector a by matrix b
|
||||
friend const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b); // Return full transform of a by matrix b
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file raytrace.cpp
|
||||
* @brief Functions called by box object scripts.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file raytrace.h
|
||||
* @brief Ray intersection tests for primitives.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v2math.cpp
|
||||
* @brief LLVector2 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v2math.h
|
||||
* @brief LLVector2 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3color.cpp
|
||||
* @brief LLColor3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3color.h
|
||||
* @brief LLColor3 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -39,6 +33,7 @@ class LLVector4;
|
||||
#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
#include "llsd.h"
|
||||
#include <string.h>
|
||||
|
||||
// LLColor3 = |r g b|
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3dmath.cpp
|
||||
* @brief LLVector3d class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -72,17 +72,22 @@ class LLVector3d
|
||||
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
|
||||
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
|
||||
|
||||
inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clearVec(); // deprecated
|
||||
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
|
||||
inline const LLVector3d& zeroVec(); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec);
|
||||
inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const LLVector3 &vec);
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 *vec); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
|
||||
|
||||
F64 magVec() const; // Returns magnitude of LLVector3d
|
||||
F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
|
||||
inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
|
||||
F64 magVec() const; // deprecated
|
||||
F64 magVecSquared() const; // deprecated
|
||||
inline F64 normVec(); // deprecated
|
||||
|
||||
F64 length() const; // Returns magnitude of LLVector3d
|
||||
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
|
||||
@@ -127,7 +132,15 @@ class LLVector3d
|
||||
|
||||
typedef LLVector3d LLGlobalVec;
|
||||
|
||||
const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
mdV[2] = vec.mV[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
@@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
|
||||
|
||||
// Clear and Assignment Functions
|
||||
|
||||
inline const LLVector3d& LLVector3d::clear(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
mdV[1] = 0.f;
|
||||
mdV[2]= 0.f;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::clearVec(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
@@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
mdV[VY] = y;
|
||||
mdV[VZ] = z;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
|
||||
{
|
||||
mdV[0] = vec.mdV[0];
|
||||
mdV[1] = vec.mdV[1];
|
||||
mdV[2] = vec.mdV[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 *vec)
|
||||
{
|
||||
mdV[0] = vec[0];
|
||||
mdV[1] = vec[1];
|
||||
mdV[2] = vec[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
@@ -472,4 +517,15 @@ inline LLVector3d projected_vec(const LLVector3d &a, const LLVector3d &b)
|
||||
return project_axis * (a * project_axis);
|
||||
}
|
||||
|
||||
inline LLVector3d inverse_projected_vec(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3d normalized_b = b;
|
||||
F64 b_length = normalized_b.normalize();
|
||||
|
||||
F64 dot_product = normalized_a * normalized_b;
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
#endif // LL_V3DMATH_H
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3math.cpp
|
||||
* @brief LLVector3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -159,6 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
|
||||
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
|
||||
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
|
||||
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
|
||||
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
|
||||
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
|
||||
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
|
||||
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
|
||||
@@ -490,9 +491,27 @@ inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
|
||||
|
||||
inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
|
||||
{
|
||||
LLVector3 project_axis = b;
|
||||
project_axis.normalize();
|
||||
return project_axis * (a * project_axis);
|
||||
F32 bb = b * b;
|
||||
if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
|
||||
{
|
||||
return ((a * b) / bb) * b;
|
||||
}
|
||||
else
|
||||
{
|
||||
return b.zero;
|
||||
}
|
||||
}
|
||||
|
||||
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
|
||||
{
|
||||
LLVector3 normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3 normalized_b = b;
|
||||
F32 b_length = normalized_b.normalize();
|
||||
|
||||
F32 dot_product = normalized_a * normalized_b;
|
||||
//NB: if a _|_ b, then returns an infinite vector
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
|
||||
@@ -556,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)
|
||||
|
||||
inline F32 angle_between(const LLVector3& a, const LLVector3& b)
|
||||
{
|
||||
LLVector3 an = a;
|
||||
LLVector3 bn = b;
|
||||
an.normalize();
|
||||
bn.normalize();
|
||||
F32 cosine = an * bn;
|
||||
F32 angle = (cosine >= 1.0f) ? 0.0f :
|
||||
(cosine <= -1.0f) ? F_PI :
|
||||
(F32)acos(cosine);
|
||||
return angle;
|
||||
F32 ab = a * b; // dotproduct
|
||||
if (ab == -0.0f)
|
||||
{
|
||||
ab = 0.0f; // get rid of negative zero
|
||||
}
|
||||
LLVector3 c = a % b; // crossproduct
|
||||
return atan2f(sqrtf(c * c), ab); // return the angle
|
||||
}
|
||||
|
||||
inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4coloru.cpp
|
||||
* @brief LLColor4U class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4math.cpp
|
||||
* @brief LLVector4 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4math.h
|
||||
* @brief LLVector4 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file xform.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -42,7 +36,7 @@ LLXform::~LLXform()
|
||||
{
|
||||
}
|
||||
|
||||
// Link optimization - don't inline these llwarns
|
||||
// Link optimization - don't inline these LL_WARNS()
|
||||
void LLXform::warn(const char* const msg)
|
||||
{
|
||||
llwarns << msg << llendl;
|
||||
|
||||
@@ -103,9 +103,9 @@ public:
|
||||
inline void setRotation(const F32 x, const F32 y, const F32 z, const F32 s);
|
||||
|
||||
// Above functions must be inline for speed, but also
|
||||
// need to emit warnings. llwarns causes inline LLError::CallSite
|
||||
// need to emit warnings. LL_WARNS() causes inline LLError::CallSite
|
||||
// static objects that make more work for the linker.
|
||||
// Avoid inline llwarns by calling this function.
|
||||
// Avoid inline LL_WARNS() by calling this function.
|
||||
void warn(const char* const msg);
|
||||
|
||||
void setChanged(const U32 bits) { mChanged |= bits; }
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lldxhardware.cpp
|
||||
* @brief LLDXHardware implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -40,9 +34,12 @@
|
||||
#include <dxdiag.h>
|
||||
#undef INITGUID
|
||||
|
||||
#include <wbemidl.h>
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
|
||||
#include "lldxhardware.h"
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
#include "llstring.h"
|
||||
@@ -59,11 +56,160 @@ LLDXHardware gDXHardware;
|
||||
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
|
||||
std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
typedef BOOL ( WINAPI* PfnCoSetProxyBlanket )( IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc,
|
||||
OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel,
|
||||
RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities );
|
||||
|
||||
HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam )
|
||||
{
|
||||
HRESULT hr;
|
||||
HRESULT hr;
|
||||
bool bGotMemory = false;
|
||||
HRESULT hrCoInitialize = S_OK;
|
||||
IWbemLocator* pIWbemLocator = nullptr;
|
||||
IWbemServices* pIWbemServices = nullptr;
|
||||
BSTR pNamespace = nullptr;
|
||||
|
||||
*pdwAdapterRam = 0;
|
||||
hrCoInitialize = CoInitialize( 0 );
|
||||
|
||||
hr = CoCreateInstance( CLSID_WbemLocator,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_IWbemLocator,
|
||||
( LPVOID* )&pIWbemLocator );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: CoCreateInstance failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
|
||||
if( SUCCEEDED( hr ) && pIWbemLocator )
|
||||
{
|
||||
// Using the locator, connect to WMI in the given namespace.
|
||||
pNamespace = SysAllocString( L"\\\\.\\root\\cimv2" );
|
||||
|
||||
hr = pIWbemLocator->ConnectServer( pNamespace, nullptr, nullptr, 0L,
|
||||
0L, nullptr, nullptr, &pIWbemServices );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pIWbemLocator->ConnectServer failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) && pIWbemServices != 0 )
|
||||
{
|
||||
HINSTANCE hinstOle32 = nullptr;
|
||||
|
||||
hinstOle32 = LoadLibraryW( L"ole32.dll" );
|
||||
if( hinstOle32 )
|
||||
{
|
||||
PfnCoSetProxyBlanket pfnCoSetProxyBlanket = nullptr;
|
||||
|
||||
pfnCoSetProxyBlanket = ( PfnCoSetProxyBlanket )GetProcAddress( hinstOle32, "CoSetProxyBlanket" );
|
||||
if( pfnCoSetProxyBlanket != 0 )
|
||||
{
|
||||
// Switch security level to IMPERSONATE.
|
||||
pfnCoSetProxyBlanket( pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr,
|
||||
RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, nullptr, 0 );
|
||||
}
|
||||
|
||||
FreeLibrary( hinstOle32 );
|
||||
}
|
||||
|
||||
IEnumWbemClassObject* pEnumVideoControllers = nullptr;
|
||||
BSTR pClassName = nullptr;
|
||||
|
||||
pClassName = SysAllocString( L"Win32_VideoController" );
|
||||
|
||||
hr = pIWbemServices->CreateInstanceEnum( pClassName, 0,
|
||||
nullptr, &pEnumVideoControllers );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pIWbemServices->CreateInstanceEnum failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
|
||||
if( SUCCEEDED( hr ) && pEnumVideoControllers )
|
||||
{
|
||||
IWbemClassObject* pVideoControllers[10] = {0};
|
||||
DWORD uReturned = 0;
|
||||
BSTR pPropName = nullptr;
|
||||
|
||||
// Get the first one in the list
|
||||
pEnumVideoControllers->Reset();
|
||||
hr = pEnumVideoControllers->Next( 5000, // timeout in 5 seconds
|
||||
10, // return the first 10
|
||||
pVideoControllers,
|
||||
&uReturned );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pEnumVideoControllers->Next failed: 0x%0.8x\n", hr );
|
||||
if( uReturned == 0 ) wprintf( L"WMI: pEnumVideoControllers uReturned == 0\n" );
|
||||
#endif
|
||||
|
||||
VARIANT var;
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
bool bFound = false;
|
||||
for( UINT iController = 0; iController < uReturned; iController++ )
|
||||
{
|
||||
if ( !pVideoControllers[iController] )
|
||||
continue;
|
||||
|
||||
pPropName = SysAllocString( L"PNPDeviceID" );
|
||||
hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) )
|
||||
wprintf( L"WMI: pVideoControllers[iController]->Get PNPDeviceID failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
if( wcsstr( var.bstrVal, strInputDeviceID ) != 0 )
|
||||
bFound = true;
|
||||
}
|
||||
VariantClear( &var );
|
||||
if( pPropName ) SysFreeString( pPropName );
|
||||
|
||||
if( bFound )
|
||||
{
|
||||
pPropName = SysAllocString( L"AdapterRAM" );
|
||||
hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) )
|
||||
wprintf( L"WMI: pVideoControllers[iController]->Get AdapterRAM failed: 0x%0.8x\n",
|
||||
hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
bGotMemory = true;
|
||||
*pdwAdapterRam = var.ulVal;
|
||||
}
|
||||
VariantClear( &var );
|
||||
if( pPropName ) SysFreeString( pPropName );
|
||||
break;
|
||||
}
|
||||
SAFE_RELEASE( pVideoControllers[iController] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pClassName )
|
||||
SysFreeString( pClassName );
|
||||
SAFE_RELEASE( pEnumVideoControllers );
|
||||
}
|
||||
|
||||
if( pNamespace )
|
||||
SysFreeString( pNamespace );
|
||||
SAFE_RELEASE( pIWbemServices );
|
||||
}
|
||||
|
||||
SAFE_RELEASE( pIWbemLocator );
|
||||
|
||||
if( SUCCEEDED( hrCoInitialize ) )
|
||||
CoUninitialize();
|
||||
|
||||
if( bGotMemory )
|
||||
return S_OK;
|
||||
else
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPropValue, int outputSize)
|
||||
{
|
||||
HRESULT hr;
|
||||
VARIANT var;
|
||||
WCHAR wszPropValue[256];
|
||||
|
||||
VariantInit( &var );
|
||||
hr = containerp->GetProp(wszPropName, &var );
|
||||
@@ -82,13 +228,19 @@ std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); /* Flawfinder: ignore */
|
||||
break;
|
||||
case VT_BSTR:
|
||||
wcsncpy( wszPropValue, var.bstrVal, 255 ); /* Flawfinder: ignore */
|
||||
wszPropValue[255] = 0;
|
||||
wcsncpy( wszPropValue, var.bstrVal, outputSize-1 ); /* Flawfinder: ignore */
|
||||
wszPropValue[outputSize-1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Clear the variant (this is needed to free BSTR memory)
|
||||
VariantClear( &var );
|
||||
}
|
||||
|
||||
std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
{
|
||||
WCHAR wszPropValue[256];
|
||||
get_wstring(containerp, wszPropName, wszPropValue, 256);
|
||||
|
||||
return utf16str_to_utf8str(wszPropValue);
|
||||
}
|
||||
@@ -126,7 +278,7 @@ BOOL LLVersion::set(const std::string &version_string)
|
||||
}
|
||||
if (count < 4)
|
||||
{
|
||||
//llwarns << "Potentially bogus version string!" << version_string << llendl;
|
||||
//LL_WARNS() << "Potentially bogus version string!" << version_string << LL_ENDL;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
mFields[i] = 0;
|
||||
@@ -177,6 +329,7 @@ std::string LLDXDriverFile::dump()
|
||||
LLDXDevice::~LLDXDevice()
|
||||
{
|
||||
for_each(mDriverFiles.begin(), mDriverFiles.end(), DeletePairedPointer());
|
||||
mDriverFiles.clear();
|
||||
}
|
||||
|
||||
std::string LLDXDevice::dump()
|
||||
@@ -236,6 +389,7 @@ LLDXHardware::LLDXHardware()
|
||||
void LLDXHardware::cleanup()
|
||||
{
|
||||
// for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer());
|
||||
// mDevices.clear();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -365,8 +519,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
|
||||
goto LCleanup;
|
||||
}
|
||||
|
||||
// Get the English VRAM string
|
||||
DWORD vram = 0;
|
||||
|
||||
WCHAR deviceID[512];
|
||||
|
||||
get_wstring(device_containerp, L"szDeviceID", deviceID, 512);
|
||||
|
||||
if (SUCCEEDED(GetVideoMemoryViaWMI(deviceID, &vram)))
|
||||
{
|
||||
mVRAM = vram/(1024*1024);
|
||||
}
|
||||
else
|
||||
{ // Get the English VRAM string
|
||||
std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish");
|
||||
|
||||
// We don't need the device any more
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
// Linden library includes
|
||||
#include "llerror.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llgl.h"
|
||||
#include "llstring.h"
|
||||
#include "lldir.h"
|
||||
@@ -58,8 +59,6 @@
|
||||
#include <dinput.h>
|
||||
#include <Dbt.h.>
|
||||
|
||||
#include "llfasttimer.h"
|
||||
|
||||
// culled from winuser.h
|
||||
#ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */
|
||||
const S32 WM_MOUSEWHEEL = 0x020A;
|
||||
@@ -87,6 +86,18 @@ void show_window_creation_error(const std::string& title)
|
||||
LL_WARNS("Window") << title << LL_ENDL;
|
||||
}
|
||||
|
||||
HGLRC SafeCreateContext(HDC hdc)
|
||||
{
|
||||
__try
|
||||
{
|
||||
return wglCreateContext(hdc);
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
BOOL LLWindowWin32::sIsClassRegistered = FALSE;
|
||||
|
||||
@@ -163,7 +174,6 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
|
||||
// Check system metrics
|
||||
if ( !GetSystemMetrics( SM_DBCSENABLED ) )
|
||||
return;
|
||||
|
||||
|
||||
mHImmDll = LoadLibraryA("Imm32");
|
||||
if (mHImmDll != NULL)
|
||||
@@ -205,7 +215,7 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
|
||||
// the case, since it is very unusual; these APIs are available from
|
||||
// the beginning, and all versions of IMM32.DLL should have them all.
|
||||
// Unfortunately, this code may be executed before initialization of
|
||||
// the logging channel (llwarns), and we can't do it here... Yes, this
|
||||
// the logging channel (LL_WARNS()), and we can't do it here... Yes, this
|
||||
// is one of disadvantages to use static constraction to DLL loading.
|
||||
FreeLibrary(mHImmDll);
|
||||
mHImmDll = NULL;
|
||||
@@ -554,6 +564,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
||||
if (closest_refresh == 0)
|
||||
{
|
||||
LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL;
|
||||
//success = FALSE;
|
||||
|
||||
if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode))
|
||||
{
|
||||
@@ -1012,7 +1023,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
dw_ex_style = WS_EX_APPWINDOW;
|
||||
dw_style = WS_POPUP;
|
||||
|
||||
// Move window borders out not to cover window contents
|
||||
// Move window borders out not to cover window contents.
|
||||
// This converts client rect to window rect, i.e. expands it by the window border size.
|
||||
AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
|
||||
}
|
||||
// If it failed, we don't want to run fullscreen
|
||||
@@ -1059,7 +1071,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
mhInstance,
|
||||
NULL);
|
||||
|
||||
LL_INFOS("Window") << "window is created." << llendl ;
|
||||
LL_INFOS("Window") << "window is created." << LL_ENDL ;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Create GL drawing context
|
||||
@@ -1092,7 +1104,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Device context retrieved." << llendl ;
|
||||
LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
|
||||
|
||||
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
|
||||
{
|
||||
@@ -1102,7 +1114,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Pixel format chosen." << llendl ;
|
||||
LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ;
|
||||
|
||||
// Verify what pixel format we actually received.
|
||||
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
|
||||
@@ -1115,35 +1127,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
}
|
||||
|
||||
// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
|
||||
LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
|
||||
LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
|
||||
LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << llendl ;
|
||||
LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
|
||||
LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << llendl ;
|
||||
LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << llendl ;
|
||||
LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << llendl ;
|
||||
LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
|
||||
LL_INFOS("Window") << "--- begin pixel format dump ---" << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pixel_format is " << pixel_format << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
|
||||
|
||||
if (pfd.cColorBits < 32)
|
||||
{
|
||||
@@ -1169,7 +1181,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(mhRC = wglCreateContext(mhDC)))
|
||||
if (!(mhRC = SafeCreateContext(mhDC)))
|
||||
{
|
||||
close();
|
||||
OSMessageBox(mCallbacks->translateString("MBGLContextErr"),
|
||||
@@ -1185,7 +1197,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Drawing context is created." << llendl ;
|
||||
LL_INFOS("Window") << "Drawing context is created." << LL_ENDL ;
|
||||
|
||||
gGLManager.initWGL();
|
||||
|
||||
@@ -1323,142 +1335,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "pixel formats done." << llendl ;
|
||||
|
||||
/*for(int i = 0; i <= num_formats-1; ++i)
|
||||
{
|
||||
GLint query[] = { WGL_SAMPLE_BUFFERS_ARB,
|
||||
WGL_SAMPLES_ARB,
|
||||
WGL_NUMBER_PIXEL_FORMATS_ARB,
|
||||
WGL_DRAW_TO_WINDOW_ARB,
|
||||
WGL_DRAW_TO_BITMAP_ARB,
|
||||
WGL_ACCELERATION_ARB,
|
||||
WGL_NEED_PALETTE_ARB,
|
||||
WGL_NEED_SYSTEM_PALETTE_ARB,
|
||||
WGL_SWAP_LAYER_BUFFERS_ARB,
|
||||
WGL_SWAP_METHOD_ARB,
|
||||
WGL_NUMBER_OVERLAYS_ARB,
|
||||
WGL_NUMBER_UNDERLAYS_ARB,
|
||||
WGL_TRANSPARENT_ARB,
|
||||
WGL_TRANSPARENT_RED_VALUE_ARB,
|
||||
WGL_TRANSPARENT_GREEN_VALUE_ARB,
|
||||
WGL_TRANSPARENT_BLUE_VALUE_ARB,
|
||||
WGL_TRANSPARENT_ALPHA_VALUE_ARB,
|
||||
WGL_TRANSPARENT_INDEX_VALUE_ARB,
|
||||
WGL_SHARE_DEPTH_ARB,
|
||||
WGL_SHARE_STENCIL_ARB,
|
||||
WGL_SHARE_ACCUM_ARB,
|
||||
WGL_SUPPORT_GDI_ARB,
|
||||
WGL_SUPPORT_OPENGL_ARB,
|
||||
WGL_DOUBLE_BUFFER_ARB,
|
||||
WGL_STEREO_ARB,
|
||||
WGL_PIXEL_TYPE_ARB,
|
||||
WGL_COLOR_BITS_ARB,
|
||||
WGL_RED_BITS_ARB,
|
||||
WGL_RED_SHIFT_ARB,
|
||||
WGL_GREEN_BITS_ARB,
|
||||
WGL_GREEN_SHIFT_ARB,
|
||||
WGL_BLUE_BITS_ARB,
|
||||
WGL_BLUE_SHIFT_ARB,
|
||||
WGL_ALPHA_BITS_ARB,
|
||||
WGL_ALPHA_SHIFT_ARB,
|
||||
WGL_ACCUM_BITS_ARB,
|
||||
WGL_ACCUM_RED_BITS_ARB,
|
||||
WGL_ACCUM_GREEN_BITS_ARB,
|
||||
WGL_ACCUM_BLUE_BITS_ARB,
|
||||
WGL_ACCUM_ALPHA_BITS_ARB,
|
||||
WGL_DEPTH_BITS_ARB,
|
||||
WGL_STENCIL_BITS_ARB,
|
||||
WGL_AUX_BUFFERS_ARB};
|
||||
std::string names[] = { "WGL_SAMPLE_BUFFERS_ARB",
|
||||
"WGL_SAMPLES_ARB",
|
||||
"WGL_NUMBER_PIXEL_FORMATS_ARB",
|
||||
"WGL_DRAW_TO_WINDOW_ARB",
|
||||
"WGL_DRAW_TO_BITMAP_ARB",
|
||||
"WGL_ACCELERATION_ARB",
|
||||
"WGL_NEED_PALETTE_ARB",
|
||||
"WGL_NEED_SYSTEM_PALETTE_ARB",
|
||||
"WGL_SWAP_LAYER_BUFFERS_ARB",
|
||||
"WGL_SWAP_METHOD_ARB",
|
||||
"WGL_NUMBER_OVERLAYS_ARB",
|
||||
"WGL_NUMBER_UNDERLAYS_ARB",
|
||||
"WGL_TRANSPARENT_ARB",
|
||||
"WGL_TRANSPARENT_RED_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_GREEN_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_BLUE_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_ALPHA_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_INDEX_VALUE_ARB",
|
||||
"WGL_SHARE_DEPTH_ARB",
|
||||
"WGL_SHARE_STENCIL_ARB",
|
||||
"WGL_SHARE_ACCUM_ARB",
|
||||
"WGL_SUPPORT_GDI_ARB",
|
||||
"WGL_SUPPORT_OPENGL_ARB",
|
||||
"WGL_DOUBLE_BUFFER_ARB",
|
||||
"WGL_STEREO_ARB",
|
||||
"WGL_PIXEL_TYPE_ARB",
|
||||
"WGL_COLOR_BITS_ARB",
|
||||
"WGL_RED_BITS_ARB",
|
||||
"WGL_RED_SHIFT_ARB",
|
||||
"WGL_GREEN_BITS_ARB",
|
||||
"WGL_GREEN_SHIFT_ARB",
|
||||
"WGL_BLUE_BITS_ARB",
|
||||
"WGL_BLUE_SHIFT_ARB",
|
||||
"WGL_ALPHA_BITS_ARB",
|
||||
"WGL_ALPHA_SHIFT_ARB",
|
||||
"WGL_ACCUM_BITS_ARB",
|
||||
"WGL_ACCUM_RED_BITS_ARB",
|
||||
"WGL_ACCUM_GREEN_BITS_ARB",
|
||||
"WGL_ACCUM_BLUE_BITS_ARB",
|
||||
"WGL_ACCUM_ALPHA_BITS_ARB",
|
||||
"WGL_DEPTH_BITS_ARB",
|
||||
"WGL_STENCIL_BITS_ARB",
|
||||
"WGL_AUX_BUFFERS_ARB"};
|
||||
S32 results[sizeof(query)/sizeof(query[0])]={0};
|
||||
|
||||
if(wglGetPixelFormatAttribivARB(mhDC, pixel_formats[i], 0, sizeof(query)/sizeof(query[0]), query, results))
|
||||
{
|
||||
llinfos << i << ":" << llendl;
|
||||
for(int j = 0; j < sizeof(query)/sizeof(query[0]); ++j)
|
||||
{
|
||||
switch(results[j])
|
||||
{
|
||||
case WGL_NO_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_NO_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_GENERIC_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_GENERIC_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_FULL_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_FULL_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_EXCHANGE_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_EXCHANGE_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_COPY_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_COPY_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_UNDEFINED_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_UNDEFINED_ARB" << llendl;
|
||||
break;
|
||||
case WGL_TYPE_RGBA_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_TYPE_RGBA_ARB" << llendl;
|
||||
break;
|
||||
case WGL_TYPE_COLORINDEX_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_TYPE_COLORINDEX_ARB" << llendl;
|
||||
break;
|
||||
default:
|
||||
llinfos << " " << names[j] << " = " << results[j] << llendl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
|
||||
|
||||
//Singu note: Reversed order of this loop. Generally, choosepixelformat returns an array with the closer matches towards the start.
|
||||
S32 swap_method = 0;
|
||||
S32 cur_format = 0;//num_formats-1;
|
||||
GLint swap_query = WGL_SWAP_METHOD_ARB;
|
||||
|
||||
BOOL found_format = FALSE;
|
||||
|
||||
while (!found_format && wglGetPixelFormatAttribivARB(mhDC, pixel_formats[cur_format], 0, 1, &swap_query, &swap_method))
|
||||
{
|
||||
if (swap_method == WGL_SWAP_UNDEFINED_ARB /*|| cur_format <= 0*/)
|
||||
@@ -1507,7 +1392,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
mhInstance,
|
||||
NULL);
|
||||
|
||||
LL_INFOS("Window") << "recreate window done." << llendl ;
|
||||
LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
|
||||
|
||||
if (!(mhDC = GetDC(mWindowHandle)))
|
||||
{
|
||||
@@ -1747,6 +1632,7 @@ BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Inform the application of the new mouse position (needed for per-frame
|
||||
// hover/picking to function).
|
||||
mCallbacks->handleMouseMove(this, position.convert(), (MASK)0);
|
||||
@@ -1996,6 +1882,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
|
||||
static bool sHandleLeftMouseUp = true;
|
||||
|
||||
// Ignore the double click received right after activating app.
|
||||
// This is to avoid triggering double click teleport after returning focus (see MAINT-3786).
|
||||
static bool sHandleDoubleClick = true;
|
||||
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA);
|
||||
|
||||
|
||||
@@ -2123,6 +2013,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
}
|
||||
}
|
||||
|
||||
if (!activating)
|
||||
{
|
||||
sHandleDoubleClick = false;
|
||||
}
|
||||
|
||||
window_imp->mCallbacks->handleActivateApp(window_imp, activating);
|
||||
|
||||
break;
|
||||
@@ -2347,6 +2242,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_NCLBUTTONDOWN");
|
||||
// A click in a non-client area, e.g. title bar or window border.
|
||||
sHandleLeftMouseUp = false;
|
||||
sHandleDoubleClick = true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2391,6 +2287,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
//case WM_RBUTTONDBLCLK:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDBLCLK");
|
||||
|
||||
if (!sHandleDoubleClick)
|
||||
{
|
||||
sHandleDoubleClick = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Because we move the cursor position in the app, we need to query
|
||||
// to find out where the cursor at the time the event is handled.
|
||||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
|
||||
@@ -1292,6 +1292,7 @@ if (WINDOWS)
|
||||
shell32
|
||||
user32
|
||||
Vfw32
|
||||
Wbemuuid
|
||||
winspool
|
||||
)
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ list ATI_Mobility_Radeon_9600
|
||||
Disregard96DefaultDrawDistance 1 0
|
||||
|
||||
list NVIDIA_GeForce_8600
|
||||
RenderTextureMemoryMultiple 1 0.375
|
||||
RenderTextureMemoryMultiple 1 1
|
||||
RenderUseImpostors 0 0
|
||||
UseOcclusion 0 0
|
||||
|
||||
|
||||
@@ -941,6 +941,8 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction)
|
||||
F32 max_distance = /*llmin(mDrawDistance*/ INT_MAX - DIST_FUDGE//,
|
||||
/*LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE )*/;
|
||||
|
||||
max_distance = llmin(max_distance, current_distance * 4.f); //Scaled max relative to current distance. MAINT-3154
|
||||
|
||||
if (new_distance > max_distance)
|
||||
{
|
||||
// <edit> screw cam constraints
|
||||
|
||||
@@ -160,7 +160,6 @@ public:
|
||||
static void onClickBuyPass(void* deselect_when_done);
|
||||
static BOOL enableBuyPass(void*);
|
||||
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
|
||||
static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata);
|
||||
static void finalizeCommit(void * userdata);
|
||||
static void onForSaleChange(LLUICtrl *ctrl, void * userdata);
|
||||
static void finalizeSetSellChange(void * userdata);
|
||||
@@ -384,6 +383,7 @@ public:
|
||||
|
||||
static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
|
||||
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
|
||||
static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata);
|
||||
static void onClickRemoveAccess(void*);
|
||||
static void onClickRemoveBanned(void*);
|
||||
|
||||
|
||||
@@ -1570,18 +1570,17 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
||||
if((mSelectedItems.size() > 0) && mScrollContainer)
|
||||
{
|
||||
LLFolderViewItem* last_selected = getCurSelectedItem();
|
||||
bool shift_select = mask & MASK_SHIFT;
|
||||
LLFolderViewItem* next = NULL;
|
||||
|
||||
if (!mKeyboardSelection)
|
||||
if (!mKeyboardSelection || (!shift_select && (!next || next == last_selected)))
|
||||
{
|
||||
setSelection(last_selected, FALSE, TRUE);
|
||||
mKeyboardSelection = TRUE;
|
||||
}
|
||||
|
||||
LLFolderViewItem* next = NULL;
|
||||
if (mask & MASK_SHIFT)
|
||||
if (shift_select)
|
||||
{
|
||||
// don't shift select down to children of folders (they are implicitly selected through parent)
|
||||
next = last_selected->getNextOpenNode(FALSE);
|
||||
if (next)
|
||||
{
|
||||
if (next->isSelected())
|
||||
@@ -1598,7 +1597,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
||||
}
|
||||
else
|
||||
{
|
||||
next = last_selected->getNextOpenNode();
|
||||
if( next )
|
||||
{
|
||||
if (next == last_selected)
|
||||
@@ -1634,18 +1632,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
||||
if((mSelectedItems.size() > 0) && mScrollContainer)
|
||||
{
|
||||
LLFolderViewItem* last_selected = mSelectedItems.back();
|
||||
bool shift_select = mask & MASK_SHIFT;
|
||||
// don't shift select down to children of folders (they are implicitly selected through parent)
|
||||
LLFolderViewItem* prev = last_selected->getPreviousOpenNode(!shift_select);
|
||||
|
||||
if (!mKeyboardSelection)
|
||||
if (!mKeyboardSelection || (!shift_select && prev == this))
|
||||
{
|
||||
setSelection(last_selected, FALSE, TRUE);
|
||||
mKeyboardSelection = TRUE;
|
||||
}
|
||||
|
||||
LLFolderViewItem* prev = NULL;
|
||||
if (mask & MASK_SHIFT)
|
||||
if (shift_select)
|
||||
{
|
||||
// don't shift select down to children of folders (they are implicitly selected through parent)
|
||||
prev = last_selected->getPreviousOpenNode(FALSE);
|
||||
if (prev)
|
||||
{
|
||||
if (prev->isSelected())
|
||||
@@ -1662,7 +1660,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
||||
}
|
||||
else
|
||||
{
|
||||
prev = last_selected->getPreviousOpenNode();
|
||||
if( prev )
|
||||
{
|
||||
if (prev == this)
|
||||
|
||||
@@ -1400,7 +1400,7 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str)
|
||||
}
|
||||
std::string cur_rest_of_match = trigger.substr(in_str.size());
|
||||
buf = "";
|
||||
S32 i=0;
|
||||
U32 i=0;
|
||||
|
||||
while (i<rest_of_match.length() && i<cur_rest_of_match.length())
|
||||
{
|
||||
|
||||
@@ -589,6 +589,14 @@ void LLInventoryPanel::modelChanged(U32 mask)
|
||||
// Item is to be moved and we found its new parent in the panel's directory, so move the item's UI.
|
||||
view_item->getParentFolder()->extractItem(view_item);
|
||||
view_item->addToFolder(new_parent, mFolderRoot.get());
|
||||
if (mInventory)
|
||||
{
|
||||
const LLUUID trash_id = mInventory->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if (trash_id != model_item->getParentUUID() && (mask & LLInventoryObserver::INTERNAL) && new_parent->isOpen())
|
||||
{
|
||||
setSelection(item_id, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,8 @@
|
||||
#include "llbbox.h"
|
||||
|
||||
|
||||
F32 get_default_max_prim_scale(bool is_flora = false);
|
||||
|
||||
class LLToolComposite;
|
||||
class LLColor4;
|
||||
|
||||
@@ -49,6 +51,13 @@ typedef enum e_scale_manipulator_type
|
||||
SCALE_MANIP_FACE
|
||||
} EScaleManipulatorType;
|
||||
|
||||
typedef enum e_snap_regimes
|
||||
{
|
||||
SNAP_REGIME_NONE = 0, //!< The cursor is not in either of the snap regimes.
|
||||
SNAP_REGIME_UPPER = 0x1, //!< The cursor is, non-exclusively, in the first of the snap regimes. Prefer to treat as bitmask.
|
||||
SNAP_REGIME_LOWER = 0x2 //!< The cursor is, non-exclusively, in the second of the snap regimes. Prefer to treat as bitmask.
|
||||
} ESnapRegimes;
|
||||
|
||||
|
||||
class LLManipScale : public LLManip
|
||||
{
|
||||
@@ -62,7 +71,7 @@ public:
|
||||
|
||||
ManipulatorHandle(LLVector3 pos, EManipPart id, EScaleManipulatorType type):mPosition(pos), mManipID(id), mType(type){}
|
||||
};
|
||||
|
||||
static const S32 NUM_MANIPULATORS = 14;
|
||||
|
||||
LLManipScale( LLToolComposite* composite );
|
||||
~LLManipScale();
|
||||
@@ -89,7 +98,7 @@ private:
|
||||
void renderFaces( const LLBBox& local_bbox );
|
||||
void renderEdges( const LLBBox& local_bbox );
|
||||
void renderBoxHandle( F32 x, F32 y, F32 z );
|
||||
void renderAxisHandle( const LLVector3& start, const LLVector3& end );
|
||||
void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end );
|
||||
void renderGuidelinesPart( const LLBBox& local_bbox );
|
||||
void renderSnapGuides( const LLBBox& local_bbox );
|
||||
|
||||
@@ -133,34 +142,36 @@ private:
|
||||
};
|
||||
|
||||
|
||||
F32 mBoxHandleSize; // The size of the handles at the corners of the bounding box
|
||||
F32 mScaledBoxHandleSize; // handle size after scaling for selection feedback
|
||||
F32 mScaledBoxHandleSize; //!< Handle size after scaling for selection feedback.
|
||||
LLVector3d mDragStartPointGlobal;
|
||||
LLVector3d mDragStartCenterGlobal; // The center of the bounding box of all selected objects at time of drag start
|
||||
LLVector3d mDragStartCenterGlobal; //!< The center of the bounding box of all selected objects at time of drag start.
|
||||
LLVector3d mDragPointGlobal;
|
||||
LLVector3d mDragFarHitGlobal;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
BOOL mSendUpdateOnMouseUp;
|
||||
U32 mLastUpdateFlags;
|
||||
typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
|
||||
minpulator_list_t mProjectedManipulators;
|
||||
typedef std::set<ManipulatorHandle*, compare_manipulators> manipulator_list_t;
|
||||
manipulator_list_t mProjectedManipulators;
|
||||
LLVector4 mManipulatorVertices[14];
|
||||
F32 mScaleSnapUnit1; // size of snap multiples for axis 1
|
||||
F32 mScaleSnapUnit2; // size of snap multiples for axis 2
|
||||
LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera
|
||||
LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera
|
||||
LLVector3 mSnapGuideDir1;
|
||||
LLVector3 mSnapGuideDir2;
|
||||
LLVector3 mSnapDir1;
|
||||
LLVector3 mSnapDir2;
|
||||
F32 mSnapRegimeOffset;
|
||||
F32 mScaleSnapUnit1; //!< Size of snap multiples for the upper scale.
|
||||
F32 mScaleSnapUnit2; //!< Size of snap multiples for the lower scale.
|
||||
LLVector3 mScalePlaneNormal1; //!< Normal of plane in which scale occurs that most faces camera.
|
||||
LLVector3 mScalePlaneNormal2; //!< Normal of plane in which scale occurs that most faces camera.
|
||||
LLVector3 mSnapGuideDir1; //!< The direction in which the upper snap guide tick marks face.
|
||||
LLVector3 mSnapGuideDir2; //!< The direction in which the lower snap guide tick marks face.
|
||||
LLVector3 mSnapDir1; //!< The direction in which the upper snap guides face.
|
||||
LLVector3 mSnapDir2; //!< The direction in which the lower snap guides face.
|
||||
F32 mSnapRegimeOffset; //!< How far off the scale axis centerline the mouse can be before it exits/enters the snap regime.
|
||||
F32 mTickPixelSpacing1; //!< The pixel spacing between snap guide tick marks for the upper scale.
|
||||
F32 mTickPixelSpacing2; //!< The pixel spacing between snap guide tick marks for the lower scale.
|
||||
F32 mSnapGuideLength;
|
||||
LLVector3 mScaleCenter;
|
||||
LLVector3 mScaleDir;
|
||||
F32 mScaleSnapValue;
|
||||
BOOL mInSnapRegime;
|
||||
F32* mManipulatorScales;
|
||||
LLVector3 mScaleCenter; //!< The location of the origin of the scaling operation.
|
||||
LLVector3 mScaleDir; //!< The direction of the scaling action. In face-dragging this is aligned with one of the cardinal axis relative to the prim, but in corner-dragging this is along the diagonal.
|
||||
F32 mScaleSnappedValue; //!< The distance of the current position nearest the mouse location, measured along mScaleDir. Is measured either from the center or from the far face/corner depending upon whether uniform scaling is true or false respectively.
|
||||
ESnapRegimes mSnapRegime; //<! Which, if any, snap regime the cursor is currently residing in.
|
||||
F32 mManipulatorScales[NUM_MANIPULATORS];
|
||||
F32 mBoxHandleSize[NUM_MANIPULATORS]; // The size of the handles at the corners of the bounding box
|
||||
};
|
||||
|
||||
#endif // LL_MANIPSCALE_H
|
||||
|
||||
@@ -1263,7 +1263,7 @@ void LLManipTranslate::renderSnapGuides()
|
||||
// find distance to nearest smallest grid unit
|
||||
F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale);
|
||||
// how many smallest grid units are we away from largest grid scale?
|
||||
S32 sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
|
||||
S32 sub_div_offset = llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
|
||||
S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale));
|
||||
|
||||
LLGLDepthTest gls_depth(GL_FALSE);
|
||||
|
||||
@@ -410,27 +410,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
||||
msg->getUUID("QueryData", "OwnerID", owner_id, 0);
|
||||
msg->getUUID("TransactionData", "TransactionID", trans_id);
|
||||
|
||||
S32 total_contribution = 0;
|
||||
if(owner_id.isNull())
|
||||
{
|
||||
// special block which has total contribution
|
||||
++first_block;
|
||||
|
||||
S32 total_contribution;
|
||||
|
||||
msg->getS32("QueryData", "ActualArea", total_contribution, 0);
|
||||
mPanel.getChild<LLUICtrl>("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution));
|
||||
|
||||
S32 committed;
|
||||
msg->getS32("QueryData", "BillableArea", committed, 0);
|
||||
mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
|
||||
|
||||
S32 available = total_contribution - committed;
|
||||
mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
|
||||
|
||||
if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
|
||||
{
|
||||
mGroupOverLimitIconp->setVisible(available < 0);
|
||||
mGroupOverLimitTextp->setVisible(available < 0);
|
||||
}
|
||||
}
|
||||
|
||||
if ( trans_id != mTransID ) return;
|
||||
@@ -449,7 +436,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
||||
std::string sim_name;
|
||||
std::string land_sku;
|
||||
std::string land_type;
|
||||
|
||||
S32 committed = 0;
|
||||
|
||||
for(S32 i = first_block; i < count; ++i)
|
||||
{
|
||||
msg->getUUID("QueryData", "OwnerID", owner_id, i);
|
||||
@@ -478,6 +466,9 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
||||
S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
|
||||
std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y);
|
||||
std::string area;
|
||||
committed+=billable_area;
|
||||
|
||||
|
||||
if(billable_area == actual_area)
|
||||
{
|
||||
area = llformat("%d", billable_area);
|
||||
@@ -514,6 +505,17 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
||||
|
||||
mGroupParcelsp->addElement(row, ADD_SORTED);
|
||||
}
|
||||
|
||||
mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
|
||||
|
||||
S32 available = total_contribution - committed;
|
||||
mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
|
||||
|
||||
if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
|
||||
{
|
||||
mGroupOverLimitIconp->setVisible(available < 0);
|
||||
mGroupOverLimitTextp->setVisible(available < 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,13 +155,13 @@ void LLPanelLandInfo::refresh()
|
||||
&& ((gAgent.getID() == auth_buyer_id)
|
||||
|| (auth_buyer_id.isNull())));
|
||||
|
||||
if (is_public)
|
||||
if (is_public && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getMultipleOwners())
|
||||
{
|
||||
childSetEnabled("button buy land",TRUE);
|
||||
getChildView("button buy land")->setEnabled(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetEnabled("button buy land",can_buy);
|
||||
getChildView("button buy land")->setEnabled(can_buy);
|
||||
}
|
||||
|
||||
BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE);
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
// library includes
|
||||
#include "llnotifications.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llsd.h"
|
||||
|
||||
|
||||
@@ -1030,7 +1030,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
|
||||
|
||||
// *HACK: this should be rolled into the composite tool logic, not
|
||||
// hardcoded at the top level.
|
||||
if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance())
|
||||
if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() && gAgent.isInitialized())
|
||||
{
|
||||
// If the current tool didn't process the click, we should show
|
||||
// the pie menu. This can be done by passing the event to the pie
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
left="205" name="terraform_help" width="18" />
|
||||
<check_box bottom_delta="-20" follows="left|top" height="20" label="Block Fly" left="10"
|
||||
name="block_fly_check" width="80" />
|
||||
<button bottom_delta="0" follows="left|top" height="18" label="?" left="205" name="fly_help" width="18" />
|
||||
<check_box bottom_delta="-20" follows="left|top" height="20" label="Block Parcel Fly Over" tool_tip="Extend access checks upwards to prevent flying over a parcel" left="10" name="block_fly_over_check" width="90" />
|
||||
<button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
|
||||
left="205" name="fly_help" width="18" />
|
||||
<check_box bottom_delta="-20" follows="left|top" height="20" label="Allow Damage"
|
||||
left="10" name="allow_damage_check" width="80" />
|
||||
<button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
|
||||
@@ -95,7 +94,7 @@
|
||||
label="Phase" left_delta="-35" max_val="30" min_val="6" name="sun_hour_slider" show_text="false" width="200" />
|
||||
<button bottom_delta="-20" enabled="false" follows="left|top" height="20" label="Apply"
|
||||
left="108" name="apply_btn" width="100" />
|
||||
<button bottom_delta="-60" follows="left|top" height="20"
|
||||
<button bottom_delta="-40" follows="left|top" height="20"
|
||||
label="Teleport Home One User..." left="10" name="kick_btn" width="250" />
|
||||
<button bottom_delta="-23" follows="left|top" height="20"
|
||||
label="Teleport Home All Users..." left="10" name="kick_all_btn" width="250" />
|
||||
|
||||
@@ -316,7 +316,10 @@ Make sure you entered the correct Login URI. An example of a Login URI is: \"htt
|
||||
|
||||
<!-- build floater -->
|
||||
<string name="multiple_textures">Multiple</string>
|
||||
|
||||
<string name="use_texture">Use texture</string>
|
||||
<string name="manip_hint1">Move mouse cursor over ruler</string>
|
||||
<string name="manip_hint2">to snap to grid</string>
|
||||
|
||||
<!-- world map -->
|
||||
<string name="texture_loading">Loading...</string>
|
||||
|
||||
Reference in New Issue
Block a user