本文整理汇总了C++中float4x4类的典型用法代码示例。如果您正苦于以下问题:C++ float4x4类的具体用法?C++ float4x4怎么用?C++ float4x4使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了float4x4类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Transform
void Capsule::Transform(const float4x4 &transform)
{
assume(transform.HasUniformScale());
assume(transform.IsColOrthogonal3());
l.Transform(transform);
r *= transform.Col3(0).Length(); // Scale the radius.
}
示例2: Transform
void Sphere::Transform(const float4x4 &transform)
{
assume(transform.HasUniformScale());
assume(!transform.ContainsProjection());
pos = transform.MulPos(pos);
r *= transform.Col3(0).Length();
}
示例3: Transform
void Circle::Transform(const float4x4 &transform)
{
assume(transform.HasUniformScale());
assume(transform.IsColOrthogonal3());
pos = transform.MulPos(pos);
normal = transform.MulDir(normal).Normalized();
r *= transform.Col3(0).Length(); // Scale the radius of the circle.
}
示例4: TransformAsAABB
void AABB::TransformAsAABB(const float4x4 &transform)
{
assume(transform.IsColOrthogonal3());
assume(transform.HasUniformScale());
assume(transform.Row(3).Equals(0,0,0,1));
AABBTransformAsAABB(*this, transform);
}
示例5: TransformAsAABB
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
}
示例6: Set
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
}
示例7:
float4x4 operator *(const float4x4 &lhs, const TranslateOp &rhs)
{
float4x4 r = lhs;
r.SetTranslatePart(lhs.TransformPos(rhs.Offset()));
// Our optimized form of multiplication must be the same as this.
mathassert(r.Equals(lhs * rhs.ToFloat4x4()));
return r;
}
示例8: assume
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;
}
示例9: tfm
Aabb operator * (const float4x4 &tfm, const Aabb &a)
{
Aabb result = { tfm.getTranslation(), tfm.getTranslation() };
for (int i = 1; i < 4; ++i)
{
for (int j = 1; j < 4; ++ j)
{
float e = tfm(i,j) * a.min[j - 1];
float f = tfm(i,j) * a.max[j - 1];
if (e < f)
{
result.min[i - 1] += e;
result.max[i - 1] += f;
}
else
{
result.min[i - 1] += f;
result.max[i - 1] += e;
}
}
}
return result;
}
示例10: Transform
void OBB::Transform(const float4x4 &transform)
{
assume(transform.IsOrthogonal3());
OBBTransform(*this, transform);
}
示例11: Transform
void Frustum::Transform(const float4x4 &transform)
{
assume(transform.Row(3).Equals(0,0,0,1));
Transform(transform.Float3x4Part());
}
示例12: SetFrom
void OBB::SetFrom(const AABB &aabb, const float4x4 &transform)
{
assume(transform.Row(3).Equals(0,0,0,1));
OBBSetFrom(*this, aabb, transform.Float3x4Part());
}
示例13: Transform
void Ray::Transform(const float4x4 &transform)
{
pos = transform.TransformPos(pos);
dir = transform.TransformDir(dir);
}
示例14: Ray
Ray operator *(const float4x4 &transform, const Ray &ray)
{
return Ray(transform.MulPos(ray.pos), transform.MulDir(ray.dir));
}
示例15: Ray
Ray operator *(const float4x4 &transform, const Ray &ray)
{
assume(transform.IsInvertible());
return Ray(transform.MulPos(ray.pos), transform.MulDir(ray.dir).Normalized());
}