irrBullet and TerrainSceneNode

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

irrBullet and TerrainSceneNode

Postby ChrisDicko » Sat Mar 26, 2011 2:32 pm

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
ChrisDicko
 
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

Postby Radikalizm » Sat Mar 26, 2011 2:48 pm

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
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

irrBullet and TerrainSceneNode

Postby ChrisDicko » Sat Mar 26, 2011 3:15 pm

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
ChrisDicko
 
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

Postby ChaiRuiPeng » Sat Mar 26, 2011 3:21 pm

@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 ;)
User avatar
ChaiRuiPeng
 
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Postby serengeor » Sat Mar 26, 2011 3:39 pm

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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Postby hybrid » Sat Mar 26, 2011 5:15 pm

Accessing the underlying mesh is shown in the example. This holds for the non-LOD mesh only, though.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby ChaiRuiPeng » Sat Mar 26, 2011 5:34 pm

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 ;)
User avatar
ChaiRuiPeng
 
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Postby Radikalizm » Sat Mar 26, 2011 5:36 pm

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 ;)
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

irrBullet and TerrainSceneNode

Postby ChrisDicko » Sun Mar 27, 2011 5:05 am

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
ChrisDicko
 
Posts: 6
Joined: Mon Sep 17, 2007 7:32 am
Location: Morriset NSW Australia

Postby cobra » Sun Mar 27, 2011 5:43 am

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
cobra
 
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States

Postby serengeor » Sun Mar 27, 2011 8:43 am

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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Postby Sudi » Sun Mar 27, 2011 1:33 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby serengeor » Sun Mar 27, 2011 2:05 pm

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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Postby ChaiRuiPeng » Sun Mar 27, 2011 2:20 pm

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 ;)
User avatar
ChaiRuiPeng
 
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Postby cobra » Mon Mar 28, 2011 4:57 pm

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
cobra
 
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States

Next

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest