messing with animations
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Oddworm.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using R3;
|
||||
using RebootKit.Engine.Extensions;
|
||||
using RebootKit.Engine.Main;
|
||||
using RebootKit.Engine.Network;
|
||||
using RebootKit.Engine.Simulation;
|
||||
@@ -115,7 +116,7 @@ namespace RebootReality.jelycho.Player {
|
||||
}
|
||||
}
|
||||
|
||||
List<Actor> m_AdditionalMountedActor = new List<Actor>();
|
||||
readonly List<Actor> m_AdditionalMountedActor = new List<Actor>();
|
||||
|
||||
protected override IActorData CreateActorData() {
|
||||
return new PlayerActorData { };
|
||||
@@ -640,7 +641,7 @@ namespace RebootReality.jelycho.Player {
|
||||
m_CameraBobbingTransitionSpeed * deltaTime);
|
||||
// m_Camera.SetBobbing(m_CurrentCameraBobbing);
|
||||
m_Camera.SetBobbing(0.0f);
|
||||
|
||||
|
||||
// m_CameraSpring.UpdateSpring(deltaTime,
|
||||
// m_CharacterForwardTransform.up,
|
||||
// m_CharacterForwardTransform.right,
|
||||
@@ -825,6 +826,9 @@ namespace RebootReality.jelycho.Player {
|
||||
// @MARK: Common
|
||||
//
|
||||
void TickCharacterRotation(float dt) {
|
||||
float3 targetCharacterForward = math.normalize(LookDirection.With(y: 0.0f));
|
||||
float3 currentCharacterForward = math.normalize(m_CharacterForwardTransform.forward.With(y: 0.0f));
|
||||
|
||||
float angleDeg = Mathf.DeltaAngle(m_Camera.Yaw, m_Locomotion.YawRotation);
|
||||
|
||||
bool rotateCharacter = false;
|
||||
@@ -845,14 +849,21 @@ namespace RebootReality.jelycho.Player {
|
||||
if (!rotateCharacter && math.abs(velocityForward) > 0.01f) {
|
||||
rotateCharacter = true;
|
||||
}
|
||||
|
||||
|
||||
if (rotateCharacter) {
|
||||
m_CharacterTurnVelocity = rotateCharacterSpeed * dt;
|
||||
m_CharacterTurnVelocitySmooth = m_CharacterTurnVelocity;
|
||||
|
||||
// var newForward = Vector3.RotateTowards(currentCharacterForward,
|
||||
// targetCharacterForward,
|
||||
// math.radians(m_CharacterTurnVelocity),
|
||||
// 0.0f);
|
||||
// m_CharacterForwardTransform.forward = newForward;
|
||||
|
||||
float newYaw = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation,
|
||||
m_Camera.Yaw,
|
||||
m_CharacterTurnVelocity);
|
||||
newYaw = m_Camera.Yaw;
|
||||
// s_Logger.Info($"YAW: {newYaw}");
|
||||
m_Locomotion.YawRotation = newYaw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user