本文整理汇总了C++中Object3D::isDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::isDirty方法的具体用法?C++ Object3D::isDirty怎么用?C++ Object3D::isDirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::isDirty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTransformation
void DualQuaternionTransformationTest::setTransformation() {
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::setTransformation(): the dual quaternion is not normalized\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
o.setTransformation(DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis()));
CORRADE_VERIFY(o.isDirty());
CORRADE_COMPARE(o.transformationMatrix(), Matrix4::rotationX(Deg(17.0f)));
/* Scene cannot be transformed */
Scene3D s;
s.setClean();
CORRADE_VERIFY(!s.isDirty());
s.setTransformation(DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis()));
CORRADE_VERIFY(!s.isDirty());
CORRADE_COMPARE(s.transformationMatrix(), Matrix4());
}
示例2:
void RigidMatrixTransformation3DTest::setTransformation() {
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error::setOutput(&out);
o.setTransformation(Matrix4::scaling(Vector3(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::setTransformation(): the matrix doesn't represent rigid transformation\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
o.setTransformation(Matrix4::rotationX(Deg(17.0f)));
CORRADE_VERIFY(o.isDirty());
CORRADE_COMPARE(o.transformationMatrix(), Matrix4::rotationX(Deg(17.0f)));
/* Scene cannot be transformed */
Scene3D s;
s.setClean();
CORRADE_VERIFY(!s.isDirty());
s.setTransformation(Matrix4::rotationX(Deg(17.0f)));
CORRADE_VERIFY(!s.isDirty());
CORRADE_COMPARE(s.transformationMatrix(), Matrix4());
}