Object slows down when using CCD

Nickeeh
Posts: 14
Joined: Wed Feb 09, 2011 8:35 pm

Object slows down when using CCD

Post by Nickeeh »

Hey there!

In a pong-like game, you have the bouncer (the "ball"), the 2 paddles and 2 walls. I've made such a pong like game using bullet, and ran into a problem when using CCD on the bouncer.

To create a pong-like game, I gave the bouncer, paddles and walls a restitution value of < 1.1 && >= 1.0, so that the bouncer speeds up. The paddles are kinetic objects, the bouncer is a dynamic object, and the walls are static.

The bouncer will really slow down when it hits either paddle. So the speed builds up due to restitution >= 1.0, and then the slowdown occurs occasionally.

Any clues on why this may happen? If I need to post more information, please say so. :)

Thanks in advance,
Nick
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Object slows down when using CCD

Post by Erwin Coumans »

What version of Bullet are you using?

You might want to try the latest, Bullet 2.78.

Also, note that Bullet will not preserve energy during collisions, so it is best to manually make sure the magnitude of the velocity stays constant.
Thanks,
Erwin
Nickeeh
Posts: 14
Joined: Wed Feb 09, 2011 8:35 pm

Re: Object slows down when using CCD

Post by Nickeeh »

I'm using the trunk of the SVN, last update I pulled was:

------------------------------------------------------------------------
r2388 | erwin.coumans | 2011-04-11 18:28:21 +0200 (Mon, 11 Apr 2011) | 4 lines

add support for PosixThreadSupport for MiniCL (partial CPU OpenCL replacement)

:)