void AABB::TransformAsAABB(const float4x4 &transform) { assume(transform.IsColOrthogonal3()); assume(transform.HasUniformScale()); assume(transform.Row(3).Equals(0,0,0,1)); AABBTransformAsAABB(*this, transform); }
float4x4 operator *(const TranslateOp &lhs, const float4x4 &rhs) { // This function is based on the optimized assumption that the last row of rhs is [0,0,0,1]. // If this does not hold and you are hitting the check below, explicitly cast TranslateOp lhs to float4x4 before multiplication! assume(rhs.Row(3).Equals(0.f, 0.f, 0.f, 1.f)); float4x4 r = rhs; r.SetTranslatePart(r.TranslatePart() + DIR_TO_FLOAT3(lhs.Offset())); return r; }
void AABB::TransformAsAABB(const float4x4 &transform) { assume(transform.IsColOrthogonal3()); assume(transform.HasUniformScale()); assume(transform.Row(3).Equals(0,0,0,1)); #if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SIMD) AABBTransformAsAABB_SIMD(*this, transform); #else AABBTransformAsAABB(*this, transform); #endif }
void Quat::Set(const float4x4 &m) { assume(m.IsColOrthogonal3()); assume(m.HasUnitaryScale()); assume(!m.HasNegativeScale()); assume(m.Row(3).Equals(0,0,0,1)); SetQuatFrom(*this, m); #ifdef MATH_ASSERT_CORRECTNESS // Test that the conversion float3x3->Quat->float3x3 is correct. mathassert(this->ToFloat3x3().Equals(m.Float3x3Part(), 0.01f)); #endif }
void Frustum::Transform(const float4x4 &transform) { assume(transform.Row(3).Equals(0,0,0,1)); Transform(transform.Float3x4Part()); }
void OBB::SetFrom(const AABB &aabb, const float4x4 &transform) { assume(transform.Row(3).Equals(0,0,0,1)); OBBSetFrom(*this, aabb, transform.Float3x4Part()); }
void Plane::Transform(const float4x4 &transform) { assume(transform.Row(3).Equals(float4(0,0,0,1))); Transform(transform.Float3x4Part()); }
void Placeable::SetWorldTransform(const float4x4 &tm) { assume(tm.Row(3).Equals(float4(0,0,0,1))); SetWorldTransform(tm.Float3x4Part()); }