some juice work on the first person weapon
This commit is contained in:
@@ -41,8 +41,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// Public stuff //
|
||||
///////////////////////////
|
||||
public HeadSystem HeadSystem;
|
||||
public Bobbing Bobbing;
|
||||
public FieldOfView FieldOfView;
|
||||
public StairsSystem StairsSystem;
|
||||
public MantleSystem MantleSystem;
|
||||
public DashSystem DashSystem;
|
||||
@@ -340,8 +338,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
// Camera stuff
|
||||
HeadSystem = GetNode<HeadSystem>("HeadSystem");
|
||||
Bobbing = GetNode<Bobbing>("Bobbing");
|
||||
FieldOfView = GetNode<FieldOfView>("FieldOfView");
|
||||
Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D");
|
||||
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
|
||||
|
||||
@@ -422,8 +418,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
// Camera stuff
|
||||
HeadSystem.Init();
|
||||
Bobbing.Init(camera);
|
||||
FieldOfView.Init(camera);
|
||||
|
||||
// Movement stuff
|
||||
// Getting universal setting from GODOT editor to be in sync
|
||||
@@ -811,8 +805,20 @@ public partial class PlayerController : CharacterBody3D,
|
||||
var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier;
|
||||
|
||||
var wallHugContactPoint = _onWallRunning.Active ? _currentWallContactPoint : Vector3.Zero;
|
||||
var playerVelocity = GetGlobalMoveInput();
|
||||
HeadSystem.LookAround(delta, inputLookDir, playerVelocity, Velocity, wallHugContactPoint, lookSensitivity, isSliding: _groundSliding.Active);
|
||||
var moveInput = GetGlobalMoveInput();
|
||||
|
||||
var lookAroundInputs = new HeadSystem.CameraParameters(
|
||||
Delta: delta,
|
||||
LookDir: inputLookDir,
|
||||
PlayerInput: moveInput,
|
||||
PlayerVelocity:Velocity,
|
||||
WallContactPoint: wallHugContactPoint,
|
||||
SensitivitMultiplier: lookSensitivity,
|
||||
WithCameraJitter: _groundSliding.Active,
|
||||
WithCameraBobbing: _grounded.Active || _onWallRunning.Active,
|
||||
BobbingMultiplier: _headBobbingMultiplier,
|
||||
FovMultiplier: _fovChangeMultiplier);
|
||||
HeadSystem.LookAround(lookAroundInputs);
|
||||
}
|
||||
public void RotateWeaponWithPlayer()
|
||||
{
|
||||
@@ -822,28 +828,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
{
|
||||
return Transform.Basis * HeadSystem.Transform.Basis * Vector3.Forward;
|
||||
}
|
||||
private void CameraModifications(float delta)
|
||||
{
|
||||
Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams
|
||||
{
|
||||
Delta = delta,
|
||||
IsOnFloorCustom = _grounded.Active || _onWallRunning.Active,
|
||||
Velocity = Velocity,
|
||||
SettingsMultiplier = _headBobbingMultiplier
|
||||
};
|
||||
Bobbing.PerformCameraBobbing(cameraBobbingParams);
|
||||
|
||||
FieldOfView.FovParameters fovParams = new FieldOfView.FovParameters
|
||||
{
|
||||
IsCrouchingHeight = false,
|
||||
Delta = delta,
|
||||
SprintSpeed = WalkSpeed,
|
||||
Velocity = Velocity,
|
||||
FOVMultiplier = _fovChangeMultiplier
|
||||
};
|
||||
FieldOfView.PerformFovAdjustment(fovParams);
|
||||
}
|
||||
|
||||
// Horizontal velocity computing
|
||||
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
|
||||
{
|
||||
@@ -1718,7 +1702,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1;
|
||||
|
||||
LookAround(delta);
|
||||
CameraModifications((float) delta);
|
||||
MoveSlideAndHandleStairs((float) delta);
|
||||
MantleSystem.ProcessMantle(_grounded.Active);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user