Fix Cut 3b Soul Pass #1 vehicle orientation, grounding, rig, halo, and debris findings
This commit is contained in:
parent
5adff2b842
commit
3e90ba2dc3
6 changed files with 750 additions and 95 deletions
|
|
@ -59,6 +59,14 @@ public partial class ArenaRenderer : Node3D
|
|||
public VehicleVisualInstance? GetSpectatorVisual(int spectatorId) =>
|
||||
_spectatorVisuals.TryGetValue(spectatorId, out var vis) ? vis.Visual : null;
|
||||
|
||||
internal float? GetSpectatorHaloLocalY(int spectatorId) =>
|
||||
_spectatorVisuals.TryGetValue(spectatorId, out var vis) && vis.HaloMesh is not null
|
||||
? vis.HaloMesh.Position.Y
|
||||
: null;
|
||||
|
||||
internal int ActiveDropVisualCount => _dropVisuals.Count;
|
||||
internal int DropGroupChildCount => _dropsGroup.GetChildCount();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_assetCache = new VehicleAssetCache();
|
||||
|
|
@ -324,8 +332,9 @@ public partial class ArenaRenderer : Node3D
|
|||
role,
|
||||
visualScale: 1f,
|
||||
targetHalfHeight: s.Grid.Spec.HalfHeight);
|
||||
instance.SyncMountedGear(s.Grid);
|
||||
_actorsGroup.AddChild(instance.Root);
|
||||
vis = CreateSpectatorVisualWrapper(instance, s.Grid.Spec);
|
||||
vis = CreateSpectatorVisualWrapper(instance);
|
||||
_spectatorVisuals[s.Id] = vis;
|
||||
}
|
||||
|
||||
|
|
@ -441,12 +450,9 @@ public partial class ArenaRenderer : Node3D
|
|||
}
|
||||
}
|
||||
|
||||
private ActorVisual CreateSpectatorVisualWrapper(VehicleVisualInstance instance, ChassisSpec spec)
|
||||
private ActorVisual CreateSpectatorVisualWrapper(VehicleVisualInstance instance)
|
||||
{
|
||||
float modelScale = instance.Template.Package.HalfHeight > 1e-4f
|
||||
? spec.HalfHeight / instance.Template.Package.HalfHeight
|
||||
: 1f;
|
||||
float haloY = MathF.Max(2.2f, instance.Template.MaxY * modelScale - spec.HalfHeight + 0.75f);
|
||||
float haloY = MathF.Max(2.2f, instance.ComputeMountedMaxY() + 0.85f);
|
||||
var haloMat = new StandardMaterial3D
|
||||
{
|
||||
ShadingMode = BaseMaterial3D.ShadingModeEnum.Unshaded,
|
||||
|
|
@ -498,7 +504,12 @@ public partial class ArenaRenderer : Node3D
|
|||
{
|
||||
if (_dropVisuals.TryGetValue(d.Id, out var pickedNode))
|
||||
{
|
||||
pickedNode.Visible = false;
|
||||
if (GodotObject.IsInstanceValid(pickedNode))
|
||||
{
|
||||
pickedNode.GetParent()?.RemoveChild(pickedNode);
|
||||
pickedNode.QueueFree();
|
||||
}
|
||||
_dropVisuals.Remove(d.Id);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue