Beispiel #1
0
void AABB::TransformAsAABB(const float3x4 &transform)
{
	assume(transform.IsColOrthogonal());
	assume(transform.HasUniformScale());

	AABBTransformAsAABB(*this, transform);
}
Beispiel #2
0
void Capsule::Transform(const float3x4 &transform)
{
	assume(transform.HasUniformScale());
	assume(transform.IsColOrthogonal());
	l.Transform(transform);
	r *= transform.Col(0).Length(); // Scale the radius.
}
Beispiel #3
0
void Circle::Transform(const float3x4 &transform)
{
	assume(transform.HasUniformScale());
	assume(transform.IsColOrthogonal());
	pos = transform.MulPos(pos);
	normal = transform.MulDir(normal).Normalized();
	r *= transform.Col(0).Length(); // Scale the radius of the circle.
}
Beispiel #4
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
}
Beispiel #5
0
void Placeable::SetWorldTransform(const float3x4 &tm)
{
    assume(tm.IsColOrthogonal());
    assume(!tm.HasNegativeScale());
    if (!parentPlaceable_) // No parent, the local->parent transform equals the local->world transform.
    {
        SetTransform(tm);
        return;
    }

    float3x4 parentWorldTransform = parentPlaceable_->LocalToWorld();

    bool success = parentWorldTransform.Inverse();
    if (!success)
    {
        if (parentEntity)
            LogError("Parent for entity " + parentEntity->ToString() + " has an invalid world transform!");
        else
            LogError("Parent for a detached entity has an invalid world transform!");
        return;
    }
        
    SetTransform(parentWorldTransform * tm);
}
Beispiel #6
0
void OBB::Transform(const float3x4 &transform)
{
	assume(transform.IsColOrthogonal());
	OBBTransform(*this, transform);
}
Beispiel #7
0
void Placeable::SetTransform(const float3x4 &tm)
{
    assume(tm.IsColOrthogonal());
    assume(!tm.HasNegativeScale());
    transform.Set(Transform(tm), AttributeChange::Default);
}