trying to figure out a camera stutter bug
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user