2010-01-12 13:46:44 +00:00
|
|
|
/*
|
|
|
|
This is a test of the manual resource loader interface to Ogre,
|
|
|
|
applied to manually created meshes. It defines a simple mesh
|
|
|
|
consisting of two triangles, and creates three instances of it as
|
|
|
|
different meshes using the same loader. It is a precursor to the NIF
|
|
|
|
loading code. If the Ogre interface changes and you have to change
|
|
|
|
this test, then you will also have to change parts of the NIF
|
|
|
|
loader.
|
|
|
|
*/
|
|
|
|
|
2010-01-24 19:58:31 +00:00
|
|
|
#include "ogre_mesh_common.cpp"
|
2010-01-08 11:06:22 +00:00
|
|
|
|
2010-01-24 19:58:31 +00:00
|
|
|
void C::doTest()
|
2010-01-08 11:06:22 +00:00
|
|
|
{
|
2010-01-10 17:32:21 +00:00
|
|
|
// Create a couple of manual meshes
|
2010-01-24 19:58:31 +00:00
|
|
|
makeMesh("mesh1.mm");
|
|
|
|
makeMesh("mesh2.mm");
|
|
|
|
makeMesh("mesh3.mm");
|
2010-01-10 17:32:21 +00:00
|
|
|
|
|
|
|
// Display the meshes
|
2010-01-12 12:15:58 +00:00
|
|
|
{
|
|
|
|
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node");
|
|
|
|
Entity *ent = mgr->createEntity("Mesh1", "mesh1.mm");
|
|
|
|
node->attachObject(ent);
|
|
|
|
node->setPosition(3,1,8);
|
|
|
|
}
|
2010-01-08 11:06:22 +00:00
|
|
|
|
2010-01-12 12:15:58 +00:00
|
|
|
{
|
|
|
|
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node2");
|
|
|
|
Entity *ent = mgr->createEntity("Mesh2", "mesh2.mm");
|
|
|
|
node->attachObject(ent);
|
|
|
|
node->setPosition(-3,1,8);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node3");
|
|
|
|
Entity *ent = mgr->createEntity("Mesh3", "mesh3.mm");
|
|
|
|
node->attachObject(ent);
|
|
|
|
node->setPosition(0,-2,8);
|
|
|
|
}
|
2010-01-08 11:06:22 +00:00
|
|
|
}
|