本文整理汇总了C++中Matrix44F::inverse方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix44F::inverse方法的具体用法?C++ Matrix44F::inverse怎么用?C++ Matrix44F::inverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix44F
的用法示例。
在下文中一共展示了Matrix44F::inverse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spin
void TransformManipulator::spin(const Vector3F & d)
{
Matrix44F ps;
parentSpace(ps);
Matrix44F invps = ps;
invps.inverse();
const Vector3F worldP = ps.transform(translation());
const Vector3F rotUp = ps.transformAsNormal(hitPlaneNormal());
Vector3F toa = m_currentPoint - worldP;
Vector3F tob = toa + d;
toa.normalize();
tob.normalize();
float ang = toa.angleBetween(tob, toa.cross(rotUp).reversed());
Vector3F angles;
if(m_rotateAxis == AY) angles.set(0.f, ang, 0.f);
else if(m_rotateAxis == AZ) angles.set(0.f, 0.f, ang);
else angles.set(ang, 0.f, 0.f);
m_subject->rotate(angles);
setRotationAngles(m_subject->rotationAngles());
}
示例2: move
void TransformManipulator::move(const Vector3F & d)
{
Matrix44F ps;
parentSpace(ps);
Matrix44F invps = ps;
invps.inverse();
Vector3F od = invps.transformAsNormal(d);
m_subject->translate(od);
setTranslation(m_subject->translation());
}
示例3: intersect
bool BaseTransform::intersect(const Ray & ray) const
{
Matrix44F s = worldSpace();
s.inverse();
Vector3F a = ray.m_origin + ray.m_dir * ray.m_tmin;
a = s.transform(a);
Vector3F b = ray.m_origin + ray.m_dir * ray.m_tmax;
b = s.transform(b);
Ray objR(a, b);
float hit0, hit1;
return getBBox().intersect(objR, &hit0, &hit1);
}
示例4: frameAll
void BaseView::frameAll(const BoundingBox & b)
{
Vector3F eye = b.center();
eye.z = b.getMax(2) + b.distance(0) / hfov() * .55f + 120.f;
setEyePosition(eye);
Matrix44F m;
m.setTranslation(eye);
*cameraSpaceR() = m;
m.inverse();
*cameraInvSpaceR() = m;
setFrustum(1.33f, 1.f, 26.2f, -1.f, -1000.f);
}
示例5: calculateSubspaceP
void SkeletonSubspaceDeformer::calculateSubspaceP()
{
unsigned i, j, n, nj, vstart;
Matrix44F spaceInv;
Vector3F p;
for(i = 0; i < numVertices(); i++) {
p = getDeformedP()[i];
n = m_jointIds[i]._ndim;
nj = n - 1;
vstart = m_jointIds[i][nj];
for(j = 0; j < nj; j++) {
SkeletonJoint * joint = m_skeleton->jointByIndex(m_jointIds[i][j]);
spaceInv = joint->worldSpace();
spaceInv.inverse();
m_subspaceP[vstart + j] = spaceInv.transform(p);
}
}
}