| 1150 | } |
| 1151 | |
| 1152 | void AAlsxtCharacter::InputMove(const FInputActionValue& ActionValue) |
| 1153 | { |
| 1154 | if (GetDesiredStatus() == ALSXTStatusTags::Normal && bMovementEnabled) |
| 1155 | { |
| 1156 | const auto Value{ UAlsVector::ClampMagnitude012D(ActionValue.Get<FVector2D>()) }; |
| 1157 | |
| 1158 | FRotator CapsuleRotation = GetActorRotation(); |
| 1159 | auto ForwardDirection{ UAlsVector::AngleToDirectionXY(UE_REAL_TO_FLOAT(GetViewState().Rotation.Yaw)) }; |
| 1160 | auto RightDirection{ UAlsVector::PerpendicularCounterClockwiseXY(ForwardDirection) }; |
| 1161 | const auto CharForwardDirection{ UAlsVector::AngleToDirectionXY(UE_REAL_TO_FLOAT(CapsuleRotation.Yaw)) }; |
| 1162 | const auto CharRightDirection{ UAlsVector::PerpendicularCounterClockwiseXY(CharForwardDirection) }; |
| 1163 | |
| 1164 | if (GetDesiredFreelooking() == ALSXTFreelookingTags::True) |
| 1165 | { |
| 1166 | // AddMovementInput(HeadLookAtState.PreviousControlRotation.Yaw * Value.Y + RightDirection * Value.X); |
| 1167 | |
| 1168 | // const auto FreelookForwardDirection{ UAlsVector::AngleToDirectionXY(UE_REAL_TO_FLOAT(GetHeadLookAtState().LockedViewState.Rotation.Yaw)) }; |
| 1169 | ForwardDirection = UAlsVector::AngleToDirectionXY(UE_REAL_TO_FLOAT(GetFreelookState().LockedViewState.Rotation.Yaw)); |
| 1170 | RightDirection = UAlsVector::PerpendicularCounterClockwiseXY(ForwardDirection); |
| 1171 | AddMovementInput(ForwardDirection * Value.Y + RightDirection * Value.X); |
| 1172 | MovementInput = ForwardDirection * Value.Y + RightDirection * Value.X; |
| 1173 | |
| 1174 | // AddMovementInput(CharForwardDirection * Value.Y + CharRightDirection * Value.X); |
| 1175 | // MovementInput = CharForwardDirection * Value.Y + CharRightDirection * Value.X; |
| 1176 | // GetLocomotionState().PreviousVelocity; |
| 1177 | // AddMovementInput(GetLocomotionState().PreviousVelocity); |
| 1178 | // MovementInput = GetLocomotionState().PreviousVelocity; |
| 1179 | } |
| 1180 | else |
| 1181 | { |
| 1182 | ForwardDirection = UAlsVector::AngleToDirectionXY(UE_REAL_TO_FLOAT(GetViewState().Rotation.Yaw)) ; |
| 1183 | RightDirection = UAlsVector::PerpendicularCounterClockwiseXY(ForwardDirection); |
| 1184 | AddMovementInput(ForwardDirection * Value.Y + RightDirection * Value.X); |
| 1185 | MovementInput = ForwardDirection * Value.Y + RightDirection * Value.X; |
| 1186 | } |
| 1187 | } |
| 1188 | } |
| 1189 | |
| 1190 | void AAlsxtCharacter::InputSprint(const FInputActionValue& ActionValue) |
| 1191 | { |
nothing calls this directly
no outgoing calls
no test coverage detected