BEPUphysics.DeactivationManagement.SimulationIslandMember.Activate C# (CSharp) Method

Activate() public method

Attempts to activate the entity.
public Activate ( ) : void
return void
        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;
            }

        }

Usage Example

 /// <summary>
 /// Removes the member from this island.
 /// </summary>
 /// <param name="simulationIslandMember">Removes the member from the manager.</param>
 public void Remove(SimulationIslandMember simulationIslandMember)
 {
     if (simulationIslandMember.DeactivationManager == this)
     {
         if (simulationIslandMember.IsDynamic)
         {
             simulationIslandMember.Activate();
         }
         else
         {
             //If the object was NOT dynamic, then simply calling activate will be insufficient
             //because it does not share any simulation island with connected objects.
             //We need to notify its connections directly.
             foreach (var connection in simulationIslandMember.connections)
             {
                 foreach (var entry in connection.entries)
                 {
                     if (entry.Member != simulationIslandMember)
                     {
                         entry.Member.Activate();
                     }
                 }
             }
         }
         simulationIslandMember.DeactivationManager = null;
         simulationIslandMembers.Remove(simulationIslandMember);
         RemoveSimulationIslandFromMember(simulationIslandMember);
     }
     else
     {
         throw new Exception("Cannot remove that member from this DeactivationManager; it belongs to a different or no manager.");
     }
 }
All Usage Examples Of BEPUphysics.DeactivationManagement.SimulationIslandMember::Activate