mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
Tiangong: the Tianhe view looks forward along the station from the top of the hull
This commit is contained in:
1 parent
66ae67dce4
commit
f0d2906220
2 files changed
+15
-8
No files matched your search
@@ -30,10 +30,12 @@ const mount = (eye, forward, up) =>
|
||||
|
||||
export const TIANGONG_MOUNTS = Object.freeze({
|
||||
/**
|
||||
* Tianhe lies along the station's long axis: from its port side amidships,
|
||||
* looking out across the track to port and down, the Earth below.
|
||||
* Tianhe lies along the station's long axis, its wings at the aft end:
|
||||
* from the top of the hull just forward of the wing roots, looking ahead
|
||||
* along the station to the node and the two labs across it, the Earth
|
||||
* below.
|
||||
*/
|
||||
tianhe: mount([3.0, 0.6, -1.5], [0.87, -0.5, 0], [0, 1, 0]),
|
||||
tianhe: mount([0, 3.0, -3], [0, -0.4, 0.92], [0, 1, 0]),
|
||||
/**
|
||||
* Wentian reaches out from the node on the model's starboard side: from
|
||||
* the top of its outer end, looking out past its wings and down, the
|
||||
|
||||
@@ -95,16 +95,21 @@ test('the spec’s mount gives the view asked for in the world, else the first',
|
||||
};
|
||||
const first = tiangongCockpitMount({ ...input, key: null });
|
||||
assert.equal(first.key, 'tianhe');
|
||||
// The modules are 4.2 m across: no eye inside Tianhe (2.1 m of its axis).
|
||||
assert.ok(
|
||||
Math.hypot(TIANGONG_MOUNTS.tianhe.eye[0], TIANGONG_MOUNTS.tianhe.eye[1]) >
|
||||
2.1,
|
||||
);
|
||||
assert.equal(first.noradId, TIANGONG_NORAD);
|
||||
assert.deepEqual(
|
||||
first.views.map((view) => view.key),
|
||||
['tianhe', 'wentian', 'mengtian', 'docked'],
|
||||
);
|
||||
// Tianhe's eye is 3 m to port: +y in the world, 0.6 m up (+x), 1.5 m aft (−z).
|
||||
assert.ok(Math.abs(first.position.y - 3.0) < 1e-9);
|
||||
assert.ok(Math.abs(first.position.x - (6_780_000 + 0.6)) < 1e-9);
|
||||
assert.ok(Math.abs(first.position.z + 1.5) < 1e-9);
|
||||
assert.ok(first.direction.y > 0.8, 'looks out to port');
|
||||
// Tianhe's eye is 3 m above the hull (+x in the world), 3 m aft (−z).
|
||||
assert.ok(Math.abs(first.position.y) < 1e-9);
|
||||
assert.ok(Math.abs(first.position.x - (6_780_000 + 3.0)) < 1e-9);
|
||||
assert.ok(Math.abs(first.position.z + 3) < 1e-9);
|
||||
assert.ok(first.direction.z > 0.9, 'looks ahead along the station');
|
||||
assert.ok(first.direction.x < 0, 'and down');
|
||||
const docked = tiangongCockpitMount({ ...input, key: 'docked' });
|
||||
assert.equal(docked.key, 'docked');
|
||||
|
||||
Reference in new issue
Block a user