public void Activate()
{
//If we're trying to activate, always set the deactivation candidacy to false. This resets the timer if necessary.
IsDeactivationCandidate = false;
var currentSimulationIsland = SimulationIsland;
if (currentSimulationIsland != null)
{
//We can force-activate an island.
//Note that this does nothing for objects not in a space
//or kinematic objects that don't have an island.
//"Activating" a kinematic object is meaningless- their activity state
//is entirely defined by their velocity.
currentSimulationIsland.IsActive = true;
}
else
{
//"Wake up" the kinematic entity.
//The time is used as a flag. If time <= 0, that means the object will be considered active until the subsequent update.
velocityTimeBelowLimit = -1;
}
}