minor optimization.

This commit is contained in:
castano
2010-03-16 22:36:14 +00:00
parent 73851ab86f
commit d8ed531e4c
4 changed files with 17 additions and 3 deletions

View File

@ -78,7 +78,14 @@ public:
u.v = m_v;
return Vec3( u.c[0], u.c[1], u.c[2] );
}
float GetX() const
{
union { vector float v; float c[4]; } u;
u.v = m_v;
return u.c[0];
}
Vec4 SplatX() const { return Vec4( vec_splat( m_v, 0 ) ); }
Vec4 SplatY() const { return Vec4( vec_splat( m_v, 1 ) ); }
Vec4 SplatZ() const { return Vec4( vec_splat( m_v, 2 ) ); }