Sphere moving after it goes inactive.
Posted: Sun May 27, 2012 12:32 am
I'm making a golf game and I have the user putt the ball after the sphere/ball goes inactive. Problem is that the ball sometimes keeps moving after it goes inactive and I'm not sure how or why. Once it does this the user can no long apply an impulse to get it to move again. Any advice on what I should do?
Code: Select all
Space = new Space
{
DeactivationManager =
{
VelocityLowerLimit = .4f,
LowVelocityTimeMinimum = .00001f
},
};
Code: Select all
if (ballSphere.ActivityInformation.IsActive)
{
// ball will be forced to slow down within a certain time after putting
timer2 += (float)gameTime.ElapsedGameTime.TotalSeconds;
ballSphere.AngularDamping = .16f * (timer2 - timer);
ballSphere.LinearDamping = .16f * (timer2 - timer);
}