Collision & BSP

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
lantis
Posts: 64
Joined: Thu Jun 17, 2004 2:46 pm

Collision & BSP

Post by lantis »

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?
Mindl
Posts: 16
Joined: Wed Jun 30, 2004 1:42 am

BSP & Collision

Post by 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? 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
lantis
Posts: 64
Joined: Thu Jun 17, 2004 2:46 pm

Post by lantis »

>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.
Mindl
Posts: 16
Joined: Wed Jun 30, 2004 1:42 am

Post by Mindl »

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
lantis
Posts: 64
Joined: Thu Jun 17, 2004 2:46 pm

Post by lantis »

getSceneNodeFromRayBB return me node(Another player)
which hided inside house ;(
Camera not see this node , so getSceneNodeFromRayBB must return NULL
but its return Node!
lantis
Posts: 64
Joined: Thu Jun 17, 2004 2:46 pm

Post by lantis »

UP
Post Reply