aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/llv4vector3.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/llv4vector3.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/linden/indra/llmath/llv4vector3.h b/linden/indra/llmath/llv4vector3.h
new file mode 100644
index 0000000..994e7f5
--- /dev/null
+++ b/linden/indra/llmath/llv4vector3.h
@@ -0,0 +1,82 @@
1/**
2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math
4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLV4VECTOR3_H
30#define LL_LLV4VECTOR3_H
31
32#include "llv4math.h"
33
34//-----------------------------------------------------------------------------
35//-----------------------------------------------------------------------------
36// LLV4Vector3
37//-----------------------------------------------------------------------------
38//-----------------------------------------------------------------------------
39
40LL_LLV4MATH_ALIGN_PREFIX
41
42class LLV4Vector3
43{
44public:
45 union {
46 F32 mV[LLV4_NUM_AXIS];
47 V4F32 v;
48 };
49
50 enum {
51 ALIGNMENT = 16
52 };
53
54 void setVec(F32 x, F32 y, F32 z);
55 void setVec(F32 a);
56}
57
58LL_LLV4MATH_ALIGN_POSTFIX;
59
60//-----------------------------------------------------------------------------
61//-----------------------------------------------------------------------------
62// LLV4Vector3
63//-----------------------------------------------------------------------------
64//-----------------------------------------------------------------------------
65
66inline void LLV4Vector3::setVec(F32 x, F32 y, F32 z)
67{
68 mV[VX] = x;
69 mV[VY] = y;
70 mV[VZ] = z;
71}
72
73inline void LLV4Vector3::setVec(F32 a)
74{
75#if LL_VECTORIZE
76 v = _mm_set1_ps(a);
77#else
78 setVec(a, a, a);
79#endif
80}
81
82#endif