Updating mesh collisions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

Updating mesh collisions

Post by Linaxys »

Hello,
I'm editing a terrain mesh ingame (it's a hillPlane), and I'd like to know if there's a faster way than clearing it's triangle selector from the meta and recreate one everytime I raise a vertice...

I use this at each update :

Code: Select all

	node->setPosition(node->getPosition());
	getMeta()->removeTriangleSelector(selector);
	selector->drop();
	selector = makeCollisions();
	getMeta()->addTriangleSelector(selector);
And it's very very slow...

Thanks.
Brkopac
Posts: 88
Joined: Fri Sep 19, 2008 2:36 am

Post by Brkopac »

Is there a reason you need to do this EVERYTIME you raise / lower or do whatever to the terrain? Why not make a button that updates it when you make multiple changes, or something of that sort?
Image - The glory days.
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

I'm doing this in my simulator's scenery editor. You raise the vertices on an ITerrainSceneNode.

Every time it's scale is changed, it changes onscreen text from "Terrain: Updated" to "Terrain: Not Updated", and then the user goes into the menu and selects "Update Terrain Node Data" and it updates it by doing this:

Code: Select all

terrain->setPosition(terrain->getPosition());
That forces it to update itself, and then the user can edit the nodes after that without it being glitchy.


Hope that helps.
Josiah Hartzell
Image
Post Reply