Table of Contents

Interface IProjectileAutomation

Namespace
AcDream.Plugin.Abstractions
Assembly
AcDream.Plugin.Abstractions.dll

Asking the client whether a shot at a target would actually get there, by simulating the projectile against world collision.

public interface IProjectileAutomation

Properties

IsAvailable

True when this host can answer path queries. False on a host with no collision probe or no session in the world, which is what the default implementation always reports.

bool IsAvailable { get; }

Property Value

bool

Methods

EvaluatePath(uint, PluginProjectilePathKind, PluginAttackHeight, float, float, int)

Fly a probe sphere from the player to the target and report what it hit.

PluginProjectilePathResult EvaluatePath(uint targetObjectId, PluginProjectilePathKind kind, PluginAttackHeight targetHeight, float projectileRadius, float stepDistance, int maximumCollisionChecks)

Parameters

targetObjectId uint

The object being shot at.

kind PluginProjectilePathKind

Which flight model to simulate.

targetHeight PluginAttackHeight

Where on the target to aim: low, medium, or high, which the host turns into an aim point 0.3, 0.9, or 1.5 meters above the target's base.

projectileRadius float

The radius of the probe sphere in meters; must be positive.

stepDistance float

How far the probe advances between collision checks, in meters; smaller steps cost more checks but miss less. Must be positive.

maximumCollisionChecks int

The most collision checks this query may spend before giving up with BudgetExceeded.

Returns

PluginProjectilePathResult

The outcome of the flight. The default implementation always returns Unavailable.

EvaluatePathWithDiagnostics(uint, PluginProjectilePathKind, PluginAttackHeight, float, float, int)

The same bounded query, but the result also carries a marker for every simulated step. A host that does not collect markers falls back to the ordinary query and returns a result with no samples.

PluginProjectilePathResult EvaluatePathWithDiagnostics(uint targetObjectId, PluginProjectilePathKind kind, PluginAttackHeight targetHeight, float projectileRadius, float stepDistance, int maximumCollisionChecks)

Parameters

targetObjectId uint

The object being shot at.

kind PluginProjectilePathKind

Which flight model to simulate.

targetHeight PluginAttackHeight

Where on the target to aim.

projectileRadius float

The probe sphere's radius in meters.

stepDistance float

How far the probe advances between collision checks, in meters.

maximumCollisionChecks int

The collision-check budget.

Returns

PluginProjectilePathResult

The outcome of the flight, with its per-step markers.

ShowDebugSamples(IReadOnlyList<PluginProjectileDebugSample>)

Hand the markers back to the client so it can draw the simulated path in the world for a short moment. Markers with a non-finite position or a radius of zero or less are dropped, and a host may cap how many it keeps. The default implementation draws nothing.

void ShowDebugSamples(IReadOnlyList<PluginProjectileDebugSample> samples)

Parameters

samples IReadOnlyList<PluginProjectileDebugSample>

The markers to draw.