Browse Source

Primitives: test Capsule with more cylinder segments.

Testing two face segments is not enough, as _exactly two_ vertex rings
are part of both the cylinder and cap hemispheres.
pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
51e2628486
  1. 22
      src/Primitives/Test/CapsuleTest.cpp

22
src/Primitives/Test/CapsuleTest.cpp

@ -50,7 +50,7 @@ CapsuleTest::CapsuleTest() {
}
void CapsuleTest::solidWithoutTextureCoords() {
Trade::MeshData3D capsule = Capsule::solid(2, 2, 3, 1.0f);
Trade::MeshData3D capsule = Capsule::solid(2, 4, 3, 1.0f);
CORRADE_COMPARE_AS(capsule.positions(0), (std::vector<Vector3>{
{0.0f, -1.5f, 0.0f},
@ -63,10 +63,18 @@ void CapsuleTest::solidWithoutTextureCoords() {
{0.866025f, -0.5f, -0.5f},
{-0.866025f, -0.5f, -0.5f},
{0.0f, -0.25f, 1.0f},
{0.866025f, -0.25f, -0.5f},
{-0.866025f, -0.25f, -0.5f},
{0.0f, 0.0f, 1.0f},
{0.866025f, 0.0f, -0.5f},
{-0.866025f, 0.0f, -0.5f},
{0.0f, 0.25f, 1.0f},
{0.866025f, 0.25f, -0.5f},
{-0.866025f, 0.25f, -0.5f},
{0.0f, 0.5f, 1.0f},
{0.866025f, 0.5f, -0.5f},
{-0.866025f, 0.5f, -0.5f},
@ -97,6 +105,14 @@ void CapsuleTest::solidWithoutTextureCoords() {
{0.866025f, 0.0f, -0.5f},
{-0.866025f, 0.0f, -0.5f},
{0.0f, 0.0f, 1.0f},
{0.866025f, 0.0f, -0.5f},
{-0.866025f, 0.0f, -0.5f},
{0.0f, 0.0f, 1.0f},
{0.866025f, 0.0f, -0.5f},
{-0.866025f, 0.0f, -0.5f},
{0.0f, 0.707107f, 0.707107f},
{0.612372f, 0.707107f, -0.353553f},
{-0.612372f, 0.707107f, -0.353553f},
@ -110,7 +126,9 @@ void CapsuleTest::solidWithoutTextureCoords() {
4, 5, 8, 4, 8, 7, 5, 6, 9, 5, 9, 8, 6, 4, 7, 6, 7, 9,
7, 8, 11, 7, 11, 10, 8, 9, 12, 8, 12, 11, 9, 7, 10, 9, 10, 12,
10, 11, 14, 10, 14, 13, 11, 12, 15, 11, 15, 14, 12, 10, 13, 12, 13, 15,
13, 14, 16, 14, 15, 16, 15, 13, 16
13, 14, 17, 13, 17, 16, 14, 15, 18, 14, 18, 17, 15, 13, 16, 15, 16, 18,
16, 17, 20, 16, 20, 19, 17, 18, 21, 17, 21, 20, 18, 16, 19, 18, 19, 21,
19, 20, 22, 20, 21, 22, 21, 19, 22
}), TestSuite::Compare::Container);
}

Loading…
Cancel
Save