это спермаггедон
This commit is contained in:
1 parent
d14f9c2a9f
commit
d51527b7f3
2 files changed
+10
-5
No files matched your search
+8
-3
@@ -85,11 +85,15 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
||||
_wallContactPoint = contactPoint;
|
||||
WallContactHeight = contactPoint.y;
|
||||
|
||||
_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
||||
//_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
||||
if (_wallTangentUp.sqrMagnitude < 0.01f) _wallTangentUp = Vector3.up;
|
||||
|
||||
_wallTangentRight = Vector3.Cross(_wallNormal, _wallTangentUp).normalized;
|
||||
|
||||
_wallTangentUp = Vector3.Cross(_wallTangentRight, _wallNormal).normalized;
|
||||
if (Vector3.Dot(_wallTangentUp, Vector3.up) < 0)
|
||||
_wallTangentUp = -_wallTangentUp;
|
||||
|
||||
WallRunStartForward = _motor.CharacterForward;
|
||||
_motor.ForceUnground();
|
||||
}
|
||||
@@ -123,7 +127,7 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
||||
1f - Mathf.Exp(-WallRunAcceleration * deltaTime)
|
||||
);
|
||||
|
||||
currentVelocity += Physics.gravity * WallRunGravityScale * deltaTime;
|
||||
currentVelocity += Physics.gravity * (WallRunGravityScale * deltaTime);
|
||||
|
||||
float distanceToWall = Vector3.Dot(_motor.TransientPosition - _wallContactPoint, _wallNormal);
|
||||
if (Mathf.Abs(distanceToWall) > 0.8f)
|
||||
@@ -170,9 +174,10 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
||||
_wallNormal = hit.normal.normalized;
|
||||
_wallContactPoint = hit.point;
|
||||
|
||||
_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
||||
/*_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
||||
if (_wallTangentUp.sqrMagnitude < 0.01f) _wallTangentUp = Vector3.up;
|
||||
_wallTangentRight = Vector3.Cross(_wallNormal, _wallTangentUp).normalized;
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ namespace Code.Gameplay.Character.Controller
|
||||
// );
|
||||
_wallRunningMechanic = new WallRunningMechanic();
|
||||
// Настройка параметров WallRunningMechanic (можно вынести в конфиг позже)
|
||||
_wallRunningMechanic.MaxWallRunTime = 1.75f;
|
||||
_wallRunningMechanic.MaxWallRunTime = 5f;
|
||||
_wallRunningMechanic.WallRunSpeed = 15.0f;
|
||||
_wallRunningMechanic.WallRunAcceleration = 25.0f;
|
||||
_wallRunningMechanic.WallRunGravityScale = 0.25f;
|
||||
@@ -142,7 +142,7 @@ namespace Code.Gameplay.Character.Controller
|
||||
|
||||
public void UpdateRotation(ref Quaternion currentRotation, float deltaTime)
|
||||
{
|
||||
if (_slideMechanic.IsSliding || _wallRunningMechanic.IsWallRunning) return;
|
||||
if (_slideMechanic.IsSliding) return;
|
||||
|
||||
switch (_currentCameraMode)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user