Prototype/Source/Prototype/Private/Task_ActiveSearch.cpp
/* Expands then contracts search area covered by flock. Exits search behavior when done.
*
*/
Expands then contracts search area covered by flock. Exits search behavior when done.
Expands then contracts search area covered by flock . Exits search behavior when done .
void AUSARAgent::BBSearch_Expand()
{
    if (expandingSearch > 0) {
        sepWeight += 5.f;
        agentSpacing += 50.f;
        if(sepWeight >= MAX_SEPARATION_WEIGHT) {
            expandingSearch = -1;
            agentSpacing = AGENT_SPACING;
        }
    }
    else if (expandingSearch < 0) {
        if (sepWeight > SEPARATION_WEIGHT) {
            sepWeight -= 5.f;
        }
        else {
            searchVector = FVector::ZeroVector;
            alignWeight  = ALIGNMENT_WEIGHT;
            cohWeight    = COHESION_WEIGHT;
            sepWeight    = SEPARATION_WEIGHT;
            targetHeight = MOVE_HEIGHT;
            expandingSearch = 0;
            statusActiveSearch = false;
            statusLoitering    = true;
            flockWPs.RemoveAt(0);
            numWPs--;
            GetWorldTimerManager().ClearTimer(timerBBSearchExpand);
            GetWorldTimerManager().ClearTimer(timerBBSearchRevolve);
            GetWorldTimerManager().SetTimer(timerCheckMoveReady, this, &AUSARAgent::FlockReadyToMove, 1.f, true);
        }
    }
}
void AUSARAgent :: BBSearch_Expand ( ) { if ( expandingSearch > 0 ) { sepWeight += 5.f ; agentSpacing += 50.f ; if ( sepWeight >= MAX_SEPARATION_WEIGHT ) { expandingSearch = -1 ; agentSpacing = AGENT_SPACING ; } } else if ( expandingSearch < 0 ) { if ( sepWeight > SEPARATION_WEIGHT ) { sepWeight -= 5.f ; } else { searchVector = FVector :: ZeroVector ; alignWeight = ALIGNMENT_WEIGHT ; cohWeight = COHESION_WEIGHT ; sepWeight = SEPARATION_WEIGHT ; targetHeight = MOVE_HEIGHT ; expandingSearch = 0 ; statusActiveSearch = false ; statusLoitering = true ; flockWPs . RemoveAt ( 0 ) ; numWPs -- ; GetWorldTimerManager ( ) . ClearTimer ( timerBBSearchExpand ) ; GetWorldTimerManager ( ) . ClearTimer ( timerBBSearchRevolve ) ; GetWorldTimerManager ( ) . SetTimer ( timerCheckMoveReady , this , & AUSARAgent :: FlockReadyToMove , 1.f , true ) ; } } }
Expands then contracts search area covered by flock.
Expands then contracts search area covered by flock .