I was trying to use the collision class and noted that you can do a ray collision against triangle selectors and it gives you the point of collision and the triangle it collided upon, but not the node itself.
I noticed you can get the node from a ray with a different function but then the collision is done by bounding box.
What i need is some way to get a node, using a ray vs selector.
Well what im actualy looking for is a way to draw a ray and check if it intersects with a specific node without hitting any other nodes in the scene first. The first method doesnt seem to have any way to tell what you actualy hit, and the second method doesnt collide with the level itself because its bounding box is huge and you're inside it.
Theres currently no way to do this right? I havent over looked some functionality somewhere?
Would be cool if there was a function that returned the first node hit by doing a ray vs a selector. any chance of adding this to the engine at some point?
Node collision by triangle selector.
check out getSceneNodeFromRayBB in the collision manager. Just give all selectable nodes a unique bitmask and non-selecable nodes a different bitmask.
I dont see a problem with it using the bounding box...it will still return the first node it hits. You said the it wont hit the level because the level is so huge...but why do you need to hit the level if you are trying to get the nearest node?
I dont see a problem with it using the bounding box...it will still return the first node it hits. You said the it wont hit the level because the level is so huge...but why do you need to hit the level if you are trying to get the nearest node?