예제 #1
0
void Capsule::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	assume(transform.IsColOrthogonal());
	l.Transform(transform);
	r *= transform.Col(0).Length(); // Scale the radius.
}
예제 #2
0
void Circle::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	assume(transform.IsColOrthogonal());
	pos = transform.Mul(pos);
	normal = transform.Mul(normal).Normalized();
	r *= transform.Col(0).Length(); // Scale the radius of the circle.
}
예제 #3
0
파일: float3x3.cpp 프로젝트: Ilikia/naali
void float3x3::Decompose(float3x3 &rotate, float3 &scale) const
{
    assume(this->IsOrthogonal());

    rotate = *this;
    scale.x = rotate.Col(0).Length();
    scale.y = rotate.Col(1).Length();
    scale.z = rotate.Col(2).Length();
    assume(!EqualAbs(scale.x, 0));
    assume(!EqualAbs(scale.y, 0));
    assume(!EqualAbs(scale.z, 0));
    rotate.ScaleCol(0, 1.f / scale.x);
    rotate.ScaleCol(1, 1.f / scale.y);
    rotate.ScaleCol(2, 1.f / scale.z);

    // Test that composing back yields the original float3x3.
    assume(float3x3::FromRS(rotate, scale).Equals(*this, 0.1f));
}
예제 #4
0
파일: Sphere.cpp 프로젝트: juj/MathGeoLib
void Sphere::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	pos = transform * pos;
	r *= transform.Col(0).Length();
}