PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llmath/llv4vector3.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 80 lines | 33 code | 12 blank | 35 comment | 0 complexity | 8855e62e6f18d40b4c9b602af1da9725 MD5 | raw file
 1/** 
 2 * @file llviewerjointmesh.cpp
 3 * @brief LLV4* class header file - vector processor enabled math
 4 *
 5 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLV4VECTOR3_H
28#define LL_LLV4VECTOR3_H
29
30#include "llv4math.h"
31
32//-----------------------------------------------------------------------------
33//-----------------------------------------------------------------------------
34// LLV4Vector3
35//-----------------------------------------------------------------------------
36//-----------------------------------------------------------------------------
37
38LL_LLV4MATH_ALIGN_PREFIX
39
40class LLV4Vector3
41{
42public:
43	union {
44		F32		mV[LLV4_NUM_AXIS];
45		V4F32	v;
46	};
47
48	enum {
49		ALIGNMENT = 16
50		};
51
52	void				setVec(F32 x, F32 y, F32 z);
53	void				setVec(F32 a);
54}
55
56LL_LLV4MATH_ALIGN_POSTFIX;
57
58//-----------------------------------------------------------------------------
59//-----------------------------------------------------------------------------
60// LLV4Vector3
61//-----------------------------------------------------------------------------
62//-----------------------------------------------------------------------------
63
64inline void	LLV4Vector3::setVec(F32 x, F32 y, F32 z)
65{
66	mV[VX] = x;
67	mV[VY] = y;
68	mV[VZ] = z;
69}
70
71inline void	LLV4Vector3::setVec(F32 a)
72{
73#if LL_VECTORIZE
74	v = _mm_set1_ps(a);
75#else
76	setVec(a, a, a);
77#endif
78}
79
80#endif