Bullet physics demo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Halifax wrote:Good work, but your taking a very minimalistic approach with your release aren't you? Why no executable? Without that, it's a lot of work just to use an updated Bullet library.
No executable code means a bar that they have to pass.

If they can deal with the code, that means they can do a lot of stuff with the demo code.
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Hey, look, 96 downloads so far. Not sure why that number is 96, though.

Image
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Updates:

Adding CTerrainHeightMap is proving to be a hassle. Bullet is having a hard time setting up the triangles.

Maybe I should stick with simple terrain meshes with low polycount?
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

This demo went OK as it passed the basic test.

Image
Image
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Well the code is a little messy but understandable...but i still dont understand the concept behind porting bullet to irrlicht...some help here?
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

Hey, anyone knows if Bullet can somehow load bmp heightmap files directly?

I know the latest version can load .raw files, but i use a heightmap generation library that only generates bmp.

Im sure that there also must be some way of passing the loaded bmp triangles from irrlicht to bullet, but i dont know how.

Please share some light on this
Thanks
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

just convert the bmp to raw... Irrlicht has way better raw support now. (1.5)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Look at btHeightfieldTerrainShape for more information on loading terrains in Bullet.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

i didnt know that irrlicht had a native conversion function. i will try that.

thanks for replying
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

Actually i couldnt find any function or way in neither irrlicht or bullet of converting bmp to raw of vice versa. does anyone know an effective way of doing that in real time?

Thanks for the help
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Once you've loaded the image, you can lock it and the resulting pointer points to RAW data.
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

Hybrid;

Thanks for the response, but i am not quite sure what you mean by "lock it".

Do you mean that once the bmp data is loaded, the internal data structure can be considered as a raw file?

My main concern here is how to transform this bmp data into raw since bullet seems to only like raw. The code below is a sample on what i am using to load heightmap info with bullet:

Code: Select all

...
        FILE* heightfieldFile = fopen(filename,"r");
		
	if (heightfieldFile)
	{
		int numBytes = fread(heightfieldData,1,width*length,heightfieldFile);
		if (!numBytes)
		{
			printf("couldn't read heightfield at %s\n",filename);
		}
		fclose (heightfieldFile);
	}
	
	...
	
	btHeightfieldTerrainShape* heightFieldShape = new btHeightfieldTerrainShape(width,length,heightfieldData,maxHeight,upIndex,useFloatDatam,flipQuadEdges);;
Any help is appreciated
Regards
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, that's probably not possible then. What you'd get is a greymap with three or four color elements per pixel. Hence, the data would be completely wrong for this function, unless you can tell bt to interpret the data differently.
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

yeah, I see what you mean;

What I will try then is getting the mesh out of the irrlicht terrain and pass it to bullet, even though this wouldnt be the most optimized solution.

What would you do if you had this issue anyway?

Regards
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Use a raw for the irrlicht map? Use the same color encoding? Get a gray version of the color map? strip irrelevant info? or alternatively add the missing one? A coder's job is to find solutions, come on, find some.
Post Reply