Position asteroid belts from daemon poses
This commit is contained in:
parent
5bfe9d9b29
commit
4e68ce29af
4 changed files with 166 additions and 8 deletions
|
|
@ -786,6 +786,54 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreEqual(3.5, poses[1].GravityWaveSpeed, 0.0001);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DaemonRenderQueriesPublishAsteroidBeltPosesFromZoneSnapshot()
|
||||
{
|
||||
var zone = new AetheriaRuntimeZoneSnapshotCommit
|
||||
{
|
||||
Orbits = new[]
|
||||
{
|
||||
new AetheriaRuntimeOrbitSnapshotCommit
|
||||
{
|
||||
OrbitKey = "orbit:belt",
|
||||
FixedPositionX = 11,
|
||||
FixedPositionY = -4
|
||||
}
|
||||
},
|
||||
Bodies = new[]
|
||||
{
|
||||
new AetheriaRuntimeBodySnapshotCommit
|
||||
{
|
||||
BodyKey = "body:belt",
|
||||
OrbitKey = "orbit:belt",
|
||||
Kind = "asteroid_belt",
|
||||
Asteroids = new[]
|
||||
{
|
||||
new AetheriaRuntimeAsteroidCommit { Distance = 3 },
|
||||
new AetheriaRuntimeAsteroidCommit { Distance = 7 },
|
||||
new AetheriaRuntimeAsteroidCommit { Distance = 5 }
|
||||
}
|
||||
},
|
||||
new AetheriaRuntimeBodySnapshotCommit
|
||||
{
|
||||
BodyKey = "body:planet",
|
||||
OrbitKey = "orbit:belt",
|
||||
Kind = "planet"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var poses = AetheriaRuntimeDaemonRenderQueries.QueryAsteroidBeltPoses(zone);
|
||||
|
||||
Assert.AreEqual(1, poses.Length);
|
||||
Assert.AreEqual("body:belt", poses[0].BodyKey);
|
||||
Assert.AreEqual("orbit:belt", poses[0].OrbitKey);
|
||||
Assert.AreEqual(11, poses[0].CenterX, 0.0001);
|
||||
Assert.AreEqual(-4, poses[0].CenterZ, 0.0001);
|
||||
Assert.AreEqual(7, poses[0].Radius, 0.0001);
|
||||
Assert.AreEqual(3, poses[0].AsteroidCount);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SoaViewIndexRejectsInvalidRenderGroups()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue