I see, I haven't tried going that big (I think)polylux wrote:roughly 350k of verteces at LOD 0serengeor wrote:How big was your terrain (how much vertices)?polylux wrote:Well, seemingly it's the wrong way to create a triangle collision mesh from your terrain as with a sufficiently sized terrain the simulation pretty fast slows down to a slide show. Bullet offers the btHeightfieldTerrainShape (Link) for such things. I am currently very tempted to extend irrBullet's functionality by this - as long as no one else has done it already.
If so, just tell me please.
p.
irrBullet 0.1.8 - Bullet physics wrapper
Re: irrBullet 0.1.71 - Bullet physics wrapper
Working on game: Marrbles (Currently stopped).
Re: irrBullet 0.1.71 - Bullet physics wrapper
i'm facing a similar issue with my project using pure bullet the simulation slows down to a crawl with a terrain larger then 256*256 and even worst my final implementation will require 6 height map of 2048x2048
so i think the only solution to the issue will be to separate the terrain into patches and load, unload the mesh data to bullet at run time depending on the position of the player since i don't think i can in my implementation use the height field implementation
so i think the only solution to the issue will be to separate the terrain into patches and load, unload the mesh data to bullet at run time depending on the position of the player since i don't think i can in my implementation use the height field implementation
-
- Posts: 14
- Joined: Sun Apr 24, 2011 4:10 am
Re: irrBullet 0.1.71 - Bullet physics wrapper
Any idea what would cause the Makefile to not function correctly:
brian@www ~/server_code/source/irrBullet-0.1.71/build $ make
make: *** No rule to make target `BulletCollision/CollisionShapes/btCollisionShape.h', needed by `../source/softbody.o'. Stop.
brian@www ~/server_code/source/irrBullet-0.1.71/build $
brian@www ~/server_code/source/irrBullet-0.1.71/build $ make
make: *** No rule to make target `BulletCollision/CollisionShapes/btCollisionShape.h', needed by `../source/softbody.o'. Stop.
brian@www ~/server_code/source/irrBullet-0.1.71/build $
Re: irrBullet 0.1.71 - Bullet physics wrapper
BulletCollision/CollisionShapes/btCollisionShape.h doesn't exist. You're probably in the wrong directory or you need -I<bullet directory>.
-
- Posts: 48
- Joined: Tue Aug 31, 2010 6:27 am
Re: irrBullet 0.1.71 - Bullet physics wrapper
Is there some way with irrBullet or the underlying Bullet physics library to reposition something instantly in space? This is coming up particularly in creating game entities. I might not have the position information up front, so the mesh is first placed at (0, 0, 0), but maybe a few lines of code later it'll get put in its real spot. This is happening between simulation steps so I wouldn't expect any change in physics. I can't then reposition Irrlicht's mesh node and get the physics wrapper to understand it. I'm afraid I have to completely re-create the physics object. I would rather not argue about why I'm not getting the position to it right then and there, since I expect eventually I'd want to do something like teleport an object without having a problem.
Re: irrBullet 0.1.71 - Bullet physics wrapper
With bullet I can position the object whereever I need it to be by getting its center of mass transform, modifying its origin and setting it back to the body. At least it works for my level editor, but I'm sure irrBullet wouldn't cause too much trouble doing that. Maybe there's even helper function to do that in irrBullet(I don't really know, as I'm not using it).
Working on game: Marrbles (Currently stopped).
-
- Posts: 48
- Joined: Tue Aug 31, 2010 6:27 am
Re: irrBullet 0.1.71 - Bullet physics wrapper
I think I ended up doing this in the end. I forgot that previously I had tried to get the world transform matrix, and change the translation vector to the new coordinates. It appeared that after doing this that my frame rate dropped, despite not doing this every frame. That turned out to be a fluke. IMO it's still kind of silly and I might write a helper for it. At the least, it would be easier to set the translation vector directly. Right now I have to copy the matrix, call the method to set the translation, then store the new matrix over the existing one. Again, this isn't something happening in bulk from frame-to-frame, but it hits my C++ OCD impulse.
Re: irrBullet 0.1.71 - Bullet physics wrapper
For me this works pretty well:
Though I haven't really done any speed measures here, but it seemed to be pretty fast. At least editing position from the GUI/3d view didn't cause too much trouble.
Code: Select all
btTransform t=m_rigidBody->getCenterOfMassTransform();
t.setOrigin(newVal);
this->m_rigidBody->setCenterOfMassTransform(t);
Working on game: Marrbles (Currently stopped).
Re: irrBullet 0.1.71 - Bullet physics wrapper
Rocko Bonaparte wrote:Is there some way with irrBullet or the underlying Bullet physics library to reposition something instantly in space? This is coming up particularly in creating game entities. I might not have the position information up front, so the mesh is first placed at (0, 0, 0), but maybe a few lines of code later it'll get put in its real spot. This is happening between simulation steps so I wouldn't expect any change in physics. I can't then reposition Irrlicht's mesh node and get the physics wrapper to understand it. I'm afraid I have to completely re-create the physics object. I would rather not argue about why I'm not getting the position to it right then and there, since I expect eventually I'd want to do something like teleport an object without having a problem.
Hi Rocko,
irrBullet makes this very easy. First, the object is located in the world wherever your scene node is at creation time (if you choose to do it that way).
The second option is this (taken from the irrBullet FAQ included with the SDK; please refer to this and the Doxygen documentation for future questions because it's likely already answered):
Code: Select all
1.2
A: How do I change the position or rotation of one of my
objects?
Q: Changing the world transform of an object is easy with
2
irrBullet.
Here is an example:
irr::core::matrix4 mat;
mat.setTranslation(irr::core::vector3df(0,1000,1000));
mat.setRotationDegrees(irr::core::vector3df(0,0,0));
object->setWorldTransform(mat);
Re: irrBullet 0.1.71 - Bullet physics wrapper
How does this make it any easier than it already is, despite the fact that it uses irrlicht matrix4?cobra wrote: irrBullet makes this very easy. First, the object is located in the world wherever your scene node is at creation time (if you choose to do it that way).
Working on game: Marrbles (Currently stopped).
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
Re: irrBullet 0.1.71 - Bullet physics wrapper
Reminds me of functions like
I really don't get the point of wrappers.
Code: Select all
void setNodePosition(irr::scene::ISceneNode* node, const irr::core::vector3df& position)
{
node->setPosition(position);
}
"Whoops..."
Re: irrBullet 0.1.71 - Bullet physics wrapper
yeah, I also don't understand why would you need to wrap almost everything in bulletrandomMesh wrote:Reminds me of functions likeI really don't get the point of wrappers.Code: Select all
void setNodePosition(irr::scene::ISceneNode* node, const irr::core::vector3df& position) { node->setPosition(position); }
It has such a nice interface to interact with that you hardly need few helper classes for it.
Working on game: Marrbles (Currently stopped).
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: irrBullet 0.1.71 - Bullet physics wrapper
This is not an issue of the code being a wrapper function, this is just a matter of either a stupid programmer, or someone who is very attached to procedural programming and therefore tries to negate all the principles of an OO design in an environment which was created with OO in mind (which is pretty stupid too when you look at it)randomMesh wrote:Reminds me of functions likeI really don't get the point of wrappers.Code: Select all
void setNodePosition(irr::scene::ISceneNode* node, const irr::core::vector3df& position) { node->setPosition(position); }
You wouldn't believe the amount of code I've seen written like this, it's ridiculous
-
- Posts: 30
- Joined: Fri Jan 08, 2010 3:30 pm
Re: irrBullet 0.1.71 - Bullet physics wrapper
Hello,
i got a small memory leak, if I'm creating a BoxShape and RigidBody.
Later I delete the body with removeCollisionObject. But Visual Studio says all the time that there is still an object allocated
Has anybody an idea, how I can free this memory?
Thanks!
i got a small memory leak, if I'm creating a BoxShape and RigidBody.
Code: Select all
ISphereShape* shape = new ISphereShape(node, mass, false);
shape->setUnscaledRadius(r);
IRigidBody* body = this->world->addRigidBody(shape,group,mask);
Code: Select all
Detected memory leaks!
Dumping objects ->
{604} normal block at 0x01D16610, 368 bytes long.
Data: < N > 00 E7 4E 01 CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
Thanks!
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: irrBullet 0.1.71 - Bullet physics wrapper
@Barratator: The memory leak dump provides you with an allocation number (in your case 604), set a breakpoint at this allocation and check which object is being created and try to trace this object throughout the program until its destruction, if it is being destroyed at all
If it's not being destroyed or dropped (when reference counted) it's pretty obvious what you need to do
If it is being dropped you should check for objects grabbing the object and not dropping it, and for cyclic references which result in the object never getting dropped (these can be harder to trace)
If it's not being destroyed or dropped (when reference counted) it's pretty obvious what you need to do
If it is being dropped you should check for objects grabbing the object and not dropping it, and for cyclic references which result in the object never getting dropped (these can be harder to trace)