当前位置: 首页>>代码示例>>C++>>正文


C++ float3x3类代码示例

本文整理汇总了C++中float3x3的典型用法代码示例。如果您正苦于以下问题:C++ float3x3类的具体用法?C++ float3x3怎么用?C++ float3x3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了float3x3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Col

void float3x4::Decompose(float3 &translate, float3x3 &rotate, float3 &scale) const
{
	assume(this->IsColOrthogonal());

	translate = Col(3);
	rotate = RotatePart();
	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 float3x4.
	assume(float3x4::FromTRS(translate, rotate, scale).Equals(*this, 0.1f));
}
开发者ID:entityhat,项目名称:style,代码行数:19,代码来源:float3x4.cpp

示例2:

float3x3 float3x3::operator *(const float3x3 &rhs) const
{
    float3x3 r;
    const float *c0 = rhs.ptr();
    const float *c1 = rhs.ptr() + 1;
    const float *c2 = rhs.ptr() + 2;
    r[0][0] = DOT3STRIDED(v[0], c0, 3);
    r[0][1] = DOT3STRIDED(v[0], c1, 3);
    r[0][2] = DOT3STRIDED(v[0], c2, 3);

    r[1][0] = DOT3STRIDED(v[1], c0, 3);
    r[1][1] = DOT3STRIDED(v[1], c1, 3);
    r[1][2] = DOT3STRIDED(v[1], c2, 3);

    r[2][0] = DOT3STRIDED(v[2], c0, 3);
    r[2][1] = DOT3STRIDED(v[2], c1, 3);
    r[2][2] = DOT3STRIDED(v[2], c2, 3);

    return r;
}
开发者ID:Ilikia,项目名称:naali,代码行数:20,代码来源:float3x3.cpp

示例3: Transform

void Frustum::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	pos = transform * pos;
	front = transform * front;
	float scaleFactor = front.Normalize();
	up = (transform * up).Normalized();
	nearPlaneDistance *= scaleFactor;
	farPlaneDistance *= scaleFactor;
	if (type == OrthographicFrustum)
	{
		orthographicWidth *= scaleFactor;
		orthographicHeight *= scaleFactor;
	}
}
开发者ID:chengzg,项目名称:MathGeoLib,代码行数:15,代码来源:Frustum.cpp

示例4:

float3x4 float3x4::operator *(const float3x3 &rhs) const
{
	///\todo SSE.
	float3x4 r;
	const float *c0 = rhs.ptr();
	const float *c1 = rhs.ptr() + 1;
	const float *c2 = rhs.ptr() + 2;
	r[0][0] = DOT3STRIDED(v[0], c0, 3);
	r[0][1] = DOT3STRIDED(v[0], c1, 3);
	r[0][2] = DOT3STRIDED(v[0], c2, 3);
	r[0][3] = v[0][3];

	r[1][0] = DOT3STRIDED(v[1], c0, 3);
	r[1][1] = DOT3STRIDED(v[1], c1, 3);
	r[1][2] = DOT3STRIDED(v[1], c2, 3);
	r[1][3] = v[1][3];

	r[2][0] = DOT3STRIDED(v[2], c0, 3);
	r[2][1] = DOT3STRIDED(v[2], c1, 3);
	r[2][2] = DOT3STRIDED(v[2], c2, 3);
	r[2][3] = v[2][3];

	return r;
}
开发者ID:entityhat,项目名称:style,代码行数:24,代码来源:float3x4.cpp

示例5: SetFrom

void OBB::SetFrom(const AABB &aabb, const float3x3 &transform)
{
    assume(transform.IsOrthogonal());
    OBBSetFrom(*this, aabb, transform);
}
开发者ID:Ilikia,项目名称:naali,代码行数:5,代码来源:OBB.cpp

示例6: Transform

void OBB::Transform(const float3x3 &transform)
{
    assume(transform.IsOrthogonal());
    OBBTransform(*this, transform);
}
开发者ID:Ilikia,项目名称:naali,代码行数:5,代码来源:OBB.cpp

示例7: Transform

void Capsule::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	l.Transform(transform);
	r *= transform.Col(0).Length(); // Scale the radius.
}
开发者ID:Mars999,项目名称:MathGeoLib,代码行数:6,代码来源:Capsule.cpp

示例8: Transform

/// Applies a transformation to this line.
void Ray::Transform(const float3x3 &transform)
{
    pos = transform.Transform(pos);
    dir = transform.Transform(dir);
}
开发者ID:Ilikia,项目名称:naali,代码行数:6,代码来源:Ray.cpp

示例9: Ray

Ray operator *(const float3x3 &transform, const Ray &ray)
{
	assume(transform.IsInvertible());
	return Ray(transform * ray.pos, (transform * ray.dir).Normalized());
}
开发者ID:ggf31416,项目名称:CompGraf1,代码行数:5,代码来源:Ray.cpp

示例10: Set

void float3x3::Set(const float3x3 &rhs)
{
    Set(rhs.ptr());
}
开发者ID:Ilikia,项目名称:naali,代码行数:4,代码来源:float3x3.cpp

示例11: assume

float4 operator *(const float4 &lhs, const float3x3 &rhs)
{
    assume(lhs.IsWZeroOrOne());
    return float4(rhs.TransformLeft(lhs.xyz()), lhs.w);
}
开发者ID:Ilikia,项目名称:naali,代码行数:5,代码来源:float3x3.cpp

示例12: Transform

void Triangle::Transform(const float3x3 &transform)
{
	transform.BatchTransform(&a, 3);
}
开发者ID:d0n3val,项目名称:Edu-Game-Engine,代码行数:4,代码来源:Triangle.cpp

示例13: Transform

void Polyhedron::Transform(const float3x3 &transform)
{
	if (!v.empty())
		transform.BatchTransform(&v[0], (int)v.size());
}
开发者ID:360degrees-fi,项目名称:tundra,代码行数:5,代码来源:Polyhedron.cpp

示例14: Transform

void Sphere::Transform(const float3x3 &transform)
{
	assume(transform.HasUniformScale());
	pos = transform * pos;
	r *= transform.Col(0).Length();
}
开发者ID:juj,项目名称:MathGeoLib,代码行数:6,代码来源:Sphere.cpp

示例15: Transform

void Plane::Transform(const float3x3 &transform)
{
    float3x3 it = transform.InverseTransposed(); ///\todo Could optimize the inverse here by assuming orthogonality or orthonormality.
    normal = it * normal;
}
开发者ID:Ilikia,项目名称:naali,代码行数:5,代码来源:Plane.cpp


注:本文中的float3x3类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。