Any way to subdue the jitteryness of bouncing?
Posted: Thu Apr 19, 2012 1:11 pm
Hey Norbo, hope you're well.
I'm just wondering if there's an obvious way to do what I'm trying to do here. The basic problem is that dynamic entities which bounce on my floor (which is a kinematic box with bounciness = 0) tend to bounce pretty much forever -- the bounces get very, very tiny, but collision events are still fired over and over again. This is annoying for things like triggering bounce sound effects based on collision events (the sound gets triggered long after the object has stopped visibly bouncing).
Today, I ran into the problem again, so I thought I'd ask if you have a recommended solution. What I was trying to do today was the create an extremely bare-bones character controller to use for enemies in my game. No stepping required, no support slope/hasTraction calculations -- just basically something that knows when it has landed after it jumps is what I'm going for. I nabbed the code from your SphericalCharacterController's SupportFinder, specifically the UpdateSupports method, and decided to try using only the code before the raycasting. It actually works great as long as the creature's bounciness is set to 0. Unfortunately, the enemy I'm working on is a blob that chases you by jumping after you and bouncing around. A bounciness of .65 is what feels right, but this leads to endless jittering of the SupportFinder.HasSupport bool after the creature has landed from a jump (presumably because the creature is invisibly bouncing a tiny bit into the air every two frames or so).
So, my question is, is there a way to make even bouncy objects come to rest much more quickly within the engine? I've tried setting the creature's Entity's ActivityInformation.DeactivationManager.VelocityLowerLimit to many different values, everything from .01 to 5, but nothing seems to address the bounce jittering. Have also tried LinearDamping.
My solution right now is to detect the number of bounces and once they've gone above a certain number set the creature's bounciness to zero, setting it back a few frames later. This actually works pretty well, although it's not always instant, and feels somewhat sloppy.
Anyway, sorry that went on a bit long. Thanks for reading, Norbo!
I'm just wondering if there's an obvious way to do what I'm trying to do here. The basic problem is that dynamic entities which bounce on my floor (which is a kinematic box with bounciness = 0) tend to bounce pretty much forever -- the bounces get very, very tiny, but collision events are still fired over and over again. This is annoying for things like triggering bounce sound effects based on collision events (the sound gets triggered long after the object has stopped visibly bouncing).
Today, I ran into the problem again, so I thought I'd ask if you have a recommended solution. What I was trying to do today was the create an extremely bare-bones character controller to use for enemies in my game. No stepping required, no support slope/hasTraction calculations -- just basically something that knows when it has landed after it jumps is what I'm going for. I nabbed the code from your SphericalCharacterController's SupportFinder, specifically the UpdateSupports method, and decided to try using only the code before the raycasting. It actually works great as long as the creature's bounciness is set to 0. Unfortunately, the enemy I'm working on is a blob that chases you by jumping after you and bouncing around. A bounciness of .65 is what feels right, but this leads to endless jittering of the SupportFinder.HasSupport bool after the creature has landed from a jump (presumably because the creature is invisibly bouncing a tiny bit into the air every two frames or so).
So, my question is, is there a way to make even bouncy objects come to rest much more quickly within the engine? I've tried setting the creature's Entity's ActivityInformation.DeactivationManager.VelocityLowerLimit to many different values, everything from .01 to 5, but nothing seems to address the bounce jittering. Have also tried LinearDamping.
My solution right now is to detect the number of bounces and once they've gone above a certain number set the creature's bounciness to zero, setting it back a few frames later. This actually works pretty well, although it's not always instant, and feels somewhat sloppy.
Anyway, sorry that went on a bit long. Thanks for reading, Norbo!