Breakout clone

cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Breakout clone

Post by cobolt_dink »

I'm trying to mess around with a 3Dish Breakout clone. But I'm not sure how to handle the ball. I assume it needs to be a rigid body instead of kinematic but I want it to not loose speed from friction against the level (TriangleMesh) and hitting the walls. I don't want to set friction and resititution to zero as it will cause the ball to bounce a bit and it also looses the spinning action from rolling. Now like Newton its possible to give an object linear velocity that it will keep the same speed until changed or it hits something. Is there something like that for Bullet?
cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Re: Breakout clone

Post by cobolt_dink »

I forgot how helpful this place could.
Wavesonics
Posts: 71
Joined: Thu May 22, 2008 8:03 pm

Re: Breakout clone

Post by Wavesonics »

Correct me if I'm wrong, but if the ball is free floating (i.e. not in contact with anything else) and there is no gravity, it shouldn't lose and speed or rotation until it comes into contacts with something else.

In the game I am using bullet with I have many free floating objects that don't stop moving or spinning after a force is applied to them.

Am I miss interpreting your question?
cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Re: Breakout clone

Post by cobolt_dink »

Its a similar concept to Breakout but the blocks are stacked up and the levels have floors. Since there is friction between the ball and the floor the ball rolls in a realistic manner. I want to be able to keep that realistic movement if at all possible. Maybe if I have to I'll cut the floor and have the ball float in space but that would be a last option.
Wavesonics
Posts: 71
Joined: Thu May 22, 2008 8:03 pm

Re: Breakout clone

Post by Wavesonics »

hhhmmmm... what you're saying seems inconsistent to me. You want to keep the realistic movement of it rolling on the floor, but you don't want friction, which makes it not realistic.

Removing a fairly key component of the physical world's rules by nature makes it un-realistic. But maybe I'm wrong...

In either case, what I think I'm hearing is you just don't want friction between the ball and the floor, and you don't want it to bounce along the floor right?

How I would go about this is to override the friction function and make it intelligent, so it looks to see what is colliding and does not apply friction if it is ball -> floor but does in every other case.

Also, since this could create some less then realistic behavior with the rolling, I would use the "zero body" constraint trick to constrain it's movement to X, Y and nullify any Z movement which solves the bouncing problem.

Is this what you are looking for?
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Breakout clone

Post by sparkprime »

You could just set its velocity each frame, or even better, apply a small force that is proportional to (desired_speed - speed) to try and bring it to that speed as if it had some kind of rocket behind it.