MCPcopy Create free account
hub / github.com/defold/defold / TEST

Function TEST

engine/dlib/src/test/test_transform.cpp:42–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 ASSERT_V3_NEAR(expected.GetScale(), actual.GetScale());
41
42TEST(dmTransform, Apply)
43{
44 TransformS1 ts1(Vector3(1.0f, 0.0f, 0.0f),
45 Quat::rotationZ((float) M_PI_2),
46 2.0f);
47
48 ASSERT_V3_NEAR(Vector3(0.0f, 2.0f, 0.0f), dmTransform::Apply(ts1, Vector3(1.0f, 0.0f, 0.0f)));
49 ASSERT_V3_NEAR(Point3(1.0f, 2.0f, 0.0f), dmTransform::Apply(ts1, Point3(1.0f, 0.0f, 0.0f)));
50
51 Transform t(Vector3(1.0f, 0.0f, 0.0f),
52 Quat::rotationZ((float) M_PI_2),
53 Vector3(2.0f, 2.0f, 2.0f));
54
55 ASSERT_V3_NEAR(Vector3(0.0f, 2.0f, 0.0f), dmTransform::Apply(t, Vector3(1.0f, 0.0f, 0.0f)));
56 ASSERT_V3_NEAR(Point3(1.0f, 2.0f, 0.0f), dmTransform::Apply(t, Point3(1.0f, 0.0f, 0.0f)));
57}
58
59TEST(dmTransform, Multiply)
60{

Callers

nothing calls this directly

Calls 15

AbsFunction · 0.85
ToTransformFunction · 0.85
Vector3Class · 0.50
ApplyFunction · 0.50
Point3Class · 0.50
MulFunction · 0.50
lengthFunction · 0.50
normalizeFunction · 0.50
QuatClass · 0.50
ToMatrix4Function · 0.50
InvFunction · 0.50
GetTranslationMethod · 0.45

Tested by

no test coverage detected