当前位置: 首页>>代码示例>>C++>>正文


C++ UNavigationSystem::GetRandomPointInNavigableRadius方法代码示例

本文整理汇总了C++中UNavigationSystem::GetRandomPointInNavigableRadius方法的典型用法代码示例。如果您正苦于以下问题:C++ UNavigationSystem::GetRandomPointInNavigableRadius方法的具体用法?C++ UNavigationSystem::GetRandomPointInNavigableRadius怎么用?C++ UNavigationSystem::GetRandomPointInNavigableRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UNavigationSystem的用法示例。


在下文中一共展示了UNavigationSystem::GetRandomPointInNavigableRadius方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetNewSearchPosition

FVector ABaseController::GetNewSearchPosition()
{
	FNavLocation Location;
	UNavigationSystem* NavSys = World->GetNavigationSystem();
	NavSys->GetRandomPointInNavigableRadius(TargetsLastKnownPosition, Self->SearchRange, Location);
	return Location.Location;
}
开发者ID:destriu,项目名称:Extinction_SourceControl,代码行数:7,代码来源:BaseController.cpp

示例2: GetHitPosition

FVector ABaseController::GetHitPosition()
{
	FNavLocation location;
	UNavigationSystem* navSys = UNavigationSystem::GetCurrent(World);
	navSys->GetRandomPointInNavigableRadius(AttackLocation, 200.f, location);
	return location.Location;
}
开发者ID:destriu,项目名称:Extinction_SourceControl,代码行数:7,代码来源:BaseController.cpp

示例3: GetNewWanderPosition

FVector ABaseController::GetNewWanderPosition()
{
	FNavLocation Location;
	UNavigationSystem* NavSys = World->GetNavigationSystem();

	FHitResult hit(ForceInit);
	FCollisionQueryParams traceParams = FCollisionQueryParams(FName(TEXT("RV_Trace")), true, Self);
	traceParams.bTraceComplex = true;
	traceParams.bTraceAsyncScene = true;

	int times = 0;
	float minimuimDist = Self->MinimuimDistanceBetweenWanderLocations;

	do{
		if (times >= 50)
		{
			times = 0;
			minimuimDist -= 500.f;
		}

		times++;
		NavSys->GetRandomPointInNavigableRadius(Self->GetActorLocation(), Self->SightRange, Location);
	} while (FVector::Dist(Location.Location, Self->GetActorLocation()) < minimuimDist);

	bool bHit = World->LineTraceSingleByChannel(hit, Self->EyeLocation, Location.Location, ECC_Visibility, traceParams);

	return Location.Location;
}
开发者ID:destriu,项目名称:Extinction_SourceControl,代码行数:28,代码来源:BaseController.cpp

示例4: ExecuteTask

EBTNodeResult::Type UATBTTask_MoveArea::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	UNavigationSystem* NavigationSystem = UNavigationSystem::GetCurrent(GetWorld());
	AATCharacterAI* MyCharacter = Cast<AATCharacterAI>(OwnerComp.GetAIOwner()->GetPawn());

	if (NavigationSystem != nullptr && MyCharacter != nullptr)
	{
		FNavLocation RandomPointIn;
		if (NavigationSystem->GetRandomPointInNavigableRadius(MyCharacter->GetActorLocation(), MyCharacter->AreaRadius, RandomPointIn))
		{
			OwnerComp.GetBlackboardComponent()->SetValue<UBlackboardKeyType_Vector>(GetSelectedBlackboardKey(), RandomPointIn.Location);
			return EBTNodeResult::Succeeded;
		}
	}
	return EBTNodeResult::Failed;
}
开发者ID:sshioi,项目名称:ATGame,代码行数:16,代码来源:ATBTTask_MoveArea.cpp


注:本文中的UNavigationSystem::GetRandomPointInNavigableRadius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。