Animate passenger venues and add port-specific cinematics

This commit is contained in:
josh
2026-11-28 14:57:34 -05:00
parent 384f140b92
commit 636a0e2cf8
37 changed files with 2891 additions and 355 deletions

View File

@@ -48,6 +48,7 @@ namespace Soundings
internal bool PassageUsesPerspective => sailing && cameraMode == CameraMode.Orbit && !viewCamera.orthographic;
internal Vector3 FirstPersonPosition => freePosition;
internal bool FirstPersonPositionIsClear => walkSpace != null && walkSpace.CanStand(freePosition);
internal bool HasActiveGuest(GuestActivity activity) => decks?.HasActiveGuest(activity) == true;
internal Vector3 OrbitTarget => OrbitFocus(orbitOffset);
internal float OrbitVerticalSpan => viewCamera.orthographic ? viewCamera.orthographicSize * 2f
: 2f * Vector3.Distance(OrbitTarget, viewCamera.transform.position) * HalfFieldOfView(viewCamera.fieldOfView);
@@ -269,8 +270,8 @@ namespace Soundings
public void UpdatePassengers(OnboardSession session, float delta)
{
if (sailing && decks != null && cameraMode != CameraMode.Service)
decks.Tick(session, delta);
if ((sailing || PortCinematicActive) && decks != null && cameraMode != CameraMode.Service)
decks.Tick(session, delta, viewCamera);
}
internal void SetRudder(float degrees) => decks?.SetRudder(degrees);
@@ -364,7 +365,7 @@ namespace Soundings
private void LateUpdate()
{
if (!viewCamera.enabled)
if (!viewCamera.enabled || PortCinematicActive)
return;
if (cameraMode != CameraMode.Orbit)
{
@@ -469,6 +470,11 @@ namespace Soundings
private void ComposeCamera()
{
if (PortCinematicActive)
{
ComposePortCinematic();
return;
}
if (cameraMode == CameraMode.Orbit)
{
viewCamera.orthographic = !sailing;
@@ -558,7 +564,9 @@ namespace Soundings
water.SetVector("_ViewRight", view.right);
water.SetVector("_ViewUp", view.up);
water.SetVector("_ViewSize", new Vector4(viewHeight * aspect, viewHeight, viewCamera.orthographic ? 1 : 0, 0));
if (backplateRatio <= 0 || sailing)
if (PortCinematicActive && portMatteAspect > 0)
FitPortMatte(aspect);
if (PortCinematicActive || backplateRatio <= 0 || sailing)
return;
float backdropScale = Mathf.Lerp(.86f, 1, Mathf.Clamp01(zoom));
float cropX = Mathf.Min(1, aspect / backplateRatio) * .95f * backdropScale;
@@ -574,7 +582,8 @@ namespace Soundings
public void Show(Ship ship)
{
SetHarbor(Market.Ports[ship?.Port ?? 0].Region);
if (!PortCinematicActive)
SetHarbor(Market.Ports[ship?.Port ?? 0].Region);
if (ship == null)
{
if (lastHull == -1)
@@ -728,6 +737,7 @@ namespace Soundings
{
ReleaseFrame();
ReleaseShip();
ReleasePortQuay();
wake?.Dispose();
foreach (Material material in materials.Values)
Destroy(material);