Created
October 8, 2017 12:35
-
-
Save Busata/489ceff8589c699a90f7b6f1281f8a84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAerialNavigationVoxel* AAerialNavigationManager::GetVoxel(int32 X, int32 Y, int32 Z) | |
{ | |
auto Plane = NavigationData.Planes[Z]; | |
int32 i = X + GetGridSize().X * Y; | |
FAerialNavigationVoxel Vox = Plane.Voxels[i]; //UStruct, TArray<FAerialNavigationVoxel> Voxels; | |
UE_LOG(LogTemp, Warning, TEXT("GetVoxelAt: %s"), *Vox.WorldLocation.ToString()); | |
return &Plane.Voxels[i]; | |
} | |
FAerialNavigationVoxel* AAerialNavigationManager::GetVoxelAt(FVector Location) | |
{ | |
if (!IsLocationInBounds(Location)) { return nullptr; } | |
auto GridStart = GetGridStart(); | |
int32 X = (Location.X - GridStart.X) / VoxelSize; | |
int32 Y = (Location.Y - GridStart.Y) / VoxelSize; | |
int32 Z = (Location.Z - GridStart.Z) / VoxelSize; | |
FAerialNavigationVoxel* VoxelPtr = GetVoxel(X, Y, Z); | |
UE_LOG(LogTemp, Warning, TEXT("GetVoxelAt: %s"), *VoxelPtr->WorldLocation.ToString()); | |
return VoxelPtr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment