Creating polygon shape

calsmurf2904

20-09-2008 21:07:53

Hello,
Is it possible to create a shape that you can alter to add polygons ?
if so how ?

imajia

21-09-2008 08:42:09

You mean add triangles during runtime? I'm not sure if there is an efficient way to add new triangles to a shape. Cou could use a btCompoundShape and then add the triangles shapes with the method addChildShape. But this might be as slow as it sounds (haven't tested it).

If a convex hull is sufficient, then btConvexHullShape could be used. This shape allows to add points, but you cannot remove them afterwards.

If you only have to change a few triangles every now and then, creating a new shape might be easier.

Perhaps I've missed something and someone has a better idea?

calsmurf2904

21-09-2008 12:30:18

I found out that the Triangle shape is easier to use...but it has one downside..for each triangle you need to make a new shape.I am currently trying to change that to the way Bullet handles it.
Edited the files...testing now.

Edit
nvm....i can't get anything to work so i decided to use plain bullet code instead of a ogrewrapper.