Island grouping and sleeping issues

Post Reply
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Island grouping and sleeping issues

Post by AlexSilverman »

Hello,

I'm having a problem with an object deativating and I'm not sure why. Here's the flow of our game.

You are given an avatar to position on a basketball court. While you move, the ball physics volume is snapped to your position, it is being activated ( body->setActivationState(1) ), and the linear velocity is set to zero, but when you stop moving, nothing is done to the ball. You hold a button to begin the shooting process, and during that process (until the button is released) the ball is again snapped, activated, and set to 0 velocity. When the button is released, the ball has an arbitrary velocity applied to it, and Bullet takes over. When the ball hits the gorund, the cycle begins again for the next player.

The problem I'm having is that the ball is deactivating, and I can't seem to figure out why. The other volumes in my scene are a static box for the backboard, a static triangle mesh for the rim of the basket, and a static plane for the ground. My understanding of the way objects are slept, is that an entire island must be ready to sleep (based on their velocities) before they can be slept. That said, I'm not sure what governs when the ball is being put to sleep.

Any help would be appreciated. Let me know if you need more information and I'll provide whatever I can.

- Alex
Proctoid
Posts: 18
Joined: Fri Apr 21, 2006 3:04 pm
Location: uk

Post by Proctoid »

body->setActivationState(DISABLE_DEACTIVATION) will keep a body active
Post Reply