Beispiel #1
0
/// See Eric Lengyel's Mathematics for 3D Game Programming And Computer Graphics 2nd ed., p.110, chapter 4.2.3.
void Plane::Transform(const float3x4 &transform)
{
    ///\todo Could optimize this function by switching to plane convention ax+by+cz+d=0 instead of ax+by+cz=d.
    float3x3 r = transform.Float3x3Part();
    bool success = r.Inverse(); ///\todo Can optimize the inverse here by assuming orthogonality or orthonormality.
    assume(success);
    d = d + Dot(normal, r * transform.TranslatePart());
    normal = normal * r;
}
Beispiel #2
0
void Quat::Set(const float3x4 &m)
{
	assume(m.IsColOrthogonal());
	assume(m.HasUnitaryScale());
	assume(!m.HasNegativeScale());
	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
}