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
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
targetObjectIduintThe object being shot at.
kindPluginProjectilePathKindWhich flight model to simulate.
targetHeightPluginAttackHeightWhere 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.
projectileRadiusfloatThe radius of the probe sphere in meters; must be positive.
stepDistancefloatHow far the probe advances between collision checks, in meters; smaller steps cost more checks but miss less. Must be positive.
maximumCollisionChecksintThe 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
targetObjectIduintThe object being shot at.
kindPluginProjectilePathKindWhich flight model to simulate.
targetHeightPluginAttackHeightWhere on the target to aim.
projectileRadiusfloatThe probe sphere's radius in meters.
stepDistancefloatHow far the probe advances between collision checks, in meters.
maximumCollisionChecksintThe 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
samplesIReadOnlyList<PluginProjectileDebugSample>The markers to draw.