这篇教程C++ GetOuter函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetOuter函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOuter函数的具体用法?C++ GetOuter怎么用?C++ GetOuter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetOuter函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UpdateAssetvoid UEnvironmentQueryGraph::UpdateAsset(int32 UpdateFlags){ if (IsLocked()) { return; } // let's find root node UEnvironmentQueryGraphNode_Root* RootNode = NULL; for (int32 Idx = 0; Idx < Nodes.Num(); Idx++) { RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]); if (RootNode != NULL) { break; } } UEnvQuery* Query = Cast<UEnvQuery>(GetOuter()); Query->GetOptionsMutable().Reset(); if (RootNode && RootNode->Pins.Num() > 0 && RootNode->Pins[0]->LinkedTo.Num() > 0) { UEdGraphPin* MyPin = RootNode->Pins[0]; // sort connections so that they're organized the same as user can see in the editor MyPin->LinkedTo.Sort(FCompareNodeXLocation()); for (int32 Idx = 0; Idx < MyPin->LinkedTo.Num(); Idx++) { UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(MyPin->LinkedTo[Idx]->GetOwningNode()); if (OptionNode) { OptionNode->UpdateNodeData(); UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance); if (OptionInstance && OptionInstance->Generator) { OptionInstance->Tests.Reset(); for (int32 TestIdx = 0; TestIdx < OptionNode->SubNodes.Num(); TestIdx++) { UAIGraphNode* SubNode = OptionNode->SubNodes[TestIdx]; if (SubNode == nullptr) { continue; } SubNode->ParentNode = OptionNode; UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(SubNode); if (TestNode && TestNode->bTestEnabled) { UEnvQueryTest* TestInstance = Cast<UEnvQueryTest>(TestNode->NodeInstance); if (TestInstance) { OptionInstance->Tests.Add(TestInstance); } } } Query->GetOptionsMutable().Add(OptionInstance); } // FORT-16508 tracking BEGIN: log invalid option if (OptionInstance && OptionInstance->Generator == nullptr) { FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option instance [pin:%d] without a generator! tests:%d"), FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num()); RootNode->LogDebugMessage(DebugMessage); } else if (OptionInstance == nullptr) { FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option node [pin:%d] without an instance! tests:%d"), FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num()); RootNode->LogDebugMessage(DebugMessage); } // FORT-16508 tracking END } } } RemoveOrphanedNodes(); // FORT-16508 tracking BEGIN: find corrupted options if (RootNode) { for (int32 Idx = 0; Idx < Nodes.Num(); Idx++) { UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]); if (OptionNode) { UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance); if (OptionNode->NodeInstance == nullptr || OptionInstance == nullptr || OptionInstance->HasAnyFlags(RF_Transient)) { FString DebugMessage = FString::Printf(TEXT("[%s] found corrupted node after RemoveOrphanedNodes! type:instance option:%s instance:%d transient:%d tests:%d"), FPlatformTime::StrTimestamp(), *GetNameSafe(OptionNode), OptionNode->NodeInstance ? (OptionInstance ? 1 : -1) : 0,//.........这里部分代码省略.........
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,
示例2: ifvoid UK2Node_Composite::PostPasteNode(){ Super::PostPasteNode(); //@TODO: Should verify that each node in the composite can be pasted into this new graph successfully (CanPasteHere) if (BoundGraph != NULL) { UEdGraph* ParentGraph = CastChecked<UEdGraph>(GetOuter()); ensure(BoundGraph != ParentGraph); // Update the InputSinkNode / OutputSourceNode pointers to point to the new graph TSet<UEdGraphNode*> BoundaryNodes; for (int32 NodeIndex = 0; NodeIndex < BoundGraph->Nodes.Num(); ++NodeIndex) { UEdGraphNode* Node = BoundGraph->Nodes[NodeIndex]; //Remove this node if it should not exist more then one in blueprint if(UK2Node_Event* Event = Cast<UK2Node_Event>(Node)) { UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraphChecked(BoundGraph); if(FBlueprintEditorUtils::FindOverrideForFunction(BP, Event->EventReference.GetMemberParentClass(Event), Event->EventReference.GetMemberName())) { FBlueprintEditorUtils::RemoveNode(BP, Node, true); NodeIndex--; continue; } } BoundaryNodes.Add(Node); if (Node->GetClass() == UK2Node_Tunnel::StaticClass()) { // Exactly a tunnel node, should be the entrance or exit node UK2Node_Tunnel* Tunnel = CastChecked<UK2Node_Tunnel>(Node); if (Tunnel->bCanHaveInputs && !Tunnel->bCanHaveOutputs) { OutputSourceNode = Tunnel; Tunnel->InputSinkNode = this; } else if (Tunnel->bCanHaveOutputs && !Tunnel->bCanHaveInputs) { InputSinkNode = Tunnel; Tunnel->OutputSourceNode = this; } else { ensureMsgf(false, *LOCTEXT("UnexpectedTunnelNode", "Unexpected tunnel node '%s' in cloned graph '%s' (both I/O or neither)").ToString(), *Tunnel->GetName(), *GetName()); } } } RenameBoundGraphCloseToName(BoundGraph->GetName()); ensure(BoundGraph->SubGraphs.Find(ParentGraph) == INDEX_NONE); //Nested composites will already be in the SubGraph array if(ParentGraph->SubGraphs.Find(BoundGraph) == INDEX_NONE) { ParentGraph->SubGraphs.Add(BoundGraph); } FEdGraphUtilities::PostProcessPastedNodes(BoundaryNodes); }}
开发者ID:Codermay,项目名称:Unreal4,代码行数:65,
示例3: Msgbool CAI_BlendedMotor::AddTurnGesture( float flYD ){ // some funky bug with human turn gestures, disable for now return false; // try using a turn gesture Activity activity = ACT_INVALID; float weight = 1.0; float turnCompletion = 1.0; if (m_flNextTurnGesture > gpGlobals->curtime) { /* if ( GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT ) { Msg( "%.1f : [ %.2f ]/n", flYD, m_flNextTurnAct - gpGlobals->curtime ); } */ return false; } if ( GetOuter()->IsMoving() || GetOuter()->IsCrouching() ) { return false; } if (fabs( flYD ) < 15) { return false; } else if (flYD < -45) { activity = ACT_GESTURE_TURN_RIGHT90; weight = flYD / -90; turnCompletion = 0.36; } else if (flYD < 0) { activity = ACT_GESTURE_TURN_RIGHT45; weight = flYD / -45; turnCompletion = 0.4; } else if (flYD <= 45) { activity = ACT_GESTURE_TURN_LEFT45; weight = flYD / 45; turnCompletion = 0.4; } else { activity = ACT_GESTURE_TURN_LEFT90; weight = flYD / 90; turnCompletion = 0.36; } int seq = SelectWeightedSequence( activity ); if (scene_flatturn->GetBool() && GetOuter()->IsCurSchedule( SCHED_SCENE_GENERIC )) { Activity flatactivity = activity; if (activity == ACT_GESTURE_TURN_RIGHT90) { flatactivity = ACT_GESTURE_TURN_RIGHT90_FLAT; } else if (activity == ACT_GESTURE_TURN_RIGHT45) { flatactivity = ACT_GESTURE_TURN_RIGHT45_FLAT; } else if (activity == ACT_GESTURE_TURN_LEFT90) { flatactivity = ACT_GESTURE_TURN_LEFT90_FLAT; } else if (activity == ACT_GESTURE_TURN_LEFT45) { flatactivity = ACT_GESTURE_TURN_LEFT45_FLAT; } if (flatactivity != activity) { int newseq = SelectWeightedSequence( flatactivity ); if (newseq != ACTIVITY_NOT_AVAILABLE) { seq = newseq; } } } if (seq != ACTIVITY_NOT_AVAILABLE) { int iLayer = GetOuter()->AddGestureSequence( seq ); if (iLayer != -1) { GetOuter()->SetLayerPriority( iLayer, 100 ); // vary the playback a bit SetLayerPlaybackRate( iLayer, 1.0 ); float actualDuration = GetOuter()->GetLayerDuration( iLayer ); float rate = enginerandom->RandomFloat( 0.5, 1.1 );//.........这里部分代码省略.........
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:101,
示例4: GetOuter//-----------------------------------------------------------------------------// Purpose: Suppress melee attacks against enemies for the given duration// Input : flDuration - Amount of time to suppress the attacks//-----------------------------------------------------------------------------void CAI_PassengerBehaviorZombie::SuppressAttack( float flDuration ){ GetOuter()->SetNextAttack( gpGlobals->curtime + flDuration );}
开发者ID:Muini,项目名称:Nag-asw,代码行数:8,
示例5: IsAMasterTrackbool UMovieSceneAudioTrack::IsAMasterTrack() const{ return Cast<UMovieScene>(GetOuter())->IsAMasterTrack(this);}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:4,
示例6: switchvoid CAI_LeadBehavior::RunTask( const Task_t *pTask ) { switch ( pTask->iTask ) { case TASK_LEAD_SUCCEED: { if ( !IsSpeaking() ) { TaskComplete(); NotifyEvent( LBE_DONE ); } break; } case TASK_LEAD_ARRIVE: { if ( !IsSpeaking() ) { TaskComplete(); NotifyEvent( LBE_ARRIVAL_DONE ); } break; } case TASK_LEAD_MOVE_TO_RANGE: { // If we haven't spoken our start speech, move closer if ( !m_hasspokenstart) { ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_leaddistance - 24 ); } else { ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_retrievedistance ); if ( !TaskIsComplete() ) { // Transition to a walk when we get near the player // Check Z first, and only check 2d if we're within that Vector vecGoalPos = GetNavigator()->GetGoalPos(); float distance = fabs(vecGoalPos.z - GetLocalOrigin().z); bool bWithinZ = false; if ( distance < m_retrievedistance ) { distance = ( vecGoalPos - GetLocalOrigin() ).Length2D(); bWithinZ = true; } if ( distance > m_retrievedistance ) { Activity followActivity = ACT_WALK; if ( GetOuter()->GetState() == NPC_STATE_COMBAT || (!bWithinZ || distance < (m_retrievedistance*4)) && GetOuter()->GetState() != NPC_STATE_COMBAT ) { followActivity = ACT_RUN; } // Don't confuse move and shoot by resetting the activity every think Activity curActivity = GetNavigator()->GetMovementActivity(); switch( curActivity ) { case ACT_WALK_AIM: curActivity = ACT_WALK; break; case ACT_RUN_AIM: curActivity = ACT_RUN; break; } if ( curActivity != followActivity ) { GetNavigator()->SetMovementActivity(followActivity); } GetNavigator()->SetArrivalDirection( GetOuter()->GetTarget() ); } } } break; } case TASK_LEAD_RETRIEVE_WAIT: { ChainRunTask( TASK_WAIT_INDEFINITE ); break; } case TASK_LEAD_WALK_PATH: { // If we're leading, and we're supposed to run, run instead of walking if ( m_run && ( IsCurSchedule( SCHED_LEAD_WAITFORPLAYER, false ) || IsCurSchedule( SCHED_LEAD_PLAYER, false ) || IsCurSchedule( SCHED_LEAD_SPEAK_THEN_LEAD_PLAYER, false )|| IsCurSchedule( SCHED_LEAD_RETRIEVE, false ) ) ) { ChainRunTask( TASK_RUN_PATH ); } else { ChainRunTask( TASK_WALK_PATH ); } // While we're walking if ( TaskIsRunning() && IsCurSchedule( SCHED_LEAD_PLAYER, false ) ) { // If we're not speaking, and we haven't tried for a while, try to speak lead idle if ( m_flNextLeadIdle < gpGlobals->curtime && !IsSpeaking() ) { m_flNextLeadIdle = gpGlobals->curtime + RandomFloat( 10,15 );//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,
示例7: GetOutervoid CAI_MoveAndShootOverlay::RunShootWhileMove(){ if ( m_bNoShootWhileMove ) return; if ( gpGlobals->curtime < m_flSuspendUntilTime ) return; m_flSuspendUntilTime = MOVESHOOT_DO_NOT_SUSPEND; CAI_BaseNPC *pOuter = GetOuter(); // keep enemy if dead but try to look for a new one if (!pOuter->GetEnemy() || !pOuter->GetEnemy()->IsAlive()) { CBaseEntity *pNewEnemy = pOuter->BestEnemy(); if( pNewEnemy != NULL ) { //New enemy! Clear the timers and set conditions. pOuter->SetEnemy( pNewEnemy ); pOuter->SetState( NPC_STATE_COMBAT ); } else { pOuter->ClearAttackConditions(); } // SetEnemy( NULL ); } /*if( !pOuter->GetNavigator()->IsGoalActive() ) return;*/ if ( GetEnemy() == NULL ) { if ( pOuter->GetAlternateMoveShootTarget() ) { // Aim at this other thing if I can't aim at my enemy. pOuter->AddFacingTarget( pOuter->GetAlternateMoveShootTarget(), pOuter->GetAlternateMoveShootTarget()->GetAbsOrigin(), 1.0, 0.2 ); } return; } bool bMoveAimAtEnemy = CanAimAtEnemy(); UpdateMoveShootActivity( bMoveAimAtEnemy ); if ( !bMoveAimAtEnemy ) { EndShootWhileMove(); return; } Assert( HasAvailableRangeAttack() ); // This should have been caught at task start Activity activity; bool bIsReloading = false; if ( ( activity = pOuter->TranslateActivity( ACT_GESTURE_RELOAD ) ) != ACT_INVALID ) { bIsReloading = pOuter->IsPlayingGesture( activity ); } if ( !bIsReloading && HasAvailableRangeAttack() ) { // time to fire? if ( pOuter->HasCondition( COND_CAN_RANGE_ATTACK1, false ) ) { if ( pOuter->GetShotRegulator()->IsInRestInterval() ) { EndShootWhileMove(); } else if ( pOuter->GetShotRegulator()->ShouldShoot() ) { if ( m_bMovingAndShooting || pOuter->OnBeginMoveAndShoot() ) { m_bMovingAndShooting = true; pOuter->OnRangeAttack1(); activity = pOuter->TranslateActivity( ACT_GESTURE_RANGE_ATTACK1 ); Assert( activity != ACT_INVALID ); pOuter->RestartGesture( activity ); // FIXME: this seems a bit wacked pOuter->Weapon_SetActivity( pOuter->Weapon_TranslateActivity( ACT_RANGE_ATTACK1 ), 0 ); } } } } // try to keep facing towards the last known position of the enemy Vector vecEnemyLKP = pOuter->GetEnemyLKP(); pOuter->AddFacingTarget( pOuter->GetEnemy(), vecEnemyLKP, 1.0, 0.8 );}
开发者ID:BG2-Dev-Team,项目名称:BG2-Code,代码行数:94,
示例8: GetOuterbool UObjectBaseUtility::IsDefaultSubobject() const{ const bool bIsInstanced = GetOuter() && (GetOuter()->HasAnyFlags(RF_ClassDefaultObject) || ((UObject*)this)->GetArchetype() != GetClass()->GetDefaultObject()); return bIsInstanced;}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:5,
示例9: AI_PROFILE_SCOPEbool CAI_TacticalServices::FindLateralLos( const Vector &vecThreat, Vector *pResult ){ AI_PROFILE_SCOPE( CAI_TacticalServices_FindLateralLos ); if( !m_bAllowFindLateralLos ) { return false; } MARK_TASK_EXPENSIVE(); Vector vecLeftTest; Vector vecRightTest; Vector vecStepRight; Vector vecCheckStart; bool bLookingForEnemy = GetEnemy() && VectorsAreEqual(vecThreat, GetEnemy()->EyePosition(), 0.1f); int i; if( !bLookingForEnemy || GetOuter()->HasCondition(COND_SEE_ENEMY) || GetOuter()->HasCondition(COND_HAVE_ENEMY_LOS) || GetOuter()->GetTimeScheduleStarted() == gpGlobals->curtime ) // Conditions get nuked before tasks run, assume should try { // My current position might already be valid. if ( TestLateralLos(vecThreat, GetLocalOrigin()) ) { *pResult = GetLocalOrigin(); return true; } } if( !ai_find_lateral_los.GetBool() ) { // Allows us to turn off lateral LOS at the console. Allow the above code to run // just in case the NPC has line of sight to begin with. return false; } int iChecks = COVER_CHECKS; int iDelta = COVER_DELTA; // If we're limited in how far we're allowed to move laterally, don't bother checking past it int iMaxLateralDelta = (int)GetOuter()->GetMaxTacticalLateralMovement(); if ( iMaxLateralDelta != MAXTACLAT_IGNORE && iMaxLateralDelta < iDelta ) { iChecks = 1; iDelta = iMaxLateralDelta; } Vector right; AngleVectors( GetLocalAngles(), NULL, &right, NULL ); vecStepRight = right * iDelta; vecStepRight.z = 0; vecLeftTest = vecRightTest = GetLocalOrigin(); vecCheckStart = vecThreat; for ( i = 0 ; i < iChecks; i++ ) { vecLeftTest = vecLeftTest - vecStepRight; vecRightTest = vecRightTest + vecStepRight; if (TestLateralLos( vecCheckStart, vecLeftTest )) { *pResult = vecLeftTest; return true; } if (TestLateralLos( vecCheckStart, vecRightTest )) { *pResult = vecRightTest; return true; } } return false;}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:75,
示例10: checkbool UActorComponent::NeedsLoadForServer() const{ check(GetOuter()); return (GetOuter()->NeedsLoadForServer() && Super::NeedsLoadForServer());}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:5,
示例11: SpawnMissingNodesvoid UEnvironmentQueryGraph::SpawnMissingNodes(){ UEnvQuery* QueryOwner = Cast<UEnvQuery>(GetOuter()); if (QueryOwner == nullptr) { return; } TSet<UEnvQueryTest*> ExistingTests; TSet<UEnvQueryOption*> ExistingNodes; TArray<UEnvQueryOption*> OptionsCopy = QueryOwner->GetOptions(); UAIGraphNode* MyRootNode = nullptr; for (int32 Idx = 0; Idx < Nodes.Num(); Idx++) { UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]); UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr; if (OptionInstance && OptionInstance->Generator) { ExistingNodes.Add(OptionInstance); ExistingTests.Empty(ExistingTests.Num()); for (int32 SubIdx = 0; SubIdx < MyNode->SubNodes.Num(); SubIdx++) { UEnvironmentQueryGraphNode* MySubNode = Cast<UEnvironmentQueryGraphNode>(MyNode->SubNodes[SubIdx]); UEnvQueryTest* TestInstance = MySubNode ? Cast<UEnvQueryTest>(MySubNode->NodeInstance) : nullptr; if (TestInstance) { ExistingTests.Add(TestInstance); } else { MyNode->RemoveSubNode(MySubNode); SubIdx--; } } SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode); } UEnvironmentQueryGraphNode_Root* RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]); if (RootNode) { MyRootNode = RootNode; } } UEdGraphPin* RootOutPin = MyRootNode ? FindGraphNodePin(MyRootNode, EGPD_Output) : nullptr; ExistingTests.Empty(0); for (int32 Idx = 0; Idx < OptionsCopy.Num(); Idx++) { UEnvQueryOption* OptionInstance = OptionsCopy[Idx]; if (ExistingNodes.Contains(OptionInstance) || OptionInstance == nullptr || OptionInstance->Generator == nullptr) { continue; } FGraphNodeCreator<UEnvironmentQueryGraphNode_Option> NodeBuilder(*this); UEnvironmentQueryGraphNode_Option* MyNode = NodeBuilder.CreateNode(); UAIGraphNode::UpdateNodeClassDataFrom(OptionInstance->Generator->GetClass(), MyNode->ClassData); MyNode->ErrorMessage = MyNode->ClassData.GetDeprecatedMessage(); NodeBuilder.Finalize(); if (MyRootNode) { MyNode->NodePosX = MyRootNode->NodePosX + (Idx * 300); MyNode->NodePosY = MyRootNode->NodePosY + 100; } MyNode->NodeInstance = OptionInstance; SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode); UEdGraphPin* SpawnedInPin = FindGraphNodePin(MyNode, EGPD_Input); if (RootOutPin && SpawnedInPin) { RootOutPin->MakeLinkTo(SpawnedInPin); } }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:80,
示例12: AI_GetSinglePlayerint CAI_LeadBehavior::SelectSchedule(){ if ( HasGoal() ) { if( HasCondition(COND_LEAD_SUCCESS) ) { return SCHED_LEAD_SUCCEED; } // Player's here, but does he have the weapon we want him to have? if ( m_weaponname != NULL_STRING ) { CBasePlayer *pFollower = AI_GetSinglePlayer(); if ( pFollower && !pFollower->Weapon_OwnsThisType( STRING(m_weaponname) ) ) { // If the safety timeout has run out, just give the player the weapon if ( !m_flWeaponSafetyTimeOut || (m_flWeaponSafetyTimeOut > gpGlobals->curtime) ) return SCHED_LEAD_PLAYERNEEDSWEAPON; string_t iszItem = AllocPooledString( "weapon_bugbait" ); pFollower->GiveNamedItem( STRING(iszItem) ); } } // If we have a waitpoint, we want to wait at it for the player. if( HasWaitPoint() && !PlayerIsAheadOfMe( true ) ) { bool bKeepWaiting = true; // If we have no wait distance, trigger as soon as the player comes in view if ( !m_waitdistance ) { if ( HasCondition( COND_SEE_PLAYER ) ) { // We've spotted the player, so stop waiting bKeepWaiting = false; } } else { // We have to collect data about the person we're leading around. CBaseEntity *pFollower = AI_GetSinglePlayer(); if( pFollower ) { float flFollowerDist = ( WorldSpaceCenter() - pFollower->WorldSpaceCenter() ).Length(); if ( flFollowerDist < m_waitdistance ) { bKeepWaiting = false; } } } // Player still not here? if ( bKeepWaiting ) return SCHED_LEAD_WAITFORPLAYER; // We're finished waiting m_waitpoint = vec3_origin; Speak( TLK_LEAD_WAITOVER ); // Don't speak the start line, because we've said m_hasspokenstart = true; return SCHED_WAIT_FOR_SPEAK_FINISH; } // If we haven't spoken our start speech, do that first if ( !m_hasspokenstart ) { if ( HasCondition(COND_LEAD_HAVE_FOLLOWER_LOS) && HasCondition(COND_LEAD_FOLLOWER_VERY_CLOSE) ) return SCHED_LEAD_SPEAK_START; // We haven't spoken to him, and we still need to. Go get him. return SCHED_LEAD_RETRIEVE; } if( HasCondition( COND_LEAD_FOLLOWER_LOST ) ) { if( m_args.iRetrievePlayer ) { // If not, we want to go get the player. DevMsg( GetOuter(), "Follower lost. Spoke COMING_BACK./n"); Speak( TLK_LEAD_COMINGBACK ); m_MoveMonitor.ClearMark(); // If we spoke something, wait for it to finish if ( m_args.iComingBackWaitForSpeak && IsSpeaking() ) return SCHED_LEAD_SPEAK_THEN_RETRIEVE_PLAYER; return SCHED_LEAD_RETRIEVE; } else { // Just stay right here and wait. return SCHED_LEAD_WAITFORPLAYERIDLE; } } if( HasCondition( COND_LEAD_FOLLOWER_LAGGING ) ) {//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,
示例13: GetGraphUWALandscapeGraph* UWALandscapeNode::GetGraph(){ return Cast<UWALandscapeGraph>(GetOuter());}
开发者ID:iniside,项目名称:ActionRPGGame,代码行数:4,
示例14: GetOwningAbilitySystemComponentUAbilitySystemComponent* UAttributeSet::GetOwningAbilitySystemComponent() const{ return UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(CastChecked<AActor>(GetOuter()));}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:4,
示例15: Modifyvoid AActor::SetActorLabelInternal( const FString& NewActorLabelDirty, bool bMakeGloballyUniqueFName, bool bMarkDirty ){ // Clean up the incoming string a bit FString NewActorLabel = NewActorLabelDirty; NewActorLabel.Trim(); NewActorLabel.TrimTrailing(); // First, update the actor label { // Has anything changed? if( FCString::Strcmp( *NewActorLabel, *GetActorLabel() ) != 0 ) { // Store new label Modify( bMarkDirty ); ActorLabel = NewActorLabel; } } // Next, update the actor's name { // Generate an object name for the actor's label const FName OldActorName = GetFName(); FName NewActorName = MakeObjectNameFromActorLabel( GetActorLabel(), OldActorName ); // Has anything changed? if( OldActorName != NewActorName ) { // Try to rename the object UObject* NewOuter = NULL; // Outer won't be changing ERenameFlags RenFlags = bMakeGloballyUniqueFName ? (REN_DontCreateRedirectors | REN_ForceGlobalUnique) : REN_DontCreateRedirectors; bool bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags ); if( bCanRename ) { // NOTE: Will assert internally if rename fails const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags ); } else { // Unable to rename the object. Use a unique object name variant. NewActorName = MakeUniqueObjectName( bMakeGloballyUniqueFName ? ANY_PACKAGE : GetOuter(), GetClass(), NewActorName ); bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags ); if( bCanRename ) { // NOTE: Will assert internally if rename fails const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags ); } else { // Unable to rename the object. Oh well, not a big deal. } } } } FPropertyChangedEvent PropertyEvent( FindField<UProperty>( AActor::StaticClass(), "ActorLabel" ) ); PostEditChangeProperty(PropertyEvent); FCoreDelegates::OnActorLabelChanged.Broadcast(this);}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:62,
示例16: GetOuter//-----------------------------------------------------------------------------// Purpose: Searches for a possible response// Input : concept - // NULL - // Output : AI_Response//-----------------------------------------------------------------------------AI_Response *CAI_Expresser::SpeakFindResponse( AIConcept_t concept, const char *modifiers /*= NULL*/ ){ IResponseSystem *rs = GetOuter()->GetResponseSystem(); if ( !rs ) { Assert( !"No response system installed for CAI_Expresser::GetOuter()!!!" ); return NULL; } AI_CriteriaSet set; // Always include the concept name set.AppendCriteria( "concept", concept, CONCEPT_WEIGHT ); // Always include any optional modifiers if ( modifiers != NULL ) { char copy_modifiers[ 255 ]; const char *pCopy; char key[ 128 ] = { 0 }; char value[ 128 ] = { 0 }; Q_strncpy( copy_modifiers, modifiers, sizeof( copy_modifiers ) ); pCopy = copy_modifiers; while( pCopy ) { pCopy = SplitContext( pCopy, key, sizeof( key ), value, sizeof( value ), NULL ); if( *key && *value ) { set.AppendCriteria( key, value, CONCEPT_WEIGHT ); } } } // Let our outer fill in most match criteria GetOuter()->ModifyOrAppendCriteria( set ); // Append local player criteria to set, but not if this is a player doing the talking if ( !GetOuter()->IsPlayer() ) { CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 ); if( pPlayer ) pPlayer->ModifyOrAppendPlayerCriteria( set ); } // Now that we have a criteria set, ask for a suitable response AI_Response *result = new AI_Response; Assert( result && "new AI_Response: Returned a NULL AI_Response!" ); bool found = rs->FindBestResponse( set, *result, this ); if ( rr_debugresponses.GetInt() == 3 ) { if ( ( GetOuter()->MyNPCPointer() && GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT ) || GetOuter()->IsPlayer() ) { const char *pszName; if ( GetOuter()->IsPlayer() ) { pszName = ((CBasePlayer*)GetOuter())->GetPlayerName(); } else { pszName = GetOuter()->GetDebugName(); } if ( found ) { char response[ 256 ]; result->GetResponse( response, sizeof( response ) ); Warning( "RESPONSERULES: %s spoke '%s'. Found response '%s'./n", pszName, concept, response ); } else { Warning( "RESPONSERULES: %s spoke '%s'. Found no matching response./n", pszName, concept ); } } } if ( !found ) { //Assert( !"rs->FindBestResponse: Returned a NULL AI_Response!" ); delete result; return NULL; } char response[ 256 ]; result->GetResponse( response, sizeof( response ) ); if ( !response[0] ) { delete result; return NULL; }//.........这里部分代码省略.........
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:101,
示例17: returnbool CAI_MoveAndShootOverlay::HasAvailableRangeAttack(){ return ( ( GetOuter()->GetActiveWeapon() != NULL ) || ( GetOuter()->CapabilitiesGet() & bits_CAP_INNATE_RANGE_ATTACK1 ) || ( GetOuter()->CapabilitiesGet() & bits_CAP_INNATE_RANGE_ATTACK2 ) );}
开发者ID:BG2-Dev-Team,项目名称:BG2-Code,代码行数:6,
示例18: sizeof//-----------------------------------------------------------------------------// Purpose: Dispatches the result// Input : *response - //-----------------------------------------------------------------------------bool CAI_Expresser::SpeakDispatchResponse( AIConcept_t concept, AI_Response *result, IRecipientFilter *filter /* = NULL */ ){ char response[ 256 ]; result->GetResponse( response, sizeof( response ) ); float delay = result->GetDelay(); bool spoke = false; soundlevel_t soundlevel = result->GetSoundLevel(); if ( IsSpeaking() && concept[0] != 0 ) { DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) already speaking, forcing '%s'/n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), concept ); // Tracker 15911: Can break the game if we stop an imported map placed lcs here, so only // cancel actor out of instanced scripted scenes. ywb RemoveActorFromScriptedScenes( GetOuter(), true /*instanced scenes only*/ ); GetOuter()->SentenceStop(); if ( IsRunningScriptedScene( GetOuter() ) ) { DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) refusing to speak due to scene entity, tossing '%s'/n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), concept ); delete result; return false; } } switch ( result->GetType() ) { default: case RESPONSE_NONE: break; case RESPONSE_SPEAK: { if ( !result->ShouldntUseScene() ) { // This generates a fake CChoreoScene wrapping the sound.txt name spoke = SpeakAutoGeneratedScene( response, delay ); } else { float speakTime = GetResponseDuration( result ); GetOuter()->EmitSound( response ); DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) playing sound '%s'/n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), response ); NoteSpeaking( speakTime, delay ); spoke = true; } } break; case RESPONSE_SENTENCE: { spoke = ( -1 != SpeakRawSentence( response, delay, VOL_NORM, soundlevel ) ) ? true : false; } break; case RESPONSE_SCENE: { spoke = SpeakRawScene( response, delay, result, filter ); } break; case RESPONSE_RESPONSE: { // This should have been recursively resolved already Assert( 0 ); } break; case RESPONSE_PRINT: { if ( g_pDeveloper->GetInt() > 0 ) { Vector vPrintPos; GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos ); NDebugOverlay::Text( vPrintPos, response, true, 1.5 ); spoke = true; } } break; } if ( spoke ) { m_flLastTimeAcceptedSpeak = gpGlobals->curtime; if ( DebuggingSpeech() && g_pDeveloper->GetInt() > 0 && response && result->GetType() != RESPONSE_PRINT ) { Vector vPrintPos; GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos ); NDebugOverlay::Text( vPrintPos, CFmtStr( "%s: %s", concept, response ), true, 1.5 ); } if ( result->IsApplyContextToWorld() ) {//.........这里部分代码省略.........
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:101,
示例19: switch//-----------------------------------------------------------------------------// Computes the surrounding collision bounds based on whatever algorithm we want...//-----------------------------------------------------------------------------void CCollisionProperty::ComputeSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs ){ if (( GetSolid() == SOLID_CUSTOM ) && (m_nSurroundType != USE_GAME_CODE )) { // NOTE: This can only happen in transition periods, say during network // reception on the client. We expect USE_GAME_CODE to be used with SOLID_CUSTOM *pVecWorldMins = GetCollisionOrigin(); *pVecWorldMaxs = *pVecWorldMins; return; } switch( m_nSurroundType ) { case USE_OBB_COLLISION_BOUNDS: { Assert( GetSolid() != SOLID_CUSTOM ); bool bUseVPhysics = false; if ( ( GetSolid() == SOLID_VPHYSICS ) && ( GetOuter()->GetMoveType() == MOVETYPE_VPHYSICS ) ) { // UNDONE: This may not be necessary any more. IPhysicsObject *pPhysics = GetOuter()->VPhysicsGetObject(); bUseVPhysics = pPhysics && pPhysics->IsAsleep(); } ComputeCollisionSurroundingBox( bUseVPhysics, pVecWorldMins, pVecWorldMaxs ); } break; case USE_BEST_COLLISION_BOUNDS: Assert( GetSolid() != SOLID_CUSTOM ); ComputeCollisionSurroundingBox( (GetSolid() == SOLID_VPHYSICS), pVecWorldMins, pVecWorldMaxs ); break; case USE_COLLISION_BOUNDS_NEVER_VPHYSICS: Assert( GetSolid() != SOLID_CUSTOM ); ComputeCollisionSurroundingBox( false, pVecWorldMins, pVecWorldMaxs ); break; case USE_HITBOXES: ComputeHitboxSurroundingBox( pVecWorldMins, pVecWorldMaxs ); break; case USE_ROTATION_EXPANDED_BOUNDS: ComputeRotationExpandedBounds( pVecWorldMins, pVecWorldMaxs ); break; case USE_SPECIFIED_BOUNDS: VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMins, *pVecWorldMins ); VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMaxs, *pVecWorldMaxs ); break; case USE_GAME_CODE: GetOuter()->ComputeWorldSpaceSurroundingBox( pVecWorldMins, pVecWorldMaxs ); Assert( pVecWorldMins->x <= pVecWorldMaxs->x ); Assert( pVecWorldMins->y <= pVecWorldMaxs->y ); Assert( pVecWorldMins->z <= pVecWorldMaxs->z ); return; }#ifdef DEBUG /* // For debugging purposes, make sure the bounds actually does surround the thing. // Otherwise the optimization we were using isn't really all that great, is it? Vector vecTestMins, vecTestMaxs; ComputeCollisionSurroundingBox( (GetSolid() == SOLID_VPHYSICS), &vecTestMins, &vecTestMaxs ); // Now that we have the basics, let's expand for hitboxes if appropriate Vector vecWorldHitboxMins, vecWorldHitboxMaxs; if ( ComputeHitboxSurroundingBox( &vecWorldHitboxMins, &vecWorldHitboxMaxs ) ) { VectorMin( vecWorldHitboxMaxs, vecTestMins, vecTestMins ); VectorMax( vecWorldHitboxMaxs, vecTestMaxs, vecTestMaxs ); } Assert( vecTestMins.x >= pVecWorldMins->x && vecTestMins.y >= pVecWorldMins->y && vecTestMins.z >= pVecWorldMins->z ); Assert( vecTestMaxs.x <= pVecWorldMaxs->x && vecTestMaxs.y <= pVecWorldMaxs->y && vecTestMaxs.z <= pVecWorldMaxs->z ); */#endif}
开发者ID:newroob,项目名称:bg2-2007,代码行数:81,
示例20: SpeechMsgvoid CAI_Expresser::BlockSpeechUntil( float time ) { SpeechMsg( GetOuter(), "BlockSpeechUntil(%f) %f/n", time, time - gpGlobals->curtime ); m_flBlockedTalkTime = time; }
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:5,
示例21: GetEngineUEngine* UGameInstance::GetEngine() const{ return CastChecked<UEngine>(GetOuter());}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:4,
示例22: GetOuter//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------bool CAI_LeadBehavior::GetClosestPointOnRoute( const Vector &targetPos, Vector *pVecClosestPoint ){ AI_Waypoint_t *waypoint = GetOuter()->GetNavigator()->GetPath()->GetCurWaypoint(); AI_Waypoint_t *builtwaypoints = NULL; if ( !waypoint ) { // We arrive here twice when lead behaviour starts: // - When the lead behaviour is first enabled. We have no schedule. We want to know if the player is ahead of us. // - A frame later when we've chosen to lead the player, but we still haven't built our route. We know that the // the player isn't lagging, so it's safe to go ahead and simply say he's ahead of us. This avoids building // the temp route twice. if ( IsCurSchedule( SCHED_LEAD_PLAYER, false ) ) return true; // Build a temp route to the gold and use that builtwaypoints = GetOuter()->GetPathfinder()->BuildRoute( GetOuter()->GetAbsOrigin(), m_goal, NULL, GetOuter()->GetDefaultNavGoalTolerance(), GetOuter()->GetNavType(), bits_BUILD_GET_CLOSE ); if ( !builtwaypoints ) return false; GetOuter()->GetPathfinder()->UnlockRouteNodes( builtwaypoints ); waypoint = builtwaypoints; } // Find the nearest node to the target (going forward) float flNearestDist2D = 999999999; float flNearestDist = 999999999; float flPathDist, flPathDist2D; Vector vecNearestPoint; Vector vecPrevPos = GetOuter()->GetAbsOrigin(); for ( ; (waypoint != NULL) ; waypoint = waypoint->GetNext() ) { // Find the closest point on the line segment on the path Vector vecClosest; CalcClosestPointOnLineSegment( targetPos, vecPrevPos, waypoint->GetPos(), vecClosest ); /* if ( builtwaypoints ) { NDebugOverlay::Line( vecPrevPos, waypoint->GetPos(), 0,0,255,true, 10.0 ); } */ vecPrevPos = waypoint->GetPos(); // Find the distance between this test point and our goal point flPathDist2D = vecClosest.AsVector2D().DistToSqr( targetPos.AsVector2D() ); if ( flPathDist2D > flNearestDist2D ) continue; flPathDist = vecClosest.z - targetPos.z; flPathDist *= flPathDist; flPathDist += flPathDist2D; if (( flPathDist2D == flNearestDist2D ) && ( flPathDist >= flNearestDist )) continue; flNearestDist2D = flPathDist2D; flNearestDist = flPathDist; vecNearestPoint = vecClosest; } if ( builtwaypoints ) { //NDebugOverlay::Line( vecNearestPoint, targetPos, 0,255,0,true, 10.0 ); DeleteAll( builtwaypoints ); } *pVecClosestPoint = vecNearestPoint; return true;}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:71,
示例23: GetIdealSpeedvoid CAI_BlendedMotor::BuildVelocityScript( const AILocalMoveGoal_t &move ){ int i; float a; float idealVelocity = GetIdealSpeed(); if (idealVelocity == 0) { idealVelocity = 50; } float idealAccel = GetIdealAccel(); if (idealAccel == 0) { idealAccel = 100; } AI_Movementscript_t script; // set current location as start of script script.vecLocation = GetAbsOrigin(); script.flMaxVelocity = GetCurSpeed(); m_scriptMove.AddToTail( script ); //------------------------- extern ConVar *npc_height_adjust; if (npc_height_adjust->GetBool() && move.bHasTraced && move.directTrace.flTotalDist != move.thinkTrace.flTotalDist) { float flDist = (move.directTrace.vEndPosition - m_scriptMove[0].vecLocation).Length2D(); float flHeight = move.directTrace.vEndPosition.z - m_scriptMove[0].vecLocation.z; float flDelta; if (flDist > 0) { flDelta = flHeight / flDist; } else { flDelta = 0; } m_flPredictiveSpeedAdjust = 1.1 - fabs( flDelta ); m_flPredictiveSpeedAdjust = clamp( m_flPredictiveSpeedAdjust, (flHeight > 0.0) ? 0.5 : 0.8, 1.0 ); /* if ((GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT)) { Msg("m_flPredictiveSpeedAdjust %.3f %.1f %.1f/n", m_flPredictiveSpeedAdjust, flHeight, flDist ); NDebugOverlay::Box( move.directTrace.vEndPosition, Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), 0,255,255, 0, 0.12 ); } */ } if (npc_height_adjust->GetBool()) { float flDist = (move.thinkTrace.vEndPosition - m_vecPrevOrigin2).Length2D(); float flHeight = move.thinkTrace.vEndPosition.z - m_vecPrevOrigin2.z; float flDelta; if (flDist > 0) { flDelta = flHeight / flDist; } else { flDelta = 0; } float newSpeedAdjust = 1.1 - fabs( flDelta ); newSpeedAdjust = clamp( newSpeedAdjust, (flHeight > 0.0) ? 0.5 : 0.8, 1.0 ); // debounce speed adjust if (newSpeedAdjust < m_flReactiveSpeedAdjust) { m_flReactiveSpeedAdjust = m_flReactiveSpeedAdjust * 0.2 + newSpeedAdjust * 0.8; } else { m_flReactiveSpeedAdjust = m_flReactiveSpeedAdjust * 0.5 + newSpeedAdjust * 0.5; } // filter through origins m_vecPrevOrigin2 = m_vecPrevOrigin1; m_vecPrevOrigin1 = GetAbsOrigin(); /* if ((GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT)) { NDebugOverlay::Box( m_vecPrevOrigin2, Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), 255,0,255, 0, 0.12 ); NDebugOverlay::Box( move.thinkTrace.vEndPosition, Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), 255,0,255, 0, 0.12 ); Msg("m_flReactiveSpeedAdjust %.3f %.1f %.1f/n", m_flReactiveSpeedAdjust, flHeight, flDist ); } */ } idealVelocity = idealVelocity * min( m_flReactiveSpeedAdjust, m_flPredictiveSpeedAdjust ); //------------------------- bool bAddedExpected = false;//.........这里部分代码省略.........
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:101,
示例24: UTIL_AngleDiffvoid CAI_BlendedMotor::MaintainTurnActivity( void ){ if (m_flNextTurnGesture > gpGlobals->curtime || m_flNextTurnAct > gpGlobals->curtime || GetOuter()->IsMoving() ) { // clear out turn detection if currently turing or moving m_doTurn = m_doRight = m_doLeft = 0; if ( GetOuter()->IsMoving()) { m_flNextTurnAct = gpGlobals->curtime + 0.3; } } else { // detect undirected turns if (m_prevYaw != GetAbsAngles().y) { float diff = UTIL_AngleDiff( m_prevYaw, GetAbsAngles().y ); if (diff < 0.0) { m_doLeft += -diff; } else { m_doRight += diff; } m_prevYaw = GetAbsAngles().y; } // accumulate turn angle, delay response for short turns m_doTurn += m_doRight + m_doLeft; // accumulate random foot stick clearing m_doTurn += enginerandom->RandomFloat( 0.4, 0.6 ); } if (m_doTurn > 15.0f) { // mostly a foot stick clear int iSeq = ACT_INVALID; if (m_doLeft > m_doRight) { iSeq = SelectWeightedSequence( ACT_GESTURE_TURN_LEFT ); } else { iSeq = SelectWeightedSequence( ACT_GESTURE_TURN_RIGHT ); } m_doLeft = 0; m_doRight = 0; if (iSeq != ACT_INVALID) { int iLayer = GetOuter()->AddGestureSequence( iSeq ); if (iLayer != -1) { GetOuter()->SetLayerPriority( iLayer, 100 ); // increase speed if we're getting behind or they're turning quickly float rate = enginerandom->RandomFloat( 0.8, 1.2 ); if (m_doTurn > 90.0) { rate *= 1.5; } GetOuter()->SetLayerPlaybackRate( iLayer, rate ); // disable turing for the duration of the gesture m_flNextTurnAct = gpGlobals->curtime + GetOuter()->GetLayerDuration( iLayer ); } else { // too many active gestures, try again in half a second m_flNextTurnAct = gpGlobals->curtime + 0.3; } } m_doTurn = m_doRight = m_doLeft = 0; }}
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:73,
示例25: GetSoundCueUSoundCue* USoundCueGraph::GetSoundCue() const{ return CastChecked<USoundCue>(GetOuter());}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:4,
注:本文中的GetOuter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetOverlappedResult函数代码示例 C++ GetOutPtr函数代码示例 |