Here code (Same in Collision demo)
----------------------------------------------------
irr::core::position2d<int> cursorPos;
cursorPos = cursor->getPosition();
core::line3d<f32> line = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(cursorPos, camera);
selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromRayBB(line);
----------------------------------------------------
Its work fine , BUT its ignore bsp node!!!
So its can select node inside house when im stand out of house and not see
node!!!!
Any ideas?
Collision & BSP
BSP & Collision
Is this BSP node a BSP map of the house? And you want to send a ray out from the camera to see if it intersects somewhere inside of the BSP house? Not to clear on exactly what you want to do. Theoretically it should send back the BSP node if that line intersects with it at all. You might want to try making a triangleselector of the bsp node and the using getCollisionPoint from the Scene CollisonManager to find which triangle it intersected with or the collison point it hit.
-Mindl
-Mindl
>Is this BSP node a BSP map of the house? And you want to send a ray out
>from the camera to see if it intersects somewhere inside of the BSP house?
Yes , exactly.
>using getCollisionPoint
Im need select Node , not a triangle ;(
This function need for me to select target , but now its can select target
always and ignore what target stand behind wall.
>from the camera to see if it intersects somewhere inside of the BSP house?
Yes , exactly.
>using getCollisionPoint
Im need select Node , not a triangle ;(
This function need for me to select target , but now its can select target
always and ignore what target stand behind wall.
Well what exactly is the getSceneNodeFromRayBB function returning? Is it returning another scenenode or is it returning 0? Also are you just trying to see if the user has clicked on the BSP house on the screen? Or are you trying to find out where exactly at on the BSP house they have clicked?
-Mindl
-Mindl