trying to figure out a camera stutter bug
This commit is contained in:
@@ -54,8 +54,7 @@ namespace RebootReality.jelycho.Player {
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
m_NoiseComponent =
|
||||
Camera.GetCinemachineComponent(CinemachineCore.Stage.Noise) as CinemachineBasicMultiChannelPerlin;
|
||||
m_NoiseComponent = Camera.GetCinemachineComponent(CinemachineCore.Stage.Noise) as CinemachineBasicMultiChannelPerlin;
|
||||
Assert.IsNotNull(m_NoiseComponent);
|
||||
|
||||
SetBobbing(0.0f);
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace RebootReality.jelycho.Player {
|
||||
InterpolateActorState(deltaTime);
|
||||
}
|
||||
|
||||
TickCharacterRotation();
|
||||
TickCharacterRotation(deltaTime);
|
||||
}
|
||||
|
||||
protected override void OnActorCommandServer(ulong senderID, ActorCommand actorCommand) {
|
||||
@@ -638,12 +638,13 @@ namespace RebootReality.jelycho.Player {
|
||||
m_CurrentCameraBobbing = Mathf.MoveTowards(m_CurrentCameraBobbing,
|
||||
m_TargetCameraBobbing,
|
||||
m_CameraBobbingTransitionSpeed * deltaTime);
|
||||
m_Camera.SetBobbing(m_CurrentCameraBobbing);
|
||||
// m_Camera.SetBobbing(m_CurrentCameraBobbing);
|
||||
m_Camera.SetBobbing(0.0f);
|
||||
|
||||
m_CameraSpring.UpdateSpring(deltaTime,
|
||||
m_CharacterForwardTransform.up,
|
||||
m_CharacterForwardTransform.right,
|
||||
m_CharacterForwardTransform.forward);
|
||||
// m_CameraSpring.UpdateSpring(deltaTime,
|
||||
// m_CharacterForwardTransform.up,
|
||||
// m_CharacterForwardTransform.right,
|
||||
// m_CharacterForwardTransform.forward);
|
||||
}
|
||||
|
||||
void SenseInteractable() {
|
||||
@@ -823,7 +824,7 @@ namespace RebootReality.jelycho.Player {
|
||||
//
|
||||
// @MARK: Common
|
||||
//
|
||||
void TickCharacterRotation() {
|
||||
void TickCharacterRotation(float dt) {
|
||||
float angleDeg = Mathf.DeltaAngle(m_Camera.Yaw, m_Locomotion.YawRotation);
|
||||
|
||||
bool rotateCharacter = false;
|
||||
@@ -846,12 +847,13 @@ namespace RebootReality.jelycho.Player {
|
||||
}
|
||||
|
||||
if (rotateCharacter) {
|
||||
m_CharacterTurnVelocity = rotateCharacterSpeed * Time.deltaTime;
|
||||
m_CharacterTurnVelocity = rotateCharacterSpeed * dt;
|
||||
m_CharacterTurnVelocitySmooth = m_CharacterTurnVelocity;
|
||||
|
||||
m_Locomotion.YawRotation = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation,
|
||||
m_Camera.Yaw,
|
||||
m_CharacterTurnVelocity);
|
||||
|
||||
float newYaw = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation,
|
||||
m_Camera.Yaw,
|
||||
m_CharacterTurnVelocity);
|
||||
m_Locomotion.YawRotation = newYaw;
|
||||
}
|
||||
|
||||
// Aim Target adjustment
|
||||
@@ -864,7 +866,7 @@ namespace RebootReality.jelycho.Player {
|
||||
public bool TryGetBeaconPosition(out Vector3 position) {
|
||||
var ray = new Ray(m_Camera.Camera.transform.position,
|
||||
m_Camera.Camera.transform.forward);
|
||||
|
||||
|
||||
if (Physics.Raycast(ray, out RaycastHit hit, m_BeaconPlacementMaxDistance, m_BeaconPlacementLayerMask) &&
|
||||
Vector3.Dot(hit.normal, Vector3.up) >= m_NormalDotUpThreshold) {
|
||||
position = hit.point;
|
||||
|
||||
@@ -97,13 +97,13 @@ namespace RebootReality.jelycho.Player {
|
||||
public IPlayable Build(PlayableGraph graph) {
|
||||
m_Mixer = AnimationMixerPlayable.Create(graph, 7);
|
||||
|
||||
AnimationClipPlayable idlePlayable = AnimationClipPlayable.Create(graph, m_IdleClip);
|
||||
AnimationClipPlayable runForwardPlayable = AnimationClipPlayable.Create(graph, m_RunForwardClip);
|
||||
AnimationClipPlayable runBackwardsPlayable = AnimationClipPlayable.Create(graph, m_RunBackwardsClip);
|
||||
AnimationClipPlayable strafeRightPlayable = AnimationClipPlayable.Create(graph, m_StrafeRightClip);
|
||||
AnimationClipPlayable strafeLeftPlayable = AnimationClipPlayable.Create(graph, m_StrafeLeftClip);
|
||||
AnimationClipPlayable turnRightPlayable = AnimationClipPlayable.Create(graph, m_TurnRightClip);
|
||||
AnimationClipPlayable turnLeftPlayable = AnimationClipPlayable.Create(graph, m_TurnLeftClip);
|
||||
var idlePlayable = AnimationClipPlayable.Create(graph, m_IdleClip);
|
||||
var runForwardPlayable = AnimationClipPlayable.Create(graph, m_RunForwardClip);
|
||||
var runBackwardsPlayable = AnimationClipPlayable.Create(graph, m_RunBackwardsClip);
|
||||
var strafeRightPlayable = AnimationClipPlayable.Create(graph, m_StrafeRightClip);
|
||||
var strafeLeftPlayable = AnimationClipPlayable.Create(graph, m_StrafeLeftClip);
|
||||
var turnRightPlayable = AnimationClipPlayable.Create(graph, m_TurnRightClip);
|
||||
var turnLeftPlayable = AnimationClipPlayable.Create(graph, m_TurnLeftClip);
|
||||
|
||||
m_Mixer.ConnectInput(0, idlePlayable, 0, 1.0f);
|
||||
m_Mixer.ConnectInput(1, runForwardPlayable, 0, 0.0f);
|
||||
@@ -305,12 +305,10 @@ namespace RebootReality.jelycho.Player {
|
||||
m_Hands.OnCharged += () => { onChargeReady?.Invoke(); };
|
||||
|
||||
m_QuickKickNode = m_ReAnimator.FindNode<AnimationClipNode>("legs_kick_quick");
|
||||
|
||||
|
||||
m_IsReady = true;
|
||||
}
|
||||
|
||||
void Update() { }
|
||||
|
||||
public void SetLocomotionParams(PlayerLocomotionAnimatorParams locomotionParams) {
|
||||
if (!m_IsReady) {
|
||||
return;
|
||||
@@ -318,8 +316,8 @@ namespace RebootReality.jelycho.Player {
|
||||
|
||||
m_LegsLayerMixer.SetLayerWeight(1, locomotionParams.IsGrounded ? 0.0f : 1.0f);
|
||||
|
||||
float2 groundBlendDirection = new float2(locomotionParams.VelocityRightNormalized,
|
||||
locomotionParams.VelocityForwardNormalized);
|
||||
var groundBlendDirection = new float2(locomotionParams.VelocityRightNormalized,
|
||||
locomotionParams.VelocityForwardNormalized);
|
||||
m_GroundBlendTree.SetInput(groundBlendDirection, locomotionParams.TurnVelocity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user