Can't do something when the particle touches to model
Can't do something when the particle touches to model
At first i should tell you this is an awesome 3d gaming engine. I have tried your sample project named demo in visual studio and debugged it and ran it. I noted that when i clicked the particle was fired and when it colloid with wall it converts into smoke. And than i wondered can't the particle convert into smoke when it colloid with the girl walking between the portals. Please tell me how can i do some function when my particle colloids with the md2 model(girl). Thanks in advance
Re: Can't do something when the particle touches to model
you need to add girl into triangle selector against which you are testing the ray collision
programmer is bad designer
designer is bad programmer
designer is bad programmer
Re: Can't do something when the particle touches to model
I know but i am not getting how to do that
Re: Can't do something when the particle touches to model
I don't know about the source code for that demo, but here's what you can do:
1. Create a meta triangle selector.
2. Get all the triangle selectors for each model and attach them to the node.
3. Then add it to the IMetaTriangleSelector:
You can then use tri_sel or whatever you name the variable with the ray test functions in your code.
Note, I'm not 100% sure on this (so someone please correct me if I'm wrong), but if you have animated models you may need
to recreate the triangle meshes each frame. This is simply based on my experiences with triangle selectors.
1. Create a meta triangle selector.
Code: Select all
IMetaTriangleSelector* tri_sel = smgr->createMetaTriangleSelector();
Code: Select all
ITriangleSelector* sel1 = smgr->createTriangleSelector(mesh1, node1);
node1->setTriangleSelector(sel1);
Code: Select all
tri_sel->addTriangleSelector(sel1);
sel1->drop(); //Be sure to drop the selector after.
Note, I'm not 100% sure on this (so someone please correct me if I'm wrong), but if you have animated models you may need
to recreate the triangle meshes each frame. This is simply based on my experiences with triangle selectors.