Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Map: turn an army token's trio and flag pole with the camera's yaw (refs #644) (#682)

Beri448dcd2b61f0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d5bcf96c..b6e5f913b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,9 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
- The unit figures' shirts are darker (0.9 of their paint), so the figures read darker than their earth base as demo2
T29's do, 0.5-0.9 of its luma at the Harel and plain 30 km looks and at gameplay03 (refs #645, #197), pinned by
`TheFiguresReadDarkerThanTheirBaseAsT29`. #559's shirt sample landed on the chest brace; the new test reads the shirt.
+- Map: an army token's figures and its flag's pole turn about the base's middle with the camera's yaw (refs #644, from
+ #559), so from every side the trio stands side by side facing the camera with the pole behind it; at yaw 90 or 270 the
+ figures stood in a column, and from about yaw 180 the pole stood in front of them. Presentation only.
- `bernadotte_assassination` says "about 250" Lehi members were arrested, not "about 200" (refs #516; owner, 15 October
2026): Ben-Gurion told the Provisional State Council 246 (184 + 62), and S/1315 gives 266 by 23 September (184 + 82).
Card text only: no golden moves, the content hash does, so an older save loads with the "different game content"
diff --git a/docs/units.md b/docs/units.md
index 499d9f2f9..42034e9c7 100644
--- a/docs/units.md
+++ b/docs/units.md
@@ -350,7 +350,9 @@ figures tall standing at the base's back edge. `UnitPlinth` and `UnitFlags` draw
radius, behind the trio and east of the badge (`TheFlagIsAboutHalfAFigureTallOnTheBasesEdge`). The cloth is drawn
unlit (white, and a blue standing for the proclamation's "dark sky-blue"), so it reads white under the map's light and
grade as T29's. Owner ruling (2026-10-15): the flag turns about its pole to face the camera (`UnitFlagFacing`), so it
- never shows edge-on as the camera orbits; the pole stays upright at the base's edge.
+ never shows edge-on as the camera orbits; the pole stays upright at the base's edge. The figures and the pole turn about
+ the base's middle with the camera's yaw (`UnitLayer.FaceCamera`, #644), so from every side the trio stands side by side
+ and the pole behind it (`TheTrioReadsSideBySideAndThePoleStandsBehindItAtEveryYaw`).
- **Use of the flag:** the Flag and Emblem Law, 5709-1949, s. 2(a), forbids using the State flag for commerce, business or
profession without a permit from the Minister of the Interior (the 1949 text, read on the cited scan; the amended text
not checked). The game is free and non-commercial; a paid release needs this checked first. Only a side whose 1948
diff --git a/unity/Assets/Scripts/Map/Units/UnitLayer.cs b/unity/Assets/Scripts/Map/Units/UnitLayer.cs
index 650d3ec39..81e552e34 100644
--- a/unity/Assets/Scripts/Map/Units/UnitLayer.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitLayer.cs
@@ -46,6 +46,15 @@ namespace Statecraft.Game.Map.Units
/// none) and the box of the token's pieces that neither turn nor move (null for a flying aircraft alone). In the order
/// of <see cref="badges"/> and <see cref="keepClear"/>.</summary>
readonly List<(Vector3 home, float back, Vector3 pole, MeshFilter? flag, Bounds? standing)> badgeHomes = new List<(Vector3, float, Vector3, MeshFilter?, Bounds?)>();
+ /// <summary>Each token's figures as laid out for camera yaw 0 (their place round the base's middle and their heading),
+ /// the base's middle and radius, the badge's lift over the highest figure and the figures' meshes (none for an aircraft
+ /// or a ship), in the order of <see cref="badges"/>. <see cref="FaceCamera"/> turns the figures and the flag's pole
+ /// about the middle with the camera's yaw (issue #644): laid out for yaw 0 alone, at yaw 90 or 270 the trio stood in a
+ /// column and from about yaw 180 the pole stood in front of it.</summary>
+ readonly List<(Vector3 centre, float radius, float lift, (Transform figure, Vector3 offset, float heading)[] figures, MeshFilter[] meshes)> trios =
+ new List<(Vector3, float, float, (Transform, Vector3, float)[], MeshFilter[])>();
+ /// <summary>The camera yaw the trios were last turned to: a pan or a zoom keeps the yaw, so it moves no figure.</summary>
+ float? turnedFor;
/// <summary>A badge sits this share of its token's base radius behind the trio, seen from the camera, and
/// <see cref="BadgeAsideM"/> to the side away from its flag's pole on screen (a compact token's pole cannot stand
/// further out than its base's edge).</summary>
@@ -163,19 +172,53 @@ namespace Statecraft.Game.Map.Units
away = away.sqrMagnitude > 1e-6f ? away.normalized : Vector3.forward;
var right = cam.transform.right; right.y = 0f;
right = right.sqrMagnitude > 1e-6f ? right.normalized : Vector3.right;
+ // The trio and its pole turn with the camera's yaw, so the camera always sees them as at yaw 0: three figures side
+ // by side, the pole behind them (issue #644). Only a new yaw moves them; each is set on the draped top where it lands.
+ // Only the game camera turns them: this runs for every camera (the scene view, a preview), and two cameras taking
+ // turns would re-drape the figures every frame and leave them turned for whichever rendered last (review of #644).
+ float yaw = Mathf.Atan2(away.x, away.z) * Mathf.Rad2Deg;
+ bool turn = cam == Camera.main && turnedFor != yaw;
+ if (turn) turnedFor = yaw;
+ var turning = Quaternion.Euler(0f, turnedFor ?? 0f, 0f); // as the figures stand now (yaw 0 until first turned)
for (int i = 0; i < badges.Count; i++)
{
var b = badges[i]; if (b == null) continue;
var (home, back, pole, flag, standing) = badgeHomes[i];
+ var (centre, radius, lift, figures, meshes) = trios[i];
+ if (turn && figures.Length > 0)
+ {
+ float highest = float.MinValue;
+ foreach (var (figure, offset, heading) in figures)
+ {
+ var p = centre + turning * offset;
+ p.y = UnitPlinth.FigureY(map, radius, p.x, p.z);
+ highest = Mathf.Max(highest, p.y);
+ figure.SetPositionAndRotation(p, Quaternion.Euler(0f, yaw + heading, 0f));
+ }
+ home.y = highest + lift; // the badge clears the highest figure, wherever the turn set it
+ badgeHomes[i] = (home, back, pole, flag, standing);
+ if (flag != null)
+ {
+ var foot = centre + turning * pole;
+ foot.y = UnitPlinth.FigureY(map, radius, foot.x, foot.z);
+ flag.transform.position = foot;
+ }
+ }
+ if (figures.Length > 0) pole = turning * pole; // where the pole stands now, for the badge's side
var aside = pole == Vector3.zero ? Vector3.zero : (Vector3.Dot(pole, right) > 0f ? -right : right) * BadgeAsideM;
var at = home + away * back + aside;
b.SetPositionAndRotation(at, rotation);
var boxes = keepClear[i];
boxes[0] = new Bounds(at, Vector3.one * UnitBadge.SizeM);
- if (flag != null && standing is Bounds s)
+ if ((flag != null || meshes.Length > 0) && standing is Bounds s)
{
- UnitFlagFacing.Face(flag.transform, eye); // as it will turn for this camera
- s.Encapsulate(WorldBox(flag)); boxes[1] = s;
+ if (flag != null)
+ {
+ UnitFlagFacing.Face(flag.transform, eye); // as it will turn for this camera
+ s.Encapsulate(WorldBox(flag));
+ }
+ foreach (var m in meshes) s.Encapsulate(WorldBox(m)); // the figures as turned
+ boxes[1] = s;
}
}
}
@@ -268,6 +311,7 @@ namespace Statecraft.Game.Map.Units
}
FreeTokenMeshes();
badges.Clear(); badgeHomes.Clear(); facedFor = null;
+ trios.Clear(); turnedFor = null; // the new figures stand as at yaw 0
treeHoles.Clear();
keepClear = new List<Bounds[]>(); // a new list, so the labels see the change
float hex = map.Hexes.hex_size_km * 1000f;
@@ -278,18 +322,20 @@ namespace Statecraft.Game.Map.Units
go.transform.SetParent(tokensRoot, false);
var centre = Centre(p.Spot);
var foot = centre; // where the badge's height is measured from
- float top;
+ float top, plinth = 0f;
+ var figures = Array.Empty<(Transform, Vector3, float)>();
switch (t.Unit.Service)
{
case UnitData.Army:
// Demo2 T29's token: the figures stand shoulder to shoulder on one earth base with a bright white
// rim, under the side's flag (refs #197). The base fits the full trio, whatever the call-up.
float k = UnitShowcase.DrawSpread * hex * Scale(p.Spot);
- float plinth = UnitPlinth.Radius(UnitPlinth.TrioWidth(UnitShowcase.FigureOffsets(3), k));
+ plinth = UnitPlinth.Radius(UnitPlinth.TrioWidth(UnitShowcase.FigureOffsets(3), k));
foot.y = UnitPlinth.Build(map, go.transform, centre, plinth, t.Unit.Side, TokenMesh, MeshFor, paint, rim, flagWhite, flagBlue);
treeHoles.Add((new Vector2(centre.x, centre.z), plinth * UnitPlinth.RimOuter));
var offsets = UnitShowcase.FigureOffsets(t.Figures);
float highest = foot.y; // the badge clears the highest figure (on a slope the uphill one stands higher)
+ figures = new (Transform, Vector3, float)[offsets.Length];
for (int i = 0; i < offsets.Length; i++)
{
// The pose and heading are the trio position's; the headgear is the unit's (sourced, or the default).
@@ -299,8 +345,9 @@ namespace Statecraft.Game.Map.Units
var at = centre + new Vector3(offsets[i].x, 0, offsets[i].y) * k;
at.y = UnitPlinth.FigureY(map, plinth, at.x, at.z);
highest = Mathf.Max(highest, at.y);
- UnitShowcase.Piece(go.transform, $"Rifleman{i}", type, () => MeshFor($"{type}/{pose}", () => UnitModels.Rifleman(hat, pose, faded, type)),
+ var figure = UnitShowcase.Piece(go.transform, $"Rifleman{i}", type, () => MeshFor($"{type}/{pose}", () => UnitModels.Rifleman(hat, pose, faded, type)),
paint, at, Quaternion.Euler(0, heading, 0), UnitShowcase.FigureScale, out _);
+ figures[i] = (figure.transform, new Vector3(offsets[i].x, 0, offsets[i].y) * k, heading);
}
foot.y = highest;
top = UnitBadge.FigureHeightM * UnitShowcase.FigureScale;
@@ -330,13 +377,15 @@ namespace Statecraft.Game.Map.Units
var flagT = go.transform.Find(UnitPlinth.FlagName);
var flag = flagT != null ? flagT.GetComponent<MeshFilter>() : null;
var pole = flagT != null ? new Vector3(flagT.position.x - centre.x, 0f, flagT.position.z - centre.z) : Vector3.zero;
- var standing = StillBox(go.transform, flag);
+ var meshes = figures.SelectMany(f => f.Item1.GetComponentsInChildren<MeshFilter>(true)).ToArray();
+ var standing = StillBox(go.transform, flag, meshes);
badges.Add(badge.transform); badgeHomes.Add((home, back, pole, flag, standing));
+ trios.Add((centre, plinth, lift, figures, meshes));
AddRenderer(badge.transform, "Plate", MeshFor("badge-plate", UnitBadge.PlateMesh), badgePlate, 0f);
AddRenderer(badge.transform, "Glyph", MeshFor("badge-" + t.Unit.Service, () => UnitBadge.GlyphMesh(t.Unit.Service)), badgeGlyph, -UnitBadge.GlyphLift);
- // The badge's cube and the pieces (the flag as it stands now); FaceCamera moves both with the camera.
+ // The badge's cube and the pieces (the flag and the figures as they stand now); FaceCamera moves both with the camera.
var pieces = standing;
- if (flag != null && pieces is Bounds s) { s.Encapsulate(WorldBox(flag)); pieces = s; }
+ if (pieces is Bounds s) { if (flag != null) s.Encapsulate(WorldBox(flag)); foreach (var m in meshes) s.Encapsulate(WorldBox(m)); pieces = s; }
keepClear.Add(pieces is Bounds p2 ? new[] { new Bounds(badge.transform.position, Vector3.one * UnitBadge.SizeM), p2 }
: new[] { new Bounds(badge.transform.position, Vector3.one * UnitBadge.SizeM) });
}
@@ -355,14 +404,14 @@ namespace Statecraft.Game.Map.Units
return box;
}
- /// <summary>The box of a token's pieces that neither turn nor move (a flying aircraft, the badge and the flag, which
- /// turns to the camera, are left out), or null when it has none.</summary>
- static Bounds? StillBox(Transform token, MeshFilter? flag)
+ /// <summary>The box of a token's pieces that neither turn nor move (a flying aircraft, the badge, and the flag and the
+ /// figures, which turn with the camera, are left out), or null when it has none.</summary>
+ static Bounds? StillBox(Transform token, MeshFilter? flag, MeshFilter[] figures)
{
Bounds? box = null;
foreach (var f in token.GetComponentsInChildren<MeshFilter>(true))
{
- if (f.sharedMesh == null || f == flag || f.GetComponentInParent<UnitBadge>(true) != null || f.GetComponentInParent<ShowcaseFlight>(true) != null) continue;
+ if (f.sharedMesh == null || f == flag || Array.IndexOf(figures, f) >= 0 || f.GetComponentInParent<UnitBadge>(true) != null || f.GetComponentInParent<ShowcaseFlight>(true) != null) continue;
var w = WorldBox(f);
if (box is Bounds b) { b.Encapsulate(w); box = b; } else box = w;
}
diff --git a/unity/Assets/Scripts/Map/Units/UnitPlinth.cs b/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
index 95a4cbc8e..eddca48e1 100644
--- a/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
@@ -234,8 +234,11 @@ namespace Statecraft.Game.Map.Units
(x, z) => map.Terrain.SampleHeight(new Vector3(x, 0, z)) + map.Terrain.transform.position.y;
/// <summary>The height a figure standing at (x, z) on a base of <paramref name="radius"/> stands at: on the draped top
- /// at its own point (round 4 of #559; an uphill boot sets into the base, which hides it).</summary>
- public static float FigureY(MapScene map, float radius, float x, float z) => HeightAt(map)(x, z) + LipShare * radius;
+ /// at its own point (round 4 of #559; an uphill boot sets into the base, which hides it).
+ /// UnitLayer.FaceCamera calls it as the camera turns (issue #644), so it samples the ground itself: HeightAt builds a
+ /// new closure on every call.</summary>
+ public static float FigureY(MapScene map, float radius, float x, float z) =>
+ map.Terrain.SampleHeight(new Vector3(x, 0, z)) + map.Terrain.transform.position.y + LipShare * radius;
/// <summary>Tests read the built meshes back: true keeps their CPU copy (players free it after the upload).</summary>
internal static bool KeepMeshesReadable;
diff --git a/unity/Assets/Tests/EditMode/UnitPlinthTests.cs b/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
index a6e34febc..b37a9a578 100644
--- a/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
+++ b/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
@@ -804,7 +804,8 @@ public class UnitPlinthTests
/// <summary>Owner ruling (2026-10-15): "billboard the flag". At gameplay03 and at a 30 km look at Harel at camera yaw 0,
/// 90 and 180, each flag turns about its pole as the camera renders: the cloth's normal points at the camera, seen from
- /// above, within 2 degrees; the pole stays upright (the flag's up is the world's); its foot does not move.</summary>
+ /// above, within 2 degrees; the pole stays upright (the flag's up is the world's); its foot stays on the base's edge (an
+ /// in-play token's pole goes round the base with the camera's yaw, so it stands behind the figures: issue #644).</summary>
[Test]
public void TheFlagTurnsAboutItsPoleToFaceTheCamera()
{
@@ -818,7 +819,8 @@ public class UnitPlinthTests
layer.Show(C, StateAt(Dates[0]));
var flags = map.Terrain.transform.Find(UnitLayer.RootName).Find("Tokens").Cast<Transform>().Select(t => t.Find(UnitPlinth.FlagName)).Where(f => f != null).ToList();
flags.Add(UnitShowcase.Spawn(map, still: true).transform.Find(UnitPlinth.FlagName));
- var feet = flags.Select(f => f.position).ToList();
+ float Edge(Transform f) { var c = f.parent.Find(UnitPlinth.PlinthName).position; return new Vector2(f.position.x - c.x, f.position.z - c.z).magnitude; }
+ var edges = flags.Select(Edge).ToList();
var (hlon, hlat) = map.Frame.ToLonLat(flags[0].position);
int n = 0;
foreach (var yaw in new[] { 0f, 90f, 180f })
@@ -835,7 +837,7 @@ public class UnitPlinthTests
Assert.That(Mathf.Min(angle, 180f - angle), Is.LessThanOrEqualTo(2f), $"yaw {yaw} {f.parent.name}: the cloth faces the camera");
Assert.Less(angle, 90f, $"yaw {yaw} {f.parent.name}: its front, not its back, so the cloth flies to the camera's right");
Assert.Greater(Vector3.Dot(f.up, Vector3.up), 0.9999f, $"yaw {yaw} {f.parent.name}: the pole stays upright");
- Assert.Less((f.position - feet[i]).magnitude, 0.01f, $"{f.parent.name}: the pole's foot stays put");
+ Assert.AreEqual(edges[i], Edge(f), 0.5f, $"{f.parent.name}: the pole's foot stays on the base's edge");
n++;
}
}
diff --git a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
index a61e088b7..bde395d33 100644
--- a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
+++ b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
@@ -569,6 +569,104 @@ public class UnitsInPlayTests
Assert.Less(o.Max(v => v.magnitude) * step + 600f, UnitShowcase.RingRadius * 5000f, "the figures stay inside the ring");
}
+ /// <summary>Issue #644: the trio and its flag were laid out for camera yaw 0, so at yaw 90 and 270 the figures stood in a
+ /// column and from about yaw 180 the pole stood in front of them. At every yaw from 0 to 315 in 45 degree steps, on a 30 km
+ /// look at each army token: its figures' feet, seen along the camera's right (flattened), stand side by side, each gap at
+ /// least 0.9 of the token's gap at yaw 0; each figure faces the camera as it does at yaw 0; and the pole's foot is farther
+ /// from the camera than every figure's feet, so the pole is drawn behind them.</summary>
+ [Test]
+ public void TheTrioReadsSideBySideAndThePoleStandsBehindItAtEveryYaw()
+ {
+ var map = BuildMap();
+ try
+ {
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ layer.Show(C, StateAt(new DateTime(1948, 5, 29), 5, 0.8));
+ var cam = Camera.main; Assert.IsNotNull(cam, "the default scene's camera");
+ var tokens = map.Terrain.transform.Find(UnitLayer.RootName).Find("Tokens").Cast<Transform>().Where(t => t.Find(UnitPlinth.PlinthName) != null).ToList();
+ var atZero = new Dictionary<string, (float[] gaps, float[] facing)>();
+ int judged = 0, poles = 0;
+ foreach (var yaw in new[] { 0f, 45f, 90f, 135f, 180f, 225f, 270f, 315f })
+ foreach (var t in tokens)
+ {
+ cam.transform.rotation = Quaternion.Euler(CameraRig.Pitch, yaw, 0f);
+ cam.transform.position = t.Find(UnitPlinth.PlinthName).position - cam.transform.forward * 30000f;
+ layer.FaceCamera(cam);
+ var right = cam.transform.right; right.y = 0f; right.Normalize();
+ var away = cam.transform.forward; away.y = 0f; away.Normalize();
+ var figures = t.Cast<Transform>().Where(x => x.name.StartsWith("Rifleman")).OrderBy(x => x.name).ToList();
+ if (figures.Count < 2) continue;
+ var across = figures.Select(f => Vector3.Dot(f.position, right)).OrderBy(v => v).ToList();
+ var gaps = Enumerable.Range(1, across.Count - 1).Select(i => across[i] - across[i - 1]).ToArray();
+ var facing = figures.Select(f => Vector3.SignedAngle(-away, Vector3.ProjectOnPlane(f.forward, Vector3.up), Vector3.up)).ToArray();
+ if (yaw == 0f) atZero[t.name] = (gaps, facing);
+ var zero = atZero[t.name];
+ for (int i = 0; i < gaps.Length; i++)
+ Assert.GreaterOrEqual(gaps[i], 0.9f * zero.gaps[i], $"yaw {yaw} {t.name}: neighbours {i} and {i + 1} stand side by side across the view, not in a column");
+ for (int i = 0; i < facing.Length; i++)
+ Assert.LessOrEqual(Mathf.Abs(Mathf.DeltaAngle(zero.facing[i], facing[i])), 1f, $"yaw {yaw} {t.name}/{figures[i].name}: faces the camera as at yaw 0");
+ judged++;
+ var flag = t.Find(UnitPlinth.FlagName); if (flag == null) continue;
+ float pole = Vector3.Dot(flag.position, away), farthest = figures.Max(f => Vector3.Dot(f.position, away));
+ Assert.Greater(pole, farthest, $"yaw {yaw} {t.name}: the pole's foot stands behind the figures, not in front ({pole - farthest:0} m)");
+ poles++;
+ }
+ Debug.Log($"UNITS yaw: {judged} trios and {poles} poles judged over 8 yaws");
+ int trios = tokens.Count(t => t.Cast<Transform>().Count(x => x.name.StartsWith("Rifleman")) >= 2);
+ Assert.GreaterOrEqual(trios, 5, "the army tokens of 29 May 1948 with two or more figures (not a vacuous pass)");
+ Assert.AreEqual(8 * trios, judged, "every army token with two or more figures, at every yaw");
+ Assert.AreEqual(judged, poles, "each with its flag");
+ }
+ finally { UnityEngine.Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>Review of #644: the turn holds through what can stale it. A roster rebuilt while the camera already looks at
+ /// yaw 90 stands its new figures turned for that yaw, as before the rebuild (the yaw cache is cleared with the tokens). A
+ /// second camera (the scene view, a preview) rendering at another yaw turns no figure: only the game camera does. A pan
+ /// and a zoom at the same yaw move no figure.</summary>
+ [Test]
+ public void TheTurnHoldsThroughARebuildASecondCameraAndAPan()
+ {
+ var map = BuildMap();
+ var other = new GameObject("PreviewCamera").AddComponent<Camera>();
+ try
+ {
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ var day = new DateTime(1948, 5, 29);
+ layer.Show(C, StateAt(day, 5, 0.8));
+ var cam = Camera.main; Assert.IsNotNull(cam, "the default scene's camera");
+ var tokensRoot = map.Terrain.transform.Find(UnitLayer.RootName).Find("Tokens");
+ Dictionary<string, Vector3> Figures() => tokensRoot.Cast<Transform>().SelectMany(t => t.Cast<Transform>().Where(x => x.name.StartsWith("Rifleman"))
+ .Select(x => (key: t.name + "/" + x.name, at: x.position))).ToDictionary(p => p.key, p => p.at);
+ void AssertStill(Dictionary<string, Vector3> want, string what)
+ {
+ var now = Figures();
+ Assert.AreEqual(want.Count, now.Count, $"{what}: the same figures");
+ foreach (var kv in want) Assert.Less((now[kv.Key] - kv.Value).magnitude, 1f, $"{what}: {kv.Key} stands where it stood at yaw 90");
+ }
+ cam.transform.rotation = Quaternion.Euler(CameraRig.Pitch, 90f, 0f);
+ cam.transform.position = tokensRoot.GetChild(0).position - cam.transform.forward * 30000f;
+ layer.FaceCamera(cam);
+ var at90 = Figures();
+ Assert.Greater(at90.Count, 10, "the figures of 29 May 1948 (not a vacuous pass)");
+ // A roster change and back, the camera still at yaw 90: Rebuild faces the new tokens to it.
+ var fewer = StateAt(day, 5, 0.3);
+ Assert.IsTrue(layer.Show(C, fewer), "the call-up changes the roster");
+ Assert.IsTrue(layer.Show(C, StateAt(day, 5, 0.8)), "and back");
+ AssertStill(at90, "rebuilt at yaw 90");
+ // A second camera at yaw 0 renders: the badges and flags face it, the figures stay turned for the game camera.
+ other.transform.SetPositionAndRotation(cam.transform.position, Quaternion.Euler(CameraRig.Pitch, 0f, 0f));
+ layer.FaceCamera(other);
+ AssertStill(at90, "after a second camera at yaw 0");
+ layer.FaceCamera(cam);
+ // A pan and a zoom at yaw 90.
+ cam.transform.position += cam.transform.right * 8000f; layer.FaceCamera(cam);
+ cam.transform.position += cam.transform.forward * 12000f; layer.FaceCamera(cam);
+ AssertStill(at90, "after a pan and a zoom");
+ }
+ finally { UnityEngine.Object.DestroyImmediate(other.gameObject); UnityEngine.Object.DestroyImmediate(map.gameObject); }
+ }
+
[Test]
public void ScreenshotsShowUnitsOnlyWhenAsked()
{