_some progerss?

This commit is contained in:
2025-09-12 13:33:49 +03:00
parent 95de571eb5
commit 5af8610c0c
4 changed files with 72 additions and 33 deletions

View File

@@ -137,7 +137,11 @@ public class PlayerMovement : Script
private PlayerActor playerActor;
public Actor rootActor;
public Float3 viewAngles;
public Float3 viewAngles
{
get => movementState.viewAngles;
set => movementState.viewAngles = value;
}
private Float3 viewAnglesLastFrame;
public uint PlayerId => playerActor ? playerActor.PlayerId : 0;
@@ -271,8 +275,6 @@ public class PlayerMovement : Script
//if (Input is PlayerInputDemo /*&& currentInputFrame2 >= currentInputFrame*/)
// return;
if (World.IsServer)
viewAngles = viewAngles;
Input.SetFrame(World.Frame);
Input.UpdateState();
@@ -473,6 +475,7 @@ public class PlayerMovement : Script
inputState =
{
Frame = currentFrame,
ViewAngles = movementState.viewAngles.XY(),
},
movementState = movementState,
};
@@ -488,7 +491,8 @@ public class PlayerMovement : Script
Input.SetFrame(currentFrame);
Input.UpdateState();
ApplyInputToCamera(frameInfo.inputState, true);
SetCameraEulerAngles(new Float3(frameInfo.inputState.ViewAngles.X, frameInfo.inputState.ViewAngles.Y, viewAngles.Z), true);
//ApplyInputToCamera(frameInfo.inputState, true);
lastFrameInfo = frameInfo;
}
SimulatePlayerMovement(frameInfo.inputState, currentFrame);