message: Begin Vehicle::computeAgl() method
diff: @@ -329,26 +329,8 @@ class Vehicle {
  // Grab images
  grabImages();
  - /*
  - // https://unrealcpp.com/line-trace-on-tick/
  - FVector Start = _pawn->GetActorLocation();
  - Start.Z -= 20;
  - FVector End = FVector(Start.X, Start.Y, Start.Z-1000);
  - //DrawDebugLine(_pawn->GetWorld(), Start, End, FColor::Green, false, 1, 0, 1);
  - DrawDebugLine(_pawn->GetWorld(), Start, End, FColor::Green, false, 0.125, 0, 1);
  -
  - FHitResult OutHit;
  - FCollisionQueryParams CollisionParams;
  - if (_pawn->GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Visibility, CollisionParams)) {
  -
  -
  - if(OutHit.bBlockingHit) {
  - debug("Hit: %s", TCHAR_TO_UTF8(*OutHit.GetActor()->GetName()));
  - debug("Impact Point: %s", TCHAR_TO_UTF8(*OutHit.ImpactPoint.ToString()));
  - debug("Normal Point: %s", TCHAR_TO_UTF8(*OutHit.ImpactNormal.ToString()));
  - }
  - }
  - */
  + // Compute height above ground level
  + computeAgl();
  }
  void PostInitializeComponents()
  @@ -361,6 +343,26 @@ class Vehicle {
  }
  }
  + void computeAgl(void)
  + {
  + // See https://unrealcpp.com/line-trace-on-tick/
  +
  + FVector startPoint = _pawn->GetActorLocation();
  + startPoint.Z -= 20;
  + FVector endPoint = FVector(startPoint.X, startPoint.Y, startPoint.Z-1000);
  + DrawDebugLine(_pawn->GetWorld(), startPoint, endPoint, FColor::Green, false, 1, 0, 1);
  + FHitResult OutHit;
  + FCollisionQueryParams CollisionParams;
  + if (_pawn->GetWorld()->LineTraceSingleByChannel(OutHit, startPoint, endPoint, ECC_Visibility, CollisionParams)) {
  + if(OutHit.bBlockingHit) {
  + FVector impactPoint = OutHit.ImpactPoint;
  + debugline("Hit: %s at (%+3.3f, %+3.3f, %+3.3f)",
  + TCHAR_TO_UTF8(*OutHit.GetActor()->GetName()),
  + impactPoint.X, impactPoint.Y, impactPoint.Z);
  + }
  + }
  + }
  +
  void rotateGimbal(FQuat rotation)
  {
  _springArm->SetRelativeRotation(rotation);
  