Code: Select all
//first insert a square wich will be the wall (1.0 ver )
node = smgr->addTestSceneNode();
node->setScale(core::vector3df(1,20,1));
node->setPosition(core::vector3df(130,-105,0));
select=node->getTriangleSelector(); //here i get the triangle selector to do the comparision ( or i think it works that way... )
....
//this square will be moving arround the screen...
scene::ISceneNode* node = 0;
node = smgr->addTestSceneNode();
node->setPosition(core::vector3df(30,-60,0));
core::vector3d<f32> start,end;
while(device->run())
{
start=node->getPosition();
node->setPosition(node->getPosition()+core::vector3df(0.1,-0.1,0));
end=node->getPosition();
core::vector3df colision;
core::triangle3df triangulo;
core::line3d<f32> line(start,end);
smgr->getSceneCollisionManager()->getCollisionPoint(line,select, colision,triangulo);
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
By the way... the line height it is infinite? i mean.. it starts and ends when it does the test or have an start and end? ... i realy speak bad english :'(