Node collision by triangle selector.

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
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

Node collision by triangle selector.

Post by Mloren »

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?
esaptonor
Posts: 145
Joined: Sat May 06, 2006 11:59 pm

Post by esaptonor »

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?
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

Post by Mloren »

because it wont hit walls. the walls of the level are all one big object (im using the quake3 level that is included with the engines examples) i need walls to collide because i dont want the ray to collide with an object behind a wall.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

What you could do is do the bounding box test on all your entities (not the map) and then to check that the entity isn't behind a wall you then check the same ray with the triangle selector of the map to make sure it doesn't go through that first.
Image Image Image
Post Reply