feat(physics): port retail projectile integration
Add a pure Core projectile driver for retail clock quanta, final-state acceleration, 50-unit velocity clamping, world-space angular integration, full-3D AlignPath, and oriented Setup-local sphere sweeps. Preserve exact success versus set_frame-only failure semantics, independent Contact/OnWalkable state, and full-cell identity across all landblock directions. Port OBJECTINFO::missile_ignore with explicit weenie/creature metadata, remove the invented transition-step cap, retain PathClipped without arming PerfectClip, and keep authoritative target identity optional. Add malformed-shape/clock, thin-wall, terrain, target-exclusion, frame-spike, failure-state, and boundary conformance coverage. Retire TS-2 and synchronize the architecture, milestones, roadmap, research oracle, and durable physics memory. Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
parent
542dcfc384
commit
f02b995e4f
21 changed files with 1669 additions and 263 deletions
|
|
@ -0,0 +1,94 @@
|
|||
using AcDream.Core.Physics;
|
||||
using Xunit;
|
||||
|
||||
namespace AcDream.Core.Tests.Physics;
|
||||
|
||||
/// <summary>
|
||||
/// Conformance table for retail <c>OBJECTINFO::missile_ignore</c>
|
||||
/// (<c>0x0050CEB0</c>). These tests deliberately separate "has a weenie"
|
||||
/// from "is a creature" because the retail branches do.
|
||||
/// </summary>
|
||||
public sealed class MissileCollisionRulesTests
|
||||
{
|
||||
private const uint Target = 0x1111u;
|
||||
private const uint Other = 0x2222u;
|
||||
|
||||
private static ObjectInfo Missile(uint targetId = 0) => new()
|
||||
{
|
||||
MoverPhysicsState = PhysicsStateFlags.Missile,
|
||||
TargetId = targetId,
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void OtherMissile_IsAlwaysIgnored_EvenWhenDesignated()
|
||||
{
|
||||
var mover = Missile(Target);
|
||||
Assert.True(mover.MissileIgnore(
|
||||
Target,
|
||||
(uint)PhysicsStateFlags.Missile,
|
||||
EntityCollisionFlags.HasWeenie));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NonMissileMover_DoesNotUseMissileExemptions()
|
||||
{
|
||||
var mover = new ObjectInfo();
|
||||
Assert.False(mover.MissileIgnore(
|
||||
Other,
|
||||
(uint)PhysicsStateFlags.Ethereal,
|
||||
EntityCollisionFlags.HasWeenie | EntityCollisionFlags.IsCreature));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DesignatedTarget_IsNeverIgnoredByLaterBranches()
|
||||
{
|
||||
var mover = Missile(Target);
|
||||
Assert.False(mover.MissileIgnore(
|
||||
Target,
|
||||
(uint)PhysicsStateFlags.Ethereal,
|
||||
EntityCollisionFlags.HasWeenie | EntityCollisionFlags.IsCreature));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true, true)]
|
||||
[InlineData(false, false)]
|
||||
public void EtherealTarget_RequiresWeenieMetadata(bool hasWeenie, bool ignored)
|
||||
{
|
||||
var flags = hasWeenie
|
||||
? EntityCollisionFlags.HasWeenie
|
||||
: EntityCollisionFlags.None;
|
||||
|
||||
Assert.Equal(ignored, Missile().MissileIgnore(
|
||||
Other,
|
||||
(uint)PhysicsStateFlags.Ethereal,
|
||||
flags));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void KnownTarget_IgnoresOtherCreatures()
|
||||
{
|
||||
var mover = Missile(Target);
|
||||
Assert.True(mover.MissileIgnore(
|
||||
Other,
|
||||
0u,
|
||||
EntityCollisionFlags.HasWeenie | EntityCollisionFlags.IsCreature));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnknownTarget_DoesNotIgnoreCreatures()
|
||||
{
|
||||
Assert.False(Missile().MissileIgnore(
|
||||
Other,
|
||||
0u,
|
||||
EntityCollisionFlags.HasWeenie | EntityCollisionFlags.IsCreature));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void KnownTarget_DoesNotIgnoreNonCreatureWeenie()
|
||||
{
|
||||
Assert.False(Missile(Target).MissileIgnore(
|
||||
Other,
|
||||
0u,
|
||||
EntityCollisionFlags.HasWeenie));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue