mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-18 00:08:20 +01:00
Update vertex test for coordinate system
This is also the first working version of the mesh. I successfully loaded it in Minetest.
This commit is contained in:
parent
3cb592369d
commit
60e70c3cc5
@ -7,8 +7,11 @@
|
|||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "S3DVertex.h"
|
#include "S3DVertex.h"
|
||||||
#include "SAnimatedMesh.h"
|
#include "SAnimatedMesh.h"
|
||||||
|
#include "SColor.h"
|
||||||
#include "SMesh.h"
|
#include "SMesh.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -35,10 +38,10 @@ IAnimatedMesh* CGLTFMeshFileLoader::createMesh(io::IReadFile* file)
|
|||||||
SMeshBuffer* meshbuf { new SMeshBuffer {} };
|
SMeshBuffer* meshbuf { new SMeshBuffer {} };
|
||||||
|
|
||||||
const video::S3DVertex* vertices { new video::S3DVertex[3] {
|
const video::S3DVertex* vertices { new video::S3DVertex[3] {
|
||||||
{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {}, 0.0f, 0.0f},
|
{{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {}, {0.0f, 0.0f}},
|
||||||
{1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {}, 0.0f, 0.0f},
|
{{0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {}, {1.0f, 0.0f}},
|
||||||
{1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, {}, 0.0f, 0.0f} } };
|
{{-1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {}, {0.0f, 1.0f}} } };
|
||||||
const u16* indices { new u16[3] {} };
|
const u16* indices { new u16[3] {0, 1, 2} };
|
||||||
meshbuf->append(vertices, 3, indices, 3);
|
meshbuf->append(vertices, 3, indices, 3);
|
||||||
|
|
||||||
SMesh* mesh { new SMesh {} };
|
SMesh* mesh { new SMesh {} };
|
||||||
|
@ -29,8 +29,8 @@ TEST_CASE("minimal triangle has correct vertices") {
|
|||||||
reinterpret_cast<irr::video::S3DVertex*>(
|
reinterpret_cast<irr::video::S3DVertex*>(
|
||||||
meshbuf->getVertices()) };
|
meshbuf->getVertices()) };
|
||||||
CHECK(vertices[0].Pos == irr::core::vector3df {0.0f, 0.0f, 0.0f});
|
CHECK(vertices[0].Pos == irr::core::vector3df {0.0f, 0.0f, 0.0f});
|
||||||
CHECK(vertices[1].Pos == irr::core::vector3df {1.0f, 0.0f, 0.0f});
|
CHECK(vertices[1].Pos == irr::core::vector3df {0.0f, 1.0f, 0.0f});
|
||||||
CHECK(vertices[2].Pos == irr::core::vector3df {1.0f, 1.0f, 0.0f});
|
CHECK(vertices[2].Pos == irr::core::vector3df {-1.0f, 0.0f, 0.0f});
|
||||||
|
|
||||||
device->drop();
|
device->drop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user