throwing weapon back on
This commit is contained in:
@ -74,25 +74,6 @@ public partial class DashSystem: Node3D
|
||||
_dashIndicatorAnim = GetNode<AnimationPlayer>("DashIndicator/AnimationPlayer");
|
||||
}
|
||||
|
||||
private Vector3 RecurseThroughCollisions(Vector3 previousCollisionPoint, Vector3 previousNormal, int recursionDepth)
|
||||
{
|
||||
if (recursionDepth == 0)
|
||||
return previousCollisionPoint;
|
||||
|
||||
var startPoint = previousCollisionPoint + previousNormal*_playerHeight;
|
||||
_playerCast3D.SetGlobalPosition(startPoint);
|
||||
_playerCast3D.SetTargetPosition(-previousNormal*_playerRadius);
|
||||
|
||||
var hasHit = _playerCast3D.IsColliding();
|
||||
if (!hasHit)
|
||||
return previousCollisionPoint;
|
||||
|
||||
return RecurseThroughCollisions(
|
||||
_playerCast3D.GetCollisionPoint(0),
|
||||
_playerCast3D.GetCollisionNormal(0),
|
||||
recursionDepth - 1);
|
||||
}
|
||||
|
||||
private DashLocation ComputeDashLocation()
|
||||
{
|
||||
var targetLocation = _dashCast3D.ToGlobal(_dashCast3D.TargetPosition);
|
||||
@ -109,18 +90,6 @@ public partial class DashSystem: Node3D
|
||||
var globalSweepPath = targetLocation - _dashCast3D.GlobalPosition;
|
||||
var locationAlongPath = _dashCast3D.GlobalPosition + globalSweepPath * fraction;
|
||||
return new DashLocation(true, locationAlongPath, collisionPoint, collisionNormal);
|
||||
|
||||
// // Pushes the point down when dashing to under a platform so head doesn't clip
|
||||
// var maxPushDownDistance = 0.9f;
|
||||
// var correctionProportion = (float) Mathf.Remap(CollisionNormal.Y, -0.5, -1, 0, 1);
|
||||
// var proportion = (float)Mathf.Remap(_dashCast3D.GlobalRotation.X, 0, 1.57, 0, 1);
|
||||
// var finalLocation = locationAlongPath
|
||||
// + CollisionNormal
|
||||
// * maxPushDownDistance
|
||||
// * Mathf.Clamp(proportion, 0, 1)
|
||||
// * Mathf.Clamp(correctionProportion, 0, 1);
|
||||
//
|
||||
// return new DashLocation(true, finalLocation);
|
||||
}
|
||||
|
||||
public void PrepareDash()
|
||||
|
@ -54,7 +54,7 @@ public partial class WeaponSystem : RigidBody3D
|
||||
PlantLocation = collisionLocation;
|
||||
PlantNormal = collisionNormal;
|
||||
LookAt(end);
|
||||
|
||||
|
||||
var tween = _tweenQueueSystem.TweenToLocation(new TweenQueueSystem.TweenInputs(end, StraightThrowDuration));
|
||||
if (hasHit)
|
||||
tween.Finished += PlantWeaponInWall;
|
||||
|
Reference in New Issue
Block a user