gd,ld: some LD and some bug fixing that didn't fix the bugs
This commit is contained in:
@ -54,7 +54,7 @@ public partial class DashSystem: Node3D
|
||||
var collisionPoint = _dashCast3D.GetCollisionPoint(0);
|
||||
var collisionNormal = _dashCast3D.GetCollisionNormal(0);
|
||||
var collisionShape = (SphereShape3D) _dashCast3D.GetShape();
|
||||
var centerSphereLocation = collisionPoint + collisionNormal * collisionShape.Radius;
|
||||
var centerSphereLocation = collisionPoint + collisionNormal * 0.2f;
|
||||
return new DashComputationRecord(true, centerSphereLocation, collisionPoint, collisionNormal);
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public partial class DashSystem: Node3D
|
||||
|
||||
var shouldMantle = false;
|
||||
var mantleLocation = Vector3.Zero;
|
||||
if (hasHit && Mathf.Abs(collisionNormal.Y) < 0.01f)
|
||||
if (hasHit && Mathf.Abs(collisionNormal.Y) < 0.5f)
|
||||
{
|
||||
var mantleResult = _mantleSystem.FindMantleLocationAtPoint(collisionPoint, collisionNormal);
|
||||
shouldMantle = mantleResult.IsSome(out mantleLocation);
|
||||
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="2_pff7b"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_qu4wy"]
|
||||
radius = 0.1
|
||||
radius = 0.2
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_qu4wy"]
|
||||
|
||||
|
@ -57,7 +57,7 @@ public partial class MantleSystem: Node3D
|
||||
var shapeCastStartLocation = horizontalEndLocation + Vector3.Up * MantleHeightCastStart;
|
||||
|
||||
_mantleCast3D.SetGlobalPosition(shapeCastStartLocation);
|
||||
var targetLocation = Vector3.Down * MantleHeightCastStart + Vector3.Up * MaxStepHeight;
|
||||
var targetLocation = Vector3.Down * MantleHeightCastStart;
|
||||
_mantleCast3D.SetTargetPosition(targetLocation);
|
||||
|
||||
if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y > 0.9f)
|
||||
|
@ -21,7 +21,7 @@ collision_mask = 2
|
||||
debug_shape_custom_color = Color(1, 0, 0, 1)
|
||||
|
||||
[node name="WallInFrontCast3D" type="ShapeCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.65, 0)
|
||||
shape = SubResource("CapsuleShape3D_qu4wy")
|
||||
target_position = Vector3(0, 0, -1.5)
|
||||
max_results = 1
|
||||
|
@ -73,7 +73,7 @@ public partial class WeaponSystem : RigidBody3D
|
||||
_weaponState.SendEvent("plant");
|
||||
Freeze = true;
|
||||
GlobalPosition = _plantLocation;
|
||||
PlayerDashLocation = _plantLocation + _plantNormal * 0.1f;
|
||||
PlayerDashLocation = ComputeDashLocation(_plantLocation, _plantNormal);
|
||||
LookAt(GlobalTransform.Origin + _plantNormal, Vector3.Up, true);
|
||||
}
|
||||
|
||||
@ -84,6 +84,11 @@ public partial class WeaponSystem : RigidBody3D
|
||||
Freeze = true;
|
||||
}
|
||||
|
||||
private Vector3 ComputeDashLocation(Vector3 collisionLocation, Vector3 collisionNormal)
|
||||
{
|
||||
return collisionLocation + collisionNormal * 0.2f;
|
||||
}
|
||||
|
||||
public override void _IntegrateForces(PhysicsDirectBodyState3D state)
|
||||
{
|
||||
base._IntegrateForces(state);
|
||||
@ -92,7 +97,7 @@ public partial class WeaponSystem : RigidBody3D
|
||||
{
|
||||
_plantLocation = state.GetContactLocalPosition(0);
|
||||
_plantNormal = state.GetContactLocalNormal(0);
|
||||
PlayerDashLocation = _plantLocation + _plantNormal * 0.1f;
|
||||
PlayerDashLocation = ComputeDashLocation(_plantLocation, _plantNormal);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user