I try to get 3d position from 2d coordinats on screen, but i get weird error from ISceneCollisionManager::getRayFromScreenCoordinates(). Debugger receives SIGSEGV signal but i dont know how to solve it. I was recompiled irrlicht two times and nothing new has happend. how can I check what variable is corrupted? Maybe i doing something wrong?
Code:
Starting debugger: F:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args F:/irrlicht-1.8.1/bin/Win32-gcc/CustomSceneNode.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 4304
Program received signal SIGSEGV, Segmentation fault.
At F:\irrlicht-1.8.1\examples\03.CustomSceneNode\main.cpp:322
Continuing...
Program received signal SIGSEGV, Segmentation fault.
At F:\irrlicht-1.8.1\examples\03.CustomSceneNode\main.cpp:322
Continuing...
[Inferior 1 (process 4304) exited with code 030000000005]
Debugger finished with status 0
Last edited by Matix522 on Wed Sep 03, 2014 4:02 pm, edited 1 time in total.
ISceneCollisionManager* SCmgr = smgr->getSceneCollisionManager();
/*rest of the code*/
ITriangleSelector* selector=smgr->createTriangleSelector((IMesh*)meshnode->getMesh(),(ISceneNode*)meshnode);
meshnode->setTriangleSelector(selector);
That was a problem, but now I'm getting valid coordinats only if I press mouse buton when cursor is on down part of mesh this is terrain using 32Bit meshbuffer and terrain size is 512(+32)x256 so this is probably a reason, but how fix this?
console text:
position in 2D space is X: 421 Y: 303
position in 3D space is X: 67.6232 Y: 11.293 Z: 88.1021
position in 2D space is X: 413 Y: 69
collision don't detected