本文整理汇总了C++中Mat4f::scale_self方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4f::scale_self方法的具体用法?C++ Mat4f::scale_self怎么用?C++ Mat4f::scale_self使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4f
的用法示例。
在下文中一共展示了Mat4f::scale_self方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_a
//.........这里部分代码省略.........
Mat4i answer(answer_values);
Mat4i result = Mat4i::translate(2, 3, 4);
if (result != answer) fail();
}
Console::write_line(" Function: translate_self() (int)");
{
Mat4i answer(test_a);
Mat4i result = test_a;
result = result * Mat4i::translate(2, 3, 4);
Mat4i result2 = test_a;
result2.translate_self(2,3,4);
if (result != result2) fail();
}
Console::write_line(" Function: translate_self() (float)");
{
Mat4f answer(test_a);
Mat4f result(test_a);
result = result * Mat4f::translate(2, 3, 4);
Mat4f result2(test_a);
result2.translate_self(2, 3, 4);
if (!result.is_equal(result2, 0.00001f))
fail();
}
Console::write_line(" Function: scale_self()");
{
Mat4i answer(test_a);
Mat4i result = test_a;
result = result * Mat4i::scale(2, 3, 4);
Mat4i result2 = test_a;
result2.scale_self(2,3,4);
if (result != result2) fail();
Mat4f test = test_c;
test.scale_self(2.0f, 3.0f, 4.0f);
if (!test.is_equal(test_c_scaled, 0.00001f))
fail();
}
Console::write_line(" Function: rotate (using euler angles)");
{
Mat4f mv = Mat4f::identity();
mv = mv * Mat4f::rotate(Angle(30.0f, angle_degrees), 0.0f, 0.0f, 1.0f, false);
mv = mv * Mat4f::rotate(Angle(10.0f, angle_degrees), 1.0f, 0.0f, 0.0f, false);
mv = mv * Mat4f::rotate(Angle(20.0f, angle_degrees), 0.0f, 1.0f, 0.0f, false);
Mat4f test_matrix;
test_matrix = Mat4f::rotate(Angle(10.0f, angle_degrees), Angle(20.0f, angle_degrees), Angle(30.0f, angle_degrees), order_YXZ);
if (!test_matrix.is_equal(mv, 0.00001f))
fail();
}