Add manual helm, grounded interiors, and taller ship classes
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Soundings
|
||||
{
|
||||
internal sealed class VesselExterior
|
||||
{
|
||||
internal const float DeckBase = 5.38f, DeckSpacing = 2.62f;
|
||||
internal enum Paint { Navy, Ivory, Pearl, Gold, Teak, TeakSeam, Steel, Black, Glass, BlueGlass, LitGlass, Lounge, Lifeboat, Pool }
|
||||
|
||||
private readonly Dictionary<Paint, HarborMesh> batches = new Dictionary<Paint, HarborMesh>();
|
||||
@@ -50,7 +51,7 @@ namespace Soundings
|
||||
new Vector3(1.013f, 5.14f, 1.027f), new Vector3(1.003f, 5.32f, 1.015f));
|
||||
Vector2[] promenade = Outline(length * .971f, beam * .979f, 0);
|
||||
Coat(Paint.Teak).Loft(promenade, center, true, new Vector3(.997f, 5.32f, 1),
|
||||
new Vector3(1, 5.38f, 1));
|
||||
new Vector3(1, DeckBase, 1));
|
||||
Rails(promenade, 5.39f, 5.99f, 2.7f);
|
||||
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
@@ -80,18 +81,19 @@ namespace Soundings
|
||||
|
||||
private void BuildPassengerDeck(int deck)
|
||||
{
|
||||
float y = 5.38f + deck * 1.88f;
|
||||
float y = DeckBase + deck * DeckSpacing;
|
||||
float roof = y + DeckSpacing;
|
||||
var (deckLength, deckBeam, offset) = DeckFootprint(deck);
|
||||
Vector2 center = new Vector2(offset, 0);
|
||||
Vector2[] outline = Outline(deckLength, deckBeam, offset);
|
||||
Coat(Paint.Ivory).Loft(outline, center, false, new Vector3(.97f, y, .77f),
|
||||
new Vector3(.99f, y + .25f, .83f), new Vector3(.99f, y + 1.49f, .83f));
|
||||
Coat(Paint.Pearl).Loft(outline, center, true, new Vector3(.993f, y + 1.49f, .96f),
|
||||
new Vector3(1.017f, y + 1.57f, 1.01f), new Vector3(1.017f, y + 1.73f, 1.015f),
|
||||
new Vector3(1, y + 1.82f, 1));
|
||||
Coat(Paint.Teak).Loft(outline, center, true, new Vector3(.992f, y + 1.82f, .989f),
|
||||
new Vector3(.994f, y + 1.88f, .992f));
|
||||
Rails(outline, y + 1.88f, y + 2.38f, 2.4f);
|
||||
new Vector3(.99f, y + .25f, .83f), new Vector3(.99f, roof - .39f, .83f));
|
||||
Coat(Paint.Pearl).Loft(outline, center, true, new Vector3(.993f, roof - .39f, .96f),
|
||||
new Vector3(1.017f, roof - .31f, 1.01f), new Vector3(1.017f, roof - .15f, 1.015f),
|
||||
new Vector3(1, roof - .06f, 1));
|
||||
Coat(Paint.Teak).Loft(outline, center, true, new Vector3(.992f, roof - .06f, .989f),
|
||||
new Vector3(.994f, roof, .992f));
|
||||
Rails(outline, roof, roof + .73f, 2.4f);
|
||||
|
||||
float width = .70f * deckLength / balconies;
|
||||
for (int i = 0; i < balconies; i++)
|
||||
@@ -105,8 +107,8 @@ namespace Soundings
|
||||
int row = side < 0 ? 0 : ship.Hull.Rows - 1;
|
||||
Facility facility = ship.Decks[deck].Cells[row * ship.Hull.Columns + column];
|
||||
float z = side * deckBeam * cross;
|
||||
Vector3 glass = new Vector3(x, y + .91f, z * .846f);
|
||||
Coat(Paint.Black).Box(glass, new Vector3(width * 1.01f, 1.21f, .17f));
|
||||
Vector3 glass = new Vector3(x, y + 1.27f, z * .846f);
|
||||
Coat(Paint.Black).Box(glass, new Vector3(width * 1.01f, 1.80f, .17f));
|
||||
float divider = width * .21f;
|
||||
Paint illumination = facility switch
|
||||
{
|
||||
@@ -118,14 +120,14 @@ namespace Soundings
|
||||
};
|
||||
for (int pane = -1; pane <= 1; pane += 2)
|
||||
Coat(pane < 0 ? illumination : Paint.BlueGlass).Box(glass + new Vector3(pane * divider, .025f, side * .09f),
|
||||
new Vector3(width * .38f, .98f, .09f));
|
||||
new Vector3(width * .38f, 1.54f, .09f));
|
||||
|
||||
if (facility == Facility.Tank)
|
||||
continue;
|
||||
Coat(Paint.Teak).Box(new Vector3(x, y + .28f, z * .935f), new Vector3(width * 1.10f, .12f, Mathf.Abs(z) * .19f));
|
||||
Coat(Paint.BlueGlass).Box(new Vector3(x, y + .48f, z * 1.016f), new Vector3(width * .96f, .32f, .05f));
|
||||
Coat(Paint.Pearl).Box(new Vector3(x, y + .67f, z * 1.02f), new Vector3(width * 1.045f, .047f, .055f));
|
||||
Coat(Paint.Pearl).Box(new Vector3(x + width * .52f, y + .52f, z * 1.02f), new Vector3(.055f, .32f, .075f));
|
||||
Coat(Paint.BlueGlass).Box(new Vector3(x, y + .63f, z * 1.016f), new Vector3(width * .96f, .48f, .05f));
|
||||
Coat(Paint.Pearl).Box(new Vector3(x, y + .92f, z * 1.02f), new Vector3(width * 1.045f, .047f, .055f));
|
||||
Coat(Paint.Pearl).Box(new Vector3(x + width * .52f, y + .65f, z * 1.02f), new Vector3(.055f, .52f, .075f));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,31 +136,31 @@ namespace Soundings
|
||||
{
|
||||
int deck = ship.Decks.Count - 1;
|
||||
var (deckLength, deckBeam, offset) = DeckFootprint(deck);
|
||||
float top = 5.38f + ship.Decks.Count * 1.88f;
|
||||
float bridge = offset + deckLength * .30f;
|
||||
float top = DeckBase + ship.Decks.Count * DeckSpacing;
|
||||
float bridge = BridgeCenter(length, ship.Decks.Count);
|
||||
Vector2 center = new Vector2(bridge, 0);
|
||||
Vector2[] capsule = Outline(deckLength * .27f, deckBeam * .83f, bridge);
|
||||
Vector2[] capsule = Outline(9.15f, beam * .67f, bridge);
|
||||
Coat(Paint.Ivory).Loft(capsule, center, false, new Vector3(.91f, top, .91f),
|
||||
new Vector3(1, top + .32f, 1));
|
||||
Coat(Paint.Glass).Loft(capsule, center, false, new Vector3(1, top + .32f, 1),
|
||||
new Vector3(.90f, top + 1.09f, .95f));
|
||||
Coat(Paint.Pearl).Loft(capsule, center, true, new Vector3(.905f, top + 1.07f, .955f),
|
||||
new Vector3(.975f, top + 1.22f, 1.025f), new Vector3(.82f, top + 1.40f, .90f));
|
||||
new Vector3(1, top + .88f, 1));
|
||||
Coat(Paint.Glass).Loft(capsule, center, false, new Vector3(1, top + .88f, 1),
|
||||
new Vector3(.90f, top + 2.62f, .95f));
|
||||
Coat(Paint.Pearl).Loft(capsule, center, true, new Vector3(.905f, top + 2.59f, .955f),
|
||||
new Vector3(.975f, top + 2.72f, 1.025f), new Vector3(.82f, top + 2.91f, .90f));
|
||||
foreach (Vector2 point in capsule)
|
||||
if (point.x > bridge - .5f)
|
||||
Coat(Paint.Steel).Rod(HarborMesh.Point(center + (point - center), top + .34f),
|
||||
HarborMesh.Point(center + (point - center) * .937f, top + 1.08f), .026f);
|
||||
Coat(Paint.Steel).Rod(HarborMesh.Point(point, top + .89f),
|
||||
HarborMesh.Point(center + Vector2.Scale(point - center, new Vector2(.90f, .95f)), top + 2.61f), .031f);
|
||||
|
||||
float mast = bridge + 1.15f;
|
||||
Coat(Paint.Ivory).Rod(new Vector3(mast, top + 1.38f, 0), new Vector3(mast - .48f, top + 4.22f, 0), .135f, 8);
|
||||
Coat(Paint.Ivory).Rod(new Vector3(mast, top + 2.88f, 0), new Vector3(mast - .48f, top + 5.72f, 0), .135f, 8);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
float y = top + 1.85f + i * .66f;
|
||||
float y = top + 3.35f + i * .66f;
|
||||
float span = 1.98f - i * .36f;
|
||||
Coat(Paint.Pearl).Rod(new Vector3(mast - .27f, y, -span), new Vector3(mast - .27f, y, span), .055f);
|
||||
Coat(Paint.Black).Rod(new Vector3(mast - .24f, y, span * .84f), new Vector3(mast - .24f, y + .40f, span * .84f), .022f);
|
||||
}
|
||||
Coat(Paint.LitGlass).Radome(new Vector3(mast - .48f, top + 4.27f, 0), .13f);
|
||||
Coat(Paint.LitGlass).Radome(new Vector3(mast - .48f, top + 5.77f, 0), .13f);
|
||||
|
||||
float stack = offset - deckLength * .24f;
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
@@ -236,11 +238,19 @@ namespace Soundings
|
||||
}
|
||||
}
|
||||
|
||||
private (float Length, float Beam, float Offset) DeckFootprint(int deck)
|
||||
internal static float BridgeCenter(float hullLength, int deckCount)
|
||||
{
|
||||
return (length * (.79f - .038f * deck), beam * (.84f - .030f * deck), -length * .034f - deck * .51f);
|
||||
int deck = deckCount - 1;
|
||||
return DeckOffset(hullLength, deck) + DeckLength(hullLength, deck) * .29f;
|
||||
}
|
||||
|
||||
internal static float DeckLength(float hullLength, int deck) => hullLength * (.81f - .027f * deck);
|
||||
internal static float DeckOffset(float hullLength, int deck) => -hullLength * (.034f + .0065f * deck);
|
||||
internal static float DeckHalfBeam(float halfBeam, int deck) => halfBeam * (.85f - .024f * deck);
|
||||
|
||||
private (float Length, float Beam, float Offset) DeckFootprint(int deck) =>
|
||||
(DeckLength(length, deck), DeckHalfBeam(beam, deck), DeckOffset(length, deck));
|
||||
|
||||
private static float SideWidth(float t)
|
||||
{
|
||||
if (t < .16f)
|
||||
|
||||
Reference in New Issue
Block a user