Animate passenger venues and add port-specific cinematics
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user