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

@@ -6,6 +6,8 @@ namespace Soundings
internal sealed class VesselExterior
{
internal const float DeckBase = 5.38f, DeckSpacing = 2.62f;
internal const float PoolHalfLength = 2.61f, PoolHalfWidth = 1.43f, PoolWaterHeight = .24f;
internal const float LoungerSeatHeight = .32f, LoungerBeamFraction = .67f;
private const int HullStations = 36, DeckStations = 28, BridgeStations = 20;
internal enum Paint
{
@@ -299,7 +301,7 @@ namespace Soundings
Coat(Paint.Pearl).Radome(radome + Vector3.up * .90f, .54f);
}
BuildSunDeck(offset + deckLength * .01f, top, deckBeam);
BuildSunDeck(SunDeckCenter(length, deck), top, deckBeam);
}
private void BuildBridgeWing(float bridge, float top, int side)
@@ -322,40 +324,69 @@ namespace Soundings
private void BuildSunDeck(float pool, float top, float deckBeam)
{
Vector2 center = new Vector2(pool, 0);
Vector2[] coping = RoundedRectangle(center, 2.88f, 1.70f, .41f);
Coat(Paint.Pearl).Loft(coping, center, true, new Vector3(1, top, 1),
new Vector3(1, top + .18f, 1), new Vector3(.989f, top + .23f, .987f));
Coat(Paint.BlueGlass).Loft(RoundedRectangle(center, 2.68f, 1.50f, .32f), center, true,
new Vector3(1, top + .234f, 1));
Coat(Paint.Pool).Loft(RoundedRectangle(center, 2.61f, 1.43f, .27f), center, true,
new Vector3(1, top + .24f, 1));
bool hasPool = ship.Count(Facility.Amenity) > 0;
if (hasPool)
PoolBasin(Coat(Paint.Pearl), Coat(Paint.BlueGlass), Coat(Paint.Pool), new Vector3(pool, top, 0),
new Vector2(PoolHalfLength, PoolHalfWidth), .37f, PoolWaterHeight);
for (int side = -1; side <= 1; side += 2)
{
float railZ = side * 1.58f;
for (int rail = -1; rail <= 1; rail += 2)
{
var foot = new Vector3(pool - 2.08f + rail * .24f, top + .035f, railZ + side * .37f);
var elbow = foot + new Vector3(0, .68f, side * -.05f);
var end = foot + new Vector3(0, .32f, side * -.64f);
Coat(Paint.Steel).Rod(foot, elbow, .026f, 8, true);
Coat(Paint.Steel).Rod(elbow, end, .026f, 8, true);
}
if (hasPool)
PoolRails(Coat(Paint.Steel), new Vector3(pool - 2.08f, top, side * PoolHalfWidth), side);
for (int i = 0; i < 8; i++)
{
float x = pool - 3.00f + i * .94f;
BuildLounger(x, top, deckBeam * .67f, side);
}
BuildLounger(LoungerX(pool, i), top, deckBeam * LoungerBeamFraction, side);
BuildParasol(new Vector3(pool + 3.81f, top, side * deckBeam * .55f), side > 0);
}
}
internal static void PoolBasin(HarborMesh coping, HarborMesh tile, HarborMesh water, Vector3 foot,
Vector2 halfSize, float rimHeight, float waterHeight)
{
Vector2 center = new Vector2(foot.x, foot.z);
float radius = Mathf.Min(.31f, halfSize.y * .45f);
const float surround = .23f;
Vector2[] inner = RoundedRectangle(center, halfSize.x, halfSize.y, radius);
Vector2[] outer = RoundedRectangle(center, halfSize.x + surround, halfSize.y + surround, radius + surround);
float rim = foot.y + rimHeight;
float surface = foot.y + waterHeight;
coping.Loft(outer, center, false, new Vector3(1f, foot.y, 1f), new Vector3(1f, rim, 1f));
water.Loft(inner, center, true, new Vector3(1f, surface, 1f));
for (int i = 0; i < outer.Length; i++)
{
int next = (i + 1) % outer.Length;
coping.Quad(HarborMesh.Point(outer[next], rim), HarborMesh.Point(outer[i], rim),
HarborMesh.Point(inner[i], rim), HarborMesh.Point(inner[next], rim));
tile.Quad(HarborMesh.Point(inner[i], surface), HarborMesh.Point(inner[next], surface),
HarborMesh.Point(inner[next], rim), HarborMesh.Point(inner[i], rim));
}
}
internal static void PoolRails(HarborMesh steel, Vector3 edge, int side)
{
for (int rail = -1; rail <= 1; rail += 2)
{
Vector3 foot = edge + new Vector3(rail * .23f, .03f, side * .36f);
Vector3 elbow = foot + new Vector3(0, .72f, -side * .13f);
Vector3 end = foot + new Vector3(0, .31f, -side * .55f);
steel.Rod(foot, elbow, .028f, 8, true);
steel.Rod(elbow, end, .028f, 8, true);
}
for (int rung = 0; rung < 2; rung++)
{
Vector3 left = edge + new Vector3(-.23f, .14f + rung * .18f, -side * .15f);
steel.Rod(left, left + Vector3.right * .46f, .024f, 8, true);
}
}
internal static float SunDeckCenter(float length, int deck) => DeckOffset(length, deck) + DeckLength(length, deck) * .01f;
internal static float LoungerX(float center, int index) => center - 3f + index * .94f;
private void BuildLounger(float x, float top, float sideDistance, int side)
{
Vector3 seat = new Vector3(x, top + .32f, side * sideDistance);
Vector3 head = seat + new Vector3(0, .38f, side * .57f);
Coat(Paint.DeckCanvas).Box(seat + Vector3.back * (side * .14f), new Vector3(.54f, .077f, .88f));
Vector3 seat = new Vector3(x, top + LoungerSeatHeight, side * sideDistance);
Vector3 head = seat + new Vector3(0, .38f, side * .64f);
Coat(Paint.DeckCanvas).Box(seat + Vector3.back * (side * .31f), new Vector3(.54f, .077f, 1.22f));
Vector3 halfWidth = Vector3.right * .262f;
Vector3 hinge = seat + Vector3.forward * (side * .30f);
Coat(Paint.DeckCanvas).Quad(hinge - halfWidth, side > 0 ? head - halfWidth : hinge + halfWidth,
@@ -364,9 +395,9 @@ namespace Soundings
for (int rail = -1; rail <= 1; rail += 2)
{
Vector3 edge = Vector3.right * (rail * .29f);
frame.Rod(seat + edge + Vector3.forward * (side * -.56f), hinge + edge, .026f);
frame.Rod(seat + edge + Vector3.back * (side * .92f), hinge + edge, .026f);
frame.Rod(hinge + edge, head + edge, .026f);
frame.Rod(seat + edge + Vector3.back * (side * .37f), seat + edge + new Vector3(0, -.32f, side * -.46f), .026f);
frame.Rod(seat + edge + Vector3.back * (side * .67f), seat + edge + new Vector3(0, -.32f, side * -.76f), .026f);
frame.Rod(hinge + edge, hinge + edge + new Vector3(0, -.32f, side * .10f), .026f);
}
frame.Rod(head - halfWidth, head + halfWidth, .023f);