Skip to content

Commit

Permalink
fix manual keyboard control of camera director so that left, right, u…
Browse files Browse the repository at this point in the history
…p, down honor the current rotation that is in effect.
  • Loading branch information
lovettchris committed Mar 31, 2017
1 parent 4f7d098 commit eb08e5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Unreal/Plugins/AirSim/Source/CameraDirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ void ACameraDirector::enableManualBindings(bool enable)
void ACameraDirector::inputManualLeft(float val)
{
if (!FMath::IsNearlyEqual(val, 0.f)) {
camera_location_manual_ += FVector(0, -val * 10, 0);
camera_location_manual_ += camera_rotation_manual_.RotateVector(FVector(0,-val*10,0));
}
}
void ACameraDirector::inputManualRight(float val)
{
if (!FMath::IsNearlyEqual(val, 0.f))
camera_location_manual_ += FVector(0, val * 10, 0);
camera_location_manual_ += camera_rotation_manual_.RotateVector(FVector(0, val * 10, 0));
}
void ACameraDirector::inputManualForward(float val)
{
if (!FMath::IsNearlyEqual(val, 0.f))
camera_location_manual_ += FVector(val * 10, 0, 0);
camera_location_manual_ += camera_rotation_manual_.RotateVector(FVector(val * 10, 0, 0));
}
void ACameraDirector::inputManualBackward(float val)
{
if (!FMath::IsNearlyEqual(val, 0.f))
camera_location_manual_ += FVector(-val * 10, 0, 0);
camera_location_manual_ += camera_rotation_manual_.RotateVector(FVector(-val * 10, 0, 0));
}
void ACameraDirector::inputManualMoveUp(float val)
{
Expand Down

0 comments on commit eb08e5f

Please sign in to comment.