gd,ld: some LD and some bug fixing that didn't fix the bugs

This commit is contained in:
2025-06-19 13:34:31 +02:00
parent 01d0488d91
commit 21bc3f4724
26 changed files with 385 additions and 51 deletions

View File

@ -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);

View File

@ -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"]

View File

@ -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)

View File

@ -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

View File

@ -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);
}
}