Page 1 of 2

irrBullet and TerrainSceneNode

Posted: Sat Mar 26, 2011 2:32 pm
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.

Posted: Sat Mar 26, 2011 2:48 pm
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

irrBullet and TerrainSceneNode

Posted: Sat Mar 26, 2011 3:15 pm
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.

Posted: Sat Mar 26, 2011 3:21 pm
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.

Posted: Sat Mar 26, 2011 3:39 pm
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.

Posted: Sat Mar 26, 2011 5:15 pm
by hybrid
Accessing the underlying mesh is shown in the example. This holds for the non-LOD mesh only, though.

Posted: Sat Mar 26, 2011 5:34 pm
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 :)

Posted: Sat Mar 26, 2011 5:36 pm
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 ;)

irrBullet and TerrainSceneNode

Posted: Sun Mar 27, 2011 5:05 am
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.

Posted: Sun Mar 27, 2011 5:43 am
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. :)

Posted: Sun Mar 27, 2011 8:43 am
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.

Posted: Sun Mar 27, 2011 1:33 pm
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

Posted: Sun Mar 27, 2011 2:05 pm
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.

Posted: Sun Mar 27, 2011 2:20 pm
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.

Posted: Mon Mar 28, 2011 4:57 pm
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.