Jump to content
  • Advertisement
Sign in to follow this  
mind in a box

[Bullet]Fast objects crashing through my level bounds

This topic is 2528 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Since working on the physics for the ships of our game Pulsedrive I've always had this issue bogging me.
I'm not working with bullet for a long time yet, so I probably don't know if I just have done something stupid in the setup of the engine.
Also I already asked this on the BulletPhysicsforums last month, but haven't got an answer yet.

To get you a better overview of the situation I made a little picture:
collisionproblemsq67q1.jpg

Most of the time the ship will just crash through the border marked with the red arrow when I am "fast" enough. This will also happen if I jump off a ramp and do a hard landing afterwards. I will just smash through the ground.
Ship uses a btBoxShape, track-pieces are btBvhTriangleMeshShapes. From my tests it doesn't seem that the ship crashes through a static box shape, so the problem must be the btBvhTriangleMeshShape.

Anyone knows a solution to this?

Share this post


Link to post
Share on other sites
Advertisement
I don't think that my objects are so fast that tunneling is the issue.

My ship would have to move about 8 units (Length of the ship) per frame for this to happen,
yet, thread were the physics are in, runs at an avg. of 0.02ms, which should be fast enough, but that happens even if I'm
moving it with just 80 or 90 units per second (80*0.02 = 1.6, problem?) , sometimes even when moving slower.

Apart from that the ship doesn't really goes through the wall fully. It gets stuck on the half way most of the times. Probably it only goes through the first polygon-wall and then gets stopped by the backside of the trackmesh.

Share this post


Link to post
Share on other sites
Hidden
Meh, I forgot to press the "Post" Button yesterday, or my posting got lost, or whatever.

But I don't think that tunneling is the issue. The Thread where the physics-calculations run it, runs at 0.02ms per frame. Yet my Ship is only moving about 70 units per second.
Not enough speed to pass the whole collisionmesh in one frame.
Also it seems that the ship goes only through one side of the track and then hangs inside it because it gets blocked by the backside of the track.

Share this post


Link to post
I was performing some search and found this thread.
Perhaps I'm going to ask you a trivial thing but...
  1. Is the ship a kinematic body?
  2. If yes, have you disabled deactivation?
  3. Are you using the provided "car simulation" code?
Edited by Krohm

Share this post


Link to post
Share on other sites
Do you use the same mesh for collision that is rendered?

What kind of time-step size are you using, and is it fixed?

Share this post


Link to post
Share on other sites
I was performing some search and found this thread.
Perhaps I'm going to ask you a trivial thing but...
  1. Is the ship a kinematic body?
  2. If yes, have you disabled deactivation?
  3. Are you using the provided "car simulation" code?
[/quote]

I'm glad you found it! ;)

1.: No, it's a normal rigidbody.
2.: -
3.: Nope, I have written one myself, using the scripting feature of our engine. The whole thing is a raycast vehicle which moves around by applying forces.
The script is a bit messy because of the tests I had to do, but I'll clean and post it if it's needed.


Do you use the same mesh for collision that is rendered?

What kind of time-step size are you using, and is it fixed? [/quote]

  1. No, the collisionmesh is much simpler. I also tried the whole thing with a simple cube, and it happened there as well.
  2. I can't really answer that question, because I don't know which timestep you exactly mean. Bullet uses an internet one as far as I know. Here is my Update()-Function:
/** Call this to update the physics */
void BulletPhysicsEngine::Update(float DeltaTime)
{
if(ThreadWork.bRunSimulation)
{
const boost::mutex::scoped_lock sl(ThreadWork.SimulationMutex);
GetDynamicsWorld()->stepSimulation(DeltaTime, BULLETPHYSICS_MAX_SUB_STEPS);
}
}


DeltaTime is usually around 0.02ms (0.00002). I run my rendering in a seperate thread, that is why it is so low.
BULLETPHYSICS_MAX_SUB_STEPS is left to the default value of 1. The fixed internal Timestep value is as well left to the default.
Could you recommend some settings for this to me?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!