示例#1
0
float3 Quat::WorldZ() const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return float4(quat_transform_vec4(q, float4::unitZ)).xyz();
#else
	return this->Transform(0.f, 0.f, 1.f);
#endif
}
示例#2
0
float3 Quat::operator *(const float3 &rhs) const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return float4(quat_transform_vec4(q, float4(rhs, 0.f).v)).xyz();
#else
	return Transform(rhs);
#endif
}
示例#3
0
float4 Quat::operator *(const float4 &rhs) const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return quat_transform_vec4(q, rhs);
#else
	return Transform(rhs);
#endif
}
示例#4
0
vec Quat::WorldZ() const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return FLOAT4_TO_DIR(quat_transform_vec4(q, float4::unitZ));
#else
	return DIR_VEC(this->Transform(0.f, 0.f, 1.f));
#endif
}
示例#5
0
float3 MUST_USE_RESULT Quat::Transform(float x, float y, float z) const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return float4(quat_transform_vec4(q, set_ps(0.f, z, y, x))).xyz();
#else
	return Transform(float3(x, y, z));
#endif
}
示例#6
0
float3 MUST_USE_RESULT Quat::Transform(float X, float Y, float Z) const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SIMD)
	return float4(quat_transform_vec4(q, set_ps(0.f, Z, Y, X))).xyz();
#else
	return Transform(float3(X, Y, Z));
#endif
}
示例#7
0
float3 MUST_USE_RESULT Quat::Transform(float x, float y, float z) const
{
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	///\todo Check the generation of temporaries here!
	return float4(quat_transform_vec4(q, float4(x,y,z,0.f).v)).xyz();
#else
	return Transform(float3(x, y, z));
#endif
}
示例#8
0
float4 MUST_USE_RESULT Quat::Transform(const float4 &vec) const
{
	assume(vec.IsWZeroOrOne());

#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return quat_transform_vec4(q, vec);
#else
	return float4(Transform(vec.x, vec.y, vec.z), vec.w);
#endif
}
示例#9
0
float3 MUST_USE_RESULT Quat::Transform(const float3 &vec) const
{
	assume2(this->IsNormalized(), *this, this->LengthSq());
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	return float4(quat_transform_vec4(q, load_vec3(vec.ptr(), 0.f))).xyz();
#else
	///\todo Optimize/benchmark the scalar path not to generate a matrix!
	float3x3 mat = this->ToFloat3x3();
	return mat * vec;
#endif
}
示例#10
0
float3 MUST_USE_RESULT Quat::Transform(const float3 &vec) const
{
	assume(this->IsNormalized());
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SSE)
	///\todo Check the generation of temporaries here!
	return float4(quat_transform_vec4(q, float4(vec,0.f).v)).xyz();
#else
	///\todo Optimize/benchmark the scalar path not to generate a matrix!
	float3x3 mat = this->ToFloat3x3();
	return mat * vec;
#endif
}