Shooting (from demo) collisions
Posted: Fri Nov 07, 2008 6:38 am
Hi all
I have got shooting to work (finally) and have a small problem (two actually, this post focuses on one).
The collision with the main ground mesh (from irr) is working fine now, but I am trying to add another collision detection with a standard 3ds mesh. I have added the object and everything, I just don't have the correct code for this. I have also tried adding another triangle selector (using this mesh only) and putting it in this code:
// get intersection point with map
if (smgr->getSceneCollisionManager()->getCollisionPoint(
line, *triangleselector*, end, triangle))
{
//Do stuff here if collision is met
}
But changing it to work with my other 3d object. This does not seem to work, as any code passed does not seem to work. What have I done wrong here? I am using exact code from the demo tutorial with shooting.
All I am aiming to do is make my sphere change colour when hit by a bullet.
I have got shooting to work (finally) and have a small problem (two actually, this post focuses on one).
The collision with the main ground mesh (from irr) is working fine now, but I am trying to add another collision detection with a standard 3ds mesh. I have added the object and everything, I just don't have the correct code for this. I have also tried adding another triangle selector (using this mesh only) and putting it in this code:
// get intersection point with map
if (smgr->getSceneCollisionManager()->getCollisionPoint(
line, *triangleselector*, end, triangle))
{
//Do stuff here if collision is met
}
But changing it to work with my other 3d object. This does not seem to work, as any code passed does not seem to work. What have I done wrong here? I am using exact code from the demo tutorial with shooting.
All I am aiming to do is make my sphere change colour when hit by a bullet.