(SOLVED) Triangle selector on a scaled node?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

(SOLVED) Triangle selector on a scaled node?

Post by danielmccarthy »

Hi when ever I scale a node the triangle selector does not work. Otherwise it does

Any advice?

Code: Select all

 
bool Game::loadMap(std::string filename)
{
    /* Remove the old map */
    if (_map != 0)
        _map->remove();
 
    IMeshSceneNode* mapNode = smgr->addOctreeSceneNode(smgr->getMesh(filename.c_str()));
    /* Load the new map*/
    _map = new Map(mapNode, gameObjectManager);
 
    gameObjectManager->addGameObject(_map);
    mapNode->setPosition(core::vector3df(500, 0, 500));
    mapNode->setScale(core::vector3df(6, 0, 6));
    mapNode->setMaterialFlag(EMF_LIGHTING, false);
 
    scene::ITriangleSelector* s = smgr->createOctreeTriangleSelector(mapNode->getMesh(),
                                                                     mapNode,
                                                                     128);
    mapNode->setTriangleSelector(s);
    s->drop();
    /* Load the objects */
    _map->addObject(1, 500, 500);
    return true;
}
Last edited by danielmccarthy on Sat Aug 23, 2014 4:14 am, edited 1 time in total.
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Triangle selector on a scaled node?

Post by danielmccarthy »

Found the issue will state here in case someone else has the same problem.
When you scale an object with the Y axis set to zero triangle selectors do not work properly.
Post Reply