irrBullet and TerrainSceneNode

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
ChrisDicko
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

irrBullet and TerrainSceneNode

Post by ChrisDicko »

Is there a way of extracting the IMesh reference from an Irrlicht TerrainSceneNode for the second parameter of irrBullet IBvhTriangleMeshShape to supply the collision mesh?

Using terrain->getMesh() for the IMesh parameter dies on the line createShape(collMesh); in the IBvhTriangleMeshShape ctor.

I have found a previous post on how to extract terrain triangles for Bullet using a btTriangleMesh but can't see a way to bend that to work with the irrBullet wrapper.
Dicko
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

The difficulty with the terrain scene node would be that it constantly changes because of its LOD algo, so you don't have one static IMesh which you can feed to bullet

This would be possible if you'd just use a terrain mesh though
ChrisDicko
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

irrBullet and TerrainSceneNode

Post by ChrisDicko »

Thanks Radikalizm

I was intending to try using just the LOD 0 which was how the "pure" Bullet code in a previous post worked. Might just stay with Bullet rather than the irrBullet wrapper. It's for sample code in a games dev class, I was hoping to ease the pain a bit using a wrapper.
Dicko
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

@Chris

i full heartedly suggest using pure bullet :D it might seem easier to use a wrapper. but once you become familiar with using pure bullet it is much easier and using a wrapper can be confusing, since its a whole different interface and you have to go through TWO layers of abstraction just to solve a problem that would have been easier to fix if you were using pure bullet.
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

ChaiRuiPeng wrote:@Chris

i full heartedly suggest using pure bullet :D it might seem easier to use a wrapper. but once you become familiar with using pure bullet it is much easier and using a wrapper can be confusing, since its a whole different interface and you have to go through TWO layers of abstraction just to solve a problem that would have been easier to fix if you were using pure bullet.
I agree, I used irrbullet also irrBP myself tough they became a bit unneeded, because working with bullet itself is easy.

The second layer just makes it harder to use, like when you have to access stuff wrapper doesn't provide.
Working on game: Marrbles (Currently stopped).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Accessing the underlying mesh is shown in the example. This holds for the non-LOD mesh only, though.
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

hybrid wrote:Accessing the underlying mesh is shown in the example. This holds for the non-LOD mesh only, though.
you seem to be stressing importance of reading examples today :)
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

ChaiRuiPeng wrote:
hybrid wrote:Accessing the underlying mesh is shown in the example. This holds for the non-LOD mesh only, though.
you seem to be stressing importance of reading examples today :)
Maybe that's because a lot of questions asked today could be solved by reading the examples ;)
ChrisDicko
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

irrBullet and TerrainSceneNode

Post by ChrisDicko »

Thanks for all the comments and yes we will stay with just bullet.

As far as the terrain example goes (I do always read the forums/samples/google before posting) it shows how to extract the terrain data with getMeshBufferForLOD etc but not how to take that data and build an IMesh reference as required by irrBullet which was the original post question.
Dicko
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

serengeor wrote:
ChaiRuiPeng wrote:@Chris

i full heartedly suggest using pure bullet :D it might seem easier to use a wrapper. but once you become familiar with using pure bullet it is much easier and using a wrapper can be confusing, since its a whole different interface and you have to go through TWO layers of abstraction just to solve a problem that would have been easier to fix if you were using pure bullet.
I agree, I used irrbullet also irrBP myself tough they became a bit unneeded, because working with bullet itself is easy.

The second layer just makes it harder to use, like when you have to access stuff wrapper doesn't provide.
That's why most wrappers (or at least mine) have functions in each class to get a pointer to what it wraps so that when you need to work more low-level you can.

Moreover, with my wrapper you can get irrBullet types from pure Bullet types with ease, so doing any pure Bullet work using irrBullet is very easy and even faster than doing it the other way. :)
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

cobra wrote:
serengeor wrote:
ChaiRuiPeng wrote:@Chris

i full heartedly suggest using pure bullet :D it might seem easier to use a wrapper. but once you become familiar with using pure bullet it is much easier and using a wrapper can be confusing, since its a whole different interface and you have to go through TWO layers of abstraction just to solve a problem that would have been easier to fix if you were using pure bullet.
I agree, I used irrbullet also irrBP myself tough they became a bit unneeded, because working with bullet itself is easy.

The second layer just makes it harder to use, like when you have to access stuff wrapper doesn't provide.
That's why most wrappers (or at least mine) have functions in each class to get a pointer to what it wraps so that when you need to work more low-level you can.

Moreover, with my wrapper you can get irrBullet types from pure Bullet types with ease, so doing any pure Bullet work using irrBullet is very easy and even faster than doing it the other way. :)
Thats what I meant with the part "The second layer just makes it harder to use, like when you have to access stuff wrapper doesn't provide."
You can access what you need with pointers but it feels just not right.
Working on game: Marrbles (Currently stopped).
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

serengeor wrote: You can access what you need with pointers but it feels just not right.
You just don't feel right :P
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Sudi wrote:
serengeor wrote: You can access what you need with pointers but it feels just not right.
You just don't feel right :P
I do feel right.
Doing stuff with bullet is really easy, and doing it by digging trough additional layer is a bit weird. Unless doing some sandbox apps, then the wrapper makes it a bit easier, because it cleans up everything when you remove objects.
Working on game: Marrbles (Currently stopped).
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

Sudi wrote:
serengeor wrote: You can access what you need with pointers but it feels just not right.
You just don't feel right :P
you just feel serengeor does not feel right :P
and anyways. wrappers might be good for some people, bad for some. if all you want is just simple collision detection to control simple characters with pill shapes && and you dont want to read through the ton of bullet api, then a wrapper sounds good for you. however i am one of those people that need bullet in its purest form right now.
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

serengeor wrote:
Sudi wrote:
serengeor wrote: You can access what you need with pointers but it feels just not right.
You just don't feel right :P
I do feel right.
Doing stuff with bullet is really easy, and doing it by digging trough additional layer is a bit weird. Unless doing some sandbox apps, then the wrapper makes it a bit easier, because it cleans up everything when you remove objects.

It's true that using pure Bullet for simple games is easy, but the reason I created irrBullet is because I need very advanced physics in my game, and the only way to do that in a logical manner is with a wrapper.
Josiah Hartzell
Image
Post Reply