ContactTests: the docked-hull test closes a third ship on the carrier, so excluding the docked hull is observable
A docked hull shares its carrier's velocity, so the pair alone never closes; a visitor does expose a second contact. Builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7565458b4d
commit
8d7b90111a
1 changed files with 6 additions and 1 deletions
|
|
@ -201,6 +201,8 @@ public sealed class ContactTests : IDisposable
|
|||
Assert.Equal(10f * 1000f / 1001000f, dot(n, station.Velocity), 4);
|
||||
}
|
||||
|
||||
// A docked hull rides its carrier's pose and velocity, so it is never a second body at the carrier's place: a
|
||||
// ship closing on the carrier makes one contact, with the carrier.
|
||||
[Fact]
|
||||
public void ADockedHullTakesNoPartInContact()
|
||||
{
|
||||
|
|
@ -208,8 +210,11 @@ public sealed class ContactTests : IDisposable
|
|||
var carrier = lab.Add("Solid", float3(0, 0, 0), float2(0, 0));
|
||||
var docked = lab.Add("Solid", float3(0, 0, 0), float2(0, 0));
|
||||
docked.SetParent(carrier);
|
||||
var visitor = lab.Add("Solid", float3(10, 0, 0), float2(-10, 0));
|
||||
lab.Step();
|
||||
Assert.Empty(lab.Events);
|
||||
|
||||
var contact = Assert.Single(lab.Events);
|
||||
Assert.Equal(new[] { carrier, visitor }, new[] { contact.A, contact.B });
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
|
|||
Loading…
Reference in a new issue