-
Notifications
You must be signed in to change notification settings - Fork 2
Cursor mode #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Cursor mode #23
Changes from 2 commits
d24e813
f4ea2f7
d5d94a8
406d2dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,13 +93,44 @@ void AStrangerController::AddHorizontalMouseScan(float amount) { | |
| if (!IsCursorLockedToCenter) { | ||
| HorizontalMousePosition = | ||
| FMath::Clamp(HorizontalMousePosition + amount, 0.0f, 1.0f); | ||
|
|
||
| // check to see if we're within +tolerance for screen border | ||
| if (1 - HorizontalMousePosition < HorizontalMouseNudgeThreshold) | ||
| { | ||
| //rotate the camera in accordance with how close the cursor is to the edge of the screen | ||
| this->AddYawInput(HorizontalMouseNudgeThreshold - | ||
| (1 - HorizontalMousePosition)); | ||
| } | ||
|
|
||
| // check to see if we're within -tolerance for screen border | ||
| if (HorizontalMousePosition < HorizontalMouseNudgeThreshold) | ||
| { | ||
| // rotate the camera in accordance with how close the cursor is to the edge of the screen | ||
| this->AddYawInput( | ||
| -(HorizontalMouseNudgeThreshold - HorizontalMousePosition)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| void AStrangerController::AddVerticalMouseScan(float amount) { | ||
| if (!IsCursorLockedToCenter) { | ||
| VerticalMousePosition = | ||
| FMath::Clamp(VerticalMousePosition + amount, 0.0f, 1.0f); | ||
|
|
||
| // check to see if we're within +tolerance for screen border | ||
| if (1 - VerticalMousePosition < VerticalMouseNudgeThreshold) | ||
| { | ||
| // rotate the camera in accordance with how close the cursor is to the edge of the screen | ||
| this->AddPitchInput( | ||
| VerticalMouseNudgeThreshold - (1 - VerticalMousePosition)); | ||
|
||
| } | ||
|
|
||
| // check to see if we're within -tolerance for screen border | ||
tropicsquirrel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (VerticalMousePosition < VerticalMouseNudgeThreshold) | ||
| { | ||
| // rotate the camera in accordance with how close the cursor is to the edge of the screen | ||
| this->AddPitchInput(-(VerticalMouseNudgeThreshold - VerticalMousePosition)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -111,7 +142,7 @@ void AStrangerController::EnterCursorMode(bool fixed) { | |
| VerticalMousePosition = 0.5; | ||
| } else { | ||
| this->IsCursorLockedToCenter = false; | ||
| this->IgnoreLookInput = 1; | ||
| //this->IgnoreLookInput = 1; | ||
tropicsquirrel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.