More than one 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!
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

More than one triangle selector

Post by The_Glitch »

I currently have a triangle selector for my level mesh to test against the camera node but when I try to have one for characters I'm not able to collide with the level mesh anymore. I'm trying to use simple physics as a placeholder until I can get bullet working with Irrlicht.

Is the Triangle Selector meant for just one type of check like in the demo it collides with the level but passes through characters.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

You can combine triangle selectors with a metatriangleselector.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

Go on
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

Uhm, not sure what else you expect. You create the metatriangleselector and add the other selectors to it. That's it...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

LOL
Okay I'll check into it Thanks.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

I setup the meta Triangle Selector and seems to be working fine except one drawback.

If the camera collides with the character the frame rate bombs :/.

I believe this issue is because the mesh of the character is a fair amount of polys. So to solve this I create a very simplistic shape of the character made of primitives and do collisions against this simple invisible version of the mesh instead of the render mesh that is seen by the user.

But will Irrlicht allow me to have another mesh that's not rendered to have collision test against it?


:EDIT:

If I set the character to use bounding box that works well, but I like my idea above most games or engines do this idea also.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

Kinda depends what this is about. If you need exact collisions you need to use the mesh itself. If invisible primitives are sufficent - then yeah - always use the simplest geometry you can get away with for collisions. Pretty much works like you described - make it invisble and then move it together with your real character. That's btw. also true for the level-mesh, many games have a simpler scene-geometry for collisions/physics.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

Yeah I'm going to see a way of having the render mesh and collision mesh as separate model files but having them together when loaded not to sure the easiest way of doing this.
Trial and error I suppose.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

Well, either 2 node arrays, first for real model and second for the collision nodes or you put both node pointers into some structure together. Just ensure they are always put at the same position each frame.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

Image
"ieg Black boxes are the collision mesh"


I haven't figured a way out to hide or not render the collision mesh node. If I set the collision node to setVisible(false) he's no longer used for collision you pass right through the object. Any suggestions
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

Hm, that doesn't sound like it should happen. Which function are you using for collision?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

2 separate nodes. I attach the collision node to the render node with the render nodes absolute position. And I set the collision node parent to the render node. Works fine if the collision node is visible but If I set the collision node to visible(false) collision acts strange it either doesn't work or the node doesn't stay with it's parent node. If you need code let me know.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

I've seemed to fix the problem. I just read the parameters for everything seems to be working well. Only problem is when one of my AI's start walking they randomly get stuck on a flat surface. Not to sure why.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

You can often fix the stuck problem by modifying the slide parameter. I'm not really deep into that code, but I think it has sometimes the problem that it finds the normals of walls which are below the floor. That's in case you have such walls in your map...
Not sure how to work around that. Maybe add a ceiling in the rooms below so there is a gap between ceiling and next floor.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

Well only problem is this is the only geometry the floor nothing below it.
Post Reply