Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 |
/** * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ class Goal_AtActor extends PathGoalEvaluator native(AI); cpptext { // Interface virtual UBOOL InitialAbortCheck( ANavigationPoint* Start, APawn* Pawn ); virtual UBOOL EvaluateGoal(ANavigationPoint*& PossibleGoal, APawn* Pawn); virtual void NotifyExceededMaxPathVisits( ANavigationPoint* BestGuess ); } /** Actor to reach */ var Actor GoalActor; /** Within this acceptable distance */ var float GoalDist; /** Should keep track of cheapest path even if don't reach goal */ var bool bKeepPartial; static function bool AtActor( Pawn P, Actor Goal, optional float Dist, optional bool bReturnPartial ) { local Goal_AtActor Eval; local Pawn GoalPawn; local Controller GoalController; local float AnchorDist; if( P != None ) { GoalPawn = Pawn(Goal); GoalController = Controller(Goal); if( GoalController != None ) { if( GoalController.Pawn != None ) { GoalPawn = GoalController.Pawn; } else { Goal = None; } } // redirect to best nav point if possible if( GoalPawn != None ) { // If moving to a pawn with a valid anchor, make sure the anchor can support the searching pawn if( GoalPawn.ValidAnchor() && GoalPawn.Anchor.IsUsableAnchorFor( P ) ) { Goal = GoalPawn.Anchor; } else { Goal = P.GetBestAnchor(GoalPawn, GoalPawn.Location, FALSE, FALSE, AnchorDist); } } else if (NavigationPoint(Goal) == None) { Goal = P.GetBestAnchor(Goal, Goal.Location, false, false, AnchorDist); if(Goal == none) { `log("PATHWARNING: Not pushing AtActor goal constraint because we couldn't find an anchor for goal!"); } } if( Goal != None ) { Eval = Goal_AtActor(P.CreatePathGoalEvaluator(default.class)); if( Eval != None ) { Eval.GoalActor = Goal; Eval.GoalDist = Dist; Eval.bKeepPartial = bReturnPartial; P.AddGoalEvaluator( Eval ); return TRUE; } } } return FALSE; } function Recycle() { GoalActor = none; GoalDist = default.GoalDist; bKeepPartial = default.bKeepPartial; Super.Recycle(); } defaultproperties { CacheIdx=0 MaxPathVisits=1024 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |